beam-automigrate-0.1.0.0: DB migration library for beam, targeting Postgres.

Safe HaskellNone
LanguageHaskell2010

Database.Beam.AutoMigrate.Util

Synopsis

Documentation

class HasColumnNames entity tbl where Source #

Methods

colNames :: tbl (TableField tbl) -> (tbl (TableField tbl) -> entity) -> [ColumnName] Source #

Instances
HasColumnNames (TableField tbl ty) tbl Source # 
Instance details

Defined in Database.Beam.AutoMigrate.Util

Methods

colNames :: tbl (TableField tbl) -> (tbl (TableField tbl) -> TableField tbl ty) -> [ColumnName] Source #

Beamable (PrimaryKey tbl) => HasColumnNames (PrimaryKey tbl (TableField c)) tbl' Source # 
Instance details

Defined in Database.Beam.AutoMigrate.Util

Methods

colNames :: tbl' (TableField tbl') -> (tbl' (TableField tbl') -> PrimaryKey tbl (TableField c)) -> [ColumnName] Source #

Beamable (PrimaryKey tbl) => HasColumnNames (PrimaryKey tbl (TableField c)) tbl Source # 
Instance details

Defined in Database.Beam.AutoMigrate.Util

Methods

colNames :: tbl (TableField tbl) -> (tbl (TableField tbl) -> PrimaryKey tbl (TableField c)) -> [ColumnName] Source #

tableSettings :: DatabaseEntity be db (TableEntity tbl) -> TableSettings tbl Source #

Extracts the TableSettings out of the input DatabaseEntity.

pkFieldNames :: (Beamable (PrimaryKey tbl), Table tbl) => DatabaseEntity be db (TableEntity tbl) -> [ColumnName] Source #

Extracts the primary key of a table as a list of ColumnName.

fieldAsColumnNames :: Beamable tbl => tbl (TableField c) -> [ColumnName] Source #

Similar to pkFieldNames, but it works on any entity that derives Beamable.

allColumnNames :: Beamable tbl => DatabaseEntity be db (TableEntity tbl) -> [ColumnName] Source #

Returns all the ColumnNames for a given DatabaseEntity.

sequenceEither :: (Monoid e, Traversable f) => f (Either e a) -> Either e (f a) Source #

Like sequence, but accumulating all errors in case of at least one Left.

sequenceExceptT :: (Monad m, Monoid w, Traversable t) => t (ExceptT w m a) -> ExceptT w m (t a) Source #

Evaluate each action in sequence, accumulating all errors in case of a failure. Note that this means each action will be run independently, regardless of failure.