persistent-postgresql-2.13.7.0: Backend for the persistent library using postgresql.
Safe HaskellNone
LanguageHaskell2010

Database.Persist.Postgresql.Internal

Synopsis

Documentation

newtype P Source #

Newtype used to avoid orphan instances for postgresql-simple classes.

Since: 2.13.2.0

Constructors

P 

Fields

Instances

Instances details
FromField P Source # 
Instance details

Defined in Database.Persist.Postgresql.Internal

ToField P Source # 
Instance details

Defined in Database.Persist.Postgresql.Internal

Methods

toField :: P -> Action #

getGetter :: Oid -> Getter PersistValue Source #

Get the field parser corresponding to the given Oid.

For example, pass in the Oid of bool, and you will get back a field parser which parses boolean values in the table into PersistBools.

Since: 2.13.2.0

data AlterDB Source #

Represents a change to a Postgres DB in a statement.

Since: 2.17.1.0

Instances

Instances details
Show AlterDB Source # 
Instance details

Defined in Database.Persist.Postgresql.Internal

Eq AlterDB Source # 
Instance details

Defined in Database.Persist.Postgresql.Internal

Methods

(==) :: AlterDB -> AlterDB -> Bool #

(/=) :: AlterDB -> AlterDB -> Bool #

data AlterTable Source #

Represents a change to a Postgres table in a DB statement.

Since: 2.17.1.0

Instances

Instances details
Show AlterTable Source # 
Instance details

Defined in Database.Persist.Postgresql.Internal

Eq AlterTable Source # 
Instance details

Defined in Database.Persist.Postgresql.Internal

data SafeToRemove Source #

Indicates whether a Postgres Column is safe to drop.

Since: 2.17.1.0

migrateStructured :: [EntityDef] -> (Text -> IO Statement) -> EntityDef -> IO (Either [Text] [AlterDB]) Source #

Returns a structured representation of all of the DB changes required to migrate the Entity from its current state in the database to the state described in Haskell.

Since: 2.17.1.0

mockMigrateStructured :: [EntityDef] -> EntityDef -> [AlterDB] Source #

Returns a structured representation of all of the DB changes required to migrate the Entity to the state described in Haskell, assuming it currently does not exist in the database.

Since: 2.17.1.0

addTable :: [Column] -> EntityDef -> AlterDB Source #

Returns a structured representation of all of the DB changes required to migrate the Entity from its current state in the database to the state described in Haskell.

Since: 2.17.1.0

findAlters Source #

Arguments

:: [EntityDef]

The list of all entity definitions that persistent is aware of.

-> EntityDef

The entity definition for the entity that we're working on.

-> Column

The column that we're searching for potential alterations for.

-> [Column] 
-> ([AlterColumn], [Column]) 

getAddReference :: [EntityDef] -> EntityDef -> FieldNameDB -> ColumnReference -> Maybe AlterDB Source #

Get the references to be added to a table for the given column.

safeToRemove :: EntityDef -> FieldNameDB -> Bool Source #

Check if a column name is listed as the "safe to remove" in the entity list.