Class FlatDdlGenerator

Namespace: redb.Export.Flat
Assembly: redb.Export.dll

Turns a into DDL for one provider.

Tables are created with plain CREATE TABLE - never IF NOT EXISTS - so a name that
is already taken fails loudly instead of two classes sharing one table. Where the provider
allows it, foreign keys are separate statements meant to run after the data is loaded.

public sealed class FlatDdlGenerator

Inheritance

Object→FlatDdlGenerator

Methods

AddForeignKeys(FlatTable)

The statements that add the foreign keys of table. Empty for a provider

public IReadOnlyList<string> AddForeignKeys(FlatTable table)

CreateIndexes(FlatTable)

The statements that create the plain indexes of table (the foreign key indexes).

public IReadOnlyList<string> CreateIndexes(FlatTable table)

CreateSequence()

The statement that creates the key sequence (), starting at 1.

public string? CreateSequence()

CreateTable(FlatTable)

The CREATE TABLE statement of table.

public string CreateTable(FlatTable table)

RestartSequence(long)

The statement that makes the key sequence hand out next next: run after the

public string? RestartSequence(long next)

Script(FlatDatabaseModel)

The whole model as one script: the key sequence, every table, then every foreign key. Run on an

public string Script(FlatDatabaseModel model)

Constructors

FlatDdlGenerator(string)

Creates a generator for a provider.