Safe Haskell | None |
---|---|
Language | Haskell2010 |
Support for creating checked databases from Haskell ADTs, using Generic
s.
For more information, see the manual
Synopsis
- defaultMigratableDbSettings :: forall be db. (Generic (CheckedDatabaseSettings be db), GAutoMigratableDb be (Rep (CheckedDatabaseSettings be db))) => CheckedDatabaseSettings be db
- class BeamMigrateSqlBackend be => HasDefaultSqlDataType be ty where
- defaultSqlDataType :: Proxy ty -> Proxy be -> Bool -> BeamSqlBackendDataTypeSyntax be
- defaultSqlDataTypeConstraints :: Proxy ty -> Proxy be -> Bool -> [FieldCheck]
- class BeamMigrateSqlBackend be => HasNullableConstraint (x :: Bool) be
- type family NullableStatus (x :: *) :: Bool where ...
Default checked database settings
defaultMigratableDbSettings :: forall be db. (Generic (CheckedDatabaseSettings be db), GAutoMigratableDb be (Rep (CheckedDatabaseSettings be db))) => CheckedDatabaseSettings be db Source #
Produce a checked database for the given Haskell database type
See the manual for more information on the defaults.
Extending the defaulting sytem
class BeamMigrateSqlBackend be => HasDefaultSqlDataType be ty where Source #
Used to define a default SQL data type for a haskell type in a particular backend, as well as any constraints that are needed
Beam defines instances for several standard SQL types, which are polymorphic over any standard data type syntax. Backends or extensions which provide custom types should instantiate instances of this class for any types they provide for which they would like checked schema migrations
:: Proxy ty | Concrete representation of the type |
-> Proxy be | Concrete representation of the backend |
-> Bool |
|
-> BeamSqlBackendDataTypeSyntax be |
Provide a data type for the given type
defaultSqlDataTypeConstraints Source #
:: Proxy ty | Concrete representation of the type |
-> Proxy be | Concrete representation of the backend |
-> Bool |
|
-> [FieldCheck] |
Provide arbitrary constraints on a field of the requested type. See
FieldCheck
for more information on the formatting of constraints.
Instances
class BeamMigrateSqlBackend be => HasNullableConstraint (x :: Bool) be Source #
nullableConstraint
Instances
(Typeable be, BeamMigrateSqlBackend be) => HasNullableConstraint False be Source # | |
Defined in Database.Beam.Migrate.Generics.Tables nullableConstraint :: Proxy False -> Proxy be -> [FieldCheck] | |
BeamMigrateSqlBackend be => HasNullableConstraint True be Source # | |
Defined in Database.Beam.Migrate.Generics.Tables nullableConstraint :: Proxy True -> Proxy be -> [FieldCheck] |
type family NullableStatus (x :: *) :: Bool where ... Source #
NullableStatus (Maybe x) = True | |
NullableStatus x = False |