Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
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
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.
dataTypeHasBeenCreated :: dataType -> (forall preCondition. Typeable preCondition => [preCondition]) -> Bool Source #
Instances
HasDataTypeCreatedCheck HsDataType Source # | |
Defined in Database.Beam.Haskell.Syntax 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
.
TableHasColumn | |
|
Instances
(Typeable be, BeamMigrateOnlySqlBackend be, Hashable (BeamMigrateSqlBackendDataTypeSyntax be)) => DatabasePredicate (TableHasColumn be) Source # | |
Defined in Database.Beam.Migrate.Checks englishDescription :: TableHasColumn be -> String Source # predicateSpecificity :: proxy (TableHasColumn be) -> PredicateSpecificity Source # serializePredicate :: TableHasColumn be -> Value Source # predicateCascadesDropOn :: DatabasePredicate p' => TableHasColumn be -> p' -> Bool Source # | |
Eq (BeamMigrateSqlBackendDataTypeSyntax be) => Eq (TableHasColumn be) Source # | |
Defined in Database.Beam.Migrate.Checks (==) :: TableHasColumn be -> TableHasColumn be -> Bool # (/=) :: TableHasColumn be -> TableHasColumn be -> Bool # | |
Hashable (BeamMigrateSqlBackendDataTypeSyntax be) => Hashable (TableHasColumn be) Source # | |
Defined in Database.Beam.Migrate.Checks hashWithSalt :: Int -> TableHasColumn be -> Int # hash :: TableHasColumn be -> Int # |
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
TableColumnHasConstraint | |
|
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.
TableHasPrimaryKey | |
|
Instances
Deserialization
beamCheckDeserializers :: forall be. (Typeable be, BeamMigrateOnlySqlBackend be, HasDataTypeCreatedCheck (BeamMigrateSqlBackendDataTypeSyntax be)) => BeamDeserializers be Source #
BeamDeserializers
for all the predicates defined in this module