Skip to content

SublimateSchemaBuilder

mxcl edited this page Oct 23, 2020 · 4 revisions

SublimateSchemaBuilder

public final class SublimateSchemaBuilder

Properties

sb

let sb: SchemaBuilder

Methods

id()

@inlinable public func id() -> Self

field(_:_:_:)

@inlinable public func field(_ key: FieldKey, _ dataType: DatabaseSchema.DataType, _ constraints: DatabaseSchema.FieldConstraint) -> Self

field(_:)

@inlinable public func field(_ field: DatabaseSchema.FieldDefinition) -> Self

unique(on:name:)

@inlinable public func unique(on fields: FieldKey, name: String? = nil) -> Self

constraint(_:)

@inlinable public func constraint(_ constraint: DatabaseSchema.Constraint) -> Self

deleteUnique(on:)

@inlinable public func deleteUnique(on fields: FieldKey) -> Self

deleteConstraint(name:)

@inlinable public func deleteConstraint(name: String) -> Self

foreignKey(_:references:_:onDelete:onUpdate:name:)

@inlinable public func foreignKey(_ field: FieldKey, references foreignSchema: String, _ foreignField: FieldKey, onDelete: DatabaseSchema.ForeignKeyAction = .noAction, onUpdate: DatabaseSchema.ForeignKeyAction = .noAction, name: String? = nil) -> Self

updateField(_:_:)

@inlinable public func updateField(_ key: FieldKey, _ dataType: DatabaseSchema.DataType) -> Self

updateField(_:)

@inlinable public func updateField(_ field: DatabaseSchema.FieldUpdate) -> Self

deleteField(_:)

@inlinable public func deleteField(_ name: FieldKey) -> Self

deleteField(_:)

@inlinable public func deleteField(_ name: DatabaseSchema.FieldName) -> Self

ignoreExisting()

@inlinable public func ignoreExisting() -> Self

create()

@inlinable public func create() throws

update()

@inlinable public func update() throws

delete()

@inlinable public func delete() throws