beam-postgres-0.5.0.0: Connection layer between beam and postgres

Safe HaskellNone
LanguageHaskell2010

Database.Beam.Postgres.Migrate

Contents

Description

Migrations support for beam-postgres. See Database.Beam.Migrate for more information on beam migrations.

Synopsis

Documentation

data PgCommandSyntax Source #

Representation of an arbitrary Postgres command. This is the combination of the command syntax (repesented by PgSyntax), as well as the type of command (represented by PgCommandType). The command type is necessary for us to know how to retrieve results from the database.

Instances
IsSql92Syntax PgCommandSyntax Source # 
Instance details

Defined in Database.Beam.Postgres.Syntax

IsSql92DdlCommandSyntax PgCommandSyntax Source # 
Instance details

Defined in Database.Beam.Postgres.Syntax

type Sql92DeleteSyntax PgCommandSyntax Source # 
Instance details

Defined in Database.Beam.Postgres.Syntax

type Sql92UpdateSyntax PgCommandSyntax Source # 
Instance details

Defined in Database.Beam.Postgres.Syntax

type Sql92InsertSyntax PgCommandSyntax Source # 
Instance details

Defined in Database.Beam.Postgres.Syntax

type Sql92SelectSyntax PgCommandSyntax Source # 
Instance details

Defined in Database.Beam.Postgres.Syntax

type Sql92DdlCommandDropTableSyntax PgCommandSyntax Source # 
Instance details

Defined in Database.Beam.Postgres.Syntax

type Sql92DdlCommandAlterTableSyntax PgCommandSyntax Source # 
Instance details

Defined in Database.Beam.Postgres.Syntax

type Sql92DdlCommandCreateTableSyntax PgCommandSyntax Source # 
Instance details

Defined in Database.Beam.Postgres.Syntax

migrationBackend :: BeamMigrationBackend Postgres Pg Source #

Top-level migration backend for use by beam-migrate tools

pgPredConverter :: HaskellPredicateConverter Source #

Converts postgres DatabasePredicates to DatabasePredicates in the Haskell syntax. Allows automatic generation of Haskell schemas from postgres constraints.

pgTypeToHs :: PgDataTypeSyntax -> Maybe HsDataType Source #

Turn a PgDataTypeSyntax into the corresponding HsDataType. This is a best effort guess, and may fail on more exotic types. Feel free to send PRs to make this function more robust!

migrateScript :: MigrationSteps Postgres () a' -> [ByteString] Source #

Turn a series of MigrationSteps into a line-by-line array of ByteStrings suitable for writing to a script.

writeMigrationScript :: FilePath -> MigrationSteps Postgres () a -> IO () Source #

Write the migration given by the MigrationSteps to a file.

Postgres data types

tsquery :: DataType Postgres TsQuery Source #

DataType for tsquery. See TsQuery for more information

tsvector :: DataType Postgres TsVector Source #

DataType for tsvector. See TsVector for more information

text :: DataType Postgres Text Source #

DataType for Postgres TEXT. characterLargeObject is also mapped to this data type

bytea :: DataType Postgres ByteString Source #

DataType for Postgres BYTEA. binaryLargeObject is also mapped to this data type

unboundedArray :: forall a. Typeable a => DataType Postgres a -> DataType Postgres (Vector a) Source #

DataType for a Postgres array without any bounds.

Note that array support in beam-migrate is still incomplete.

uuid :: DataType Postgres UUID Source #

DataType for UUID columns. The pgCryptoGenRandomUUID function in the PgCrypto extension can be used to generate UUIDs at random.

json :: (ToJSON a, FromJSON a) => DataType Postgres (PgJSON a) Source #

DataType for JSON. See PgJSON for more information

jsonb :: (ToJSON a, FromJSON a) => DataType Postgres (PgJSONB a) Source #

DataType for JSONB. See PgJSON for more information

smallserial :: Integral a => DataType Postgres (SqlSerial a) Source #

Postgres SERIAL data types. Automatically generates an appropriate DEFAULT clause and sequence

serial :: Integral a => DataType Postgres (SqlSerial a) Source #

Postgres SERIAL data types. Automatically generates an appropriate DEFAULT clause and sequence

bigserial :: Integral a => DataType Postgres (SqlSerial a) Source #

Postgres SERIAL data types. Automatically generates an appropriate DEFAULT clause and sequence

Orphan instances