Safe Haskell | None |
---|---|
Language | Haskell2010 |
Database.Beam.Migrate.Checks
Contents
Description
Defines common
DatabasePredicate
s that are shared among backends
Synopsis
- data TableExistsPredicate = TableExistsPredicate QualifiedName
-
class
HasDataTypeCreatedCheck
dataType
where
- dataTypeHasBeenCreated :: dataType -> ( forall preCondition. Typeable preCondition => [preCondition]) -> Bool
-
data
TableHasColumn
be
where
- TableHasColumn :: HasDataTypeCreatedCheck ( BeamMigrateSqlBackendDataTypeSyntax be) => {..} -> TableHasColumn be
- data TableColumnHasConstraint be = TableColumnHasConstraint { }
- data TableHasPrimaryKey = TableHasPrimaryKey { }
- beamCheckDeserializers :: forall be. ( Typeable be, BeamMigrateOnlySqlBackend be, HasDataTypeCreatedCheck ( BeamMigrateSqlBackendDataTypeSyntax be)) => BeamDeserializers be
Table checks
data TableExistsPredicate Source #
Asserts that a table with the given name exists in a database
Constructors
TableExistsPredicate QualifiedName |
Table name |
Instances
class HasDataTypeCreatedCheck dataType where Source #
A class that can check whether a particular data type is present in a set of preconditions.
Methods
dataTypeHasBeenCreated :: dataType -> ( forall preCondition. Typeable preCondition => [preCondition]) -> Bool Source #
Instances
HasDataTypeCreatedCheck HsDataType Source # | |
Defined in Database.Beam.Haskell.Syntax Methods dataTypeHasBeenCreated :: HsDataType -> ( forall preCondition. Typeable preCondition => [preCondition]) -> Bool Source # |
data TableHasColumn be where Source #
Asserts that the table specified has a column with the given data type. The
type paramater
syntax
should be an instance of
IsSql92ColumnSchemaSyntax
.
Constructors
TableHasColumn | |
Fields
|
Instances
Eq ( BeamMigrateSqlBackendDataTypeSyntax be) => Eq ( TableHasColumn be) Source # | |
Defined in Database.Beam.Migrate.Checks Methods (==) :: TableHasColumn be -> TableHasColumn be -> Bool Source # (/=) :: TableHasColumn be -> TableHasColumn be -> Bool Source # |
|
Hashable ( BeamMigrateSqlBackendDataTypeSyntax be) => Hashable ( TableHasColumn be) Source # | |
Defined in Database.Beam.Migrate.Checks Methods hashWithSalt :: Int -> TableHasColumn be -> Int Source # hash :: TableHasColumn be -> Int Source # |
|
( Typeable be, BeamMigrateOnlySqlBackend be, Hashable ( BeamMigrateSqlBackendDataTypeSyntax be)) => DatabasePredicate ( TableHasColumn be) Source # | |
Defined in Database.Beam.Migrate.Checks Methods englishDescription :: TableHasColumn be -> String Source # predicateSpecificity :: proxy ( TableHasColumn be) -> PredicateSpecificity Source # serializePredicate :: TableHasColumn be -> Value Source # predicateCascadesDropOn :: DatabasePredicate p' => TableHasColumn be -> p' -> Bool Source # |
data TableColumnHasConstraint be Source #
Asserts that a particular column of a table has a given constraint. The
syntax
type parameter should be an instance of
IsSql92ColumnSchemaSyntax
Constructors
TableColumnHasConstraint | |
Fields
|
Instances
data TableHasPrimaryKey Source #
Asserts that the given table has a primary key made of the given columns. The order of the columns is significant.
Constructors
TableHasPrimaryKey | |
Fields
|
Instances
Deserialization
beamCheckDeserializers :: forall be. ( Typeable be, BeamMigrateOnlySqlBackend be, HasDataTypeCreatedCheck ( BeamMigrateSqlBackendDataTypeSyntax be)) => BeamDeserializers be Source #
BeamDeserializers
for all the predicates defined in this module