beam-postgres-0.3.2.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

migrationBackend :: BeamMigrationBackend PgCommandSyntax Postgres Connection 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 PgCommandSyntax () 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 PgCommandSyntax () a -> IO () Source #

Write the migration given by the MigrationSteps to a file.

Postgres data types

tsquery :: DataType PgDataTypeSyntax TsQuery Source #

DataType for tsquery. See TsQuery for more information

tsvector :: DataType PgDataTypeSyntax TsVector Source #

DataType for tsvector. See TsVector for more information

text :: DataType PgDataTypeSyntax Text Source #

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

bytea :: DataType PgDataTypeSyntax ByteString Source #

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

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

DataType for a Postgres array without any bounds.

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

uuid :: DataType PgDataTypeSyntax 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 PgDataTypeSyntax (PgJSON a) Source #

DataType for JSON. See PgJSON for more information

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

DataType for JSONB. See PgJSON for more information

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

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

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

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

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

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

Orphan instances