Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Schema = Schema {}
- type Enumerations = Map EnumerationName Enumeration
- newtype EnumerationName = EnumerationName {}
- newtype Enumeration = Enumeration {
- enumValues :: [Text]
- type Sequences = Map SequenceName Sequence
- newtype SequenceName = SequenceName {}
- data Sequence = Sequence {}
- mkSequenceName :: TableName -> ColumnName -> SequenceName
- parseSequenceName :: SequenceName -> Maybe (TableName, ColumnName)
- type Tables = Map TableName Table
- newtype TableName = TableName {}
- data Table = Table {}
- type Columns = Map ColumnName Column
- newtype ColumnName = ColumnName {
- columnName :: Text
- data Column = Column {}
- data ColumnType
- data PgDataType
- newtype PgEnum a = PgEnum a
- newtype DbEnum a = DbEnum a
- type ConstraintName = Text
- data TableConstraint
- data ColumnConstraint
- data ReferenceAction
- = NoAction
- | Restrict
- | Cascade
- | SetNull
- | SetDefault
- data EditAction
- = TableAdded TableName Table
- | TableRemoved TableName
- | TableConstraintAdded TableName TableConstraint
- | TableConstraintRemoved TableName TableConstraint
- | ColumnAdded TableName ColumnName Column
- | ColumnRemoved TableName ColumnName
- | ColumnTypeChanged TableName ColumnName ColumnType ColumnType
- | ColumnConstraintAdded TableName ColumnName ColumnConstraint
- | ColumnConstraintRemoved TableName ColumnName ColumnConstraint
- | EnumTypeAdded EnumerationName Enumeration
- | EnumTypeRemoved EnumerationName
- | EnumTypeValueAdded EnumerationName Text InsertionOrder Text
- | SequenceAdded SequenceName Sequence
- | SequenceRemoved SequenceName
- data EditSafety
- defaultEditSafety :: EditAction -> EditSafety
- data EditCondition = EditCondition {}
- prettyEditConditionQuery :: EditCondition -> ByteString
- data Edit = Edit {}
- editAction :: Lens' Edit EditAction
- editCondition :: Lens' Edit (Either EditCondition EditSafety)
- editSafetyIs :: EditSafety -> Edit -> Bool
- mkEditWith :: (EditAction -> EditSafety) -> EditAction -> Edit
- defMkEdit :: EditAction -> Edit
- data InsertionOrder
- data DiffError
- noSchema :: Schema
- noTableConstraints :: Set TableConstraint
- noColumnConstraints :: Set ColumnConstraint
Documentation
Instances
Eq Schema Source # | |
Show Schema Source # | |
Generic Schema Source # | |
Arbitrary Schema Source # | |
NFData Schema Source # | |
Defined in Database.Beam.AutoMigrate.Types | |
Diffable Schema Source # | Computes the diff between two |
type Rep Schema Source # | |
Defined in Database.Beam.AutoMigrate.Types type Rep Schema = D1 (MetaData "Schema" "Database.Beam.AutoMigrate.Types" "beam-automigrate-0.1.2.0-inplace" False) (C1 (MetaCons "Schema" PrefixI True) (S1 (MetaSel (Just "schemaTables") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Tables) :*: (S1 (MetaSel (Just "schemaEnumerations") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Enumerations) :*: S1 (MetaSel (Just "schemaSequences") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Sequences)))) |
type Enumerations = Map EnumerationName Enumeration Source #
newtype EnumerationName Source #
Instances
newtype Enumeration Source #
Enumeration | |
|
Instances
newtype SequenceName Source #
Instances
Instances
Eq Sequence Source # | |
Ord Sequence Source # | |
Defined in Database.Beam.AutoMigrate.Types | |
Show Sequence Source # | |
Generic Sequence Source # | |
NFData Sequence Source # | |
Defined in Database.Beam.AutoMigrate.Types | |
Diffable Sequences Source # | |
type Rep Sequence Source # | |
Defined in Database.Beam.AutoMigrate.Types type Rep Sequence = D1 (MetaData "Sequence" "Database.Beam.AutoMigrate.Types" "beam-automigrate-0.1.2.0-inplace" False) (C1 (MetaCons "Sequence" PrefixI True) (S1 (MetaSel (Just "seqTable") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 TableName) :*: S1 (MetaSel (Just "seqColumn") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ColumnName))) |
mkSequenceName :: TableName -> ColumnName -> SequenceName Source #
parseSequenceName :: SequenceName -> Maybe (TableName, ColumnName) Source #
Instances
Eq TableName Source # | |
Ord TableName Source # | |
Defined in Database.Beam.AutoMigrate.Types | |
Show TableName Source # | |
Generic TableName Source # | |
NFData TableName Source # | |
Defined in Database.Beam.AutoMigrate.Types | |
FromField TableName Source # | |
Defined in Database.Beam.AutoMigrate.Postgres | |
Diffable Tables Source # | |
type Rep TableName Source # | |
Defined in Database.Beam.AutoMigrate.Types |
Instances
Eq Table Source # | |
Show Table Source # | |
Generic Table Source # | |
Semigroup Table Source # | |
Monoid Table Source # | |
NFData Table Source # | |
Defined in Database.Beam.AutoMigrate.Types | |
Diffable Tables Source # | |
type Rep Table Source # | |
Defined in Database.Beam.AutoMigrate.Types type Rep Table = D1 (MetaData "Table" "Database.Beam.AutoMigrate.Types" "beam-automigrate-0.1.2.0-inplace" False) (C1 (MetaCons "Table" PrefixI True) (S1 (MetaSel (Just "tableConstraints") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Set TableConstraint)) :*: S1 (MetaSel (Just "tableColumns") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Columns))) |
newtype ColumnName Source #
Instances
Instances
Eq Column Source # | |
Show Column Source # | |
Generic Column Source # | |
NFData Column Source # | |
Defined in Database.Beam.AutoMigrate.Types | |
type Rep Column Source # | |
Defined in Database.Beam.AutoMigrate.Types type Rep Column = D1 (MetaData "Column" "Database.Beam.AutoMigrate.Types" "beam-automigrate-0.1.2.0-inplace" False) (C1 (MetaCons "Column" PrefixI True) (S1 (MetaSel (Just "columnType") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ColumnType) :*: S1 (MetaSel (Just "columnConstraints") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Set ColumnConstraint)))) |
data ColumnType Source #
Basic types for columns. We piggyback on 'beam-core' SQL types for now. Albeit they are a bit more specialised (i.e, SQL specific), we are less subject from their and our representation to diverge.
SqlStdType DataType | Standard SQL types. |
PgSpecificType PgDataType | Postgres specific types. |
DbEnumeration EnumerationName Enumeration | An enumeration implemented with text-based encoding. |
Instances
data PgDataType Source #
PgJson | |
PgJsonB | |
PgRangeInt4 | |
PgRangeInt8 | |
PgRangeNum | |
PgRangeTs | |
PgRangeTsTz | |
PgRangeDate | |
PgUuid | |
PgEnumeration EnumerationName |
Instances
PgEnum a |
Instances
Bounded a => Bounded (PgEnum a) Source # | |
Enum a => Enum (PgEnum a) Source # | |
Defined in Database.Beam.AutoMigrate.Types | |
Eq a => Eq (PgEnum a) Source # | |
Show a => Show (PgEnum a) Source # | |
Generic (PgEnum a) Source # | |
(Show a, Typeable a, Enum a, Bounded a) => HasColumnType (PgEnum a) Source # | |
Defined in Database.Beam.AutoMigrate.Compat defaultColumnType :: Proxy (PgEnum a) -> ColumnType Source # defaultTypeCast :: Proxy (PgEnum a) -> Maybe Text Source # defaultEnums :: Proxy (PgEnum a) -> Enumerations Source # | |
type Rep (PgEnum a) Source # | |
Defined in Database.Beam.AutoMigrate.Types |
DbEnum a |
Instances
Bounded a => Bounded (DbEnum a) Source # | |
Enum a => Enum (DbEnum a) Source # | |
Defined in Database.Beam.AutoMigrate.Types | |
Eq a => Eq (DbEnum a) Source # | |
Show a => Show (DbEnum a) Source # | |
Generic (DbEnum a) Source # | |
(Show a, Typeable a, Enum a, Bounded a) => HasColumnType (DbEnum a) Source # | |
Defined in Database.Beam.AutoMigrate.Compat defaultColumnType :: Proxy (DbEnum a) -> ColumnType Source # defaultTypeCast :: Proxy (DbEnum a) -> Maybe Text Source # defaultEnums :: Proxy (DbEnum a) -> Enumerations Source # | |
type Rep (DbEnum a) Source # | |
Defined in Database.Beam.AutoMigrate.Types |
type ConstraintName = Text Source #
data TableConstraint Source #
PrimaryKey ConstraintName (Set ColumnName) | This set of |
ForeignKey ConstraintName TableName (Set (ColumnName, ColumnName)) ReferenceAction ReferenceAction | This set of |
Unique ConstraintName (Set ColumnName) |
Instances
data ColumnConstraint Source #
Instances
data ReferenceAction Source #
Instances
data EditAction Source #
A possible list of edits on a Schema
.
Instances
Eq EditAction Source # | |
Defined in Database.Beam.AutoMigrate.Types (==) :: EditAction -> EditAction -> Bool # (/=) :: EditAction -> EditAction -> Bool # | |
Show EditAction Source # | |
Defined in Database.Beam.AutoMigrate.Types showsPrec :: Int -> EditAction -> ShowS # show :: EditAction -> String # showList :: [EditAction] -> ShowS # | |
NFData EditAction Source # | |
Defined in Database.Beam.AutoMigrate.Types rnf :: EditAction -> () # |
data EditSafety Source #
Safety rating for a given edit.
Safety is defined as some EditAction
that might cause data loss.
Instances
Eq EditSafety Source # | |
Defined in Database.Beam.AutoMigrate.Types (==) :: EditSafety -> EditSafety -> Bool # (/=) :: EditSafety -> EditSafety -> Bool # | |
Ord EditSafety Source # | |
Defined in Database.Beam.AutoMigrate.Types compare :: EditSafety -> EditSafety -> Ordering # (<) :: EditSafety -> EditSafety -> Bool # (<=) :: EditSafety -> EditSafety -> Bool # (>) :: EditSafety -> EditSafety -> Bool # (>=) :: EditSafety -> EditSafety -> Bool # max :: EditSafety -> EditSafety -> EditSafety # min :: EditSafety -> EditSafety -> EditSafety # | |
Show EditSafety Source # | |
Defined in Database.Beam.AutoMigrate.Types showsPrec :: Int -> EditSafety -> ShowS # show :: EditSafety -> String # showList :: [EditSafety] -> ShowS # |
data EditCondition Source #
Instances
Eq EditCondition Source # | |
Defined in Database.Beam.AutoMigrate.Types (==) :: EditCondition -> EditCondition -> Bool # (/=) :: EditCondition -> EditCondition -> Bool # | |
Show EditCondition Source # | |
Defined in Database.Beam.AutoMigrate.Types showsPrec :: Int -> EditCondition -> ShowS # show :: EditCondition -> String # showList :: [EditCondition] -> ShowS # |
editSafetyIs :: EditSafety -> Edit -> Bool Source #
mkEditWith :: (EditAction -> EditSafety) -> EditAction -> Edit Source #
defMkEdit :: EditAction -> Edit Source #
data InsertionOrder Source #
Instances
Eq InsertionOrder Source # | |
Defined in Database.Beam.AutoMigrate.Types (==) :: InsertionOrder -> InsertionOrder -> Bool # (/=) :: InsertionOrder -> InsertionOrder -> Bool # | |
Show InsertionOrder Source # | |
Defined in Database.Beam.AutoMigrate.Types showsPrec :: Int -> InsertionOrder -> ShowS # show :: InsertionOrder -> String # showList :: [InsertionOrder] -> ShowS # | |
Generic InsertionOrder Source # | |
Defined in Database.Beam.AutoMigrate.Types type Rep InsertionOrder :: Type -> Type # from :: InsertionOrder -> Rep InsertionOrder x # to :: Rep InsertionOrder x -> InsertionOrder # | |
NFData InsertionOrder Source # | |
Defined in Database.Beam.AutoMigrate.Types rnf :: InsertionOrder -> () # | |
type Rep InsertionOrder Source # | |
A possible enumerations of the reasons why a diff
operation might not work.
AutomaticDiffNotPossible | The diff couldn't be completed. TODO(adn) We need extra information we can later on reify into the raw SQL queries users can try to run themselves. |
ValuesRemovedFromEnum EnumerationName [Text] | Postgres doesn't support removing values from an enum. |
Instances
Eq DiffError Source # | |
Show DiffError Source # | |
Generic DiffError Source # | |
Exception DiffError Source # | |
Defined in Database.Beam.AutoMigrate.Types toException :: DiffError -> SomeException # fromException :: SomeException -> Maybe DiffError # displayException :: DiffError -> String # | |
NFData DiffError Source # | |
Defined in Database.Beam.AutoMigrate.Types | |
type Rep DiffError Source # | |
Defined in Database.Beam.AutoMigrate.Types type Rep DiffError = D1 (MetaData "DiffError" "Database.Beam.AutoMigrate.Types" "beam-automigrate-0.1.2.0-inplace" False) (C1 (MetaCons "AutomaticDiffNotPossible" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "ValuesRemovedFromEnum" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 EnumerationName) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Text]))) |