-
Notifications
You must be signed in to change notification settings - Fork 14
CreateColumnBuilder
Josh Wright edited this page Jan 14, 2021
·
3 revisions
A builder for creating columns on a table in a relational database.
public final class CreateColumnBuilder<Default: Sequelizable>: ColumnBuilderErased
Default
is a Swift type that can be used to add a default value
to this column.
ColumnBuilderErased
Adds an expression as the default value of this column.
@discardableResult public func `default`(expression: String) -> Self
- expression: An expression for generating the default value of this column.
This column builder.
Adds a value as the default for this column.
@discardableResult public func `default`(val: Default) -> Self
- expression: A default value for this column.
This column builder.
Define this column as not nullable.
@discardableResult public func notNull() -> Self
This column builder.
Defines this column as a reference to another column on a table.
@discardableResult public func references(_ column: String, on table: String) -> Self
- column: The column name this column references.
- table: The table of the column this column references.
This column builder.
Defines this column as a primary key.
@discardableResult public func primary() -> Self
This column builder.
Defines this column as unique.
@discardableResult public func unique() -> Self
This column builder.
Generated at 2021-01-13T22:24:59-0800 using swift-doc 1.0.0-beta.5.
Alchemy
Types
- AlterTableBuilder
- BCryptDigest
- BasicAuthMiddleware
- BcryptError
- BelongsToRelationship
- CORSMiddleware
- CORSMiddleware.AllowOriginSetting
- CORSMiddleware.Configuration
- ColumnType
- CreateColumn
- CreateColumnBuilder
- CreateIndex
- CreateTableBuilder
- DatabaseConfig
- DatabaseError
- DatabaseField
- DatabaseKeyMappingStrategy
- DatabaseValue
- DayUnit
- Env
- FrequencyTyped
- Grammar
- HTTPAuth
- HTTPAuth.Basic
- HTTPAuth.Bearer
- HTTPBody
- HTTPError
- HasManyRelationship
- HasOneRelationship
- HasRelationship
- HourUnit
- JoinClause
- JoinType
- Launch
- Log
- MIMEType
- MinuteUnit
- ModelQuery
- MySQLDatabase
- Operator
- OrderClause
- OrderClause.Sort
- OrderedDictionary
- PapyrusClientError
- PathParameter
- PathParameter.DecodingError
- PostgresDatabase
- Query
- Request
- Response
- Router
- RuneError
- SQL
- SQLJSON
- Scheduler
- Schema
- SecondUnit
- Services
- Socket
- StaticFileMiddleware
- StringLength
- Thread
- TokenAuthMiddleware
- WeekUnit
- Weekday
- WhereBoolean
- WhereColumn
- WhereIn
- WhereIn.InType
- WhereNested
- WhereRaw
- WhereValue