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.
Synopsis
- 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] |
Instances
(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 # | |
Defined in Database.Beam.Migrate.SQL.Tables field' :: Proxy defaultGiven -> Proxy collationGiven -> Text -> Sql92ColumnSchemaColumnTypeSyntax syntax -> Maybe (Sql92ColumnSchemaExpressionSyntax syntax) -> Maybe Text -> [Sql92ColumnSchemaColumnConstraintDefinitionSyntax syntax] -> TableFieldSchema syntax resTy Source # |
newtype FieldSchema syntax a Source #
A schema for a field which hasn't been named yet
FieldSchema syntax |
Instances
Eq syntax => Eq (FieldSchema syntax a) Source # | |
Defined in Database.Beam.Migrate.SQL.Types (==) :: FieldSchema syntax a -> FieldSchema syntax a -> Bool # (/=) :: FieldSchema syntax a -> FieldSchema syntax a -> Bool # | |
Show syntax => Show (FieldSchema syntax a) Source # | |
Defined in Database.Beam.Migrate.SQL.Types showsPrec :: Int -> FieldSchema syntax a -> ShowS # show :: FieldSchema syntax a -> String # showList :: [FieldSchema syntax a] -> ShowS # |
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 |
Instances
(FieldReturnType defaultGiven collationGiven syntax resTy a, (TypeError (Text "Only one type declaration allowed per 'field' invocation") :: Constraint)) => FieldReturnType defaultGiven collationGiven syntax resTy (DataType syntax' x -> a) Source # | |
Defined in Database.Beam.Migrate.SQL.Tables field' :: Proxy defaultGiven -> Proxy collationGiven -> Text -> Sql92ColumnSchemaColumnTypeSyntax syntax -> Maybe (Sql92ColumnSchemaExpressionSyntax syntax) -> Maybe Text -> [Sql92ColumnSchemaColumnConstraintDefinitionSyntax syntax] -> DataType syntax' x -> a Source # | |
Eq syntax => Eq (DataType syntax a) Source # | |
Sql92DisplaySyntax syntax => Show (DataType syntax a) Source # | |