beam-migrate-0.3.2.1: SQL DDL support and migrations support library for Beam

Safe HaskellNone
LanguageHaskell2010

Database.Beam.Migrate.SQL

Description

Manual alternative to the CheckedDatabaseSettings mechanism.

Database schemas are given as sequences of DDL commands expressed in a beam-migrate DSL. The runMigrationSilenced function can be used to recover the CheckedDatabaseSettings that represents the database settings as well as the database predicates corresponding to the sequence of DDL commands.

This is often a more concise way of specifying a database schema when your database names are wildly different from the defaults beam assigns or you multiple constraints that make modifying the auto-generated schema too difficult.

Synopsis

Documentation

type TableSchema fieldSchemaSyntax tbl = tbl (TableFieldSchema fieldSchemaSyntax) Source #

A table schema, produced by createTable

newtype FieldSchema syntax a Source #

A schema for a field which hasn't been named yet

Constructors

FieldSchema syntax 
Instances
Eq syntax => Eq (FieldSchema syntax a) Source # 
Instance details

Defined in Database.Beam.Migrate.SQL.Types

Methods

(==) :: FieldSchema syntax a -> FieldSchema syntax a -> Bool #

(/=) :: FieldSchema syntax a -> FieldSchema syntax a -> Bool #

Show syntax => Show (FieldSchema syntax a) Source # 
Instance details

Defined in Database.Beam.Migrate.SQL.Types

Methods

showsPrec :: Int -> FieldSchema syntax a -> ShowS #

show :: FieldSchema syntax a -> String #

showList :: [FieldSchema syntax a] -> ShowS #

newtype DataType syntax a Source #

A data type in a given IsSql92DataTypeSyntax which describes a SQL type mapping to the Haskell type a

Constructors

DataType syntax 
Instances
(FieldReturnType defaultGiven collationGiven syntax resTy a, (TypeError (Text "Only one type declaration allowed per 'field' invocation") :: Constraint)) => FieldReturnType defaultGiven collationGiven syntax resTy (DataType syntax' x -> a) Source # 
Instance details

Defined in Database.Beam.Migrate.SQL.Tables

Methods

field' :: Proxy defaultGiven -> Proxy collationGiven -> Text -> Sql92ColumnSchemaColumnTypeSyntax syntax -> Maybe (Sql92ColumnSchemaExpressionSyntax syntax) -> Maybe Text -> [Sql92ColumnSchemaColumnConstraintDefinitionSyntax syntax] -> DataType syntax' x -> a Source #

Eq syntax => Eq (DataType syntax a) Source # 
Instance details

Defined in Database.Beam.Migrate.SQL.Types

Methods

(==) :: DataType syntax a -> DataType syntax a -> Bool #

(/=) :: DataType syntax a -> DataType syntax a -> Bool #

Sql92DisplaySyntax syntax => Show (DataType syntax a) Source # 
Instance details

Defined in Database.Beam.Migrate.SQL.Types

Methods

showsPrec :: Int -> DataType syntax a -> ShowS #

show :: DataType syntax a -> String #

showList :: [DataType syntax a] -> ShowS #