Safe Haskell | None |
---|---|
Language | Haskell2010 |
This is a module which adapts and simplifies certain things normally provided by "beam-migrate", but without the extra complication of importing and using the library itself.
Documentation
class HasColumnType ty where Source #
defaultColumnType :: Proxy ty -> ColumnType Source #
Provide a ColumnType
for the given type
defaultTypeCast :: Proxy ty -> Maybe Text Source #
defaultEnums :: Proxy ty -> Enumerations Source #
If ty
maps to a DB ENUM
, use this method to specify which one.
Instances
class Ord (SchemaConstraint ty) => HasSchemaConstraints ty where Source #
Nothing
schemaConstraints :: Proxy ty -> Set (SchemaConstraint ty) Source #
Provide arbitrary constraints on a field of the requested type.
Instances
(IsMaybe a ~ nullary, HasSchemaConstraints' nullary a, Ord (SchemaConstraint a)) => HasSchemaConstraints a Source # | |
Defined in Database.Beam.AutoMigrate.Compat schemaConstraints :: Proxy a -> Set (SchemaConstraint a) Source # |
class Ord (SchemaConstraint ty) => HasSchemaConstraints' (nullary :: Bool) ty where Source #
schemaConstraints' :: Proxy nullary -> Proxy ty -> Set (SchemaConstraint ty) Source #
Instances
type family SchemaConstraint (k :: *) where ... Source #
type family GeneratesSqlSequence ty where ... Source #
GeneratesSqlSequence (SqlSerial a) = 'True | |
GeneratesSqlSequence _ = 'False |
class HasCompanionSequence' (generatesSeq :: Bool) ty where Source #
hasCompanionSequence' :: Proxy generatesSeq -> Proxy ty -> TableName -> ColumnName -> Maybe ((SequenceName, Sequence), ColumnConstraint) Source #
Instances
HasCompanionSequence' 'False ty Source # | |
Defined in Database.Beam.AutoMigrate.Compat hasCompanionSequence' :: Proxy 'False -> Proxy ty -> TableName -> ColumnName -> Maybe ((SequenceName, Sequence), ColumnConstraint) Source # | |
HasCompanionSequence' 'True (SqlSerial a) Source # | |
Defined in Database.Beam.AutoMigrate.Compat hasCompanionSequence' :: Proxy 'True -> Proxy (SqlSerial a) -> TableName -> ColumnName -> Maybe ((SequenceName, Sequence), ColumnConstraint) Source # |
class HasCompanionSequence ty where Source #
hasCompanionSequence :: Proxy ty -> TableName -> ColumnName -> Maybe ((SequenceName, Sequence), ColumnConstraint) Source #
Instances
(GeneratesSqlSequence ty ~ genSeq, HasCompanionSequence' genSeq ty) => HasCompanionSequence ty Source # | |
Defined in Database.Beam.AutoMigrate.Compat hasCompanionSequence :: Proxy ty -> TableName -> ColumnName -> Maybe ((SequenceName, Sequence), ColumnConstraint) Source # |