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

Safe HaskellNone
LanguageHaskell2010

Database.Beam.Migrate.SQL.SQL92

Contents

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 (IsSql92ColumnSchemaSyntax (Sql92AlterTableColumnSchemaSyntax syntax), IsSql92AlterColumnActionSyntax (Sql92AlterTableAlterColumnActionSyntax syntax)) => IsSql92AlterTableActionSyntax syntax where Source #

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 (IsSql92ColumnConstraintSyntax (Sql92ColumnConstraintDefinitionConstraintSyntax constraint), IsSql92ConstraintAttributesSyntax (Sql92ColumnConstraintDefinitionAttributesSyntax constraint), Typeable constraint) => IsSql92ColumnConstraintDefinitionSyntax constraint where Source #

Instances
IsSql92ColumnConstraintDefinitionSyntax SqlSyntaxBuilder Source # 
Instance details

Defined in Database.Beam.Migrate.SQL.Builder

IsSql92ColumnConstraintDefinitionSyntax BeamSerializedConstraintDefinition Source # 
Instance details

Defined in Database.Beam.Migrate.Serialization

IsSql92ColumnConstraintDefinitionSyntax HsConstraintDefinition Source # 
Instance details

Defined in Database.Beam.Haskell.Syntax

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
IsSql92ColumnConstraintSyntax SqlSyntaxBuilder Source # 
Instance details

Defined in Database.Beam.Migrate.SQL.Builder

IsSql92ColumnConstraintSyntax BeamSerializedConstraint Source # 
Instance details

Defined in Database.Beam.Migrate.Serialization

IsSql92ColumnConstraintSyntax HsExpr Source # 
Instance details

Defined in Database.Beam.Haskell.Syntax

class Sql92SerializableDataTypeSyntax dataType where Source #

IsSql92DataTypeSyntaxes that can be serialized to JSON

Methods

serializeDataType :: dataType -> Value Source #