Table of Contents

Method ExportSchema

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

ExportSchema(Schema, ConfigType, string, ExportConfig, bool)

Exports an entire schema including its definition and all table data to files.

public void ExportSchema(Schema schema, ConfigType configType, string dataPath, ExportConfig exportConfig = null, bool includeViews = false)

Parameters

schema Schema

The Schema to export.

configType ConfigType

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

dataPath string

The directory path where schema definition 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 export.

Examples

using (var m = new Manager(conn))
{
    var schema = m.LoadSchema("app");

    // Export schema and data to folder
    var exportConfig = new ExportConfig { IncludeHeaders = true };
    m.ExportSchema(schema, ConfigType.Json, "./backup/app", exportConfig, includeViews: true);

    Console.WriteLine("Schema exported to ./backup/app");
}

Exceptions

DbException

Thrown when a database error occurs.