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

Safe HaskellNone
LanguageHaskell2010

Database.Beam.Haskell.Syntax

Contents

Description

Instances that allow us to use Haskell as a backend syntax. This allows us to use migrations defined a la SQL to generate a beam schema.

Mainly of interest to backends.

Unfortunately, we define some orphan Hashable instances that aren't defined for us in haskell-src-exts.

Synopsis

Documentation

newtype HsDbField Source #

Constructors

HsDbField 

Fields

data HsConstraintDefinition Source #

Instances

Eq HsConstraintDefinition Source # 
Show HsConstraintDefinition Source # 
Generic HsConstraintDefinition Source # 
Hashable HsConstraintDefinition Source # 
Sql92SerializableConstraintDefinitionSyntax HsConstraintDefinition Source # 
IsSql92ColumnConstraintDefinitionSyntax HsConstraintDefinition Source # 
Sql92DisplaySyntax HsConstraintDefinition Source # 
type Rep HsConstraintDefinition Source # 
type Rep HsConstraintDefinition = D1 * (MetaData "HsConstraintDefinition" "Database.Beam.Haskell.Syntax" "beam-migrate-0.3.1.0-7aFhmLBkLkbJFhhut2jziB" False) (C1 * (MetaCons "HsConstraintDefinition" PrefixI True) (S1 * (MetaSel (Just Symbol "hsConstraintDefinitionConstraint") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * HsExpr)))
type Sql92ColumnConstraintDefinitionConstraintSyntax HsConstraintDefinition Source # 
type Sql92ColumnConstraintDefinitionAttributesSyntax HsConstraintDefinition Source # 

data HsImport Source #

Constructors

HsImportAll 
HsImportSome (Set (ImportSpec ())) 

Instances

Eq HsImport Source # 
Show HsImport Source # 
Generic HsImport Source # 

Associated Types

type Rep HsImport :: * -> * #

Methods

from :: HsImport -> Rep HsImport x #

to :: Rep HsImport x -> HsImport #

Semigroup HsImport Source # 
Monoid HsImport Source # 
Hashable HsImport Source # 

Methods

hashWithSalt :: Int -> HsImport -> Int #

hash :: HsImport -> Int #

type Rep HsImport Source # 
type Rep HsImport = D1 * (MetaData "HsImport" "Database.Beam.Haskell.Syntax" "beam-migrate-0.3.1.0-7aFhmLBkLkbJFhhut2jziB" False) ((:+:) * (C1 * (MetaCons "HsImportAll" PrefixI False) (U1 *)) (C1 * (MetaCons "HsImportSome" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (Set (ImportSpec ()))))))

data HsDataType Source #

Instances

Eq HsDataType Source # 
Show HsDataType Source # 
Generic HsDataType Source # 

Associated Types

type Rep HsDataType :: * -> * #

Hashable HsDataType Source # 
IsSql2003BinaryAndVarBinaryDataTypeSyntax HsDataType Source # 
IsSql2008BigIntDataTypeSyntax HsDataType Source # 
IsSql99DataTypeSyntax HsDataType Source # 
IsSql92DataTypeSyntax HsDataType Source # 
Sql92SerializableDataTypeSyntax HsDataType Source # 
Sql92DisplaySyntax HsDataType Source # 
type Rep HsDataType Source # 
type Rep HsDataType = D1 * (MetaData "HsDataType" "Database.Beam.Haskell.Syntax" "beam-migrate-0.3.1.0-7aFhmLBkLkbJFhhut2jziB" False) (C1 * (MetaCons "HsDataType" PrefixI True) ((:*:) * (S1 * (MetaSel (Just Symbol "hsDataTypeMigration") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * HsExpr)) ((:*:) * (S1 * (MetaSel (Just Symbol "hsDataTypeType") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * HsType)) (S1 * (MetaSel (Just Symbol "hsDataTypeSerialized") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * BeamSerializedDataType)))))

data HsType Source #

Constructors

HsType 

Instances

Eq HsType Source # 

Methods

(==) :: HsType -> HsType -> Bool #

(/=) :: HsType -> HsType -> Bool #

Show HsType Source # 
Generic HsType Source # 

Associated Types

type Rep HsType :: * -> * #

Methods

from :: HsType -> Rep HsType x #

to :: Rep HsType x -> HsType #

Hashable HsType Source # 

Methods

hashWithSalt :: Int -> HsType -> Int #

hash :: HsType -> Int #

type Rep HsType Source # 
type Rep HsType = D1 * (MetaData "HsType" "Database.Beam.Haskell.Syntax" "beam-migrate-0.3.1.0-7aFhmLBkLkbJFhhut2jziB" False) (C1 * (MetaCons "HsType" PrefixI True) ((:*:) * (S1 * (MetaSel (Just Symbol "hsTypeSyntax") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (Type ()))) (S1 * (MetaSel (Just Symbol "hsTypeImports") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * HsImports))))

data HsExpr Source #

Instances

Eq HsExpr Source # 

Methods

(==) :: HsExpr -> HsExpr -> Bool #

(/=) :: HsExpr -> HsExpr -> Bool #

Show HsExpr Source # 
Generic HsExpr Source # 

Associated Types

type Rep HsExpr :: * -> * #

Methods

from :: HsExpr -> Rep HsExpr x #

to :: Rep HsExpr x -> HsExpr #

Hashable HsExpr Source # 

Methods

hashWithSalt :: Int -> HsExpr -> Int #

hash :: HsExpr -> Int #

IsSql92FieldNameSyntax HsExpr Source # 
IsSql92QuantifierSyntax HsExpr Source # 
IsSql92ExpressionSyntax HsExpr Source # 

Methods

valueE :: Sql92ExpressionValueSyntax HsExpr -> HsExpr #

rowE :: [HsExpr] -> HsExpr #

quantifierListE :: [HsExpr] -> HsExpr #

coalesceE :: [HsExpr] -> HsExpr #

caseE :: [(HsExpr, HsExpr)] -> HsExpr -> HsExpr #

fieldE :: Sql92ExpressionFieldNameSyntax HsExpr -> HsExpr #

betweenE :: HsExpr -> HsExpr -> HsExpr -> HsExpr #

andE :: HsExpr -> HsExpr -> HsExpr #

orE :: HsExpr -> HsExpr -> HsExpr #

addE :: HsExpr -> HsExpr -> HsExpr #

subE :: HsExpr -> HsExpr -> HsExpr #

mulE :: HsExpr -> HsExpr -> HsExpr #

divE :: HsExpr -> HsExpr -> HsExpr #

likeE :: HsExpr -> HsExpr -> HsExpr #

modE :: HsExpr -> HsExpr -> HsExpr #

overlapsE :: HsExpr -> HsExpr -> HsExpr #

nullIfE :: HsExpr -> HsExpr -> HsExpr #

positionE :: HsExpr -> HsExpr -> HsExpr #

eqE :: Maybe (Sql92ExpressionQuantifierSyntax HsExpr) -> HsExpr -> HsExpr -> HsExpr #

neqE :: Maybe (Sql92ExpressionQuantifierSyntax HsExpr) -> HsExpr -> HsExpr -> HsExpr #

ltE :: Maybe (Sql92ExpressionQuantifierSyntax HsExpr) -> HsExpr -> HsExpr -> HsExpr #

gtE :: Maybe (Sql92ExpressionQuantifierSyntax HsExpr) -> HsExpr -> HsExpr -> HsExpr #

leE :: Maybe (Sql92ExpressionQuantifierSyntax HsExpr) -> HsExpr -> HsExpr -> HsExpr #

geE :: Maybe (Sql92ExpressionQuantifierSyntax HsExpr) -> HsExpr -> HsExpr -> HsExpr #

eqMaybeE :: HsExpr -> HsExpr -> HsExpr -> HsExpr #

neqMaybeE :: HsExpr -> HsExpr -> HsExpr -> HsExpr #

castE :: HsExpr -> Sql92ExpressionCastTargetSyntax HsExpr -> HsExpr #

notE :: HsExpr -> HsExpr #

negateE :: HsExpr -> HsExpr #

isNullE :: HsExpr -> HsExpr #

isNotNullE :: HsExpr -> HsExpr #

isTrueE :: HsExpr -> HsExpr #

isNotTrueE :: HsExpr -> HsExpr #

isFalseE :: HsExpr -> HsExpr #

isNotFalseE :: HsExpr -> HsExpr #

isUnknownE :: HsExpr -> HsExpr #

isNotUnknownE :: HsExpr -> HsExpr #

charLengthE :: HsExpr -> HsExpr #

octetLengthE :: HsExpr -> HsExpr #

bitLengthE :: HsExpr -> HsExpr #

lowerE :: HsExpr -> HsExpr #

upperE :: HsExpr -> HsExpr #

trimE :: HsExpr -> HsExpr #

absE :: HsExpr -> HsExpr #

extractE :: Sql92ExpressionExtractFieldSyntax HsExpr -> HsExpr -> HsExpr #

existsE :: Sql92ExpressionSelectSyntax HsExpr -> HsExpr #

uniqueE :: Sql92ExpressionSelectSyntax HsExpr -> HsExpr #

subqueryE :: Sql92ExpressionSelectSyntax HsExpr -> HsExpr #

currentTimestampE :: HsExpr #

defaultE :: HsExpr #

inE :: HsExpr -> [HsExpr] -> HsExpr #

IsSql92ColumnConstraintSyntax HsExpr Source # 
HasSqlValueSyntax HsExpr Bool Source # 
HasSqlValueSyntax HsExpr Int Source # 

Methods

sqlValueSyntax :: Int -> HsExpr #

type Rep HsExpr Source # 
type Rep HsExpr = D1 * (MetaData "HsExpr" "Database.Beam.Haskell.Syntax" "beam-migrate-0.3.1.0-7aFhmLBkLkbJFhhut2jziB" False) (C1 * (MetaCons "HsExpr" PrefixI True) ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "hsExprSyntax") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (Exp ()))) (S1 * (MetaSel (Just Symbol "hsExprImports") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * HsImports))) ((:*:) * (S1 * (MetaSel (Just Symbol "hsExprConstraints") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * [Asst ()])) (S1 * (MetaSel (Just Symbol "hsExprTypeVariables") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (Set (Name ())))))))
type Sql92ExpressionExtractFieldSyntax HsExpr Source # 
type Sql92ExpressionCastTargetSyntax HsExpr Source # 
type Sql92ExpressionFieldNameSyntax HsExpr Source # 
type Sql92ExpressionSelectSyntax HsExpr Source # 
type Sql92ExpressionValueSyntax HsExpr Source # 
type Sql92ExpressionQuantifierSyntax HsExpr Source # 
type Sql92ColumnConstraintMatchTypeSyntax HsExpr Source # 
type Sql92ColumnConstraintReferentialActionSyntax HsExpr Source # 
type Sql92ColumnConstraintExpressionSyntax HsExpr Source # 

data HsColumnSchema Source #

data HsAction Source #

Constructors

HsAction 

Instances

Semigroup HsAction Source # 
Monoid HsAction Source # 
IsSql92AlterTableSyntax HsAction Source # 
IsSql92DropTableSyntax HsAction Source # 
IsSql92CreateTableSyntax HsAction Source # 
IsSql92DdlCommandSyntax HsAction Source # 
type Sql92AlterTableAlterTableActionSyntax HsAction Source # 
type Sql92CreateTableColumnSchemaSyntax HsAction Source # 
type Sql92CreateTableTableConstraintSyntax HsAction Source # 
type Sql92CreateTableOptionsSyntax HsAction Source # 
type Sql92DdlCommandCreateTableSyntax HsAction Source # 
type Sql92DdlCommandAlterTableSyntax HsAction Source # 
type Sql92DdlCommandDropTableSyntax HsAction Source # 

newtype HsFieldLookup Source #

Constructors

HsFieldLookup 

Fields

dataDecl :: DeclHead () -> [QualConDecl ()] -> Maybe (Deriving ()) -> Decl () Source #

DDL Syntax definitions

data HsNone Source #

Constructors

HsNone 

Instances

Eq HsNone Source # 

Methods

(==) :: HsNone -> HsNone -> Bool #

(/=) :: HsNone -> HsNone -> Bool #

Ord HsNone Source # 
Show HsNone Source # 
Generic HsNone Source # 

Associated Types

type Rep HsNone :: * -> * #

Methods

from :: HsNone -> Rep HsNone x #

to :: Rep HsNone x -> HsNone #

Semigroup HsNone Source # 
Monoid HsNone Source # 
Hashable HsNone Source # 

Methods

hashWithSalt :: Int -> HsNone -> Int #

hash :: HsNone -> Int #

IsSql92ConstraintAttributesSyntax HsNone Source # 
IsSql92ReferentialActionSyntax HsNone Source # 
IsSql92MatchTypeSyntax HsNone Source # 
IsSql92AlterColumnActionSyntax HsNone Source # 
IsSql92AlterTableActionSyntax HsNone Source # 
type Rep HsNone Source # 
type Rep HsNone = D1 * (MetaData "HsNone" "Database.Beam.Haskell.Syntax" "beam-migrate-0.3.1.0-7aFhmLBkLkbJFhhut2jziB" False) (C1 * (MetaCons "HsNone" PrefixI False) (U1 *))
type Sql92AlterTableAlterColumnActionSyntax HsNone Source # 
type Sql92AlterTableColumnSchemaSyntax HsNone Source # 

HsSyntax utilities

tyParens :: Type () -> Type () Source #

functionTy :: Type () -> Type () -> Type () Source #

tyTuple :: [Type ()] -> Type () Source #

tyApp :: Type () -> [Type ()] -> Type () Source #

combineHsExpr :: (Exp () -> Exp () -> Exp ()) -> HsExpr -> HsExpr -> HsExpr Source #

hsInt :: (Integral a, Show a) => a -> HsExpr Source #

hsOp :: Text -> QOp () Source #

hsInstance :: Text -> [Type ()] -> [InstDecl ()] -> Decl () Source #

Orphans

Orphan instances

Hashable Boxed Source # 

Methods

hashWithSalt :: Int -> Boxed -> Int #

hash :: Boxed -> Int #

Hashable a => Hashable (Set a) Source # 

Methods

hashWithSalt :: Int -> Set a -> Int #

hash :: Set a -> Int #

Hashable (ModuleName ()) Source # 

Methods

hashWithSalt :: Int -> ModuleName () -> Int #

hash :: ModuleName () -> Int #

Hashable (SpecialCon ()) Source # 

Methods

hashWithSalt :: Int -> SpecialCon () -> Int #

hash :: SpecialCon () -> Int #

Hashable (QName ()) Source # 

Methods

hashWithSalt :: Int -> QName () -> Int #

hash :: QName () -> Int #

Hashable (Name ()) Source # 

Methods

hashWithSalt :: Int -> Name () -> Int #

hash :: Name () -> Int #

Hashable (IPName ()) Source # 

Methods

hashWithSalt :: Int -> IPName () -> Int #

hash :: IPName () -> Int #

Hashable (QOp ()) Source # 

Methods

hashWithSalt :: Int -> QOp () -> Int #

hash :: QOp () -> Int #

Hashable (Op ()) Source # 

Methods

hashWithSalt :: Int -> Op () -> Int #

hash :: Op () -> Int #

Hashable (CName ()) Source # 

Methods

hashWithSalt :: Int -> CName () -> Int #

hash :: CName () -> Int #

Hashable (Namespace ()) Source # 

Methods

hashWithSalt :: Int -> Namespace () -> Int #

hash :: Namespace () -> Int #

Hashable (ImportSpec ()) Source # 

Methods

hashWithSalt :: Int -> ImportSpec () -> Int #

hash :: ImportSpec () -> Int #

Hashable (Assoc ()) Source # 

Methods

hashWithSalt :: Int -> Assoc () -> Int #

hash :: Assoc () -> Int #

Hashable (Decl ()) Source # 

Methods

hashWithSalt :: Int -> Decl () -> Int #

hash :: Decl () -> Int #

Hashable (PatternSynDirection ()) Source # 
Hashable (TypeEqn ()) Source # 

Methods

hashWithSalt :: Int -> TypeEqn () -> Int #

hash :: TypeEqn () -> Int #

Hashable (Annotation ()) Source # 

Methods

hashWithSalt :: Int -> Annotation () -> Int #

hash :: Annotation () -> Int #

Hashable (BooleanFormula ()) Source # 
Hashable (Role ()) Source # 

Methods

hashWithSalt :: Int -> Role () -> Int #

hash :: Role () -> Int #

Hashable (DataOrNew ()) Source # 

Methods

hashWithSalt :: Int -> DataOrNew () -> Int #

hash :: DataOrNew () -> Int #

Hashable (InjectivityInfo ()) Source # 
Hashable (ResultSig ()) Source # 

Methods

hashWithSalt :: Int -> ResultSig () -> Int #

hash :: ResultSig () -> Int #

Hashable (DeclHead ()) Source # 

Methods

hashWithSalt :: Int -> DeclHead () -> Int #

hash :: DeclHead () -> Int #

Hashable (InstRule ()) Source # 

Methods

hashWithSalt :: Int -> InstRule () -> Int #

hash :: InstRule () -> Int #

Hashable (InstHead ()) Source # 

Methods

hashWithSalt :: Int -> InstHead () -> Int #

hash :: InstHead () -> Int #

Hashable (Deriving ()) Source # 

Methods

hashWithSalt :: Int -> Deriving () -> Int #

hash :: Deriving () -> Int #

Hashable (DerivStrategy ()) Source # 
Hashable (Binds ()) Source # 

Methods

hashWithSalt :: Int -> Binds () -> Int #

hash :: Binds () -> Int #

Hashable (IPBind ()) Source # 

Methods

hashWithSalt :: Int -> IPBind () -> Int #

hash :: IPBind () -> Int #

Hashable (Match ()) Source # 

Methods

hashWithSalt :: Int -> Match () -> Int #

hash :: Match () -> Int #

Hashable (QualConDecl ()) Source # 

Methods

hashWithSalt :: Int -> QualConDecl () -> Int #

hash :: QualConDecl () -> Int #

Hashable (ConDecl ()) Source # 

Methods

hashWithSalt :: Int -> ConDecl () -> Int #

hash :: ConDecl () -> Int #

Hashable (FieldDecl ()) Source # 

Methods

hashWithSalt :: Int -> FieldDecl () -> Int #

hash :: FieldDecl () -> Int #

Hashable (GadtDecl ()) Source # 

Methods

hashWithSalt :: Int -> GadtDecl () -> Int #

hash :: GadtDecl () -> Int #

Hashable (ClassDecl ()) Source # 

Methods

hashWithSalt :: Int -> ClassDecl () -> Int #

hash :: ClassDecl () -> Int #

Hashable (InstDecl ()) Source # 

Methods

hashWithSalt :: Int -> InstDecl () -> Int #

hash :: InstDecl () -> Int #

Hashable (BangType ()) Source # 

Methods

hashWithSalt :: Int -> BangType () -> Int #

hash :: BangType () -> Int #

Hashable (Unpackedness ()) Source # 

Methods

hashWithSalt :: Int -> Unpackedness () -> Int #

hash :: Unpackedness () -> Int #

Hashable (Rhs ()) Source # 

Methods

hashWithSalt :: Int -> Rhs () -> Int #

hash :: Rhs () -> Int #

Hashable (GuardedRhs ()) Source # 

Methods

hashWithSalt :: Int -> GuardedRhs () -> Int #

hash :: GuardedRhs () -> Int #

Hashable (Type ()) Source # 

Methods

hashWithSalt :: Int -> Type () -> Int #

hash :: Type () -> Int #

Hashable (MaybePromotedName ()) Source # 
Hashable (Promoted ()) Source # 

Methods

hashWithSalt :: Int -> Promoted () -> Int #

hash :: Promoted () -> Int #

Hashable (TyVarBind ()) Source # 

Methods

hashWithSalt :: Int -> TyVarBind () -> Int #

hash :: TyVarBind () -> Int #

Hashable (Kind ()) Source # 

Methods

hashWithSalt :: Int -> Kind () -> Int #

hash :: Kind () -> Int #

Hashable (FunDep ()) Source # 

Methods

hashWithSalt :: Int -> FunDep () -> Int #

hash :: FunDep () -> Int #

Hashable (Context ()) Source # 

Methods

hashWithSalt :: Int -> Context () -> Int #

hash :: Context () -> Int #

Hashable (Asst ()) Source # 

Methods

hashWithSalt :: Int -> Asst () -> Int #

hash :: Asst () -> Int #

Hashable (Literal ()) Source # 

Methods

hashWithSalt :: Int -> Literal () -> Int #

hash :: Literal () -> Int #

Hashable (Sign ()) Source # 

Methods

hashWithSalt :: Int -> Sign () -> Int #

hash :: Sign () -> Int #

Hashable (Exp ()) Source # 

Methods

hashWithSalt :: Int -> Exp () -> Int #

hash :: Exp () -> Int #

Hashable (XName ()) Source # 

Methods

hashWithSalt :: Int -> XName () -> Int #

hash :: XName () -> Int #

Hashable (XAttr ()) Source # 

Methods

hashWithSalt :: Int -> XAttr () -> Int #

hash :: XAttr () -> Int #

Hashable (Bracket ()) Source # 

Methods

hashWithSalt :: Int -> Bracket () -> Int #

hash :: Bracket () -> Int #

Hashable (Splice ()) Source # 

Methods

hashWithSalt :: Int -> Splice () -> Int #

hash :: Splice () -> Int #

Hashable (Safety ()) Source # 

Methods

hashWithSalt :: Int -> Safety () -> Int #

hash :: Safety () -> Int #

Hashable (CallConv ()) Source # 

Methods

hashWithSalt :: Int -> CallConv () -> Int #

hash :: CallConv () -> Int #

Hashable (Overlap ()) Source # 

Methods

hashWithSalt :: Int -> Overlap () -> Int #

hash :: Overlap () -> Int #

Hashable (Activation ()) Source # 

Methods

hashWithSalt :: Int -> Activation () -> Int #

hash :: Activation () -> Int #

Hashable (Rule ()) Source # 

Methods

hashWithSalt :: Int -> Rule () -> Int #

hash :: Rule () -> Int #

Hashable (RuleVar ()) Source # 

Methods

hashWithSalt :: Int -> RuleVar () -> Int #

hash :: RuleVar () -> Int #

Hashable (Pat ()) Source # 

Methods

hashWithSalt :: Int -> Pat () -> Int #

hash :: Pat () -> Int #

Hashable (PXAttr ()) Source # 

Methods

hashWithSalt :: Int -> PXAttr () -> Int #

hash :: PXAttr () -> Int #

Hashable (RPatOp ()) Source # 

Methods

hashWithSalt :: Int -> RPatOp () -> Int #

hash :: RPatOp () -> Int #

Hashable (RPat ()) Source # 

Methods

hashWithSalt :: Int -> RPat () -> Int #

hash :: RPat () -> Int #

Hashable (PatField ()) Source # 

Methods

hashWithSalt :: Int -> PatField () -> Int #

hash :: PatField () -> Int #

Hashable (Stmt ()) Source # 

Methods

hashWithSalt :: Int -> Stmt () -> Int #

hash :: Stmt () -> Int #

Hashable (QualStmt ()) Source # 

Methods

hashWithSalt :: Int -> QualStmt () -> Int #

hash :: QualStmt () -> Int #

Hashable (FieldUpdate ()) Source # 

Methods

hashWithSalt :: Int -> FieldUpdate () -> Int #

hash :: FieldUpdate () -> Int #

Hashable (Alt ()) Source # 

Methods

hashWithSalt :: Int -> Alt () -> Int #

hash :: Alt () -> Int #