Skip to main content

Class: SchemaGenerator

The SchemaGenerator class is used to generate SQL schema DDL statements corresponding to a given metadata model.

Extends

Constructors

new SchemaGenerator()

new SchemaGenerator(): SchemaGenerator

Returns

SchemaGenerator

Inherited from

ModelVisitor.constructor

Methods

generate()

generate(metadata: Metadata): SqlNode[]

Parameters

ParameterType
metadataMetadata

Returns

SqlNode[]

Defined in

packages/verse-core/src/db/schema.ts:30


visitBooleanProperty()

visitBooleanProperty(booleanProperty: BooleanPropertyModel, state?: unknown): SqlNode

Parameters

ParameterType
booleanPropertyBooleanPropertyModel
state?unknown

Returns

SqlNode

Inherited from

ModelVisitor.visitBooleanProperty

Defined in

packages/verse-core/src/model/visitor.ts:79


visitConcurrency()

visitConcurrency(concurrency: ConcurrencyModel, state?: unknown): SqlNode

Parameters

ParameterType
concurrencyConcurrencyModel
state?unknown

Returns

SqlNode

Inherited from

ModelVisitor.visitConcurrency

Defined in

packages/verse-core/src/model/visitor.ts:59


visitConversion()

visitConversion(conversion: ConversionModel, state?: unknown): SqlNode

Parameters

ParameterType
conversionConversionModel
state?unknown

Returns

SqlNode

Inherited from

ModelVisitor.visitConversion

Defined in

packages/verse-core/src/model/visitor.ts:109


visitDateProperty()

visitDateProperty(dateProperty: DatePropertyModel, state?: unknown): SqlNode

Parameters

ParameterType
datePropertyDatePropertyModel
state?unknown

Returns

SqlNode

Inherited from

ModelVisitor.visitDateProperty

Defined in

packages/verse-core/src/model/visitor.ts:84


visitEntity()

visitEntity(entity: EntityModel<any, any>): SqlNode

Parameters

ParameterType
entityEntityModel<any, any>

Returns

SqlNode

Overrides

ModelVisitor.visitEntity

Defined in

packages/verse-core/src/db/schema.ts:48


visitForeignKey()

visitForeignKey(foreignKey: ForeignKeyModel): SqlForeignKey

Parameters

ParameterType
foreignKeyForeignKeyModel

Returns

SqlForeignKey

Overrides

ModelVisitor.visitForeignKey

Defined in

packages/verse-core/src/db/schema.ts:67


visitGenerator()

visitGenerator(generator: GeneratorModel, state?: unknown): SqlNode

Parameters

ParameterType
generatorGeneratorModel
state?unknown

Returns

SqlNode

Inherited from

ModelVisitor.visitGenerator

Defined in

packages/verse-core/src/model/visitor.ts:104


visitIntProperty()

visitIntProperty(intProperty: IntPropertyModel, state?: unknown): SqlNode

Parameters

ParameterType
intPropertyIntPropertyModel
state?unknown

Returns

SqlNode

Inherited from

ModelVisitor.visitIntProperty

Defined in

packages/verse-core/src/model/visitor.ts:74


visitKey()

visitKey(key: KeyModel, state?: unknown): SqlNode

Parameters

ParameterType
keyKeyModel
state?unknown

Returns

SqlNode

Inherited from

ModelVisitor.visitKey

Defined in

packages/verse-core/src/model/visitor.ts:49


visitModel()

visitModel(model: Model): SqlNode

Parameters

ParameterType
modelModel

Returns

SqlNode

Overrides

ModelVisitor.visitModel

Defined in

packages/verse-core/src/db/schema.ts:38


visitNavigationProperty()

visitNavigationProperty(navigation: NavigationPropertyModel, state?: unknown): SqlNode

Parameters

ParameterType
navigationNavigationPropertyModel
state?unknown

Returns

SqlNode

Inherited from

ModelVisitor.visitNavigationProperty

Defined in

packages/verse-core/src/model/visitor.ts:94


visitNumberProperty()

visitNumberProperty(numberProperty: NumberPropertyModel, state?: unknown): SqlNode

Parameters

ParameterType
numberPropertyNumberPropertyModel
state?unknown

Returns

SqlNode

Inherited from

ModelVisitor.visitNumberProperty

Defined in

packages/verse-core/src/model/visitor.ts:89


visitScalarProperty()

visitScalarProperty(scalarProperty: ScalarPropertyModel): SqlColumn

Parameters

ParameterType
scalarPropertyScalarPropertyModel

Returns

SqlColumn

Overrides

ModelVisitor.visitScalarProperty

Defined in

packages/verse-core/src/db/schema.ts:76


visitSequence()

visitSequence(sequence: SequenceModel): SqlCreateSequence

Parameters

ParameterType
sequenceSequenceModel

Returns

SqlCreateSequence

Overrides

ModelVisitor.visitSequence

Defined in

packages/verse-core/src/db/schema.ts:59


visitStringProperty()

visitStringProperty(stringProperty: StringPropertyModel, state?: unknown): SqlNode

Parameters

ParameterType
stringPropertyStringPropertyModel
state?unknown

Returns

SqlNode

Inherited from

ModelVisitor.visitStringProperty

Defined in

packages/verse-core/src/model/visitor.ts:69


visitValueObject()

visitValueObject(valueObject: ValueObjectModel<any>, state?: unknown): SqlNode

Parameters

ParameterType
valueObjectValueObjectModel<any>
state?unknown

Returns

SqlNode

Inherited from

ModelVisitor.visitValueObject

Defined in

packages/verse-core/src/model/visitor.ts:39


visitValueObjectProperty()

visitValueObjectProperty(valueObjectProperty: ValueObjectPropertyModel, state?: unknown): SqlNode

Parameters

ParameterType
valueObjectPropertyValueObjectPropertyModel
state?unknown

Returns

SqlNode

Inherited from

ModelVisitor.visitValueObjectProperty

Defined in

packages/verse-core/src/model/visitor.ts:99