-
Notifications
You must be signed in to change notification settings - Fork 14
Schema
Josh Wright edited this page Jan 14, 2021
·
3 revisions
Represents the schema of a table in a relational database.
public class Schema
Create a table with the supplied builder.
public func create(table: String, ifNotExists: Bool = false, builder: (inout CreateTableBuilder) -> Void)
- table: The name of the table to create.
- ifNotExists: If the query should silently not be run if the table already exists. Defaults to
false
. - builder: A closure for building the new table.
Alter an existing table with the supplied builder.
public func alter(table: String, builder: (inout AlterTableBuilder) -> Void)
- table: The table to alter.
- builder: A closure passing a builder for defining what should be altered.
Drop a table.
public func drop(table: String)
- table: The table to drop.
Rename a table.
public func rename(table: String, to: String)
- table: The table to rename.
- to: The new name for the table.
Execute a raw SQL statement when running this migration schema.
public func raw(sql: String)
- sql: The raw SQL string to execute.
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