packages feed

hydra-ext-0.17.4: src/main/haskell/Hydra/Sql/Syntax.hs

-- Note: this is an automatically generated file. Do not edit.

-- | A subset of ANSI SQL:2003, capturing selected productions of the BNF grammar provided at https://ronsavage.github.io/SQL/sql-2003-2.bnf.html, which is based on the Final Committee Draft (FCD) of ISO/IEC 9075-2:2003

module Hydra.Sql.Syntax where

import qualified Hydra.Core as Core
import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, map, pure, sum)
import qualified Data.Scientific as Sci

-- | An approximate (floating-point) numeric literal, such as 1.5E10
newtype ApproximateNumericLiteral =
  ApproximateNumericLiteral {
    unApproximateNumericLiteral :: String}
  deriving (Eq, Ord, Read, Show)

_ApproximateNumericLiteral = Core.Name "hydra.sql.syntax.ApproximateNumericLiteral"

-- | An approximate numeric type: FLOAT, REAL, or DOUBLE PRECISION
data ApproximateNumericType =
  ApproximateNumericTypeFloat (Maybe Precision) |
  ApproximateNumericTypeReal |
  ApproximateNumericTypeDouble
  deriving (Eq, Ord, Read, Show)

_ApproximateNumericType = Core.Name "hydra.sql.syntax.ApproximateNumericType"

_ApproximateNumericType_float = Core.Name "float"

_ApproximateNumericType_real = Core.Name "real"

_ApproximateNumericType_double = Core.Name "double"

-- | A single element of an array value
newtype ArrayElement =
  ArrayElement {
    unArrayElement :: ValueExpression}
  deriving (Eq, Ord, Read, Show)

_ArrayElement = Core.Name "hydra.sql.syntax.ArrayElement"

-- | A non-empty, comma-separated list of array elements
data ArrayElementList =
  ArrayElementList {
    arrayElementListFirst :: ArrayElement,
    arrayElementListRest :: [ArrayElement]}
  deriving (Eq, Ord, Read, Show)

_ArrayElementList = Core.Name "hydra.sql.syntax.ArrayElementList"

_ArrayElementList_first = Core.Name "first"

_ArrayElementList_rest = Core.Name "rest"

-- | A reference to an element of an array by index
newtype ArrayElementReference =
  ArrayElementReference {
    unArrayElementReference :: ()}
  deriving (Eq, Ord, Read, Show)

_ArrayElementReference = Core.Name "hydra.sql.syntax.ArrayElementReference"

-- | An ARRAY collection type
newtype ArrayType =
  ArrayType {
    unArrayType :: ()}
  deriving (Eq, Ord, Read, Show)

_ArrayType = Core.Name "hydra.sql.syntax.ArrayType"

-- | A constructor for an array value, either by enumeration or by query
data ArrayValueConstructor =
  ArrayValueConstructorEnumeration ArrayValueConstructorByEnumeration |
  ArrayValueConstructorQuery ArrayValueConstructorByQuery
  deriving (Eq, Ord, Read, Show)

_ArrayValueConstructor = Core.Name "hydra.sql.syntax.ArrayValueConstructor"

_ArrayValueConstructor_enumeration = Core.Name "enumeration"

_ArrayValueConstructor_query = Core.Name "query"

-- | An array value constructed by explicitly enumerating its elements
data ArrayValueConstructorByEnumeration =
  ArrayValueConstructorByEnumeration {
    arrayValueConstructorByEnumerationLeftBracketOrTrigraph :: LeftBracketOrTrigraph,
    arrayValueConstructorByEnumerationArrayElementList :: ArrayElementList,
    arrayValueConstructorByEnumerationRightBracketOrTrigraph :: RightBracketOrTrigraph}
  deriving (Eq, Ord, Read, Show)

_ArrayValueConstructorByEnumeration = Core.Name "hydra.sql.syntax.ArrayValueConstructorByEnumeration"

_ArrayValueConstructorByEnumeration_LeftBracketOrTrigraph = Core.Name "LeftBracketOrTrigraph"

_ArrayValueConstructorByEnumeration_ArrayElementList = Core.Name "ArrayElementList"

_ArrayValueConstructorByEnumeration_RightBracketOrTrigraph = Core.Name "RightBracketOrTrigraph"

-- | An array value constructed from the result of a query
newtype ArrayValueConstructorByQuery =
  ArrayValueConstructorByQuery {
    unArrayValueConstructorByQuery :: ()}
  deriving (Eq, Ord, Read, Show)

_ArrayValueConstructorByQuery = Core.Name "hydra.sql.syntax.ArrayValueConstructorByQuery"

-- | An expression that evaluates to an array value
newtype ArrayValueExpression =
  ArrayValueExpression {
    unArrayValueExpression :: ()}
  deriving (Eq, Ord, Read, Show)

_ArrayValueExpression = Core.Name "hydra.sql.syntax.ArrayValueExpression"

-- | A clause introducing a table's contents as the result of a subquery
newtype AsSubqueryClause =
  AsSubqueryClause {
    unAsSubqueryClause :: ()}
  deriving (Eq, Ord, Read, Show)

_AsSubqueryClause = Core.Name "hydra.sql.syntax.AsSubqueryClause"

-- | A reference to an attribute or method of a structured value
newtype AttributeOrMethodReference =
  AttributeOrMethodReference {
    unAttributeOrMethodReference :: ()}
  deriving (Eq, Ord, Read, Show)

_AttributeOrMethodReference = Core.Name "hydra.sql.syntax.AttributeOrMethodReference"

-- | A binary large object string type: BINARY LARGE OBJECT or BLOB
data BinaryLargeObjectStringType =
  BinaryLargeObjectStringTypeBinary (Maybe LargeObjectLength) |
  BinaryLargeObjectStringTypeBlob (Maybe LargeObjectLength)
  deriving (Eq, Ord, Read, Show)

_BinaryLargeObjectStringType = Core.Name "hydra.sql.syntax.BinaryLargeObjectStringType"

_BinaryLargeObjectStringType_binary = Core.Name "binary"

_BinaryLargeObjectStringType_blob = Core.Name "blob"

-- | A binary string literal, e.g. X'FF00'
newtype BinaryStringLiteral =
  BinaryStringLiteral {
    unBinaryStringLiteral :: ()}
  deriving (Eq, Ord, Read, Show)

_BinaryStringLiteral = Core.Name "hydra.sql.syntax.BinaryStringLiteral"

-- | A boolean test, optionally negated with NOT
data BooleanFactor =
  BooleanFactor {
    booleanFactorNOT :: (Maybe ()),
    booleanFactorBooleanTest :: BooleanTest}
  deriving (Eq, Ord, Read, Show)

_BooleanFactor = Core.Name "hydra.sql.syntax.BooleanFactor"

_BooleanFactor_NOT = Core.Name "NOT"

_BooleanFactor_BooleanTest = Core.Name "BooleanTest"

-- | A boolean literal: TRUE, FALSE, or UNKNOWN
data BooleanLiteral =
  BooleanLiteralTRUE |
  BooleanLiteralFALSE |
  BooleanLiteralUNKNOWN
  deriving (Eq, Ord, Read, Show)

_BooleanLiteral = Core.Name "hydra.sql.syntax.BooleanLiteral"

_BooleanLiteral_TRUE = Core.Name "TRUE"

_BooleanLiteral_FALSE = Core.Name "FALSE"

_BooleanLiteral_UNKNOWN = Core.Name "UNKNOWN"

-- | An operand of a boolean predicate
newtype BooleanPredicand =
  BooleanPredicand {
    unBooleanPredicand :: ()}
  deriving (Eq, Ord, Read, Show)

_BooleanPredicand = Core.Name "hydra.sql.syntax.BooleanPredicand"

-- | A boolean primary expression: either a predicate or a boolean predicand
data BooleanPrimary =
  BooleanPrimaryPredicate Predicate |
  BooleanPrimaryPredicand BooleanPredicand
  deriving (Eq, Ord, Read, Show)

_BooleanPrimary = Core.Name "hydra.sql.syntax.BooleanPrimary"

_BooleanPrimary_predicate = Core.Name "predicate"

_BooleanPrimary_predicand = Core.Name "predicand"

-- | A boolean term: a factor, or a conjunction of terms with AND
data BooleanTerm =
  BooleanTermFactor BooleanFactor |
  BooleanTermConjunction BooleanTermAnd
  deriving (Eq, Ord, Read, Show)

_BooleanTerm = Core.Name "hydra.sql.syntax.BooleanTerm"

_BooleanTerm_factor = Core.Name "factor"

_BooleanTerm_conjunction = Core.Name "conjunction"

-- | A conjunction of two boolean terms joined by AND
data BooleanTermAnd =
  BooleanTermAnd {
    booleanTermAndLhs :: BooleanTerm,
    booleanTermAndRhs :: BooleanFactor}
  deriving (Eq, Ord, Read, Show)

_BooleanTermAnd = Core.Name "hydra.sql.syntax.BooleanTermAnd"

_BooleanTermAnd_lhs = Core.Name "lhs"

_BooleanTermAnd_rhs = Core.Name "rhs"

-- | A boolean primary, optionally compared against a truth value with IS
data BooleanTest =
  BooleanTest {
    booleanTestBooleanPrimary :: BooleanPrimary,
    booleanTestSequence :: (Maybe BooleanTestSequenceOption)}
  deriving (Eq, Ord, Read, Show)

_BooleanTest = Core.Name "hydra.sql.syntax.BooleanTest"

_BooleanTest_BooleanPrimary = Core.Name "BooleanPrimary"

_BooleanTest_Sequence = Core.Name "Sequence"

-- | The IS [NOT] truth-value suffix of a boolean test
data BooleanTestSequenceOption =
  BooleanTestSequenceOption {
    booleanTestSequenceOptionNOT :: (Maybe ()),
    booleanTestSequenceOptionTruthValue :: TruthValue}
  deriving (Eq, Ord, Read, Show)

_BooleanTestSequenceOption = Core.Name "hydra.sql.syntax.BooleanTestSequenceOption"

_BooleanTestSequenceOption_NOT = Core.Name "NOT"

_BooleanTestSequenceOption_TruthValue = Core.Name "TruthValue"

-- | The BOOLEAN data type
newtype BooleanType =
  BooleanType {
    unBooleanType :: ()}
  deriving (Eq, Ord, Read, Show)

_BooleanType = Core.Name "hydra.sql.syntax.BooleanType"

-- | A boolean value expression: a term, or a disjunction of terms with OR
data BooleanValueExpression =
  BooleanValueExpressionTerm BooleanTerm |
  BooleanValueExpressionDisjunction BooleanValueExpressionOr
  deriving (Eq, Ord, Read, Show)

_BooleanValueExpression = Core.Name "hydra.sql.syntax.BooleanValueExpression"

_BooleanValueExpression_term = Core.Name "term"

_BooleanValueExpression_disjunction = Core.Name "disjunction"

-- | A disjunction of two boolean value expressions joined by OR
data BooleanValueExpressionOr =
  BooleanValueExpressionOr {
    booleanValueExpressionOrLhs :: BooleanValueExpression,
    booleanValueExpressionOrRhs :: BooleanTerm}
  deriving (Eq, Ord, Read, Show)

_BooleanValueExpressionOr = Core.Name "hydra.sql.syntax.BooleanValueExpressionOr"

_BooleanValueExpressionOr_lhs = Core.Name "lhs"

_BooleanValueExpressionOr_rhs = Core.Name "rhs"

-- | A CASE expression, selecting a result from among several alternatives
newtype CaseExpression =
  CaseExpression {
    unCaseExpression :: ()}
  deriving (Eq, Ord, Read, Show)

_CaseExpression = Core.Name "hydra.sql.syntax.CaseExpression"

-- | A CAST expression, converting a value to a specified data type
newtype CastSpecification =
  CastSpecification {
    unCastSpecification :: ()}
  deriving (Eq, Ord, Read, Show)

_CastSpecification = Core.Name "hydra.sql.syntax.CastSpecification"

-- | The name of a character set
newtype CharacterSetSpecification =
  CharacterSetSpecification {
    unCharacterSetSpecification :: ()}
  deriving (Eq, Ord, Read, Show)

_CharacterSetSpecification = Core.Name "hydra.sql.syntax.CharacterSetSpecification"

-- | A character string literal, e.g. 'hello'
newtype CharacterStringLiteral =
  CharacterStringLiteral {
    unCharacterStringLiteral :: String}
  deriving (Eq, Ord, Read, Show)

_CharacterStringLiteral = Core.Name "hydra.sql.syntax.CharacterStringLiteral"

-- | A character string type: CHARACTER, VARCHAR, or CHARACTER LARGE OBJECT
data CharacterStringType =
  CharacterStringTypeCharacter (Maybe Length) |
  CharacterStringTypeChar (Maybe Length) |
  CharacterStringTypeCharacterVarying Length |
  CharacterStringTypeCharVarying Length |
  CharacterStringTypeVarchar Length |
  CharacterStringTypeCharacterLargeObject (Maybe LargeObjectLength) |
  CharacterStringTypeCharLargeObject (Maybe LargeObjectLength) |
  CharacterStringTypeClob (Maybe LargeObjectLength)
  deriving (Eq, Ord, Read, Show)

_CharacterStringType = Core.Name "hydra.sql.syntax.CharacterStringType"

_CharacterStringType_character = Core.Name "character"

_CharacterStringType_char = Core.Name "char"

_CharacterStringType_characterVarying = Core.Name "characterVarying"

_CharacterStringType_charVarying = Core.Name "charVarying"

_CharacterStringType_varchar = Core.Name "varchar"

_CharacterStringType_characterLargeObject = Core.Name "characterLargeObject"

_CharacterStringType_charLargeObject = Core.Name "charLargeObject"

_CharacterStringType_clob = Core.Name "clob"

-- | A COLLATE clause specifying the collation to apply to a character value
newtype CollateClause =
  CollateClause {
    unCollateClause :: ()}
  deriving (Eq, Ord, Read, Show)

_CollateClause = Core.Name "hydra.sql.syntax.CollateClause"

-- | A collection type: ARRAY or MULTISET
data CollectionType =
  CollectionTypeArray ArrayType |
  CollectionTypeMultiset MultisetType
  deriving (Eq, Ord, Read, Show)

_CollectionType = Core.Name "hydra.sql.syntax.CollectionType"

_CollectionType_array = Core.Name "array"

_CollectionType_multiset = Core.Name "multiset"

-- | A constructor for a collection value: an array or multiset constructor
data CollectionValueConstructor =
  CollectionValueConstructorArray ArrayValueConstructor |
  CollectionValueConstructorMultiset MultisetValueConstructor
  deriving (Eq, Ord, Read, Show)

_CollectionValueConstructor = Core.Name "hydra.sql.syntax.CollectionValueConstructor"

_CollectionValueConstructor_array = Core.Name "array"

_CollectionValueConstructor_multiset = Core.Name "multiset"

-- | An expression that evaluates to a collection value
data CollectionValueExpression =
  CollectionValueExpressionArray ArrayValueExpression |
  CollectionValueExpressionMultiset MultisetValueExpression
  deriving (Eq, Ord, Read, Show)

_CollectionValueExpression = Core.Name "hydra.sql.syntax.CollectionValueExpression"

_CollectionValueExpression_array = Core.Name "array"

_CollectionValueExpression_multiset = Core.Name "multiset"

-- | A constraint attached to a single column definition
newtype ColumnConstraintDefinition =
  ColumnConstraintDefinition {
    unColumnConstraintDefinition :: ()}
  deriving (Eq, Ord, Read, Show)

_ColumnConstraintDefinition = Core.Name "hydra.sql.syntax.ColumnConstraintDefinition"

-- | The definition of a single column within a table definition
data ColumnDefinition =
  ColumnDefinition {
    columnDefinitionName :: ColumnName,
    columnDefinitionTypeOrDomain :: (Maybe ColumnDefinitionTypeOrDomainOption),
    columnDefinitionRefScope :: (Maybe ReferenceScopeCheck),
    columnDefinitionDefaultOrIdentityOrGeneration :: (Maybe ColumnDefinitionDefaultOrIdentityOrGenerationOption),
    columnDefinitionConstraints :: [ColumnConstraintDefinition],
    columnDefinitionCollate :: (Maybe CollateClause)}
  deriving (Eq, Ord, Read, Show)

_ColumnDefinition = Core.Name "hydra.sql.syntax.ColumnDefinition"

_ColumnDefinition_name = Core.Name "name"

_ColumnDefinition_typeOrDomain = Core.Name "typeOrDomain"

_ColumnDefinition_refScope = Core.Name "refScope"

_ColumnDefinition_defaultOrIdentityOrGeneration = Core.Name "defaultOrIdentityOrGeneration"

_ColumnDefinition_constraints = Core.Name "constraints"

_ColumnDefinition_collate = Core.Name "collate"

-- | A column's default value, identity, or generation specification
data ColumnDefinitionDefaultOrIdentityOrGenerationOption =
  ColumnDefinitionDefaultOrIdentityOrGenerationOptionDefaultClause DefaultClause |
  ColumnDefinitionDefaultOrIdentityOrGenerationOptionIdentityColumnSpecification IdentityColumnSpecification |
  ColumnDefinitionDefaultOrIdentityOrGenerationOptionGenerationClause GenerationClause
  deriving (Eq, Ord, Read, Show)

_ColumnDefinitionDefaultOrIdentityOrGenerationOption =
    Core.Name "hydra.sql.syntax.ColumnDefinitionDefaultOrIdentityOrGenerationOption"

_ColumnDefinitionDefaultOrIdentityOrGenerationOption_DefaultClause = Core.Name "DefaultClause"

_ColumnDefinitionDefaultOrIdentityOrGenerationOption_IdentityColumnSpecification =
    Core.Name "IdentityColumnSpecification"

_ColumnDefinitionDefaultOrIdentityOrGenerationOption_GenerationClause = Core.Name "GenerationClause"

-- | A column's declared data type or domain
data ColumnDefinitionTypeOrDomainOption =
  ColumnDefinitionTypeOrDomainOptionDataType DataType |
  ColumnDefinitionTypeOrDomainOptionDomainName DomainName
  deriving (Eq, Ord, Read, Show)

_ColumnDefinitionTypeOrDomainOption = Core.Name "hydra.sql.syntax.ColumnDefinitionTypeOrDomainOption"

_ColumnDefinitionTypeOrDomainOption_DataType = Core.Name "DataType"

_ColumnDefinitionTypeOrDomainOption_DomainName = Core.Name "DomainName"

-- | The name of a table column
newtype ColumnName =
  ColumnName {
    unColumnName :: String}
  deriving (Eq, Ord, Read, Show)

_ColumnName = Core.Name "hydra.sql.syntax.ColumnName"

-- | A non-empty, comma-separated list of column names
data ColumnNameList =
  ColumnNameList {
    columnNameListFirst :: ColumnName,
    columnNameListRest :: [ColumnName]}
  deriving (Eq, Ord, Read, Show)

_ColumnNameList = Core.Name "hydra.sql.syntax.ColumnNameList"

_ColumnNameList_first = Core.Name "first"

_ColumnNameList_rest = Core.Name "rest"

-- | The WITH OPTIONS clause of a column definition inherited via LIKE
newtype ColumnOptions =
  ColumnOptions {
    unColumnOptions :: ()}
  deriving (Eq, Ord, Read, Show)

_ColumnOptions = Core.Name "hydra.sql.syntax.ColumnOptions"

-- | A reference to a column, optionally qualified by a table or correlation name
newtype ColumnReference =
  ColumnReference {
    unColumnReference :: ()}
  deriving (Eq, Ord, Read, Show)

_ColumnReference = Core.Name "hydra.sql.syntax.ColumnReference"

-- | A value expression common to numeric, string, datetime, interval, user-defined, reference, and collection types
data CommonValueExpression =
  CommonValueExpressionNumeric NumericValueExpression |
  CommonValueExpressionString StringValueExpression |
  CommonValueExpressionDatetime DatetimeValueExpression |
  CommonValueExpressionInterval IntervalValueExpression |
  CommonValueExpressionUserDefined UserDefinedTypeValueExpression |
  CommonValueExpressionReference ReferenceValueExpression |
  CommonValueExpressionCollection CollectionValueExpression
  deriving (Eq, Ord, Read, Show)

_CommonValueExpression = Core.Name "hydra.sql.syntax.CommonValueExpression"

_CommonValueExpression_numeric = Core.Name "numeric"

_CommonValueExpression_string = Core.Name "string"

_CommonValueExpression_datetime = Core.Name "datetime"

_CommonValueExpression_interval = Core.Name "interval"

_CommonValueExpression_userDefined = Core.Name "userDefined"

_CommonValueExpression_reference = Core.Name "reference"

_CommonValueExpression_collection = Core.Name "collection"

-- | A row value constructor whose element types are inferred from context
newtype ContextuallyTypedRowValueConstructor =
  ContextuallyTypedRowValueConstructor {
    unContextuallyTypedRowValueConstructor :: ()}
  deriving (Eq, Ord, Read, Show)

_ContextuallyTypedRowValueConstructor = Core.Name "hydra.sql.syntax.ContextuallyTypedRowValueConstructor"

-- | A contextually typed row value expression: a special case or a constructor
data ContextuallyTypedRowValueExpression =
  ContextuallyTypedRowValueExpressionSpecialCase RowValueSpecialCase |
  ContextuallyTypedRowValueExpressionConstructor ContextuallyTypedRowValueConstructor
  deriving (Eq, Ord, Read, Show)

_ContextuallyTypedRowValueExpression = Core.Name "hydra.sql.syntax.ContextuallyTypedRowValueExpression"

_ContextuallyTypedRowValueExpression_specialCase = Core.Name "specialCase"

_ContextuallyTypedRowValueExpression_constructor = Core.Name "constructor"

-- | A non-empty, comma-separated list of contextually typed row value expressions
data ContextuallyTypedRowValueExpressionList =
  ContextuallyTypedRowValueExpressionList {
    contextuallyTypedRowValueExpressionListFirst :: ContextuallyTypedRowValueExpression,
    contextuallyTypedRowValueExpressionListRest :: [ContextuallyTypedRowValueExpression]}
  deriving (Eq, Ord, Read, Show)

_ContextuallyTypedRowValueExpressionList = Core.Name "hydra.sql.syntax.ContextuallyTypedRowValueExpressionList"

_ContextuallyTypedRowValueExpressionList_first = Core.Name "first"

_ContextuallyTypedRowValueExpressionList_rest = Core.Name "rest"

-- | A table value constructor built from a list of contextually typed row values
newtype ContextuallyTypedTableValueConstructor =
  ContextuallyTypedTableValueConstructor {
    unContextuallyTypedTableValueConstructor :: ContextuallyTypedRowValueExpressionList}
  deriving (Eq, Ord, Read, Show)

_ContextuallyTypedTableValueConstructor = Core.Name "hydra.sql.syntax.ContextuallyTypedTableValueConstructor"

-- | A data type: predefined, row, named, reference, or collection
data DataType =
  DataTypePredefined PredefinedType |
  DataTypeRow RowType |
  DataTypeNamed PathResolvedUserDefinedTypeName |
  DataTypeReference ReferenceType |
  DataTypeCollection CollectionType
  deriving (Eq, Ord, Read, Show)

_DataType = Core.Name "hydra.sql.syntax.DataType"

_DataType_predefined = Core.Name "predefined"

_DataType_row = Core.Name "row"

_DataType_named = Core.Name "named"

_DataType_reference = Core.Name "reference"

_DataType_collection = Core.Name "collection"

-- | A DATE literal
newtype DateLiteral =
  DateLiteral {
    unDateLiteral :: DateString}
  deriving (Eq, Ord, Read, Show)

_DateLiteral = Core.Name "hydra.sql.syntax.DateLiteral"

-- | The string representation of a date literal, e.g. '2003-01-01'
newtype DateString =
  DateString {
    unDateString :: ()}
  deriving (Eq, Ord, Read, Show)

_DateString = Core.Name "hydra.sql.syntax.DateString"

-- | A datetime literal: a date, time, or timestamp literal
data DatetimeLiteral =
  DatetimeLiteralDate DateLiteral |
  DatetimeLiteralTime TimeLiteral |
  DatetimeLiteralTimestamp TimestampLiteral
  deriving (Eq, Ord, Read, Show)

_DatetimeLiteral = Core.Name "hydra.sql.syntax.DatetimeLiteral"

_DatetimeLiteral_date = Core.Name "date"

_DatetimeLiteral_time = Core.Name "time"

_DatetimeLiteral_timestamp = Core.Name "timestamp"

-- | A datetime type: DATE, TIME, or TIMESTAMP
newtype DatetimeType =
  DatetimeType {
    unDatetimeType :: ()}
  deriving (Eq, Ord, Read, Show)

_DatetimeType = Core.Name "hydra.sql.syntax.DatetimeType"

-- | An expression that evaluates to a datetime value
newtype DatetimeValueExpression =
  DatetimeValueExpression {
    unDatetimeValueExpression :: ()}
  deriving (Eq, Ord, Read, Show)

_DatetimeValueExpression = Core.Name "hydra.sql.syntax.DatetimeValueExpression"

-- | A DEFAULT clause specifying a column's default value
newtype DefaultClause =
  DefaultClause {
    unDefaultClause :: ()}
  deriving (Eq, Ord, Read, Show)

_DefaultClause = Core.Name "hydra.sql.syntax.DefaultClause"

-- | The name of a user-defined domain
newtype DomainName =
  DomainName {
    unDomainName :: String}
  deriving (Eq, Ord, Read, Show)

_DomainName = Core.Name "hydra.sql.syntax.DomainName"

-- | An exact numeric literal, such as an integer or fixed-point decimal
newtype ExactNumericLiteral =
  ExactNumericLiteral {
    unExactNumericLiteral :: String}
  deriving (Eq, Ord, Read, Show)

_ExactNumericLiteral = Core.Name "hydra.sql.syntax.ExactNumericLiteral"

-- | An exact numeric type: NUMERIC, DECIMAL, DEC, SMALLINT, INTEGER, INT, or BIGINT
data ExactNumericType =
  ExactNumericTypeNumeric (Maybe ExactNumericTypeNumericOption) |
  ExactNumericTypeDecimal (Maybe ExactNumericTypeDecimalOption) |
  ExactNumericTypeDec (Maybe ExactNumericTypeDecOption) |
  ExactNumericTypeSmallint |
  ExactNumericTypeInteger |
  ExactNumericTypeInt |
  ExactNumericTypeBigint
  deriving (Eq, Ord, Read, Show)

_ExactNumericType = Core.Name "hydra.sql.syntax.ExactNumericType"

_ExactNumericType_numeric = Core.Name "numeric"

_ExactNumericType_decimal = Core.Name "decimal"

_ExactNumericType_dec = Core.Name "dec"

_ExactNumericType_smallint = Core.Name "smallint"

_ExactNumericType_integer = Core.Name "integer"

_ExactNumericType_int = Core.Name "int"

_ExactNumericType_bigint = Core.Name "bigint"

-- | The precision and optional scale of a DEC type
data ExactNumericTypeDecOption =
  ExactNumericTypeDecOption {
    exactNumericTypeDecOptionPrecision :: Precision,
    exactNumericTypeDecOptionSequence :: (Maybe Scale)}
  deriving (Eq, Ord, Read, Show)

_ExactNumericTypeDecOption = Core.Name "hydra.sql.syntax.ExactNumericTypeDecOption"

_ExactNumericTypeDecOption_Precision = Core.Name "Precision"

_ExactNumericTypeDecOption_Sequence = Core.Name "Sequence"

-- | The precision and optional scale of a DECIMAL type
data ExactNumericTypeDecimalOption =
  ExactNumericTypeDecimalOption {
    exactNumericTypeDecimalOptionPrecision :: Precision,
    exactNumericTypeDecimalOptionSequence :: (Maybe Scale)}
  deriving (Eq, Ord, Read, Show)

_ExactNumericTypeDecimalOption = Core.Name "hydra.sql.syntax.ExactNumericTypeDecimalOption"

_ExactNumericTypeDecimalOption_Precision = Core.Name "Precision"

_ExactNumericTypeDecimalOption_Sequence = Core.Name "Sequence"

-- | The precision and optional scale of a NUMERIC type
data ExactNumericTypeNumericOption =
  ExactNumericTypeNumericOption {
    exactNumericTypeNumericOptionPrecision :: Precision,
    exactNumericTypeNumericOptionSequence :: (Maybe Scale)}
  deriving (Eq, Ord, Read, Show)

_ExactNumericTypeNumericOption = Core.Name "hydra.sql.syntax.ExactNumericTypeNumericOption"

_ExactNumericTypeNumericOption_Precision = Core.Name "Precision"

_ExactNumericTypeNumericOption_Sequence = Core.Name "Sequence"

-- | A reference to a field of a row or structured value
newtype FieldReference =
  FieldReference {
    unFieldReference :: ()}
  deriving (Eq, Ord, Read, Show)

_FieldReference = Core.Name "hydra.sql.syntax.FieldReference"

-- | An INSERT source specified by an explicit value constructor, with optional column list and override clause
data FromConstructor =
  FromConstructor {
    fromConstructorColumns :: (Maybe InsertColumnList),
    fromConstructorOverride :: (Maybe OverrideClause),
    fromConstructorValues :: ContextuallyTypedTableValueConstructor}
  deriving (Eq, Ord, Read, Show)

_FromConstructor = Core.Name "hydra.sql.syntax.FromConstructor"

_FromConstructor_columns = Core.Name "columns"

_FromConstructor_override = Core.Name "override"

_FromConstructor_values = Core.Name "values"

-- | An INSERT source specified as DEFAULT VALUES
newtype FromDefault =
  FromDefault {
    unFromDefault :: ()}
  deriving (Eq, Ord, Read, Show)

_FromDefault = Core.Name "hydra.sql.syntax.FromDefault"

-- | An INSERT source specified as the result of a subquery
newtype FromSubquery =
  FromSubquery {
    unFromSubquery :: ()}
  deriving (Eq, Ord, Read, Show)

_FromSubquery = Core.Name "hydra.sql.syntax.FromSubquery"

-- | A general literal: a string, datetime, interval, or boolean literal
data GeneralLiteral =
  GeneralLiteralString CharacterStringLiteral |
  GeneralLiteralNationalString NationalCharacterStringLiteral |
  GeneralLiteralUnicode UnicodeCharacterStringLiteral |
  GeneralLiteralBinary BinaryStringLiteral |
  GeneralLiteralDateTime DatetimeLiteral |
  GeneralLiteralInterval IntervalLiteral |
  GeneralLiteralBoolean BooleanLiteral
  deriving (Eq, Ord, Read, Show)

_GeneralLiteral = Core.Name "hydra.sql.syntax.GeneralLiteral"

_GeneralLiteral_string = Core.Name "string"

_GeneralLiteral_nationalString = Core.Name "nationalString"

_GeneralLiteral_unicode = Core.Name "unicode"

_GeneralLiteral_binary = Core.Name "binary"

_GeneralLiteral_dateTime = Core.Name "dateTime"

_GeneralLiteral_interval = Core.Name "interval"

_GeneralLiteral_boolean = Core.Name "boolean"

-- | A general value specification, such as a parameter or dynamic value
newtype GeneralValueSpecification =
  GeneralValueSpecification {
    unGeneralValueSpecification :: ()}
  deriving (Eq, Ord, Read, Show)

_GeneralValueSpecification = Core.Name "hydra.sql.syntax.GeneralValueSpecification"

-- | A GENERATED ALWAYS AS clause for a computed column
newtype GenerationClause =
  GenerationClause {
    unGenerationClause :: ()}
  deriving (Eq, Ord, Read, Show)

_GenerationClause = Core.Name "hydra.sql.syntax.GenerationClause"

-- | The GLOBAL or LOCAL qualifier of a temporary table scope
data GlobalOrLocal =
  GlobalOrLocalGlobal |
  GlobalOrLocalLocal
  deriving (Eq, Ord, Read, Show)

_GlobalOrLocal = Core.Name "hydra.sql.syntax.GlobalOrLocal"

_GlobalOrLocal_global = Core.Name "global"

_GlobalOrLocal_local = Core.Name "local"

-- | A GENERATED ... AS IDENTITY column specification
newtype IdentityColumnSpecification =
  IdentityColumnSpecification {
    unIdentityColumnSpecification :: ()}
  deriving (Eq, Ord, Read, Show)

_IdentityColumnSpecification = Core.Name "hydra.sql.syntax.IdentityColumnSpecification"

-- | The parenthesized list of target column names in an INSERT statement
newtype InsertColumnList =
  InsertColumnList {
    unInsertColumnList :: ColumnNameList}
  deriving (Eq, Ord, Read, Show)

_InsertColumnList = Core.Name "hydra.sql.syntax.InsertColumnList"

-- | The column list and value source of an INSERT statement: a subquery, constructor, or default
data InsertColumnsAndSource =
  InsertColumnsAndSourceSubquery FromSubquery |
  InsertColumnsAndSourceConstructor FromConstructor |
  InsertColumnsAndSourceDefault FromDefault
  deriving (Eq, Ord, Read, Show)

_InsertColumnsAndSource = Core.Name "hydra.sql.syntax.InsertColumnsAndSource"

_InsertColumnsAndSource_subquery = Core.Name "subquery"

_InsertColumnsAndSource_constructor = Core.Name "constructor"

_InsertColumnsAndSource_default = Core.Name "default"

-- | An ANSI SQL INSERT statement
data InsertStatement =
  InsertStatement {
    insertStatementTarget :: InsertionTarget,
    insertStatementColumnsAndSource :: InsertColumnsAndSource}
  deriving (Eq, Ord, Read, Show)

_InsertStatement = Core.Name "hydra.sql.syntax.InsertStatement"

_InsertStatement_target = Core.Name "target"

_InsertStatement_columnsAndSource = Core.Name "columnsAndSource"

-- | The table into which an INSERT statement inserts rows
newtype InsertionTarget =
  InsertionTarget {
    unInsertionTarget :: TableName}
  deriving (Eq, Ord, Read, Show)

_InsertionTarget = Core.Name "hydra.sql.syntax.InsertionTarget"

-- | An INTERVAL literal
newtype IntervalLiteral =
  IntervalLiteral {
    unIntervalLiteral :: ()}
  deriving (Eq, Ord, Read, Show)

_IntervalLiteral = Core.Name "hydra.sql.syntax.IntervalLiteral"

-- | The INTERVAL data type
newtype IntervalType =
  IntervalType {
    unIntervalType :: ()}
  deriving (Eq, Ord, Read, Show)

_IntervalType = Core.Name "hydra.sql.syntax.IntervalType"

-- | An expression that evaluates to an interval value
newtype IntervalValueExpression =
  IntervalValueExpression {
    unIntervalValueExpression :: ()}
  deriving (Eq, Ord, Read, Show)

_IntervalValueExpression = Core.Name "hydra.sql.syntax.IntervalValueExpression"

-- | The length specification of a large object type, e.g. 1K, 1M, or 1G
newtype LargeObjectLength =
  LargeObjectLength {
    unLargeObjectLength :: ()}
  deriving (Eq, Ord, Read, Show)

_LargeObjectLength = Core.Name "hydra.sql.syntax.LargeObjectLength"

-- | A left square bracket, or its trigraph equivalent ??(
newtype LeftBracketOrTrigraph =
  LeftBracketOrTrigraph {
    unLeftBracketOrTrigraph :: String}
  deriving (Eq, Ord, Read, Show)

_LeftBracketOrTrigraph = Core.Name "hydra.sql.syntax.LeftBracketOrTrigraph"

-- | The length specification of a character or binary string type
newtype Length =
  Length {
    unLength :: UnsignedInteger}
  deriving (Eq, Ord, Read, Show)

_Length = Core.Name "hydra.sql.syntax.Length"

-- | A LIKE clause, copying column definitions from another table
newtype LikeClause =
  LikeClause {
    unLikeClause :: ()}
  deriving (Eq, Ord, Read, Show)

_LikeClause = Core.Name "hydra.sql.syntax.LikeClause"

-- | An invocation of a method on a structured value
newtype MethodInvocation =
  MethodInvocation {
    unMethodInvocation :: ()}
  deriving (Eq, Ord, Read, Show)

_MethodInvocation = Core.Name "hydra.sql.syntax.MethodInvocation"

-- | A reference to an element of a multiset by way of the ELEMENT function
newtype MultisetElementReference =
  MultisetElementReference {
    unMultisetElementReference :: ()}
  deriving (Eq, Ord, Read, Show)

_MultisetElementReference = Core.Name "hydra.sql.syntax.MultisetElementReference"

-- | A MULTISET collection type over a given element data type
newtype MultisetType =
  MultisetType {
    unMultisetType :: DataType}
  deriving (Eq, Ord, Read, Show)

_MultisetType = Core.Name "hydra.sql.syntax.MultisetType"

-- | A constructor for a multiset value
newtype MultisetValueConstructor =
  MultisetValueConstructor {
    unMultisetValueConstructor :: ()}
  deriving (Eq, Ord, Read, Show)

_MultisetValueConstructor = Core.Name "hydra.sql.syntax.MultisetValueConstructor"

-- | An expression that evaluates to a multiset value
newtype MultisetValueExpression =
  MultisetValueExpression {
    unMultisetValueExpression :: ()}
  deriving (Eq, Ord, Read, Show)

_MultisetValueExpression = Core.Name "hydra.sql.syntax.MultisetValueExpression"

-- | A national character string literal, e.g. N'hello'
newtype NationalCharacterStringLiteral =
  NationalCharacterStringLiteral {
    unNationalCharacterStringLiteral :: ()}
  deriving (Eq, Ord, Read, Show)

_NationalCharacterStringLiteral = Core.Name "hydra.sql.syntax.NationalCharacterStringLiteral"

-- | A national character string type: NATIONAL CHARACTER or NATIONAL CHARACTER VARYING
newtype NationalCharacterStringType =
  NationalCharacterStringType {
    unNationalCharacterStringType :: ()}
  deriving (Eq, Ord, Read, Show)

_NationalCharacterStringType = Core.Name "hydra.sql.syntax.NationalCharacterStringType"

-- | A NEW invocation, constructing an instance of a structured type
newtype NewSpecification =
  NewSpecification {
    unNewSpecification :: ()}
  deriving (Eq, Ord, Read, Show)

_NewSpecification = Core.Name "hydra.sql.syntax.NewSpecification"

-- | A NEXT VALUE FOR expression, retrieving the next value of a sequence generator
newtype NextValueExpression =
  NextValueExpression {
    unNextValueExpression :: ()}
  deriving (Eq, Ord, Read, Show)

_NextValueExpression = Core.Name "hydra.sql.syntax.NextValueExpression"

-- | A value expression primary that does not begin with a parenthesis
data NonparenthesizedValueExpressionPrimary =
  NonparenthesizedValueExpressionPrimaryUnsigned UnsignedValueSpecification |
  NonparenthesizedValueExpressionPrimaryColumn ColumnReference |
  NonparenthesizedValueExpressionPrimarySetFunction SetFunctionSpecification |
  NonparenthesizedValueExpressionPrimaryWindowFunction WindowFunction |
  NonparenthesizedValueExpressionPrimaryScalarSubquery ScalarSubquery |
  NonparenthesizedValueExpressionPrimaryCases CaseExpression |
  NonparenthesizedValueExpressionPrimaryCast CastSpecification |
  NonparenthesizedValueExpressionPrimaryField FieldReference |
  NonparenthesizedValueExpressionPrimarySubtype SubtypeTreatment |
  NonparenthesizedValueExpressionPrimaryMethod MethodInvocation |
  NonparenthesizedValueExpressionPrimaryStaticMethod StaticMethodInvocation |
  NonparenthesizedValueExpressionPrimaryNew NewSpecification |
  NonparenthesizedValueExpressionPrimaryAttributeOrMethod AttributeOrMethodReference |
  NonparenthesizedValueExpressionPrimaryReference ReferenceResolution |
  NonparenthesizedValueExpressionPrimaryCollection CollectionValueConstructor |
  NonparenthesizedValueExpressionPrimaryArrayElement ArrayElementReference |
  NonparenthesizedValueExpressionPrimaryMultisetElement MultisetElementReference |
  NonparenthesizedValueExpressionPrimaryRoutine RoutineInvocation |
  NonparenthesizedValueExpressionPrimaryNext NextValueExpression
  deriving (Eq, Ord, Read, Show)

_NonparenthesizedValueExpressionPrimary = Core.Name "hydra.sql.syntax.NonparenthesizedValueExpressionPrimary"

_NonparenthesizedValueExpressionPrimary_unsigned = Core.Name "unsigned"

_NonparenthesizedValueExpressionPrimary_column = Core.Name "column"

_NonparenthesizedValueExpressionPrimary_setFunction = Core.Name "setFunction"

_NonparenthesizedValueExpressionPrimary_windowFunction = Core.Name "windowFunction"

_NonparenthesizedValueExpressionPrimary_scalarSubquery = Core.Name "scalarSubquery"

_NonparenthesizedValueExpressionPrimary_cases = Core.Name "cases"

_NonparenthesizedValueExpressionPrimary_cast = Core.Name "cast"

_NonparenthesizedValueExpressionPrimary_field = Core.Name "field"

_NonparenthesizedValueExpressionPrimary_subtype = Core.Name "subtype"

_NonparenthesizedValueExpressionPrimary_method = Core.Name "method"

_NonparenthesizedValueExpressionPrimary_staticMethod = Core.Name "staticMethod"

_NonparenthesizedValueExpressionPrimary_new = Core.Name "new"

_NonparenthesizedValueExpressionPrimary_attributeOrMethod = Core.Name "attributeOrMethod"

_NonparenthesizedValueExpressionPrimary_reference = Core.Name "reference"

_NonparenthesizedValueExpressionPrimary_collection = Core.Name "collection"

_NonparenthesizedValueExpressionPrimary_arrayElement = Core.Name "arrayElement"

_NonparenthesizedValueExpressionPrimary_multisetElement = Core.Name "multisetElement"

_NonparenthesizedValueExpressionPrimary_routine = Core.Name "routine"

_NonparenthesizedValueExpressionPrimary_next = Core.Name "next"

-- | A numeric type: exact or approximate
data NumericType =
  NumericTypeExact ExactNumericType |
  NumericTypeApproximate ApproximateNumericType
  deriving (Eq, Ord, Read, Show)

_NumericType = Core.Name "hydra.sql.syntax.NumericType"

_NumericType_exact = Core.Name "exact"

_NumericType_approximate = Core.Name "approximate"

-- | An expression that evaluates to a numeric value
newtype NumericValueExpression =
  NumericValueExpression {
    unNumericValueExpression :: ()}
  deriving (Eq, Ord, Read, Show)

_NumericValueExpression = Core.Name "hydra.sql.syntax.NumericValueExpression"

-- | An OVERRIDING USER VALUE or OVERRIDING SYSTEM VALUE clause of an INSERT statement
data OverrideClause =
  OverrideClauseOVERRIDINGspUSERspVALUE |
  OverrideClauseOVERRIDINGspSYSTEMspVALUE
  deriving (Eq, Ord, Read, Show)

_OverrideClause = Core.Name "hydra.sql.syntax.OverrideClause"

_OverrideClause_OVERRIDINGspUSERspVALUE = Core.Name "OVERRIDINGspUSERspVALUE"

_OverrideClause_OVERRIDINGspSYSTEMspVALUE = Core.Name "OVERRIDINGspSYSTEMspVALUE"

-- | A value expression enclosed in parentheses
newtype ParenthesizedValueExpression =
  ParenthesizedValueExpression {
    unParenthesizedValueExpression :: ValueExpression}
  deriving (Eq, Ord, Read, Show)

_ParenthesizedValueExpression = Core.Name "hydra.sql.syntax.ParenthesizedValueExpression"

-- | A user-defined type name, resolved against the current schema path
newtype PathResolvedUserDefinedTypeName =
  PathResolvedUserDefinedTypeName {
    unPathResolvedUserDefinedTypeName :: String}
  deriving (Eq, Ord, Read, Show)

_PathResolvedUserDefinedTypeName = Core.Name "hydra.sql.syntax.PathResolvedUserDefinedTypeName"

-- | The precision of a numeric type, as an unsigned integer
newtype Precision =
  Precision {
    unPrecision :: UnsignedInteger}
  deriving (Eq, Ord, Read, Show)

_Precision = Core.Name "hydra.sql.syntax.Precision"

-- | A predefined data type: string, numeric, boolean, datetime, or interval
data PredefinedType =
  PredefinedTypeStringType PredefinedTypeString |
  PredefinedTypeNationalStringType PredefinedTypeNationalString |
  PredefinedTypeBlob BinaryLargeObjectStringType |
  PredefinedTypeNumeric NumericType |
  PredefinedTypeBoolean BooleanType |
  PredefinedTypeDatetime DatetimeType |
  PredefinedTypeInterval IntervalType
  deriving (Eq, Ord, Read, Show)

_PredefinedType = Core.Name "hydra.sql.syntax.PredefinedType"

_PredefinedType_stringType = Core.Name "stringType"

_PredefinedType_nationalStringType = Core.Name "nationalStringType"

_PredefinedType_blob = Core.Name "blob"

_PredefinedType_numeric = Core.Name "numeric"

_PredefinedType_boolean = Core.Name "boolean"

_PredefinedType_datetime = Core.Name "datetime"

_PredefinedType_interval = Core.Name "interval"

-- | A national character string type together with an optional COLLATE clause
data PredefinedTypeNationalString =
  PredefinedTypeNationalString {
    predefinedTypeNationalStringType :: NationalCharacterStringType,
    predefinedTypeNationalStringCollate :: (Maybe CollateClause)}
  deriving (Eq, Ord, Read, Show)

_PredefinedTypeNationalString = Core.Name "hydra.sql.syntax.PredefinedTypeNationalString"

_PredefinedTypeNationalString_type = Core.Name "type"

_PredefinedTypeNationalString_collate = Core.Name "collate"

-- | A character string type together with an optional character set and COLLATE clause
data PredefinedTypeString =
  PredefinedTypeString {
    predefinedTypeStringType :: CharacterStringType,
    predefinedTypeStringCharacters :: (Maybe CharacterSetSpecification),
    predefinedTypeStringCollate :: (Maybe CollateClause)}
  deriving (Eq, Ord, Read, Show)

_PredefinedTypeString = Core.Name "hydra.sql.syntax.PredefinedTypeString"

_PredefinedTypeString_type = Core.Name "type"

_PredefinedTypeString_characters = Core.Name "characters"

_PredefinedTypeString_collate = Core.Name "collate"

-- | A predicate, evaluating to a boolean truth value
newtype Predicate =
  Predicate {
    unPredicate :: ()}
  deriving (Eq, Ord, Read, Show)

_Predicate = Core.Name "hydra.sql.syntax.Predicate"

-- | A query expression, such as a SELECT statement possibly combined with set operators
newtype QueryExpression =
  QueryExpression {
    unQueryExpression :: ()}
  deriving (Eq, Ord, Read, Show)

_QueryExpression = Core.Name "hydra.sql.syntax.QueryExpression"

-- | The DEREF operator, resolving a reference to the value it targets
newtype ReferenceResolution =
  ReferenceResolution {
    unReferenceResolution :: ()}
  deriving (Eq, Ord, Read, Show)

_ReferenceResolution = Core.Name "hydra.sql.syntax.ReferenceResolution"

-- | A REFERENCES ARE [NOT] CHECKED clause on a reference-typed column
newtype ReferenceScopeCheck =
  ReferenceScopeCheck {
    unReferenceScopeCheck :: ()}
  deriving (Eq, Ord, Read, Show)

_ReferenceScopeCheck = Core.Name "hydra.sql.syntax.ReferenceScopeCheck"

-- | A REF reference type over a given referenced type
newtype ReferenceType =
  ReferenceType {
    unReferenceType :: ()}
  deriving (Eq, Ord, Read, Show)

_ReferenceType = Core.Name "hydra.sql.syntax.ReferenceType"

-- | An expression that evaluates to a reference value
newtype ReferenceValueExpression =
  ReferenceValueExpression {
    unReferenceValueExpression :: ValueExpressionPrimary}
  deriving (Eq, Ord, Read, Show)

_ReferenceValueExpression = Core.Name "hydra.sql.syntax.ReferenceValueExpression"

-- | A right square bracket, or its trigraph equivalent ??)
newtype RightBracketOrTrigraph =
  RightBracketOrTrigraph {
    unRightBracketOrTrigraph :: String}
  deriving (Eq, Ord, Read, Show)

_RightBracketOrTrigraph = Core.Name "hydra.sql.syntax.RightBracketOrTrigraph"

-- | An invocation of a user-defined SQL routine
newtype RoutineInvocation =
  RoutineInvocation {
    unRoutineInvocation :: ()}
  deriving (Eq, Ord, Read, Show)

_RoutineInvocation = Core.Name "hydra.sql.syntax.RoutineInvocation"

-- | A ROW type, defined by a list of field name and data type pairs
newtype RowType =
  RowType {
    unRowType :: ()}
  deriving (Eq, Ord, Read, Show)

_RowType = Core.Name "hydra.sql.syntax.RowType"

-- | An expression that evaluates to a row value
newtype RowValueExpression =
  RowValueExpression {
    unRowValueExpression :: ()}
  deriving (Eq, Ord, Read, Show)

_RowValueExpression = Core.Name "hydra.sql.syntax.RowValueExpression"

-- | A row value expressed as a single nonparenthesized value expression
newtype RowValueSpecialCase =
  RowValueSpecialCase {
    unRowValueSpecialCase :: NonparenthesizedValueExpressionPrimary}
  deriving (Eq, Ord, Read, Show)

_RowValueSpecialCase = Core.Name "hydra.sql.syntax.RowValueSpecialCase"

-- | A subquery that returns exactly one row and one column
newtype ScalarSubquery =
  ScalarSubquery {
    unScalarSubquery :: Subquery}
  deriving (Eq, Ord, Read, Show)

_ScalarSubquery = Core.Name "hydra.sql.syntax.ScalarSubquery"

-- | The scale of a numeric type, as an unsigned integer
newtype Scale =
  Scale {
    unScale :: UnsignedInteger}
  deriving (Eq, Ord, Read, Show)

_Scale = Core.Name "hydra.sql.syntax.Scale"

-- | A REF IS clause identifying a table's self-referencing column
newtype SelfReferencingColumnSpecification =
  SelfReferencingColumnSpecification {
    unSelfReferencingColumnSpecification :: ()}
  deriving (Eq, Ord, Read, Show)

_SelfReferencingColumnSpecification = Core.Name "hydra.sql.syntax.SelfReferencingColumnSpecification"

-- | A set (aggregate) function invocation, such as COUNT or SUM
newtype SetFunctionSpecification =
  SetFunctionSpecification {
    unSetFunctionSpecification :: ()}
  deriving (Eq, Ord, Read, Show)

_SetFunctionSpecification = Core.Name "hydra.sql.syntax.SetFunctionSpecification"

-- | An invocation of a static method on a user-defined type
newtype StaticMethodInvocation =
  StaticMethodInvocation {
    unStaticMethodInvocation :: ()}
  deriving (Eq, Ord, Read, Show)

_StaticMethodInvocation = Core.Name "hydra.sql.syntax.StaticMethodInvocation"

-- | An expression that evaluates to a character, binary, or Unicode string value
newtype StringValueExpression =
  StringValueExpression {
    unStringValueExpression :: ()}
  deriving (Eq, Ord, Read, Show)

_StringValueExpression = Core.Name "hydra.sql.syntax.StringValueExpression"

-- | A parenthesized query expression used as an operand
newtype Subquery =
  Subquery {
    unSubquery :: QueryExpression}
  deriving (Eq, Ord, Read, Show)

_Subquery = Core.Name "hydra.sql.syntax.Subquery"

-- | An UNDER clause declaring a table as a subtable of a supertable
newtype SubtableClause =
  SubtableClause {
    unSubtableClause :: ()}
  deriving (Eq, Ord, Read, Show)

_SubtableClause = Core.Name "hydra.sql.syntax.SubtableClause"

-- | A TREAT AS expression, treating a value as an instance of a subtype
newtype SubtypeTreatment =
  SubtypeTreatment {
    unSubtypeTreatment :: ()}
  deriving (Eq, Ord, Read, Show)

_SubtypeTreatment = Core.Name "hydra.sql.syntax.SubtypeTreatment"

-- | The ON COMMIT action of a temporary table: PRESERVE ROWS or DELETE ROWS
data TableCommitAction =
  TableCommitActionPreserve |
  TableCommitActionDelete
  deriving (Eq, Ord, Read, Show)

_TableCommitAction = Core.Name "hydra.sql.syntax.TableCommitAction"

_TableCommitAction_preserve = Core.Name "preserve"

_TableCommitAction_delete = Core.Name "delete"

-- | A table-level constraint definition
newtype TableConstraintDefinition =
  TableConstraintDefinition {
    unTableConstraintDefinition :: ()}
  deriving (Eq, Ord, Read, Show)

_TableConstraintDefinition = Core.Name "hydra.sql.syntax.TableConstraintDefinition"

-- | The source of a table's contents: an element list, a supertable, or a query
data TableContentsSource =
  TableContentsSourceList TableElementList |
  TableContentsSourceSubtableOf TableContentsSourceSubtable |
  TableContentsSourceSubquery AsSubqueryClause
  deriving (Eq, Ord, Read, Show)

_TableContentsSource = Core.Name "hydra.sql.syntax.TableContentsSource"

_TableContentsSource_list = Core.Name "list"

_TableContentsSource_subtableOf = Core.Name "subtableOf"

_TableContentsSource_subquery = Core.Name "subquery"

-- | A table's contents defined as a subtable of a named user-defined type
data TableContentsSourceSubtable =
  TableContentsSourceSubtable {
    tableContentsSourceSubtableType :: PathResolvedUserDefinedTypeName,
    tableContentsSourceSubtableSubtable :: (Maybe SubtableClause),
    tableContentsSourceSubtableElements :: (Maybe TableElementList)}
  deriving (Eq, Ord, Read, Show)

_TableContentsSourceSubtable = Core.Name "hydra.sql.syntax.TableContentsSourceSubtable"

_TableContentsSourceSubtable_type = Core.Name "type"

_TableContentsSourceSubtable_subtable = Core.Name "subtable"

_TableContentsSourceSubtable_elements = Core.Name "elements"

-- | An ANSI SQL CREATE TABLE statement
data TableDefinition =
  TableDefinition {
    tableDefinitionScope :: (Maybe TableScope),
    tableDefinitionName :: TableName,
    tableDefinitionSource :: TableContentsSource,
    tableDefinitionCommitActions :: (Maybe TableCommitAction)}
  deriving (Eq, Ord, Read, Show)

_TableDefinition = Core.Name "hydra.sql.syntax.TableDefinition"

_TableDefinition_scope = Core.Name "scope"

_TableDefinition_name = Core.Name "name"

_TableDefinition_source = Core.Name "source"

_TableDefinition_commitActions = Core.Name "commitActions"

-- | An element of a table definition: a column, constraint, LIKE clause, or related option
data TableElement =
  TableElementColumn ColumnDefinition |
  TableElementTableConstraint TableConstraintDefinition |
  TableElementLike LikeClause |
  TableElementSelfReferencingColumn SelfReferencingColumnSpecification |
  TableElementColumOptions ColumnOptions
  deriving (Eq, Ord, Read, Show)

_TableElement = Core.Name "hydra.sql.syntax.TableElement"

_TableElement_column = Core.Name "column"

_TableElement_tableConstraint = Core.Name "tableConstraint"

_TableElement_like = Core.Name "like"

_TableElement_selfReferencingColumn = Core.Name "selfReferencingColumn"

_TableElement_columOptions = Core.Name "columOptions"

-- | A non-empty, comma-separated list of table elements
data TableElementList =
  TableElementList {
    tableElementListFirst :: TableElement,
    tableElementListRest :: [TableElement]}
  deriving (Eq, Ord, Read, Show)

_TableElementList = Core.Name "hydra.sql.syntax.TableElementList"

_TableElementList_first = Core.Name "first"

_TableElementList_rest = Core.Name "rest"

-- | The name of a table
newtype TableName =
  TableName {
    unTableName :: String}
  deriving (Eq, Ord, Read, Show)

_TableName = Core.Name "hydra.sql.syntax.TableName"

-- | The GLOBAL or LOCAL TEMPORARY scope of a table definition
newtype TableScope =
  TableScope {
    unTableScope :: GlobalOrLocal}
  deriving (Eq, Ord, Read, Show)

_TableScope = Core.Name "hydra.sql.syntax.TableScope"

-- | A TIME literal
newtype TimeLiteral =
  TimeLiteral {
    unTimeLiteral :: TimeString}
  deriving (Eq, Ord, Read, Show)

_TimeLiteral = Core.Name "hydra.sql.syntax.TimeLiteral"

-- | The string representation of a time literal, e.g. '12:00:00'
newtype TimeString =
  TimeString {
    unTimeString :: ()}
  deriving (Eq, Ord, Read, Show)

_TimeString = Core.Name "hydra.sql.syntax.TimeString"

-- | A timestamp literal, combining a date and a time
newtype TimestampLiteral =
  TimestampLiteral {
    unTimestampLiteral :: ()}
  deriving (Eq, Ord, Read, Show)

_TimestampLiteral = Core.Name "hydra.sql.syntax.TimestampLiteral"

-- | A three-valued logic truth value: TRUE, FALSE, or UNKNOWN
data TruthValue =
  TruthValueTRUE |
  TruthValueFALSE |
  TruthValueUNKNOWN
  deriving (Eq, Ord, Read, Show)

_TruthValue = Core.Name "hydra.sql.syntax.TruthValue"

_TruthValue_TRUE = Core.Name "TRUE"

_TruthValue_FALSE = Core.Name "FALSE"

_TruthValue_UNKNOWN = Core.Name "UNKNOWN"

-- | A Unicode character string literal, e.g. U&'hello'
newtype UnicodeCharacterStringLiteral =
  UnicodeCharacterStringLiteral {
    unUnicodeCharacterStringLiteral :: ()}
  deriving (Eq, Ord, Read, Show)

_UnicodeCharacterStringLiteral = Core.Name "hydra.sql.syntax.UnicodeCharacterStringLiteral"

-- | An unsigned integer literal
newtype UnsignedInteger =
  UnsignedInteger {
    unUnsignedInteger :: String}
  deriving (Eq, Ord, Read, Show)

_UnsignedInteger = Core.Name "hydra.sql.syntax.UnsignedInteger"

-- | An unsigned literal: a numeric or general literal
data UnsignedLiteral =
  UnsignedLiteralNumeric UnsignedNumericLiteral |
  UnsignedLiteralGeneral GeneralLiteral
  deriving (Eq, Ord, Read, Show)

_UnsignedLiteral = Core.Name "hydra.sql.syntax.UnsignedLiteral"

_UnsignedLiteral_numeric = Core.Name "numeric"

_UnsignedLiteral_general = Core.Name "general"

-- | An unsigned numeric literal: exact or approximate
data UnsignedNumericLiteral =
  UnsignedNumericLiteralExact ExactNumericLiteral |
  UnsignedNumericLiteralApproximate ApproximateNumericLiteral
  deriving (Eq, Ord, Read, Show)

_UnsignedNumericLiteral = Core.Name "hydra.sql.syntax.UnsignedNumericLiteral"

_UnsignedNumericLiteral_exact = Core.Name "exact"

_UnsignedNumericLiteral_approximate = Core.Name "approximate"

-- | An unsigned value specification: a literal or a general value specification
data UnsignedValueSpecification =
  UnsignedValueSpecificationLiteral UnsignedLiteral |
  UnsignedValueSpecificationGeneral GeneralValueSpecification
  deriving (Eq, Ord, Read, Show)

_UnsignedValueSpecification = Core.Name "hydra.sql.syntax.UnsignedValueSpecification"

_UnsignedValueSpecification_literal = Core.Name "literal"

_UnsignedValueSpecification_general = Core.Name "general"

-- | An expression that evaluates to a value of a user-defined type
newtype UserDefinedTypeValueExpression =
  UserDefinedTypeValueExpression {
    unUserDefinedTypeValueExpression :: ValueExpressionPrimary}
  deriving (Eq, Ord, Read, Show)

_UserDefinedTypeValueExpression = Core.Name "hydra.sql.syntax.UserDefinedTypeValueExpression"

-- | A value expression: common, boolean, or row-valued
data ValueExpression =
  ValueExpressionCommon CommonValueExpression |
  ValueExpressionBoolean BooleanValueExpression |
  ValueExpressionRow RowValueExpression
  deriving (Eq, Ord, Read, Show)

_ValueExpression = Core.Name "hydra.sql.syntax.ValueExpression"

_ValueExpression_common = Core.Name "common"

_ValueExpression_boolean = Core.Name "boolean"

_ValueExpression_row = Core.Name "row"

-- | A value expression primary, optionally parenthesized
data ValueExpressionPrimary =
  ValueExpressionPrimaryParens ParenthesizedValueExpression |
  ValueExpressionPrimaryNoparens NonparenthesizedValueExpressionPrimary
  deriving (Eq, Ord, Read, Show)

_ValueExpressionPrimary = Core.Name "hydra.sql.syntax.ValueExpressionPrimary"

_ValueExpressionPrimary_parens = Core.Name "parens"

_ValueExpressionPrimary_noparens = Core.Name "noparens"

-- | A window function invocation, such as ROW_NUMBER() OVER (...)
newtype WindowFunction =
  WindowFunction {
    unWindowFunction :: ()}
  deriving (Eq, Ord, Read, Show)

_WindowFunction = Core.Name "hydra.sql.syntax.WindowFunction"