Safe Haskell | None |
---|---|
Language | Haskell2010 |
Manual alternative to the CheckedDatabaseSettings
mechanism.
Database schemas are given as sequences of DDL commands expressed in a
beam-migrate
DSL. The runMigrationSilenced
function can be used to
recover the CheckedDatabaseSettings
that represents the database settings
as well as the database predicates corresponding to the sequence of DDL
commands.
This is often a more concise way of specifying a database schema when your database names are wildly different from the defaults beam assigns or you multiple constraints that make modifying the auto-generated schema too difficult.
- module Database.Beam.Migrate.SQL.SQL92
- module Database.Beam.Migrate.SQL.Tables
- type TableSchema fieldSchemaSyntax tbl = tbl (TableFieldSchema fieldSchemaSyntax)
- data TableFieldSchema fieldSchemaSyntax a = TableFieldSchema Text (FieldSchema fieldSchemaSyntax a) [FieldCheck]
- newtype FieldSchema syntax a = FieldSchema syntax
- newtype DataType syntax a = DataType syntax
Documentation
type TableSchema fieldSchemaSyntax tbl = tbl (TableFieldSchema fieldSchemaSyntax) Source #
A table schema, produced by createTable
data TableFieldSchema fieldSchemaSyntax a Source #
A schema for a field within a given table
TableFieldSchema Text (FieldSchema fieldSchemaSyntax a) [FieldCheck] |
(Typeable * syntax, Typeable * (Sql92ColumnSchemaColumnTypeSyntax syntax), Sql92DisplaySyntax (Sql92ColumnSchemaColumnTypeSyntax syntax), Eq (Sql92ColumnSchemaColumnTypeSyntax syntax), Sql92DisplaySyntax (Sql92ColumnSchemaColumnConstraintDefinitionSyntax syntax), Eq (Sql92ColumnSchemaColumnConstraintDefinitionSyntax syntax), IsSql92ColumnSchemaSyntax syntax, Sql92SerializableConstraintDefinitionSyntax (Sql92ColumnSchemaColumnConstraintDefinitionSyntax syntax), Sql92SerializableDataTypeSyntax (Sql92ColumnSchemaColumnTypeSyntax syntax)) => FieldReturnType defaultGiven collationGiven syntax resTy (TableFieldSchema syntax resTy) Source # | |
newtype FieldSchema syntax a Source #
A schema for a field which hasn't been named yet
FieldSchema syntax |
Eq syntax => Eq (FieldSchema syntax a) Source # | |
Show syntax => Show (FieldSchema syntax a) Source # | |
newtype DataType syntax a Source #
A data type in a given IsSql92DataTypeSyntax
which describes a SQL type
mapping to the Haskell type a
DataType syntax |
(FieldReturnType defaultGiven collationGiven syntax resTy a, TypeError Constraint (Text "Only one type declaration allowed per 'field' invocation")) => FieldReturnType defaultGiven collationGiven syntax resTy (DataType syntax' x -> a) Source # | |
Eq syntax => Eq (DataType syntax a) Source # | |
Sql92DisplaySyntax syntax => Show (DataType syntax a) Source # | |