-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Full parser and generator for SQL as implemented by SQLite3
--
-- This is a full parser and generator for SQL as implemented by SQLite3.
-- It is well-typed in the sense that it is possible to construct an
-- abstract syntax tree if and only if it corresponds to valid SQL.
-- Version 1.1 adds support for parsing and generating type affinities.
@package language-sqlite
@version 1.1
module Language.SQL.SQLite.Tools
changeTableSchema :: CreateTable -> CreateTable -> (Map UnqualifiedIdentifier Expression) -> StatementList
module Language.SQL.SQLite
lexModuleArgument :: String -> Parse (Token, String)
data ParseError
readType :: String -> Either ParseError Type
readMaybeType :: String -> Either ParseError MaybeType
readMaybeTypeName :: String -> Either ParseError MaybeTypeName
readMaybeTypeSize :: String -> Either ParseError MaybeTypeSize
readTypeSizeField :: String -> Either ParseError TypeSizeField
readLikeType :: String -> Either ParseError LikeType
readMaybeSwitchExpression :: String -> Either ParseError MaybeSwitchExpression
readCasePair :: String -> Either ParseError CasePair
readEscape :: String -> Either ParseError Escape
readElse :: String -> Either ParseError Else
readExpression :: String -> Either ParseError Expression
readMaybeUnique :: String -> Either ParseError MaybeUnique
readMaybeIfNotExists :: String -> Either ParseError MaybeIfNotExists
readMaybeIfExists :: String -> Either ParseError MaybeIfExists
readMaybeForEachRow :: String -> Either ParseError MaybeForEachRow
readMaybeTemporary :: String -> Either ParseError MaybeTemporary
readMaybeCollation :: String -> Either ParseError MaybeCollation
readMaybeAscDesc :: String -> Either ParseError MaybeAscDesc
readMaybeAutoincrement :: String -> Either ParseError MaybeAutoincrement
readMaybeSign :: String -> Either ParseError MaybeSign
readMaybeColumn :: String -> Either ParseError MaybeColumn
readAlterTableBody :: String -> Either ParseError AlterTableBody
readColumnDefinition :: String -> Either ParseError ColumnDefinition
readDefaultValue :: String -> Either ParseError DefaultValue
readIndexedColumn :: String -> Either ParseError IndexedColumn
readColumnConstraint :: String -> Either ParseError ColumnConstraint
readTableConstraint :: String -> Either ParseError TableConstraint
readMaybeConstraintName :: String -> Either ParseError MaybeConstraintName
readTriggerTime :: String -> Either ParseError TriggerTime
readTriggerCondition :: String -> Either ParseError TriggerCondition
readModuleArgument :: String -> Either ParseError ModuleArgument
readTriggerStatement :: String -> Either ParseError TriggerStatement
readQualifiedTableName :: String -> Either ParseError QualifiedTableName
readOrderingTerm :: String -> Either ParseError OrderingTerm
readPragmaBody :: String -> Either ParseError PragmaBody
readPragmaValue :: String -> Either ParseError PragmaValue
readCreateTableBody :: String -> Either ParseError CreateTableBody
readInsertHead :: String -> Either ParseError InsertHead
readInsertBody :: String -> Either ParseError InsertBody
readUpdateHead :: String -> Either ParseError UpdateHead
readDistinctness :: String -> Either ParseError Distinctness
readMaybeHaving :: String -> Either ParseError MaybeHaving
readMaybeAs :: String -> Either ParseError MaybeAs
readCompoundOperator :: String -> Either ParseError CompoundOperator
readSelectCore :: String -> Either ParseError SelectCore
readResultColumn :: String -> Either ParseError ResultColumn
readJoinSource :: String -> Either ParseError JoinSource
readSingleSource :: String -> Either ParseError SingleSource
readJoinOperation :: String -> Either ParseError JoinOperation
readJoinConstraint :: String -> Either ParseError JoinConstraint
readMaybeIndexedBy :: String -> Either ParseError MaybeIndexedBy
readFromClause :: String -> Either ParseError FromClause
readWhereClause :: String -> Either ParseError WhereClause
readGroupClause :: String -> Either ParseError GroupClause
readOrderClause :: String -> Either ParseError OrderClause
readLimitClause :: String -> Either ParseError LimitClause
readWhenClause :: String -> Either ParseError WhenClause
readConflictClause :: String -> Either ParseError ConflictClause
readForeignKeyClause :: String -> Either ParseError ForeignKeyClause
readForeignKeyClauseActionOrMatchPart :: String -> Either ParseError ForeignKeyClauseActionOrMatchPart
readForeignKeyClauseActionPart :: String -> Either ParseError ForeignKeyClauseActionPart
readMaybeForeignKeyClauseDeferrablePart :: String -> Either ParseError MaybeForeignKeyClauseDeferrablePart
readMaybeInitialDeferralStatus :: String -> Either ParseError MaybeInitialDeferralStatus
readCommitHead :: String -> Either ParseError CommitHead
readMaybeTransaction :: String -> Either ParseError MaybeTransaction
readMaybeTransactionType :: String -> Either ParseError MaybeTransactionType
readMaybeDatabase :: String -> Either ParseError MaybeDatabase
readMaybeSavepoint :: String -> Either ParseError MaybeSavepoint
readMaybeReleaseSavepoint :: String -> Either ParseError MaybeReleaseSavepoint
readStatementList :: String -> Either ParseError StatementList
readAnyStatement :: String -> Either ParseError AnyStatement
readExplainableStatement :: String -> Either ParseError ExplainableStatement
readExplain :: String -> Either ParseError Explain
readExplainQueryPlan :: String -> Either ParseError ExplainQueryPlan
readAlterTable :: String -> Either ParseError AlterTable
readAnalyze :: String -> Either ParseError Analyze
readAttach :: String -> Either ParseError Attach
readBegin :: String -> Either ParseError Begin
readCommit :: String -> Either ParseError Commit
readCreateIndex :: String -> Either ParseError CreateIndex
readCreateTable :: String -> Either ParseError CreateTable
readCreateTrigger :: String -> Either ParseError CreateTrigger
readCreateView :: String -> Either ParseError CreateView
readCreateVirtualTable :: String -> Either ParseError CreateVirtualTable
readDelete :: String -> Either ParseError Delete
readDeleteLimited :: String -> Either ParseError DeleteLimited
readDeleteOrDeleteLimited :: String -> Either ParseError AnyStatement
readDetach :: String -> Either ParseError Detach
readDropIndex :: String -> Either ParseError DropIndex
readDropTable :: String -> Either ParseError DropTable
readDropTrigger :: String -> Either ParseError DropTrigger
readDropView :: String -> Either ParseError DropView
readInsert :: String -> Either ParseError Insert
readPragma :: String -> Either ParseError Pragma
readReindex :: String -> Either ParseError Reindex
readRelease :: String -> Either ParseError Release
readRollback :: String -> Either ParseError Rollback
readSavepoint :: String -> Either ParseError Savepoint
readSelect :: String -> Either ParseError Select
readUpdate :: String -> Either ParseError Update
readUpdateLimited :: String -> Either ParseError UpdateLimited
readUpdateOrUpdateLimited :: String -> Either ParseError AnyStatement
readVacuum :: String -> Either ParseError Vacuum
readUnqualifiedIdentifier :: String -> Either ParseError UnqualifiedIdentifier
readSinglyQualifiedIdentifier :: String -> Either ParseError SinglyQualifiedIdentifier
readDoublyQualifiedIdentifier :: String -> Either ParseError DoublyQualifiedIdentifier
-- | A class implemented by every node of the AST; converts the node and
-- its children into a list of tokens which correspond to the SQL
-- representation of the node.
class ShowTokens a
showTokens :: ShowTokens a => a -> [Token]
-- | A class with hidden implementation so as to enforce the constraint
-- that it is a nonempty homogeneous list of items.
data OneOrMore a
-- | The constructor for OneOrMore a. Returns
-- Nothing if the list it's given is empty, or Just
-- OneOrMore a if it is not.
mkOneOrMore :: [a] -> Maybe (OneOrMore a)
-- | The accessor for OneOrMore a. Returns [a].
fromOneOrMore :: (OneOrMore a) -> [a]
-- | A class with hidden implementation so as to enforce the constraint
-- that it is a nonnegative double.
data NonnegativeDouble
-- | The constructor for NonnegativeDouble. Returns Nothing
-- if the double it's given is negative, or Just
-- NonnegativeDouble if it is not.
mkNonnegativeDouble :: Double -> Maybe NonnegativeDouble
-- | The accessor for NonnegativeDouble. Returns a double.
fromNonnegativeDouble :: NonnegativeDouble -> Double
-- | Computes a TypeAffinity from a MaybeTypeName, as used in
-- Type.
computeTypeNameAffinity :: MaybeTypeName -> TypeAffinity
-- | Computes a MaybeTypeName from a TypeAffinity, as used in
-- Type.
computeAffinityTypeName :: TypeAffinity -> MaybeTypeName
-- | A class implemented by all identifiers regardless of how many levels
-- of qualification they allow.
class Identifier a
identifierProperName :: Identifier a => a -> String
identifierParentName :: Identifier a => a -> Maybe String
identifierGrandparentName :: Identifier a => a -> Maybe String
-- | Converts an identifier to be doubly-qualified. This does not actually
-- synthesize any missing components, merely provides Nothing for
-- them.
toDoublyQualifiedIdentifier :: Identifier a => a -> DoublyQualifiedIdentifier
-- | An identifier which does not allow any levels of qualification. This
-- is typically a database name.
data UnqualifiedIdentifier
UnqualifiedIdentifier :: String -> UnqualifiedIdentifier
-- | An identifier which allows a single level of qualification. This is
-- typically the name of a table or other database-level object.
data SinglyQualifiedIdentifier
SinglyQualifiedIdentifier :: (Maybe String) -> String -> SinglyQualifiedIdentifier
-- | An identifier which allows two levels of qualification. This is
-- typically a column name.
data DoublyQualifiedIdentifier
DoublyQualifiedIdentifier :: (Maybe (String, Maybe String)) -> String -> DoublyQualifiedIdentifier
-- | Not an AST node but a token which corresponds to a primitive of SQL
-- syntax. Has an instance of Show which prints a list of them as
-- syntactically-valid SQL with no line wrapping.
data Token
EndOfInputToken :: Token
Identifier :: String -> Token
LiteralInteger :: Word64 -> Token
LiteralFloat :: NonnegativeDouble -> Token
LiteralString :: String -> Token
LiteralBlob :: ByteString -> Token
Variable :: Token
VariableN :: Word64 -> Token
VariableNamed :: String -> Token
ModuleArgumentToken :: String -> Token
PunctuationBarBar :: Token
PunctuationStar :: Token
PunctuationSlash :: Token
PunctuationPercent :: Token
PunctuationPlus :: Token
PunctuationMinus :: Token
PunctuationLessLess :: Token
PunctuationGreaterGreater :: Token
PunctuationAmpersand :: Token
PunctuationBar :: Token
PunctuationLess :: Token
PunctuationLessEquals :: Token
PunctuationGreater :: Token
PunctuationGreaterEquals :: Token
PunctuationEquals :: Token
PunctuationEqualsEquals :: Token
PunctuationBangEquals :: Token
PunctuationLessGreater :: Token
PunctuationTilde :: Token
PunctuationLeftParenthesis :: Token
PunctuationRightParenthesis :: Token
PunctuationComma :: Token
PunctuationDot :: Token
PunctuationSemicolon :: Token
KeywordAbort :: Token
KeywordAction :: Token
KeywordAdd :: Token
KeywordAfter :: Token
KeywordAll :: Token
KeywordAlter :: Token
KeywordAnalyze :: Token
KeywordAnd :: Token
KeywordAs :: Token
KeywordAsc :: Token
KeywordAttach :: Token
KeywordAutoincrement :: Token
KeywordBefore :: Token
KeywordBegin :: Token
KeywordBetween :: Token
KeywordBy :: Token
KeywordCascade :: Token
KeywordCase :: Token
KeywordCast :: Token
KeywordCheck :: Token
KeywordCollate :: Token
KeywordColumn :: Token
KeywordCommit :: Token
KeywordConflict :: Token
KeywordConstraint :: Token
KeywordCreate :: Token
KeywordCross :: Token
KeywordCurrentDate :: Token
KeywordCurrentTime :: Token
KeywordCurrentTimestamp :: Token
KeywordDatabase :: Token
KeywordDefault :: Token
KeywordDeferrable :: Token
KeywordDeferred :: Token
KeywordDelete :: Token
KeywordDesc :: Token
KeywordDetach :: Token
KeywordDistinct :: Token
KeywordDrop :: Token
KeywordEach :: Token
KeywordElse :: Token
KeywordEnd :: Token
KeywordEscape :: Token
KeywordExcept :: Token
KeywordExclusive :: Token
KeywordExists :: Token
KeywordExplain :: Token
KeywordFail :: Token
KeywordFor :: Token
KeywordForeign :: Token
KeywordFrom :: Token
KeywordFull :: Token
KeywordGlob :: Token
KeywordGroup :: Token
KeywordHaving :: Token
KeywordIf :: Token
KeywordIgnore :: Token
KeywordImmediate :: Token
KeywordIn :: Token
KeywordIndex :: Token
KeywordIndexed :: Token
KeywordInitially :: Token
KeywordInner :: Token
KeywordInsert :: Token
KeywordInstead :: Token
KeywordIntersect :: Token
KeywordInto :: Token
KeywordIs :: Token
KeywordIsnull :: Token
KeywordJoin :: Token
KeywordKey :: Token
KeywordLeft :: Token
KeywordLike :: Token
KeywordLimit :: Token
KeywordMatch :: Token
KeywordNatural :: Token
KeywordNo :: Token
KeywordNot :: Token
KeywordNotnull :: Token
KeywordNull :: Token
KeywordOf :: Token
KeywordOffset :: Token
KeywordOn :: Token
KeywordOr :: Token
KeywordOrder :: Token
KeywordOuter :: Token
KeywordPlan :: Token
KeywordPragma :: Token
KeywordPrimary :: Token
KeywordQuery :: Token
KeywordRaise :: Token
KeywordReferences :: Token
KeywordRegexp :: Token
KeywordReindex :: Token
KeywordRelease :: Token
KeywordRename :: Token
KeywordReplace :: Token
KeywordRestrict :: Token
KeywordRight :: Token
KeywordRollback :: Token
KeywordRow :: Token
KeywordSavepoint :: Token
KeywordSelect :: Token
KeywordSet :: Token
KeywordTable :: Token
KeywordTemp :: Token
KeywordTemporary :: Token
KeywordThen :: Token
KeywordTo :: Token
KeywordTransaction :: Token
KeywordTrigger :: Token
KeywordUnion :: Token
KeywordUnique :: Token
KeywordUpdate :: Token
KeywordUsing :: Token
KeywordVacuum :: Token
KeywordValues :: Token
KeywordView :: Token
KeywordVirtual :: Token
KeywordWhen :: Token
KeywordWhere :: Token
-- | The AST node corresponding to the body of an AlterTable
-- statement. Used by AlterTable.
data AlterTableBody
RenameTo :: UnqualifiedIdentifier -> AlterTableBody
AddColumn :: MaybeColumn -> ColumnDefinition -> AlterTableBody
-- | The AST node corresponding to each WHEN-THEN pair of
-- subexpressions in a CASE expression. Used by
-- ExpressionCase.
data CasePair
WhenThen :: Expression -> Expression -> CasePair
-- | The AST node corresponding to a column constraint subclause. Used by
-- ColumnDefinition.
data ColumnConstraint
ColumnPrimaryKey :: MaybeConstraintName -> MaybeAscDesc -> (Maybe ConflictClause) -> MaybeAutoincrement -> ColumnConstraint
ColumnNotNull :: MaybeConstraintName -> (Maybe ConflictClause) -> ColumnConstraint
ColumnUnique :: MaybeConstraintName -> (Maybe ConflictClause) -> ColumnConstraint
ColumnCheck :: MaybeConstraintName -> Expression -> ColumnConstraint
ColumnDefault :: MaybeConstraintName -> DefaultValue -> ColumnConstraint
ColumnCollate :: MaybeConstraintName -> UnqualifiedIdentifier -> ColumnConstraint
ColumnForeignKey :: MaybeConstraintName -> ForeignKeyClause -> ColumnConstraint
-- | The AST node corresponding to a column-definition subclause. Used by
-- AlterTableBody and CreateTableBody.
data ColumnDefinition
ColumnDefinition :: UnqualifiedIdentifier -> MaybeType -> [ColumnConstraint] -> ColumnDefinition
-- | The AST node corresponding to the head of a COMMIT statement.
-- Used by Commit.
data CommitHead
CommitCommit :: CommitHead
CommitEnd :: CommitHead
-- | The AST node corresponding to a compound operator in a SELECT
-- statement. Used by Select.
data CompoundOperator
Union :: CompoundOperator
UnionAll :: CompoundOperator
Intersect :: CompoundOperator
Except :: CompoundOperator
-- | The AST node corresponding to an ON CONFLICT clause. Used by
-- ColumnConstraint and TableConstraint.
data ConflictClause
OnConflictRollback :: ConflictClause
OnConflictAbort :: ConflictClause
OnConflictFail :: ConflictClause
OnConflictIgnore :: ConflictClause
OnConflictReplace :: ConflictClause
-- | The AST node corresponding to a default-value subclause. Used by
-- ColumnConstraint.
data DefaultValue
DefaultValueSignedInteger :: MaybeSign -> Word64 -> DefaultValue
DefaultValueSignedFloat :: MaybeSign -> NonnegativeDouble -> DefaultValue
DefaultValueLiteralString :: String -> DefaultValue
DefaultValueLiteralBlob :: ByteString -> DefaultValue
DefaultValueLiteralNull :: DefaultValue
DefaultValueLiteralCurrentTime :: DefaultValue
DefaultValueLiteralCurrentDate :: DefaultValue
DefaultValueLiteralCurrentTimestamp :: DefaultValue
DefaultValueExpression :: Expression -> DefaultValue
-- | The AST node corresponding to an optional DISTINCT or
-- ALL qualifier. Used by SelectCore.
data Distinctness
NoDistinctness :: Distinctness
Distinct :: Distinctness
All :: Distinctness
-- | The AST node corresponding to a create-table body. Used by
-- CreateTable.
data CreateTableBody
ColumnsAndConstraints :: (OneOrMore ColumnDefinition) -> [TableConstraint] -> CreateTableBody
AsSelect :: (Select) -> CreateTableBody
-- | The AST node corresponding to the optional ELSE subclause in
-- a CASE expression. Used by ExpressionCase.
data Else
NoElse :: Else
Else :: Expression -> Else
-- | The AST node corresponding to the ESCAPE subclause of a
-- textual comparison expression. Used by ExpressionLike.
data Escape
NoEscape :: Escape
Escape :: Expression -> Escape
-- | The AST node corresponding to a FOREIGN KEY clause. Used by
-- ColumnConstraint and TableConstraint.
data ForeignKeyClause
References :: UnqualifiedIdentifier -> [UnqualifiedIdentifier] -> [ForeignKeyClauseActionOrMatchPart] -> MaybeForeignKeyClauseDeferrablePart -> ForeignKeyClause
-- | The AST node corresponding to the first partial body of a FOREIGN
-- KEY clause. Used by ForeignKeyClause.
data ForeignKeyClauseActionOrMatchPart
OnDelete :: ForeignKeyClauseActionPart -> ForeignKeyClauseActionOrMatchPart
OnUpdate :: ForeignKeyClauseActionPart -> ForeignKeyClauseActionOrMatchPart
ReferencesMatch :: UnqualifiedIdentifier -> ForeignKeyClauseActionOrMatchPart
-- | The AST node corresponding to an action subclause in the first partial
-- body of a FOREIGN KEY clause. Used by
-- ForeignKeyClauseActionOrMatchPart.
data ForeignKeyClauseActionPart
SetNull :: ForeignKeyClauseActionPart
SetDefault :: ForeignKeyClauseActionPart
Cascade :: ForeignKeyClauseActionPart
Restrict :: ForeignKeyClauseActionPart
NoAction :: ForeignKeyClauseActionPart
-- | The AST node corresponding to a FROM clause. Used by
-- SelectCore.
data FromClause
From :: JoinSource -> FromClause
-- | The AST node corresponding to a GROUP BY clause. Used by
-- SelectCore.
data GroupClause
GroupBy :: (OneOrMore OrderingTerm) -> MaybeHaving -> GroupClause
-- | The AST node corresponding to an indexed-column subclause. Used by
-- TableConstraint and CreateIndex.
data IndexedColumn
IndexedColumn :: UnqualifiedIdentifier -> MaybeCollation -> MaybeAscDesc -> IndexedColumn
-- | The AST node corresponding to an insert body. Used by Insert.
data InsertBody
InsertValues :: [UnqualifiedIdentifier] -> (OneOrMore Expression) -> InsertBody
InsertSelect :: [UnqualifiedIdentifier] -> (Select) -> InsertBody
InsertDefaultValues :: InsertBody
-- | The AST node corresponding to an insert head. Used by Insert.
data InsertHead
InsertNoAlternative :: InsertHead
InsertOrRollback :: InsertHead
InsertOrAbort :: InsertHead
InsertOrReplace :: InsertHead
InsertOrFail :: InsertHead
InsertOrIgnore :: InsertHead
Replace :: InsertHead
-- | The AST node corresponding to a join constraint, a qualifier in the
-- FROM clause of a SELECT statement. Used by
-- JoinSource.
data JoinConstraint
NoConstraint :: JoinConstraint
On :: Expression -> JoinConstraint
Using :: (OneOrMore UnqualifiedIdentifier) -> JoinConstraint
-- | The AST node corresponding to a join operation, a conjunction in the
-- FROM clause of a SELECT statement. Used by
-- JoinSource.
data JoinOperation
Comma :: JoinOperation
Join :: JoinOperation
OuterJoin :: JoinOperation
LeftJoin :: JoinOperation
LeftOuterJoin :: JoinOperation
InnerJoin :: JoinOperation
CrossJoin :: JoinOperation
NaturalJoin :: JoinOperation
NaturalOuterJoin :: JoinOperation
NaturalLeftJoin :: JoinOperation
NaturalLeftOuterJoin :: JoinOperation
NaturalInnerJoin :: JoinOperation
NaturalCrossJoin :: JoinOperation
-- | The AST node corresponding to a source from which to join columns in a
-- SELECT statement, which may be the head of the statement's
-- FROM clause, or, in the case of a subjoin, only part of it.
-- Used by FromClause and SingleSource.
data JoinSource
JoinSource :: SingleSource -> [(JoinOperation, SingleSource, JoinConstraint)] -> JoinSource
-- | The AST node corresponding to a textual comparison operator in an
-- expression. Used by ExpressionLike.
data LikeType
Like :: LikeType
NotLike :: LikeType
Glob :: LikeType
NotGlob :: LikeType
Regexp :: LikeType
NotRegexp :: LikeType
Match :: LikeType
NotMatch :: LikeType
-- | The AST node corresponding to a LIMIT clause. Used by
-- Select, DeleteLimited, and UpdateLimited.
data LimitClause
Limit :: Word64 -> LimitClause
LimitOffset :: Word64 -> Word64 -> LimitClause
LimitComma :: Word64 -> Word64 -> LimitClause
-- | The AST node corresponding to an optional AS subclause,
-- possibly with the actual keyword elided. Used by ResultColumn
-- and SingleSource.
data MaybeAs
NoAs :: MaybeAs
As :: UnqualifiedIdentifier -> MaybeAs
ElidedAs :: UnqualifiedIdentifier -> MaybeAs
-- | The AST node corresponding to an optional ASC or
-- DESC qualifier. Used by IndexedColumn,
-- ColumnConstraint, and OrderingTerm.
data MaybeAscDesc
NoAscDesc :: MaybeAscDesc
Asc :: MaybeAscDesc
Desc :: MaybeAscDesc
-- | The AST node corresponding to an optional AUTOINCREMENT
-- qualifier. Used by ColumnConstraint.
data MaybeAutoincrement
NoAutoincrement :: MaybeAutoincrement
Autoincrement :: MaybeAutoincrement
-- | The AST node corresponding to an optional COLLATE subclause.
-- Used by IndexedColumn and OrderingTerm.
data MaybeCollation
NoCollation :: MaybeCollation
Collation :: UnqualifiedIdentifier -> MaybeCollation
-- | The AST node corresponding to an optional COLUMN keyword.
-- Used by AlterTableBody.
data MaybeColumn
ElidedColumn :: MaybeColumn
Column :: MaybeColumn
-- | The AST node corresponding to an optional constraint name subclause.
-- Used by ColumnConstraint and 'Table Constraint'.
data MaybeConstraintName
NoConstraintName :: MaybeConstraintName
ConstraintName :: UnqualifiedIdentifier -> MaybeConstraintName
-- | The AST node corresponding to an optional DATABASE keyword.
-- Used by Attach and Detach.
data MaybeDatabase
ElidedDatabase :: MaybeDatabase
Database :: MaybeDatabase
-- | The AST node corresponding to an optional FOR EACH ROW
-- qualifier. Used by CreateTrigger.
data MaybeForEachRow
NoForEachRow :: MaybeForEachRow
ForEachRow :: MaybeForEachRow
-- | The AST node corresponding to the second partial body of a FOREIGN
-- KEY clause. Used by ForeignKeyClause.
data MaybeForeignKeyClauseDeferrablePart
NoDeferrablePart :: MaybeForeignKeyClauseDeferrablePart
Deferrable :: MaybeInitialDeferralStatus -> MaybeForeignKeyClauseDeferrablePart
NotDeferrable :: MaybeInitialDeferralStatus -> MaybeForeignKeyClauseDeferrablePart
-- | The AST node corresponding to an optional HAVING subclause.
-- Used by GroupClause.
data MaybeHaving
NoHaving :: MaybeHaving
Having :: Expression -> MaybeHaving
-- | The AST node corresponding to an optional IF EXISTS
-- qualifier. Used by DropIndex, DropTable,
-- DropTrigger, and DropView.
data MaybeIfExists
NoIfExists :: MaybeIfExists
IfExists :: MaybeIfExists
-- | The AST node corresponding to an optional IF NOT EXISTS
-- qualifier. Used by CreateIndex, CreateTable,
-- CreateTrigger, and CreateView.
data MaybeIfNotExists
NoIfNotExists :: MaybeIfNotExists
IfNotExists :: MaybeIfNotExists
-- | The AST node corresponding to an optional INDEXED BY or
-- NOT INDEXED qualifier. Used by SingleSource.
data MaybeIndexedBy
NoIndexedBy :: MaybeIndexedBy
IndexedBy :: UnqualifiedIdentifier -> MaybeIndexedBy
NotIndexed :: MaybeIndexedBy
-- | The AST node corresponding to an optional INITIALLY DEFERRED
-- or INITIALLY IMMEDIATE qualifier in a FOREIGN KEY
-- clause. Used by MaybeForeignKeyClauseDeferrablePart.
data MaybeInitialDeferralStatus
NoInitialDeferralStatus :: MaybeInitialDeferralStatus
InitiallyDeferred :: MaybeInitialDeferralStatus
InitiallyImmediate :: MaybeInitialDeferralStatus
-- | The AST node corresponding to an optional RELEASE SAVEPOINT
-- qualifier. Used by Release.
data MaybeReleaseSavepoint
ElidedReleaseSavepoint :: UnqualifiedIdentifier -> MaybeReleaseSavepoint
ReleaseSavepoint :: UnqualifiedIdentifier -> MaybeReleaseSavepoint
-- | The AST node corresponding to an optional TO SAVEPOINT
-- qualifier. Used by Rollback.
data MaybeSavepoint
NoSavepoint :: MaybeSavepoint
To :: UnqualifiedIdentifier -> MaybeSavepoint
ToSavepoint :: UnqualifiedIdentifier -> MaybeSavepoint
-- | The AST node corresponding to an optional + or -
-- sign. Used by TypeSizeField, DefaultValue, and
-- PragmaValue.
data MaybeSign
NoSign :: MaybeSign
PositiveSign :: MaybeSign
NegativeSign :: MaybeSign
-- | The AST node corresponding to the optional first subexpression in a
-- CASE expression. Used by ExpressionCase.
data MaybeSwitchExpression
NoSwitch :: MaybeSwitchExpression
Switch :: Expression -> MaybeSwitchExpression
-- | The AST node corresponding to an optional TEMP or
-- TEMPORARY qualifier. Used by CreateTable,
-- CreateTrigger, and CreateView.
data MaybeTemporary
NoTemporary :: MaybeTemporary
Temp :: MaybeTemporary
Temporary :: MaybeTemporary
-- | The AST node corresponding to an optional TRASACTION keyword.
-- Used by Begin, Commit, and Rollback.
data MaybeTransaction
ElidedTransaction :: MaybeTransaction
Transaction :: MaybeTransaction
-- | The AST node corresponding to an optional transaction-type qualifier.
-- Used by Begin.
data MaybeTransactionType
NoTransactionType :: MaybeTransactionType
Deferred :: MaybeTransactionType
Immediate :: MaybeTransactionType
Exclusive :: MaybeTransactionType
-- | The AST node corresponding to an optional column type. Used by
-- ColumnDefinition.
data MaybeType
NoType :: MaybeType
JustType :: Type -> MaybeType
data MaybeTypeName
NoTypeName :: MaybeTypeName
TypeName :: (OneOrMore UnqualifiedIdentifier) -> MaybeTypeName
-- | The AST node corresponding to an optional size annotation on a column
-- or value type. Used by Type.
data MaybeTypeSize
NoTypeSize :: MaybeTypeSize
TypeMaximumSize :: TypeSizeField -> MaybeTypeSize
TypeSize :: TypeSizeField -> TypeSizeField -> MaybeTypeSize
-- | The AST node corresponding to an optional UNIQUE qualifier.
-- Used by CreateIndex.
data MaybeUnique
NoUnique :: MaybeUnique
Unique :: MaybeUnique
-- | The AST node corresponding to a module argument. Used by
-- CreateVirtualTable.
data ModuleArgument
ModuleArgument :: String -> ModuleArgument
-- | The AST node corresponding to an ORDER BY clause. Used by
-- Select, DeleteLimited, and UpdateLimited.
data OrderClause
OrderBy :: (OneOrMore OrderingTerm) -> OrderClause
-- | The AST node corresponding to an ordering term subclause. Used by
-- GroupClause and OrderClause.
data OrderingTerm
OrderingTerm :: Expression -> MaybeCollation -> MaybeAscDesc -> OrderingTerm
-- | The AST node corresponding to a pragma body. Used by Pragma.
data PragmaBody
EmptyPragmaBody :: PragmaBody
EqualsPragmaBody :: PragmaValue -> PragmaBody
CallPragmaBody :: PragmaValue -> PragmaBody
-- | The AST node corresponding to a pragma value subclause. Used by
-- PragmaBody.
data PragmaValue
SignedIntegerPragmaValue :: MaybeSign -> Word64 -> PragmaValue
SignedFloatPragmaValue :: MaybeSign -> NonnegativeDouble -> PragmaValue
NamePragmaValue :: UnqualifiedIdentifier -> PragmaValue
StringPragmaValue :: String -> PragmaValue
-- | The AST node corresponding to a qualified table name subclause. Used
-- by Delete, DeleteLimited, Update, and
-- UpdateLimited.
data QualifiedTableName
TableNoIndexedBy :: SinglyQualifiedIdentifier -> QualifiedTableName
TableIndexedBy :: SinglyQualifiedIdentifier -> UnqualifiedIdentifier -> QualifiedTableName
TableNotIndexed :: SinglyQualifiedIdentifier -> QualifiedTableName
-- | The AST node corresponding to a result column in a SELECT
-- statement. Used by SelectCore.
data ResultColumn
Star :: ResultColumn
TableStar :: UnqualifiedIdentifier -> ResultColumn
Result :: Expression -> MaybeAs -> ResultColumn
-- | The AST node corresponding to the core part of a SELECT
-- statement, which may be the head of the overall statement, or, in the
-- case of a compound SELECT, only part of it. Used by
-- Select.
data SelectCore
SelectCore :: Distinctness -> (OneOrMore ResultColumn) -> (Maybe FromClause) -> (Maybe WhereClause) -> (Maybe GroupClause) -> SelectCore
-- | The AST node corresponding to a primitive source from which to join
-- columns in a SELECT statement, which is a body of the
-- statement's FROM clause. Used by JoinSource.
data SingleSource
TableSource :: SinglyQualifiedIdentifier -> MaybeAs -> MaybeIndexedBy -> SingleSource
SelectSource :: (Select) -> MaybeAs -> SingleSource
SubjoinSource :: JoinSource -> SingleSource
-- | The AST node corresponding to a semicolon-separated list of
-- statements. Used at the top level of an SQL file.
data StatementList
StatementList :: [AnyStatement] -> StatementList
-- | The AST node corresponding to a table-constraint subclause. Used by
-- CreateTableBody.
data TableConstraint
TablePrimaryKey :: MaybeConstraintName -> (OneOrMore IndexedColumn) -> (Maybe ConflictClause) -> TableConstraint
TableUnique :: MaybeConstraintName -> (OneOrMore IndexedColumn) -> (Maybe ConflictClause) -> TableConstraint
TableCheck :: MaybeConstraintName -> Expression -> TableConstraint
TableForeignKey :: MaybeConstraintName -> (OneOrMore UnqualifiedIdentifier) -> ForeignKeyClause -> TableConstraint
-- | The AST node corresponding to a trigger-condition subclause. Used by
-- CreateTrigger.
data TriggerCondition
DeleteOn :: TriggerCondition
InsertOn :: TriggerCondition
UpdateOn :: [UnqualifiedIdentifier] -> TriggerCondition
-- | The AST node corresponding to a trigger-time qualifier. Used by
-- CreateTrigger.
data TriggerTime
Before :: TriggerTime
After :: TriggerTime
InsteadOf :: TriggerTime
-- | The AST node corresponding to a column or value type. Used by
-- MaybeType which is used by ColumnDefinition, and by
-- ExpressionCast.
data Type
Type :: TypeAffinity -> MaybeTypeName -> MaybeTypeSize -> Type
-- | The AST node corresponding to the affinity of a column or value type.
-- Used by Type.
data TypeAffinity
TypeAffinityText :: TypeAffinity
TypeAffinityNumeric :: TypeAffinity
TypeAffinityInteger :: TypeAffinity
TypeAffinityReal :: TypeAffinity
TypeAffinityNone :: TypeAffinity
-- | The AST node corresponding to one of zero to two fields annotating a
-- column or value type with size limits. Used by MaybeTypeSize.
data TypeSizeField
DoubleSize :: MaybeSign -> NonnegativeDouble -> TypeSizeField
IntegerSize :: MaybeSign -> Word64 -> TypeSizeField
-- | The AST node corresponding to an update head. Used by Update
-- and UpdateLimited.
data UpdateHead
UpdateNoAlternative :: UpdateHead
UpdateOrRollback :: UpdateHead
UpdateOrAbort :: UpdateHead
UpdateOrReplace :: UpdateHead
UpdateOrFail :: UpdateHead
UpdateOrIgnore :: UpdateHead
-- | The AST node corresponding to a WHEN clause. Used by
-- CreateTrigger.
data WhenClause
When :: Expression -> WhenClause
-- | The AST node corresponding to a WHERE clause. Used by
-- SelectCore, Delete, DeleteLimited, Update,
-- and UpdateLimited.
data WhereClause
Where :: Expression -> WhereClause
-- | The AST node corresponding to an expression. Used by
-- DefaultValue, ColumnConstraint, TableConstraint,
-- OrderingTerm, InsertBody, MaybeHaving,
-- ResultColumn, JoinConstraint, WhereClause,
-- WhenClause, Update, and UpdateLimited. Also
-- useful at top level.
data Expression
-- | Represents a literal integer expression.
ExpressionLiteralInteger :: Word64 -> Expression
-- | Represents a literal floating-point expression.
ExpressionLiteralFloat :: NonnegativeDouble -> Expression
-- | Represents a literal string expression.
ExpressionLiteralString :: String -> Expression
-- | Represents a literal blob (binary large object) expression.
ExpressionLiteralBlob :: ByteString -> Expression
-- | Represents a literal NULL expression.
ExpressionLiteralNull :: Expression
-- | Represents a literal current_time expression.
ExpressionLiteralCurrentTime :: Expression
-- | Represents a literal current_date expression.
ExpressionLiteralCurrentDate :: Expression
-- | Represents a literal current_timestamp expression.
ExpressionLiteralCurrentTimestamp :: Expression
-- | Represents a positional-variable expression, written in SQL as
-- ?.
ExpressionVariable :: Expression
-- | Represents a numbered positional variable expression, written in SQL
-- as ?nnn.
ExpressionVariableN :: Word64 -> Expression
-- | Represents a named positional variable expression, written in SQL as
-- :aaaa.
ExpressionVariableNamed :: String -> Expression
-- | Represents a column-name expression, optionally qualified by a table
-- name and further by a database name.
ExpressionIdentifier :: DoublyQualifiedIdentifier -> Expression
-- | Represents a unary negation expression.
ExpressionUnaryNegative :: Expression -> Expression
-- | Represents a unary positive-sign expression. Yes, this is an nop.
ExpressionUnaryPositive :: Expression -> Expression
-- | Represents a unary bitwise negation expression.
ExpressionUnaryBitwiseNot :: Expression -> Expression
-- | Represents a unary logical negation expression.
ExpressionUnaryLogicalNot :: Expression -> Expression
-- | Represents a binary string-concatenation expression.
ExpressionBinaryConcatenate :: Expression -> Expression -> Expression
-- | Represents a binary multiplication expression.
ExpressionBinaryMultiply :: Expression -> Expression -> Expression
-- | Represents a binary division expression.
ExpressionBinaryDivide :: Expression -> Expression -> Expression
-- | Represents a binary modulus expression.
ExpressionBinaryModulus :: Expression -> Expression -> Expression
-- | Represents a binary addition expression.
ExpressionBinaryAdd :: Expression -> Expression -> Expression
-- | Represents a binary subtraction expression.
ExpressionBinarySubtract :: Expression -> Expression -> Expression
-- | Represents a binary left-shift expression.
ExpressionBinaryLeftShift :: Expression -> Expression -> Expression
-- | Represents a binary right-shift expression.
ExpressionBinaryRightShift :: Expression -> Expression -> Expression
-- | Represents a binary bitwise-and expression.
ExpressionBinaryBitwiseAnd :: Expression -> Expression -> Expression
-- | Represents a binary bitwise-or expression.
ExpressionBinaryBitwiseOr :: Expression -> Expression -> Expression
-- | Represents a binary less-than comparison expression.
ExpressionBinaryLess :: Expression -> Expression -> Expression
-- | Represents a binary less-than-or-equal-to comparison expression.
ExpressionBinaryLessEquals :: Expression -> Expression -> Expression
-- | Represents a binary greater-than comparison expression.
ExpressionBinaryGreater :: Expression -> Expression -> Expression
-- | Represents a binary greater-than-or-equal-to comparison expression.
ExpressionBinaryGreaterEquals :: Expression -> Expression -> Expression
-- | Represents a binary equal-to comparison expression, written in SQL as
-- =.
ExpressionBinaryEquals :: Expression -> Expression -> Expression
-- | Represents a binary equal-to comparison expression, written in SQL as
-- ==.
ExpressionBinaryEqualsEquals :: Expression -> Expression -> Expression
-- | Represents a binary not-equal-to comparison expression, written in SQL
-- as !=.
ExpressionBinaryNotEquals :: Expression -> Expression -> Expression
-- | Represents a binary not-equal-to comparison expression, written in SQL
-- as .
ExpressionBinaryLessGreater :: Expression -> Expression -> Expression
-- | Represents a binary logical-and expression.
ExpressionBinaryLogicalAnd :: Expression -> Expression -> Expression
-- | Represents a binary logical-or expression.
ExpressionBinaryLogicalOr :: Expression -> Expression -> Expression
-- | Represents a call to a built-in function.
ExpressionFunctionCall :: UnqualifiedIdentifier -> [Expression] -> Expression
-- | Represents a call to a built-in function, with the DISTINCT
-- qualifier.
ExpressionFunctionCallDistinct :: UnqualifiedIdentifier -> (OneOrMore Expression) -> Expression
-- | Represents a call to a built-in function, with * as
-- parameter.
ExpressionFunctionCallStar :: UnqualifiedIdentifier -> Expression
-- | Represents a type-cast expression.
ExpressionCast :: Expression -> Type -> Expression
-- | Represents a COLLATE expression.
ExpressionCollate :: Expression -> UnqualifiedIdentifier -> Expression
-- | Represents a textual comparison expression.
ExpressionLike :: Expression -> LikeType -> Expression -> Escape -> Expression
-- | Represents an ISNULL expression. Not to be confused with an
-- IS expression with a literal NULL as its right side;
-- the meaning is the same but the parsing is different.
ExpressionIsnull :: Expression -> Expression
-- | Represents a NOTNULL expression. Not to be confused with a
-- NOT NULL expression; the meaning is the same but the parsing
-- is different.
ExpressionNotnull :: Expression -> Expression
-- | Represents a NOT NULL expression. Not to be confused with a
-- NOTNULL expression; the meaning is the same but the parsing
-- is different.
ExpressionNotNull :: Expression -> Expression
-- | Represents an IS expression.
ExpressionIs :: Expression -> Expression -> Expression
-- | Represents an IS NOT expression.
ExpressionIsNot :: Expression -> Expression -> Expression
-- | Represents a BETWEEN expression.
ExpressionBetween :: Expression -> Expression -> Expression -> Expression
-- | Represents a NOT BETWEEN expression.
ExpressionNotBetween :: Expression -> Expression -> Expression -> Expression
-- | Represents an IN expression with the right-hand side being a
-- SELECT statement.
ExpressionInSelect :: Expression -> (Select) -> Expression
-- | Represents a NOT IN expression with the right-hand side being
-- a SELECT statement.
ExpressionNotInSelect :: Expression -> (Select) -> Expression
-- | Represents an IN expression with the right-hand side being a
-- list of subexpressions.
ExpressionInList :: Expression -> [Expression] -> Expression
-- | Represents a NOT IN expression with the right-hand side being
-- a list of subexpressions.
ExpressionNotInList :: Expression -> [Expression] -> Expression
-- | Represents an IN expression with the right-hand side being a
-- table name, optionally qualified by a database name.
ExpressionInTable :: Expression -> SinglyQualifiedIdentifier -> Expression
-- | Represents a NOT IN expression with the right-hand side being
-- a table name, optionally qualified by a database name.
ExpressionNotInTable :: Expression -> SinglyQualifiedIdentifier -> Expression
-- | Represents a subquery SELECT expression.
ExpressionSubquery :: (Select) -> Expression
-- | Represents a subquery SELECT expression with the
-- EXISTS qualifier.
ExpressionExistsSubquery :: (Select) -> Expression
-- | Represents a subquery SELECT expression with the NOT
-- EXISTS qualifier.
ExpressionNotExistsSubquery :: (Select) -> Expression
-- | Represents a CASE expression.
ExpressionCase :: MaybeSwitchExpression -> (OneOrMore CasePair) -> Else -> Expression
-- | Represents a RAISE(IGNORE) expression.
ExpressionRaiseIgnore :: Expression
-- | Represents a RAISE(ROLLBACK, string) expression.
ExpressionRaiseRollback :: String -> Expression
-- | Represents a RAISE(ABORT, string) expression.
ExpressionRaiseAbort :: String -> Expression
-- | Represents a RAISE(FAIL, string) expression.
ExpressionRaiseFail :: String -> Expression
-- | Represents a parenthesized subexpression.
ExpressionParenthesized :: Expression -> Expression
-- | The AST node corresponding to any statement. Used by
-- StatementList. Also useful at top level.
data AnyStatement
Statement :: (Statement l t v w) -> AnyStatement
fromAnyStatement :: StatementClass a => AnyStatement -> a
data ExplainableStatement
ExplainableStatement :: (Statement L0 t v w) -> ExplainableStatement
fromExplainableStatement :: StatementClass a => ExplainableStatement -> a
data TriggerStatement
TriggerStatement :: (Statement l T v w) -> TriggerStatement
fromTriggerStatement :: StatementClass a => TriggerStatement -> a
-- | The AST node which corresponds to a statement. Not directly useful at
-- top level because it is a generalized algebraic datatype the type
-- parameters to which are not exported; instead, see the existentially
-- qualified types AnyStatement, ExplainableStatement, and
-- TriggerStatement, and the type synonyms such as Select
-- which correspond to individual statement types.
--
-- I apologize for the lack of documentation on these individual entries,
-- but Haddock won't let me do it! At any rate, each of them is an AST
-- node corresponding to an individual statement type.
--
-- Note the distinctions between Delete and DeleteLimited
-- and Update and UpdateLimited: The Limited ones
-- have LIMIT clauses and the others do not. Because SQL imposes
-- stricter restrictions on where the ones with LIMIT clauses
-- can occur, these are are separate types.
data Statement level triggerable valueReturning which
Explain :: ExplainableStatement -> Statement L1 NT NS Explain'
ExplainQueryPlan :: ExplainableStatement -> Statement L1 NT NS ExplainQueryPlan'
AlterTable :: SinglyQualifiedIdentifier -> AlterTableBody -> Statement L0 NT NS AlterTable'
Analyze :: SinglyQualifiedIdentifier -> Statement L0 NT NS Analyze'
Attach :: MaybeDatabase -> String -> UnqualifiedIdentifier -> Statement L0 NT NS Attach'
Begin :: MaybeTransactionType -> MaybeTransaction -> Statement L0 NT NS Begin'
Commit :: CommitHead -> MaybeTransaction -> Statement L0 NT NS Commit'
CreateIndex :: MaybeUnique -> MaybeIfNotExists -> SinglyQualifiedIdentifier -> UnqualifiedIdentifier -> (OneOrMore IndexedColumn) -> Statement L0 NT NS CreateIndex'
CreateTable :: MaybeTemporary -> MaybeIfNotExists -> SinglyQualifiedIdentifier -> CreateTableBody -> Statement L0 NT NS CreateTable'
CreateTrigger :: MaybeTemporary -> MaybeIfNotExists -> SinglyQualifiedIdentifier -> TriggerTime -> TriggerCondition -> UnqualifiedIdentifier -> MaybeForEachRow -> (Maybe WhenClause) -> (OneOrMore TriggerStatement) -> Statement L0 NT NS CreateTrigger'
CreateView :: MaybeTemporary -> MaybeIfNotExists -> SinglyQualifiedIdentifier -> (Statement L0 T S Select') -> Statement L0 NT NS CreateView'
CreateVirtualTable :: SinglyQualifiedIdentifier -> UnqualifiedIdentifier -> [ModuleArgument] -> Statement L0 NT NS CreateVirtualTable'
Delete :: QualifiedTableName -> (Maybe WhereClause) -> Statement L0 T NS Delete'
DeleteLimited :: QualifiedTableName -> (Maybe WhereClause) -> (Maybe OrderClause) -> LimitClause -> Statement L0 NT NS DeleteLimited'
Detach :: MaybeDatabase -> UnqualifiedIdentifier -> Statement L0 NT NS Detach'
DropIndex :: MaybeIfExists -> SinglyQualifiedIdentifier -> Statement L0 NT NS DropIndex'
DropTable :: MaybeIfExists -> SinglyQualifiedIdentifier -> Statement L0 NT NS DropTable'
DropTrigger :: MaybeIfExists -> SinglyQualifiedIdentifier -> Statement L0 NT NS DropTrigger'
DropView :: MaybeIfExists -> SinglyQualifiedIdentifier -> Statement L0 NT NS DropView'
Insert :: InsertHead -> SinglyQualifiedIdentifier -> InsertBody -> Statement L0 T NS Insert'
Pragma :: SinglyQualifiedIdentifier -> PragmaBody -> Statement L0 NT NS Pragma'
Reindex :: SinglyQualifiedIdentifier -> Statement L0 NT NS Reindex'
Release :: MaybeReleaseSavepoint -> UnqualifiedIdentifier -> Statement L0 NT NS Release'
Rollback :: MaybeTransaction -> MaybeSavepoint -> Statement L0 NT NS Rollback'
Savepoint :: UnqualifiedIdentifier -> Statement L0 NT NS Savepoint'
Select :: SelectCore -> [(CompoundOperator, SelectCore)] -> (Maybe OrderClause) -> (Maybe LimitClause) -> Statement L0 T S Select'
Update :: UpdateHead -> QualifiedTableName -> (OneOrMore (UnqualifiedIdentifier, Expression)) -> (Maybe WhereClause) -> Statement L0 T NS Update'
UpdateLimited :: UpdateHead -> QualifiedTableName -> (OneOrMore (UnqualifiedIdentifier, Expression)) -> (Maybe WhereClause) -> (Maybe OrderClause) -> LimitClause -> Statement L0 NT NS UpdateLimited'
Vacuum :: Statement L0 NT NS Vacuum'
-- | A type synonym which matches only the AST node corresponding to an
-- ALTER TABLE statement. Useful at top level.
type AlterTable = Statement L0 NT NS AlterTable'
-- | A type synonym which matches only the AST node corresponding to an
-- ANALYZE statement. Useful at top level.
type Analyze = Statement L0 NT NS Analyze'
-- | A type synonym which matches only the AST node corresponding to an
-- ATTACH statement. Useful at top level.
type Attach = Statement L0 NT NS Attach'
-- | A type synonym which matches only the AST node corresponding to a
-- BEGIN statement. Useful at top level.
type Begin = Statement L0 NT NS Begin'
-- | A type synonym which matches only the AST node corresponding to a
-- COMMIT statement. Useful at top level.
type Commit = Statement L0 NT NS Commit'
-- | A type synonym which matches only the AST node corresponding to a
-- CREATE INDEX statement. Useful at top level.
type CreateIndex = Statement L0 NT NS CreateIndex'
-- | A type synonym which matches only the AST node corresponding to a
-- CREATE TABLE statement. Useful at top level.
type CreateTable = Statement L0 NT NS CreateTable'
-- | A type synonym which matches only the AST node corresponding to a
-- CREATE TRIGGER statement. Useful at top level.
type CreateTrigger = Statement L0 NT NS CreateTrigger'
-- | A type synonym which matches only the AST node corresponding to a
-- CREATE VIEW statement. Useful at top level.
type CreateView = Statement L0 NT NS CreateView'
-- | A type synonym which matches only the AST node corresponding to a
-- CREATE VIRTUAL TABLE statement. Useful at top level.
type CreateVirtualTable = Statement L0 NT NS CreateVirtualTable'
-- | A type synonym which matches only the AST node corresponding to a
-- DELETE statement without a LIMIT clause. Useful at
-- top level.
type Delete = Statement L0 T NS Delete'
-- | A type synonym which matches only the AST node corresponding to a
-- DELETE statement with a LIMIT clause. Useful at top
-- level.
type DeleteLimited = Statement L0 NT NS DeleteLimited'
-- | A type synonym which matches only the AST node corresponding to a
-- DETACH statement. Useful at top level.
type Detach = Statement L0 NT NS Detach'
-- | A type synonym which matches only the AST node corresponding to a
-- DROP INDEX statement. Useful at top level.
type DropIndex = Statement L0 NT NS DropIndex'
-- | A type synonym which matches only the AST node corresponding to a
-- DROP TABLE statement. Useful at top level.
type DropTable = Statement L0 NT NS DropTable'
-- | A type synonym which matches only the AST node corresponding to a
-- DROP TRIGGER statement. Useful at top level.
type DropTrigger = Statement L0 NT NS DropTrigger'
-- | A type synonym which matches only the AST node corresponding to a
-- DROP VIEW statement. Useful at top level.
type DropView = Statement L0 NT NS DropView'
-- | A type synonym which matches only the AST node corresponding to an
-- EXPLAIN statement. Useful at top level.
type Explain = Statement L1 NT NS Explain'
-- | A type synonym which matches only the AST node corresponding to an
-- EXPLAIN QUERY PLAN statement. Useful at top level.
type ExplainQueryPlan = Statement L1 NT NS ExplainQueryPlan'
-- | A type synonym which matches only the AST node corresponding to an
-- INSERT statement. Useful at top level.
type Insert = Statement L0 T NS Insert'
-- | A type synonym which matches only the AST node corresponding to a
-- PRAGMA statement. Useful at top level.
type Pragma = Statement L0 NT NS Pragma'
-- | A type synonym which matches only the AST node corresponding to a
-- REINDEX statement. Useful at top level.
type Reindex = Statement L0 NT NS Reindex'
-- | A type synonym which matches only the AST node corresponding to a
-- RELEASE statement. Useful at top level.
type Release = Statement L0 NT NS Release'
-- | A type synonym which matches only the AST node corresponding to a
-- ROLLBACK statement. Useful at top level.
type Rollback = Statement L0 NT NS Rollback'
-- | A type synonym which matches only the AST node corresponding to a
-- SAVEPOINT statement. Useful at top level.
type Savepoint = Statement L0 NT NS Savepoint'
-- | A type synonym which matches only the AST node corresponding to a
-- SELECT statement. Useful at top level.
type Select = Statement L0 T S Select'
-- | A type synonym which matches only the AST node corresponding to an
-- UPDATE statement without a LIMIT clause. Useful at
-- top level.
type Update = Statement L0 T NS Update'
-- | A type synonym which matches only the AST node corresponding to an
-- UPDATE statement with a LIMIT clause. Useful at top
-- level.
type UpdateLimited = Statement L0 NT NS UpdateLimited'
-- | A type synonym which matches only the AST node corresponding to a
-- VACUUM statement. Useful at top level.
type Vacuum = Statement L0 NT NS Vacuum'