Class ConstraintBuilder

Builder to specify the schema of a table constraint.

Hierarchy

Constructors

Properties

constraintExpression?: QuerySafeValue

The expression defining this constraint, if applicable.

constraintType: ConstraintType = ConstraintType.Unique

The type of this constraint.

dirty: boolean = false

True if the schema has been modified since created/loaded.

existsInSchema: boolean = false

True if this resource exists, in some form, in the schema.

fields: Set<string> = ...

The fields included in this constraint.

name: string

The name of the schema item.

originalFromSchema?: ConstraintBuilder

If the resource exists in the schema, the unaltered values it has.

parent: TableBuilder

The table this constraint belongs to.

shouldDrop: "yes" | "exists" | "no" = 'no'

Whether or not the schema item should be dropped.

  • exists - drop if exists
shouldRenameTo?: string

The name the schema item should have if renaming.

shouldSkipIfExists: boolean = false

If true, apply IF NOT EXISTS syntax.

Methods