-
Notifications
You must be signed in to change notification settings - Fork 14
CreateTableBuilder
A builder with useful functions for creating a table.
public class CreateTableBuilder
Add an index.
public func addIndex(columns: [String], isUnique: Bool)
It's name will be <tableName>_<columnName1>_<columnName2>...
suffixed with key
if it's unique or idx
if not.
- columns: The names of the column(s) in this index.
- isUnique: Whether this index will be unique.
Adds an auto-incrementing Int
column.
@discardableResult public func increments(_ column: String) -> CreateColumnBuilder<Int>
- column: The name of the column to add.
A builder for adding modifiers to the column.
Adds an Int
column.
@discardableResult public func int(_ column: String) -> CreateColumnBuilder<Int>
- column: The name of the column to add.
A builder for adding modifiers to the column.
Adds a Double
column.
@discardableResult public func double(_ column: String) -> CreateColumnBuilder<Double>
- column: The name of the column to add.
A builder for adding modifiers to the column.
Adds an String
column.
@discardableResult public func string(_ column: String, length: StringLength = .limit(255)) -> CreateColumnBuilder<String>
- column: The name of the column to add.
- length: The max length of this string. Defaults to
.limit(255)
.
A builder for adding modifiers to the column.
Adds a UUID
column.
@discardableResult public func uuid(_ column: String) -> CreateColumnBuilder<UUID>
- column: The name of the column to add.
A builder for adding modifiers to the column.
Adds a Bool
column.
@discardableResult public func bool(_ column: String) -> CreateColumnBuilder<Bool>
- column: The name of the column to add.
A builder for adding modifiers to the column.
Adds a Date
column.
@discardableResult public func date(_ column: String) -> CreateColumnBuilder<Date>
- column: The name of the column to add.
A builder for adding modifiers to the column.
Adds a JSON column.
@discardableResult public func json(_ column: String) -> CreateColumnBuilder<SQLJSON>
- column: The name of the column to add.
A builder for adding modifiers to the column.
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