Safe Haskell | None |
---|---|
Language | Haskell2010 |
Database.Beam.Migrate.SQL
Description
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 be tbl = tbl ( TableFieldSchema be)
- data TableFieldSchema be a = TableFieldSchema Text ( FieldSchema be a) [ FieldCheck ]
- newtype FieldSchema be a = FieldSchema ( BeamSqlBackendColumnSchemaSyntax be)
- class ( Typeable ( BeamSqlBackendSyntax be), IsSql92DdlCommandSyntax ( BeamSqlBackendSyntax be), Sql92SaneDdlCommandSyntaxMigrateOnly ( BeamSqlBackendSyntax be), Sql92DisplaySyntax ( BeamMigrateSqlBackendDataTypeSyntax be), Eq ( BeamMigrateSqlBackendDataTypeSyntax be), Typeable ( BeamMigrateSqlBackendDataTypeSyntax be), Sql92SerializableDataTypeSyntax ( BeamMigrateSqlBackendDataTypeSyntax be), Sql92SerializableConstraintDefinitionSyntax ( BeamSqlBackendColumnConstraintDefinitionSyntax be), Sql92DisplaySyntax ( BeamSqlBackendColumnConstraintDefinitionSyntax be), Eq ( BeamSqlBackendColumnConstraintDefinitionSyntax be), Typeable be) => BeamMigrateOnlySqlBackend be
- type BeamMigrateSqlBackend be = ( BeamMigrateOnlySqlBackend be, Sql92SaneDdlCommandSyntax ( BeamSqlBackendSyntax be), BeamSqlBackend be)
- type BeamMigrateSql99Backend be = ( BeamMigrateSqlBackend be, IsSql99DataTypeSyntax ( BeamSqlBackendDataTypeSyntax be))
- type BeamSqlBackendConstraintSyntax be = Sql92DdlCommandColumnConstraintSyntax ( BeamSqlBackendSyntax be)
- type BeamSqlBackendColumnConstraintDefinitionSyntax be = Sql92DdlCommandConstraintDefinitionSyntax ( BeamSqlBackendSyntax be)
- type BeamMigrateSqlBackendDataTypeSyntax be = Sql92DdlCommandDataTypeSyntax ( BeamSqlBackendSyntax be)
- type BeamSqlBackendColumnSchemaSyntax be = Sql92DdlCommandColumnSchemaSyntax ( BeamSqlBackendSyntax be)
- type BeamSqlBackendAlterTableSyntax be = Sql92DdlCommandAlterTableSyntax ( BeamSqlBackendSyntax be)
- type BeamSqlBackendMatchTypeSyntax be = Sql92DdlCommandMatchTypeSyntax ( BeamSqlBackendSyntax be)
- type BeamSqlBackendReferentialActionSyntax be = Sql92DdlCommandReferentialActionSyntax ( BeamSqlBackendSyntax be)
- type BeamSqlBackendConstraintAttributesSyntax be = Sql92DdlCommandConstraintAttributesSyntax ( BeamSqlBackendSyntax be)
Documentation
type TableSchema be tbl = tbl ( TableFieldSchema be) Source #
A table schema, produced by
createTable
data TableFieldSchema be a Source #
A schema for a field within a given table
Constructors
TableFieldSchema Text ( FieldSchema be a) [ FieldCheck ] |
Instances
( BeamMigrateSqlBackend be, HasDataTypeCreatedCheck ( BeamMigrateSqlBackendDataTypeSyntax be)) => FieldReturnType defaultGiven collationGiven be resTy ( TableFieldSchema be resTy) Source # | |
Defined in Database.Beam.Migrate.SQL.Tables Methods field' :: Proxy defaultGiven -> Proxy collationGiven -> Text -> BeamMigrateSqlBackendDataTypeSyntax be -> Maybe ( BeamSqlBackendExpressionSyntax be) -> Maybe Text -> [ BeamSqlBackendColumnConstraintDefinitionSyntax be] -> TableFieldSchema be resTy Source # |
newtype FieldSchema be a Source #
A schema for a field which hasn't been named yet
Constructors
FieldSchema ( BeamSqlBackendColumnSchemaSyntax be) |
Instances
BeamMigrateOnlySqlBackend be => Eq ( FieldSchema be a) Source # | |
Defined in Database.Beam.Migrate.SQL.Types Methods (==) :: FieldSchema be a -> FieldSchema be a -> Bool Source # (/=) :: FieldSchema be a -> FieldSchema be a -> Bool Source # |
class ( Typeable ( BeamSqlBackendSyntax be), IsSql92DdlCommandSyntax ( BeamSqlBackendSyntax be), Sql92SaneDdlCommandSyntaxMigrateOnly ( BeamSqlBackendSyntax be), Sql92DisplaySyntax ( BeamMigrateSqlBackendDataTypeSyntax be), Eq ( BeamMigrateSqlBackendDataTypeSyntax be), Typeable ( BeamMigrateSqlBackendDataTypeSyntax be), Sql92SerializableDataTypeSyntax ( BeamMigrateSqlBackendDataTypeSyntax be), Sql92SerializableConstraintDefinitionSyntax ( BeamSqlBackendColumnConstraintDefinitionSyntax be), Sql92DisplaySyntax ( BeamSqlBackendColumnConstraintDefinitionSyntax be), Eq ( BeamSqlBackendColumnConstraintDefinitionSyntax be), Typeable be) => BeamMigrateOnlySqlBackend be Source #
Instances
type BeamMigrateSqlBackend be = ( BeamMigrateOnlySqlBackend be, Sql92SaneDdlCommandSyntax ( BeamSqlBackendSyntax be), BeamSqlBackend be) Source #
type BeamMigrateSql99Backend be = ( BeamMigrateSqlBackend be, IsSql99DataTypeSyntax ( BeamSqlBackendDataTypeSyntax be)) Source #
type BeamSqlBackendConstraintSyntax be = Sql92DdlCommandColumnConstraintSyntax ( BeamSqlBackendSyntax be) Source #
type BeamSqlBackendColumnConstraintDefinitionSyntax be = Sql92DdlCommandConstraintDefinitionSyntax ( BeamSqlBackendSyntax be) Source #
type BeamMigrateSqlBackendDataTypeSyntax be = Sql92DdlCommandDataTypeSyntax ( BeamSqlBackendSyntax be) Source #
type BeamSqlBackendColumnSchemaSyntax be = Sql92DdlCommandColumnSchemaSyntax ( BeamSqlBackendSyntax be) Source #
type BeamSqlBackendAlterTableSyntax be = Sql92DdlCommandAlterTableSyntax ( BeamSqlBackendSyntax be) Source #
type BeamSqlBackendMatchTypeSyntax be = Sql92DdlCommandMatchTypeSyntax ( BeamSqlBackendSyntax be) Source #