beam-migrate-0.5.2.0: SQL DDL support and migrations support library for Beam
Safe HaskellSafe-Inferred
LanguageHaskell2010

Database.Beam.Migrate.SQL.SQL92

Description

Finally-tagless encoding of SQL92 DDL commands.

If you're writing a beam backend driver and you want to support migrations, making an instance of your command syntax for IsSql92DdlCommandSyntax and making it satisfy Sql92SaneDdlCommandSyntax.

Synopsis

Convenience type synonyms

type Sql92SaneDdlCommandSyntax cmd = (Sql92SaneDdlCommandSyntaxMigrateOnly cmd, Sql92ExpressionCastTargetSyntax (Sql92ExpressionSyntax cmd) ~ Sql92DdlCommandDataTypeSyntax cmd, Sql92ColumnSchemaExpressionSyntax (Sql92DdlCommandColumnSchemaSyntax cmd) ~ Sql92ExpressionSyntax cmd) Source #

Syntax equalities that any reasonable DDL syntax would follow, including equalities between beam-migrate and beam-core types.

class (IsSql92CreateTableSyntax (Sql92DdlCommandCreateTableSyntax syntax), IsSql92DropTableSyntax (Sql92DdlCommandDropTableSyntax syntax), IsSql92AlterTableSyntax (Sql92DdlCommandAlterTableSyntax syntax)) => IsSql92DdlCommandSyntax syntax where Source #

class (IsSql92TableConstraintSyntax (Sql92CreateTableTableConstraintSyntax syntax), IsSql92ColumnSchemaSyntax (Sql92CreateTableColumnSchemaSyntax syntax), IsSql92TableNameSyntax (Sql92CreateTableTableNameSyntax syntax)) => IsSql92CreateTableSyntax syntax where Source #

class IsSql92TableNameSyntax (Sql92DropTableTableNameSyntax syntax) => IsSql92DropTableSyntax syntax where Source #

Associated Types

type Sql92DropTableTableNameSyntax syntax :: * Source #

Instances

Instances details
IsSql92DropTableSyntax SqlSyntaxBuilder Source # 
Instance details

Defined in Database.Beam.Migrate.SQL.Builder

Associated Types

type Sql92DropTableTableNameSyntax SqlSyntaxBuilder Source #

Methods

dropTableSyntax :: Sql92DropTableTableNameSyntax SqlSyntaxBuilder -> SqlSyntaxBuilder Source #

IsSql92DropTableSyntax HsAction Source # 
Instance details

Defined in Database.Beam.Haskell.Syntax

class (IsSql92ColumnSchemaSyntax (Sql92AlterTableColumnSchemaSyntax syntax), IsSql92AlterColumnActionSyntax (Sql92AlterTableAlterColumnActionSyntax syntax)) => IsSql92AlterTableActionSyntax syntax where Source #

class IsSql92AlterColumnActionSyntax syntax where Source #

Methods

setNotNullSyntax :: syntax Source #

setNullSyntax :: syntax Source #

Instances

Instances details
IsSql92AlterColumnActionSyntax SqlSyntaxBuilder Source # 
Instance details

Defined in Database.Beam.Migrate.SQL.Builder

Methods

setNotNullSyntax :: SqlSyntaxBuilder Source #

setNullSyntax :: SqlSyntaxBuilder Source #

IsSql92AlterColumnActionSyntax HsNone Source # 
Instance details

Defined in Database.Beam.Haskell.Syntax

class (IsSql92ColumnConstraintDefinitionSyntax (Sql92ColumnSchemaColumnConstraintDefinitionSyntax columnSchema), IsSql92DataTypeSyntax (Sql92ColumnSchemaColumnTypeSyntax columnSchema), Typeable (Sql92ColumnSchemaColumnTypeSyntax columnSchema), Sql92DisplaySyntax (Sql92ColumnSchemaColumnTypeSyntax columnSchema), Hashable (Sql92ColumnSchemaColumnTypeSyntax columnSchema), Eq (Sql92ColumnSchemaColumnTypeSyntax columnSchema), Sql92DisplaySyntax (Sql92ColumnSchemaColumnConstraintDefinitionSyntax columnSchema), Eq (Sql92ColumnSchemaColumnConstraintDefinitionSyntax columnSchema), Hashable (Sql92ColumnSchemaColumnConstraintDefinitionSyntax columnSchema), IsSql92ExpressionSyntax (Sql92ColumnSchemaExpressionSyntax columnSchema), Typeable columnSchema, Sql92DisplaySyntax columnSchema, Eq columnSchema, Hashable columnSchema) => IsSql92ColumnSchemaSyntax columnSchema where Source #

Associated Types

type Sql92ColumnSchemaColumnTypeSyntax columnSchema :: * Source #

type Sql92ColumnSchemaExpressionSyntax columnSchema :: * Source #

type Sql92ColumnSchemaColumnConstraintDefinitionSyntax columnSchema :: * Source #

Methods

columnSchemaSyntax Source #

Arguments

:: Sql92ColumnSchemaColumnTypeSyntax columnSchema

Column type

-> Maybe (Sql92ColumnSchemaExpressionSyntax columnSchema)

Default value

-> [Sql92ColumnSchemaColumnConstraintDefinitionSyntax columnSchema]

Column constraints

-> Maybe Text

Default collation

-> columnSchema 

class Typeable constraint => IsSql92TableConstraintSyntax constraint where Source #

Methods

primaryKeyConstraintSyntax :: [Text] -> constraint Source #

Instances

Instances details
IsSql92TableConstraintSyntax SqlSyntaxBuilder Source # 
Instance details

Defined in Database.Beam.Migrate.SQL.Builder

Methods

primaryKeyConstraintSyntax :: [Text] -> SqlSyntaxBuilder Source #

IsSql92TableConstraintSyntax HsTableConstraint Source # 
Instance details

Defined in Database.Beam.Haskell.Syntax

class (IsSql92ColumnConstraintSyntax (Sql92ColumnConstraintDefinitionConstraintSyntax constraint), IsSql92ConstraintAttributesSyntax (Sql92ColumnConstraintDefinitionAttributesSyntax constraint), Typeable constraint) => IsSql92ColumnConstraintDefinitionSyntax constraint where Source #

Instances

Instances details
IsSql92ColumnConstraintDefinitionSyntax SqlSyntaxBuilder Source # 
Instance details

Defined in Database.Beam.Migrate.SQL.Builder

IsSql92ColumnConstraintDefinitionSyntax HsConstraintDefinition Source # 
Instance details

Defined in Database.Beam.Haskell.Syntax

IsSql92ColumnConstraintDefinitionSyntax BeamSerializedConstraintDefinition Source # 
Instance details

Defined in Database.Beam.Migrate.Serialization

class (Semigroup attrs, Monoid attrs, Typeable attrs) => IsSql92ConstraintAttributesSyntax attrs where Source #

class (IsSql92MatchTypeSyntax (Sql92ColumnConstraintMatchTypeSyntax constraint), IsSql92ReferentialActionSyntax (Sql92ColumnConstraintReferentialActionSyntax constraint), Typeable (Sql92ColumnConstraintExpressionSyntax constraint), Typeable constraint) => IsSql92ColumnConstraintSyntax constraint where Source #

Instances

Instances details
IsSql92ColumnConstraintSyntax SqlSyntaxBuilder Source # 
Instance details

Defined in Database.Beam.Migrate.SQL.Builder

IsSql92ColumnConstraintSyntax HsExpr Source # 
Instance details

Defined in Database.Beam.Haskell.Syntax

IsSql92ColumnConstraintSyntax BeamSerializedConstraint Source # 
Instance details

Defined in Database.Beam.Migrate.Serialization

class Sql92SerializableDataTypeSyntax dataType where Source #

IsSql92DataTypeSyntaxes that can be serialized to JSON

Methods

serializeDataType :: dataType -> Value Source #

Instances

Instances details
Sql92SerializableDataTypeSyntax HsDataType Source # 
Instance details

Defined in Database.Beam.Haskell.Syntax