Table of Contents

Method ExportDatabase

Namespace
YndigoBlue.Velocity.Engine
Assembly
YndigoBlue.Velocity.dll

ExportDatabase(Database, ConfigType, string, ExportConfig, bool)

Exports an entire database (multiple schemas) including all schema definitions and table data to files.

public void ExportDatabase(Database database, ConfigType configType, string dataPath, ExportConfig exportConfig = null, bool includeViews = false)

Parameters

database Database

The Database containing schemas to export.

configType ConfigType

The format for schema definition files (XML, JSON, or YAML).

dataPath string

The directory path where schema definitions and CSV data files will be created.

exportConfig ExportConfig

Optional ExportConfig for CSV export settings. Uses defaults if null.

includeViews bool

If true, includes view definitions in the schema exports.

Examples

using (var m = new Manager(conn))
{
    var database = m.LoadDatabase();

    // Export all schemas and data
    m.ExportDatabase(database, ConfigType.Xml, "./full_backup", includeViews: true);

    Console.WriteLine($"Exported {database.Schemas.Count} schemas");
}

Exceptions

DbException

Thrown when a database error occurs.