packages feed

hydra-ext-0.18.0: src/main/haskell/Hydra/Ext/Dsl/Sql/Syntax.hs

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

-- | DSL functions for hydra.ext.sql.syntax

module Hydra.Ext.Dsl.Sql.Syntax where

import qualified Hydra.Core.Model as Model
import qualified Hydra.Core.Typed as Typed
import qualified Hydra.Ext.Sql.Syntax as Syntax
import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)
import qualified Data.Scientific as Sci
import Data.Void

-- | DSL constructor for the hydra.ext.sql.syntax.ApproximateNumericLiteral wrapper
approximateNumericLiteral :: Typed.TypedTerm String -> Typed.TypedTerm Syntax.ApproximateNumericLiteral
approximateNumericLiteral x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.ApproximateNumericLiteral"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.ApproximateNumericLiteral
approximateNumericLiteralApproximateNumericLiteral :: Typed.TypedName Syntax.ApproximateNumericLiteral
approximateNumericLiteralApproximateNumericLiteral =
    Typed.TypedName (Model.Name "hydra.ext.sql.syntax.ApproximateNumericLiteral")

-- | DSL name token for hydra.ext.sql.syntax.ApproximateNumericType
approximateNumericTypeApproximateNumericType :: Typed.TypedName Syntax.ApproximateNumericType
approximateNumericTypeApproximateNumericType = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.ApproximateNumericType")

-- | DSL injection for the double variant of hydra.ext.sql.syntax.ApproximateNumericType
approximateNumericTypeDouble :: Typed.TypedTerm Syntax.ApproximateNumericType
approximateNumericTypeDouble =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.ApproximateNumericType"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "double"),
        Model.fieldTerm = Model.TermUnit}}))

-- | DSL injection for the float variant of hydra.ext.sql.syntax.ApproximateNumericType
approximateNumericTypeFloat :: Typed.TypedTerm (Maybe Syntax.Precision) -> Typed.TypedTerm Syntax.ApproximateNumericType
approximateNumericTypeFloat x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.ApproximateNumericType"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "float"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the real variant of hydra.ext.sql.syntax.ApproximateNumericType
approximateNumericTypeReal :: Typed.TypedTerm Syntax.ApproximateNumericType
approximateNumericTypeReal =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.ApproximateNumericType"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "real"),
        Model.fieldTerm = Model.TermUnit}}))

-- | DSL constructor for the hydra.ext.sql.syntax.ArrayElement wrapper
arrayElement :: Typed.TypedTerm Syntax.ValueExpression -> Typed.TypedTerm Syntax.ArrayElement
arrayElement x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.ArrayElement"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.ArrayElement
arrayElementArrayElement :: Typed.TypedName Syntax.ArrayElement
arrayElementArrayElement = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.ArrayElement")

-- | DSL constructor for hydra.ext.sql.syntax.ArrayElementList
arrayElementList :: Typed.TypedTerm Syntax.ArrayElement -> Typed.TypedTerm [Syntax.ArrayElement] -> Typed.TypedTerm Syntax.ArrayElementList
arrayElementList first rest =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.ArrayElementList"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "first"),
          Model.fieldTerm = (Typed.unTypedTerm first)},
        Model.Field {
          Model.fieldName = (Model.Name "rest"),
          Model.fieldTerm = (Typed.unTypedTerm rest)}]}))

-- | DSL name token for hydra.ext.sql.syntax.ArrayElementList
arrayElementListArrayElementList :: Typed.TypedName Syntax.ArrayElementList
arrayElementListArrayElementList = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.ArrayElementList")

-- | DSL accessor for the first field of hydra.ext.sql.syntax.ArrayElementList
arrayElementListFirst :: Typed.TypedTerm Syntax.ArrayElementList -> Typed.TypedTerm Syntax.ArrayElement
arrayElementListFirst x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ArrayElementList"),
        Model.projectionFieldName = (Model.Name "first")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the rest field of hydra.ext.sql.syntax.ArrayElementList
arrayElementListRest :: Typed.TypedTerm Syntax.ArrayElementList -> Typed.TypedTerm [Syntax.ArrayElement]
arrayElementListRest x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ArrayElementList"),
        Model.projectionFieldName = (Model.Name "rest")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL updater for the first field of hydra.ext.sql.syntax.ArrayElementList
arrayElementListWithFirst :: Typed.TypedTerm Syntax.ArrayElementList -> Typed.TypedTerm Syntax.ArrayElement -> Typed.TypedTerm Syntax.ArrayElementList
arrayElementListWithFirst original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.ArrayElementList"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "first"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)},
        Model.Field {
          Model.fieldName = (Model.Name "rest"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ArrayElementList"),
              Model.projectionFieldName = (Model.Name "rest")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))

-- | DSL updater for the rest field of hydra.ext.sql.syntax.ArrayElementList
arrayElementListWithRest :: Typed.TypedTerm Syntax.ArrayElementList -> Typed.TypedTerm [Syntax.ArrayElement] -> Typed.TypedTerm Syntax.ArrayElementList
arrayElementListWithRest original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.ArrayElementList"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "first"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ArrayElementList"),
              Model.projectionFieldName = (Model.Name "first")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "rest"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))

-- | DSL constructor for the hydra.ext.sql.syntax.ArrayElementReference wrapper
arrayElementReference :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.ArrayElementReference
arrayElementReference x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.ArrayElementReference"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.ArrayElementReference
arrayElementReferenceArrayElementReference :: Typed.TypedName Syntax.ArrayElementReference
arrayElementReferenceArrayElementReference = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.ArrayElementReference")

-- | DSL constructor for the hydra.ext.sql.syntax.ArrayType wrapper
arrayType :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.ArrayType
arrayType x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.ArrayType"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.ArrayType
arrayTypeArrayType :: Typed.TypedName Syntax.ArrayType
arrayTypeArrayType = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.ArrayType")

-- | DSL name token for hydra.ext.sql.syntax.ArrayValueConstructor
arrayValueConstructorArrayValueConstructor :: Typed.TypedName Syntax.ArrayValueConstructor
arrayValueConstructorArrayValueConstructor = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.ArrayValueConstructor")

-- | DSL constructor for hydra.ext.sql.syntax.ArrayValueConstructorByEnumeration
arrayValueConstructorByEnumeration :: Typed.TypedTerm Syntax.LeftBracketOrTrigraph -> Typed.TypedTerm Syntax.ArrayElementList -> Typed.TypedTerm Syntax.RightBracketOrTrigraph -> Typed.TypedTerm Syntax.ArrayValueConstructorByEnumeration
arrayValueConstructorByEnumeration leftBracketOrTrigraph arrayElementList rightBracketOrTrigraph =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.ArrayValueConstructorByEnumeration"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "LeftBracketOrTrigraph"),
          Model.fieldTerm = (Typed.unTypedTerm leftBracketOrTrigraph)},
        Model.Field {
          Model.fieldName = (Model.Name "ArrayElementList"),
          Model.fieldTerm = (Typed.unTypedTerm arrayElementList)},
        Model.Field {
          Model.fieldName = (Model.Name "RightBracketOrTrigraph"),
          Model.fieldTerm = (Typed.unTypedTerm rightBracketOrTrigraph)}]}))

-- | DSL accessor for the ArrayElementList field of hydra.ext.sql.syntax.ArrayValueConstructorByEnumeration
arrayValueConstructorByEnumerationArrayElementList :: Typed.TypedTerm Syntax.ArrayValueConstructorByEnumeration -> Typed.TypedTerm Syntax.ArrayElementList
arrayValueConstructorByEnumerationArrayElementList x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ArrayValueConstructorByEnumeration"),
        Model.projectionFieldName = (Model.Name "ArrayElementList")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.ArrayValueConstructorByEnumeration
arrayValueConstructorByEnumerationArrayValueConstructorByEnumeration :: Typed.TypedName Syntax.ArrayValueConstructorByEnumeration
arrayValueConstructorByEnumerationArrayValueConstructorByEnumeration =
    Typed.TypedName (Model.Name "hydra.ext.sql.syntax.ArrayValueConstructorByEnumeration")

-- | DSL accessor for the LeftBracketOrTrigraph field of hydra.ext.sql.syntax.ArrayValueConstructorByEnumeration
arrayValueConstructorByEnumerationLeftBracketOrTrigraph :: Typed.TypedTerm Syntax.ArrayValueConstructorByEnumeration -> Typed.TypedTerm Syntax.LeftBracketOrTrigraph
arrayValueConstructorByEnumerationLeftBracketOrTrigraph x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ArrayValueConstructorByEnumeration"),
        Model.projectionFieldName = (Model.Name "LeftBracketOrTrigraph")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the RightBracketOrTrigraph field of hydra.ext.sql.syntax.ArrayValueConstructorByEnumeration
arrayValueConstructorByEnumerationRightBracketOrTrigraph :: Typed.TypedTerm Syntax.ArrayValueConstructorByEnumeration -> Typed.TypedTerm Syntax.RightBracketOrTrigraph
arrayValueConstructorByEnumerationRightBracketOrTrigraph x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ArrayValueConstructorByEnumeration"),
        Model.projectionFieldName = (Model.Name "RightBracketOrTrigraph")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL updater for the ArrayElementList field of hydra.ext.sql.syntax.ArrayValueConstructorByEnumeration
arrayValueConstructorByEnumerationWithArrayElementList :: Typed.TypedTerm Syntax.ArrayValueConstructorByEnumeration -> Typed.TypedTerm Syntax.ArrayElementList -> Typed.TypedTerm Syntax.ArrayValueConstructorByEnumeration
arrayValueConstructorByEnumerationWithArrayElementList original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.ArrayValueConstructorByEnumeration"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "LeftBracketOrTrigraph"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ArrayValueConstructorByEnumeration"),
              Model.projectionFieldName = (Model.Name "LeftBracketOrTrigraph")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "ArrayElementList"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)},
        Model.Field {
          Model.fieldName = (Model.Name "RightBracketOrTrigraph"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ArrayValueConstructorByEnumeration"),
              Model.projectionFieldName = (Model.Name "RightBracketOrTrigraph")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))

-- | DSL updater for the LeftBracketOrTrigraph field of hydra.ext.sql.syntax.ArrayValueConstructorByEnumeration
arrayValueConstructorByEnumerationWithLeftBracketOrTrigraph :: Typed.TypedTerm Syntax.ArrayValueConstructorByEnumeration -> Typed.TypedTerm Syntax.LeftBracketOrTrigraph -> Typed.TypedTerm Syntax.ArrayValueConstructorByEnumeration
arrayValueConstructorByEnumerationWithLeftBracketOrTrigraph original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.ArrayValueConstructorByEnumeration"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "LeftBracketOrTrigraph"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)},
        Model.Field {
          Model.fieldName = (Model.Name "ArrayElementList"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ArrayValueConstructorByEnumeration"),
              Model.projectionFieldName = (Model.Name "ArrayElementList")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "RightBracketOrTrigraph"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ArrayValueConstructorByEnumeration"),
              Model.projectionFieldName = (Model.Name "RightBracketOrTrigraph")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))

-- | DSL updater for the RightBracketOrTrigraph field of hydra.ext.sql.syntax.ArrayValueConstructorByEnumeration
arrayValueConstructorByEnumerationWithRightBracketOrTrigraph :: Typed.TypedTerm Syntax.ArrayValueConstructorByEnumeration -> Typed.TypedTerm Syntax.RightBracketOrTrigraph -> Typed.TypedTerm Syntax.ArrayValueConstructorByEnumeration
arrayValueConstructorByEnumerationWithRightBracketOrTrigraph original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.ArrayValueConstructorByEnumeration"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "LeftBracketOrTrigraph"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ArrayValueConstructorByEnumeration"),
              Model.projectionFieldName = (Model.Name "LeftBracketOrTrigraph")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "ArrayElementList"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ArrayValueConstructorByEnumeration"),
              Model.projectionFieldName = (Model.Name "ArrayElementList")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "RightBracketOrTrigraph"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))

-- | DSL constructor for the hydra.ext.sql.syntax.ArrayValueConstructorByQuery wrapper
arrayValueConstructorByQuery :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.ArrayValueConstructorByQuery
arrayValueConstructorByQuery x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.ArrayValueConstructorByQuery"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.ArrayValueConstructorByQuery
arrayValueConstructorByQueryArrayValueConstructorByQuery :: Typed.TypedName Syntax.ArrayValueConstructorByQuery
arrayValueConstructorByQueryArrayValueConstructorByQuery =
    Typed.TypedName (Model.Name "hydra.ext.sql.syntax.ArrayValueConstructorByQuery")

-- | DSL injection for the enumeration variant of hydra.ext.sql.syntax.ArrayValueConstructor
arrayValueConstructorEnumeration :: Typed.TypedTerm Syntax.ArrayValueConstructorByEnumeration -> Typed.TypedTerm Syntax.ArrayValueConstructor
arrayValueConstructorEnumeration x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.ArrayValueConstructor"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "enumeration"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the query variant of hydra.ext.sql.syntax.ArrayValueConstructor
arrayValueConstructorQuery :: Typed.TypedTerm Syntax.ArrayValueConstructorByQuery -> Typed.TypedTerm Syntax.ArrayValueConstructor
arrayValueConstructorQuery x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.ArrayValueConstructor"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "query"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL constructor for the hydra.ext.sql.syntax.ArrayValueExpression wrapper
arrayValueExpression :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.ArrayValueExpression
arrayValueExpression x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.ArrayValueExpression"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.ArrayValueExpression
arrayValueExpressionArrayValueExpression :: Typed.TypedName Syntax.ArrayValueExpression
arrayValueExpressionArrayValueExpression = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.ArrayValueExpression")

-- | DSL constructor for the hydra.ext.sql.syntax.AsSubqueryClause wrapper
asSubqueryClause :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.AsSubqueryClause
asSubqueryClause x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.AsSubqueryClause"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.AsSubqueryClause
asSubqueryClauseAsSubqueryClause :: Typed.TypedName Syntax.AsSubqueryClause
asSubqueryClauseAsSubqueryClause = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.AsSubqueryClause")

-- | DSL constructor for the hydra.ext.sql.syntax.AttributeOrMethodReference wrapper
attributeOrMethodReference :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.AttributeOrMethodReference
attributeOrMethodReference x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.AttributeOrMethodReference"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.AttributeOrMethodReference
attributeOrMethodReferenceAttributeOrMethodReference :: Typed.TypedName Syntax.AttributeOrMethodReference
attributeOrMethodReferenceAttributeOrMethodReference =
    Typed.TypedName (Model.Name "hydra.ext.sql.syntax.AttributeOrMethodReference")

-- | DSL injection for the binary variant of hydra.ext.sql.syntax.BinaryLargeObjectStringType
binaryLargeObjectStringTypeBinary :: Typed.TypedTerm (Maybe Syntax.LargeObjectLength) -> Typed.TypedTerm Syntax.BinaryLargeObjectStringType
binaryLargeObjectStringTypeBinary x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.BinaryLargeObjectStringType"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "binary"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL name token for hydra.ext.sql.syntax.BinaryLargeObjectStringType
binaryLargeObjectStringTypeBinaryLargeObjectStringType :: Typed.TypedName Syntax.BinaryLargeObjectStringType
binaryLargeObjectStringTypeBinaryLargeObjectStringType =
    Typed.TypedName (Model.Name "hydra.ext.sql.syntax.BinaryLargeObjectStringType")

-- | DSL injection for the blob variant of hydra.ext.sql.syntax.BinaryLargeObjectStringType
binaryLargeObjectStringTypeBlob :: Typed.TypedTerm (Maybe Syntax.LargeObjectLength) -> Typed.TypedTerm Syntax.BinaryLargeObjectStringType
binaryLargeObjectStringTypeBlob x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.BinaryLargeObjectStringType"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "blob"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL constructor for the hydra.ext.sql.syntax.BinaryStringLiteral wrapper
binaryStringLiteral :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.BinaryStringLiteral
binaryStringLiteral x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.BinaryStringLiteral"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.BinaryStringLiteral
binaryStringLiteralBinaryStringLiteral :: Typed.TypedName Syntax.BinaryStringLiteral
binaryStringLiteralBinaryStringLiteral = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.BinaryStringLiteral")

-- | DSL constructor for hydra.ext.sql.syntax.BooleanFactor
booleanFactor :: Typed.TypedTerm (Maybe ()) -> Typed.TypedTerm Syntax.BooleanTest -> Typed.TypedTerm Syntax.BooleanFactor
booleanFactor nOT booleanTest =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.BooleanFactor"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "NOT"),
          Model.fieldTerm = (Typed.unTypedTerm nOT)},
        Model.Field {
          Model.fieldName = (Model.Name "BooleanTest"),
          Model.fieldTerm = (Typed.unTypedTerm booleanTest)}]}))

-- | DSL name token for hydra.ext.sql.syntax.BooleanFactor
booleanFactorBooleanFactor :: Typed.TypedName Syntax.BooleanFactor
booleanFactorBooleanFactor = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.BooleanFactor")

-- | DSL accessor for the BooleanTest field of hydra.ext.sql.syntax.BooleanFactor
booleanFactorBooleanTest :: Typed.TypedTerm Syntax.BooleanFactor -> Typed.TypedTerm Syntax.BooleanTest
booleanFactorBooleanTest x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.BooleanFactor"),
        Model.projectionFieldName = (Model.Name "BooleanTest")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the NOT field of hydra.ext.sql.syntax.BooleanFactor
booleanFactorNOT :: Typed.TypedTerm Syntax.BooleanFactor -> Typed.TypedTerm (Maybe ())
booleanFactorNOT x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.BooleanFactor"),
        Model.projectionFieldName = (Model.Name "NOT")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL updater for the BooleanTest field of hydra.ext.sql.syntax.BooleanFactor
booleanFactorWithBooleanTest :: Typed.TypedTerm Syntax.BooleanFactor -> Typed.TypedTerm Syntax.BooleanTest -> Typed.TypedTerm Syntax.BooleanFactor
booleanFactorWithBooleanTest original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.BooleanFactor"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "NOT"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.BooleanFactor"),
              Model.projectionFieldName = (Model.Name "NOT")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "BooleanTest"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))

-- | DSL updater for the NOT field of hydra.ext.sql.syntax.BooleanFactor
booleanFactorWithNOT :: Typed.TypedTerm Syntax.BooleanFactor -> Typed.TypedTerm (Maybe ()) -> Typed.TypedTerm Syntax.BooleanFactor
booleanFactorWithNOT original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.BooleanFactor"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "NOT"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)},
        Model.Field {
          Model.fieldName = (Model.Name "BooleanTest"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.BooleanFactor"),
              Model.projectionFieldName = (Model.Name "BooleanTest")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))

-- | DSL name token for hydra.ext.sql.syntax.BooleanLiteral
booleanLiteralBooleanLiteral :: Typed.TypedName Syntax.BooleanLiteral
booleanLiteralBooleanLiteral = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.BooleanLiteral")

-- | DSL injection for the FALSE variant of hydra.ext.sql.syntax.BooleanLiteral
booleanLiteralFALSE :: Typed.TypedTerm Syntax.BooleanLiteral
booleanLiteralFALSE =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.BooleanLiteral"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "FALSE"),
        Model.fieldTerm = Model.TermUnit}}))

-- | DSL injection for the TRUE variant of hydra.ext.sql.syntax.BooleanLiteral
booleanLiteralTRUE :: Typed.TypedTerm Syntax.BooleanLiteral
booleanLiteralTRUE =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.BooleanLiteral"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "TRUE"),
        Model.fieldTerm = Model.TermUnit}}))

-- | DSL injection for the UNKNOWN variant of hydra.ext.sql.syntax.BooleanLiteral
booleanLiteralUNKNOWN :: Typed.TypedTerm Syntax.BooleanLiteral
booleanLiteralUNKNOWN =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.BooleanLiteral"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "UNKNOWN"),
        Model.fieldTerm = Model.TermUnit}}))

-- | DSL constructor for the hydra.ext.sql.syntax.BooleanPredicand wrapper
booleanPredicand :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.BooleanPredicand
booleanPredicand x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.BooleanPredicand"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.BooleanPredicand
booleanPredicandBooleanPredicand :: Typed.TypedName Syntax.BooleanPredicand
booleanPredicandBooleanPredicand = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.BooleanPredicand")

-- | DSL name token for hydra.ext.sql.syntax.BooleanPrimary
booleanPrimaryBooleanPrimary :: Typed.TypedName Syntax.BooleanPrimary
booleanPrimaryBooleanPrimary = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.BooleanPrimary")

-- | DSL injection for the predicand variant of hydra.ext.sql.syntax.BooleanPrimary
booleanPrimaryPredicand :: Typed.TypedTerm Syntax.BooleanPredicand -> Typed.TypedTerm Syntax.BooleanPrimary
booleanPrimaryPredicand x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.BooleanPrimary"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "predicand"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the predicate variant of hydra.ext.sql.syntax.BooleanPrimary
booleanPrimaryPredicate :: Typed.TypedTerm Syntax.Predicate -> Typed.TypedTerm Syntax.BooleanPrimary
booleanPrimaryPredicate x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.BooleanPrimary"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "predicate"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL constructor for hydra.ext.sql.syntax.BooleanTermAnd
booleanTermAnd :: Typed.TypedTerm Syntax.BooleanTerm -> Typed.TypedTerm Syntax.BooleanFactor -> Typed.TypedTerm Syntax.BooleanTermAnd
booleanTermAnd lhs rhs =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.BooleanTermAnd"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "lhs"),
          Model.fieldTerm = (Typed.unTypedTerm lhs)},
        Model.Field {
          Model.fieldName = (Model.Name "rhs"),
          Model.fieldTerm = (Typed.unTypedTerm rhs)}]}))

-- | DSL name token for hydra.ext.sql.syntax.BooleanTermAnd
booleanTermAndBooleanTermAnd :: Typed.TypedName Syntax.BooleanTermAnd
booleanTermAndBooleanTermAnd = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.BooleanTermAnd")

-- | DSL accessor for the lhs field of hydra.ext.sql.syntax.BooleanTermAnd
booleanTermAndLhs :: Typed.TypedTerm Syntax.BooleanTermAnd -> Typed.TypedTerm Syntax.BooleanTerm
booleanTermAndLhs x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.BooleanTermAnd"),
        Model.projectionFieldName = (Model.Name "lhs")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the rhs field of hydra.ext.sql.syntax.BooleanTermAnd
booleanTermAndRhs :: Typed.TypedTerm Syntax.BooleanTermAnd -> Typed.TypedTerm Syntax.BooleanFactor
booleanTermAndRhs x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.BooleanTermAnd"),
        Model.projectionFieldName = (Model.Name "rhs")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL updater for the lhs field of hydra.ext.sql.syntax.BooleanTermAnd
booleanTermAndWithLhs :: Typed.TypedTerm Syntax.BooleanTermAnd -> Typed.TypedTerm Syntax.BooleanTerm -> Typed.TypedTerm Syntax.BooleanTermAnd
booleanTermAndWithLhs original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.BooleanTermAnd"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "lhs"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)},
        Model.Field {
          Model.fieldName = (Model.Name "rhs"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.BooleanTermAnd"),
              Model.projectionFieldName = (Model.Name "rhs")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))

-- | DSL updater for the rhs field of hydra.ext.sql.syntax.BooleanTermAnd
booleanTermAndWithRhs :: Typed.TypedTerm Syntax.BooleanTermAnd -> Typed.TypedTerm Syntax.BooleanFactor -> Typed.TypedTerm Syntax.BooleanTermAnd
booleanTermAndWithRhs original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.BooleanTermAnd"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "lhs"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.BooleanTermAnd"),
              Model.projectionFieldName = (Model.Name "lhs")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "rhs"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))

-- | DSL name token for hydra.ext.sql.syntax.BooleanTerm
booleanTermBooleanTerm :: Typed.TypedName Syntax.BooleanTerm
booleanTermBooleanTerm = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.BooleanTerm")

-- | DSL injection for the conjunction variant of hydra.ext.sql.syntax.BooleanTerm
booleanTermConjunction :: Typed.TypedTerm Syntax.BooleanTermAnd -> Typed.TypedTerm Syntax.BooleanTerm
booleanTermConjunction x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.BooleanTerm"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "conjunction"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the factor variant of hydra.ext.sql.syntax.BooleanTerm
booleanTermFactor :: Typed.TypedTerm Syntax.BooleanFactor -> Typed.TypedTerm Syntax.BooleanTerm
booleanTermFactor x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.BooleanTerm"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "factor"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL constructor for hydra.ext.sql.syntax.BooleanTest
booleanTest :: Typed.TypedTerm Syntax.BooleanPrimary -> Typed.TypedTerm (Maybe Syntax.BooleanTestSequenceOption) -> Typed.TypedTerm Syntax.BooleanTest
booleanTest booleanPrimary sequence =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.BooleanTest"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "BooleanPrimary"),
          Model.fieldTerm = (Typed.unTypedTerm booleanPrimary)},
        Model.Field {
          Model.fieldName = (Model.Name "Sequence"),
          Model.fieldTerm = (Typed.unTypedTerm sequence)}]}))

-- | DSL accessor for the BooleanPrimary field of hydra.ext.sql.syntax.BooleanTest
booleanTestBooleanPrimary :: Typed.TypedTerm Syntax.BooleanTest -> Typed.TypedTerm Syntax.BooleanPrimary
booleanTestBooleanPrimary x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.BooleanTest"),
        Model.projectionFieldName = (Model.Name "BooleanPrimary")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.BooleanTest
booleanTestBooleanTest :: Typed.TypedName Syntax.BooleanTest
booleanTestBooleanTest = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.BooleanTest")

-- | DSL accessor for the Sequence field of hydra.ext.sql.syntax.BooleanTest
booleanTestSequence :: Typed.TypedTerm Syntax.BooleanTest -> Typed.TypedTerm (Maybe Syntax.BooleanTestSequenceOption)
booleanTestSequence x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.BooleanTest"),
        Model.projectionFieldName = (Model.Name "Sequence")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL constructor for hydra.ext.sql.syntax.BooleanTestSequenceOption
booleanTestSequenceOption :: Typed.TypedTerm (Maybe ()) -> Typed.TypedTerm Syntax.TruthValue -> Typed.TypedTerm Syntax.BooleanTestSequenceOption
booleanTestSequenceOption nOT truthValue =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.BooleanTestSequenceOption"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "NOT"),
          Model.fieldTerm = (Typed.unTypedTerm nOT)},
        Model.Field {
          Model.fieldName = (Model.Name "TruthValue"),
          Model.fieldTerm = (Typed.unTypedTerm truthValue)}]}))

-- | DSL name token for hydra.ext.sql.syntax.BooleanTestSequenceOption
booleanTestSequenceOptionBooleanTestSequenceOption :: Typed.TypedName Syntax.BooleanTestSequenceOption
booleanTestSequenceOptionBooleanTestSequenceOption =
    Typed.TypedName (Model.Name "hydra.ext.sql.syntax.BooleanTestSequenceOption")

-- | DSL accessor for the NOT field of hydra.ext.sql.syntax.BooleanTestSequenceOption
booleanTestSequenceOptionNOT :: Typed.TypedTerm Syntax.BooleanTestSequenceOption -> Typed.TypedTerm (Maybe ())
booleanTestSequenceOptionNOT x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.BooleanTestSequenceOption"),
        Model.projectionFieldName = (Model.Name "NOT")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the TruthValue field of hydra.ext.sql.syntax.BooleanTestSequenceOption
booleanTestSequenceOptionTruthValue :: Typed.TypedTerm Syntax.BooleanTestSequenceOption -> Typed.TypedTerm Syntax.TruthValue
booleanTestSequenceOptionTruthValue x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.BooleanTestSequenceOption"),
        Model.projectionFieldName = (Model.Name "TruthValue")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL updater for the NOT field of hydra.ext.sql.syntax.BooleanTestSequenceOption
booleanTestSequenceOptionWithNOT :: Typed.TypedTerm Syntax.BooleanTestSequenceOption -> Typed.TypedTerm (Maybe ()) -> Typed.TypedTerm Syntax.BooleanTestSequenceOption
booleanTestSequenceOptionWithNOT original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.BooleanTestSequenceOption"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "NOT"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)},
        Model.Field {
          Model.fieldName = (Model.Name "TruthValue"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.BooleanTestSequenceOption"),
              Model.projectionFieldName = (Model.Name "TruthValue")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))

-- | DSL updater for the TruthValue field of hydra.ext.sql.syntax.BooleanTestSequenceOption
booleanTestSequenceOptionWithTruthValue :: Typed.TypedTerm Syntax.BooleanTestSequenceOption -> Typed.TypedTerm Syntax.TruthValue -> Typed.TypedTerm Syntax.BooleanTestSequenceOption
booleanTestSequenceOptionWithTruthValue original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.BooleanTestSequenceOption"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "NOT"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.BooleanTestSequenceOption"),
              Model.projectionFieldName = (Model.Name "NOT")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "TruthValue"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))

-- | DSL updater for the BooleanPrimary field of hydra.ext.sql.syntax.BooleanTest
booleanTestWithBooleanPrimary :: Typed.TypedTerm Syntax.BooleanTest -> Typed.TypedTerm Syntax.BooleanPrimary -> Typed.TypedTerm Syntax.BooleanTest
booleanTestWithBooleanPrimary original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.BooleanTest"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "BooleanPrimary"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)},
        Model.Field {
          Model.fieldName = (Model.Name "Sequence"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.BooleanTest"),
              Model.projectionFieldName = (Model.Name "Sequence")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))

-- | DSL updater for the Sequence field of hydra.ext.sql.syntax.BooleanTest
booleanTestWithSequence :: Typed.TypedTerm Syntax.BooleanTest -> Typed.TypedTerm (Maybe Syntax.BooleanTestSequenceOption) -> Typed.TypedTerm Syntax.BooleanTest
booleanTestWithSequence original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.BooleanTest"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "BooleanPrimary"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.BooleanTest"),
              Model.projectionFieldName = (Model.Name "BooleanPrimary")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "Sequence"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))

-- | DSL constructor for the hydra.ext.sql.syntax.BooleanType wrapper
booleanType :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.BooleanType
booleanType x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.BooleanType"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.BooleanType
booleanTypeBooleanType :: Typed.TypedName Syntax.BooleanType
booleanTypeBooleanType = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.BooleanType")

-- | DSL name token for hydra.ext.sql.syntax.BooleanValueExpression
booleanValueExpressionBooleanValueExpression :: Typed.TypedName Syntax.BooleanValueExpression
booleanValueExpressionBooleanValueExpression = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.BooleanValueExpression")

-- | DSL injection for the disjunction variant of hydra.ext.sql.syntax.BooleanValueExpression
booleanValueExpressionDisjunction :: Typed.TypedTerm Syntax.BooleanValueExpressionOr -> Typed.TypedTerm Syntax.BooleanValueExpression
booleanValueExpressionDisjunction x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.BooleanValueExpression"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "disjunction"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL constructor for hydra.ext.sql.syntax.BooleanValueExpressionOr
booleanValueExpressionOr :: Typed.TypedTerm Syntax.BooleanValueExpression -> Typed.TypedTerm Syntax.BooleanTerm -> Typed.TypedTerm Syntax.BooleanValueExpressionOr
booleanValueExpressionOr lhs rhs =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.BooleanValueExpressionOr"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "lhs"),
          Model.fieldTerm = (Typed.unTypedTerm lhs)},
        Model.Field {
          Model.fieldName = (Model.Name "rhs"),
          Model.fieldTerm = (Typed.unTypedTerm rhs)}]}))

-- | DSL name token for hydra.ext.sql.syntax.BooleanValueExpressionOr
booleanValueExpressionOrBooleanValueExpressionOr :: Typed.TypedName Syntax.BooleanValueExpressionOr
booleanValueExpressionOrBooleanValueExpressionOr =
    Typed.TypedName (Model.Name "hydra.ext.sql.syntax.BooleanValueExpressionOr")

-- | DSL accessor for the lhs field of hydra.ext.sql.syntax.BooleanValueExpressionOr
booleanValueExpressionOrLhs :: Typed.TypedTerm Syntax.BooleanValueExpressionOr -> Typed.TypedTerm Syntax.BooleanValueExpression
booleanValueExpressionOrLhs x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.BooleanValueExpressionOr"),
        Model.projectionFieldName = (Model.Name "lhs")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the rhs field of hydra.ext.sql.syntax.BooleanValueExpressionOr
booleanValueExpressionOrRhs :: Typed.TypedTerm Syntax.BooleanValueExpressionOr -> Typed.TypedTerm Syntax.BooleanTerm
booleanValueExpressionOrRhs x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.BooleanValueExpressionOr"),
        Model.projectionFieldName = (Model.Name "rhs")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL updater for the lhs field of hydra.ext.sql.syntax.BooleanValueExpressionOr
booleanValueExpressionOrWithLhs :: Typed.TypedTerm Syntax.BooleanValueExpressionOr -> Typed.TypedTerm Syntax.BooleanValueExpression -> Typed.TypedTerm Syntax.BooleanValueExpressionOr
booleanValueExpressionOrWithLhs original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.BooleanValueExpressionOr"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "lhs"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)},
        Model.Field {
          Model.fieldName = (Model.Name "rhs"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.BooleanValueExpressionOr"),
              Model.projectionFieldName = (Model.Name "rhs")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))

-- | DSL updater for the rhs field of hydra.ext.sql.syntax.BooleanValueExpressionOr
booleanValueExpressionOrWithRhs :: Typed.TypedTerm Syntax.BooleanValueExpressionOr -> Typed.TypedTerm Syntax.BooleanTerm -> Typed.TypedTerm Syntax.BooleanValueExpressionOr
booleanValueExpressionOrWithRhs original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.BooleanValueExpressionOr"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "lhs"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.BooleanValueExpressionOr"),
              Model.projectionFieldName = (Model.Name "lhs")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "rhs"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))

-- | DSL injection for the term variant of hydra.ext.sql.syntax.BooleanValueExpression
booleanValueExpressionTerm :: Typed.TypedTerm Syntax.BooleanTerm -> Typed.TypedTerm Syntax.BooleanValueExpression
booleanValueExpressionTerm x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.BooleanValueExpression"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "term"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL constructor for the hydra.ext.sql.syntax.CaseExpression wrapper
caseExpression :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.CaseExpression
caseExpression x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.CaseExpression"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.CaseExpression
caseExpressionCaseExpression :: Typed.TypedName Syntax.CaseExpression
caseExpressionCaseExpression = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.CaseExpression")

-- | DSL constructor for the hydra.ext.sql.syntax.CastSpecification wrapper
castSpecification :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.CastSpecification
castSpecification x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.CastSpecification"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.CastSpecification
castSpecificationCastSpecification :: Typed.TypedName Syntax.CastSpecification
castSpecificationCastSpecification = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.CastSpecification")

-- | DSL constructor for the hydra.ext.sql.syntax.CharacterSetSpecification wrapper
characterSetSpecification :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.CharacterSetSpecification
characterSetSpecification x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.CharacterSetSpecification"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.CharacterSetSpecification
characterSetSpecificationCharacterSetSpecification :: Typed.TypedName Syntax.CharacterSetSpecification
characterSetSpecificationCharacterSetSpecification =
    Typed.TypedName (Model.Name "hydra.ext.sql.syntax.CharacterSetSpecification")

-- | DSL constructor for the hydra.ext.sql.syntax.CharacterStringLiteral wrapper
characterStringLiteral :: Typed.TypedTerm String -> Typed.TypedTerm Syntax.CharacterStringLiteral
characterStringLiteral x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.CharacterStringLiteral"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.CharacterStringLiteral
characterStringLiteralCharacterStringLiteral :: Typed.TypedName Syntax.CharacterStringLiteral
characterStringLiteralCharacterStringLiteral = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.CharacterStringLiteral")

-- | DSL injection for the char variant of hydra.ext.sql.syntax.CharacterStringType
characterStringTypeChar :: Typed.TypedTerm (Maybe Syntax.Length) -> Typed.TypedTerm Syntax.CharacterStringType
characterStringTypeChar x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.CharacterStringType"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "char"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the charLargeObject variant of hydra.ext.sql.syntax.CharacterStringType
characterStringTypeCharLargeObject :: Typed.TypedTerm (Maybe Syntax.LargeObjectLength) -> Typed.TypedTerm Syntax.CharacterStringType
characterStringTypeCharLargeObject x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.CharacterStringType"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "charLargeObject"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the charVarying variant of hydra.ext.sql.syntax.CharacterStringType
characterStringTypeCharVarying :: Typed.TypedTerm Syntax.Length -> Typed.TypedTerm Syntax.CharacterStringType
characterStringTypeCharVarying x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.CharacterStringType"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "charVarying"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the character variant of hydra.ext.sql.syntax.CharacterStringType
characterStringTypeCharacter :: Typed.TypedTerm (Maybe Syntax.Length) -> Typed.TypedTerm Syntax.CharacterStringType
characterStringTypeCharacter x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.CharacterStringType"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "character"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the characterLargeObject variant of hydra.ext.sql.syntax.CharacterStringType
characterStringTypeCharacterLargeObject :: Typed.TypedTerm (Maybe Syntax.LargeObjectLength) -> Typed.TypedTerm Syntax.CharacterStringType
characterStringTypeCharacterLargeObject x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.CharacterStringType"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "characterLargeObject"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL name token for hydra.ext.sql.syntax.CharacterStringType
characterStringTypeCharacterStringType :: Typed.TypedName Syntax.CharacterStringType
characterStringTypeCharacterStringType = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.CharacterStringType")

-- | DSL injection for the characterVarying variant of hydra.ext.sql.syntax.CharacterStringType
characterStringTypeCharacterVarying :: Typed.TypedTerm Syntax.Length -> Typed.TypedTerm Syntax.CharacterStringType
characterStringTypeCharacterVarying x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.CharacterStringType"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "characterVarying"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the clob variant of hydra.ext.sql.syntax.CharacterStringType
characterStringTypeClob :: Typed.TypedTerm (Maybe Syntax.LargeObjectLength) -> Typed.TypedTerm Syntax.CharacterStringType
characterStringTypeClob x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.CharacterStringType"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "clob"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the varchar variant of hydra.ext.sql.syntax.CharacterStringType
characterStringTypeVarchar :: Typed.TypedTerm Syntax.Length -> Typed.TypedTerm Syntax.CharacterStringType
characterStringTypeVarchar x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.CharacterStringType"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "varchar"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL constructor for the hydra.ext.sql.syntax.CollateClause wrapper
collateClause :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.CollateClause
collateClause x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.CollateClause"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.CollateClause
collateClauseCollateClause :: Typed.TypedName Syntax.CollateClause
collateClauseCollateClause = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.CollateClause")

-- | DSL injection for the array variant of hydra.ext.sql.syntax.CollectionType
collectionTypeArray :: Typed.TypedTerm Syntax.ArrayType -> Typed.TypedTerm Syntax.CollectionType
collectionTypeArray x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.CollectionType"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "array"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL name token for hydra.ext.sql.syntax.CollectionType
collectionTypeCollectionType :: Typed.TypedName Syntax.CollectionType
collectionTypeCollectionType = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.CollectionType")

-- | DSL injection for the multiset variant of hydra.ext.sql.syntax.CollectionType
collectionTypeMultiset :: Typed.TypedTerm Syntax.MultisetType -> Typed.TypedTerm Syntax.CollectionType
collectionTypeMultiset x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.CollectionType"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "multiset"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the array variant of hydra.ext.sql.syntax.CollectionValueConstructor
collectionValueConstructorArray :: Typed.TypedTerm Syntax.ArrayValueConstructor -> Typed.TypedTerm Syntax.CollectionValueConstructor
collectionValueConstructorArray x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.CollectionValueConstructor"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "array"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL name token for hydra.ext.sql.syntax.CollectionValueConstructor
collectionValueConstructorCollectionValueConstructor :: Typed.TypedName Syntax.CollectionValueConstructor
collectionValueConstructorCollectionValueConstructor =
    Typed.TypedName (Model.Name "hydra.ext.sql.syntax.CollectionValueConstructor")

-- | DSL injection for the multiset variant of hydra.ext.sql.syntax.CollectionValueConstructor
collectionValueConstructorMultiset :: Typed.TypedTerm Syntax.MultisetValueConstructor -> Typed.TypedTerm Syntax.CollectionValueConstructor
collectionValueConstructorMultiset x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.CollectionValueConstructor"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "multiset"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the array variant of hydra.ext.sql.syntax.CollectionValueExpression
collectionValueExpressionArray :: Typed.TypedTerm Syntax.ArrayValueExpression -> Typed.TypedTerm Syntax.CollectionValueExpression
collectionValueExpressionArray x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.CollectionValueExpression"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "array"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL name token for hydra.ext.sql.syntax.CollectionValueExpression
collectionValueExpressionCollectionValueExpression :: Typed.TypedName Syntax.CollectionValueExpression
collectionValueExpressionCollectionValueExpression =
    Typed.TypedName (Model.Name "hydra.ext.sql.syntax.CollectionValueExpression")

-- | DSL injection for the multiset variant of hydra.ext.sql.syntax.CollectionValueExpression
collectionValueExpressionMultiset :: Typed.TypedTerm Syntax.MultisetValueExpression -> Typed.TypedTerm Syntax.CollectionValueExpression
collectionValueExpressionMultiset x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.CollectionValueExpression"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "multiset"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL constructor for the hydra.ext.sql.syntax.ColumnConstraintDefinition wrapper
columnConstraintDefinition :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.ColumnConstraintDefinition
columnConstraintDefinition x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnConstraintDefinition"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.ColumnConstraintDefinition
columnConstraintDefinitionColumnConstraintDefinition :: Typed.TypedName Syntax.ColumnConstraintDefinition
columnConstraintDefinitionColumnConstraintDefinition =
    Typed.TypedName (Model.Name "hydra.ext.sql.syntax.ColumnConstraintDefinition")

-- | DSL constructor for hydra.ext.sql.syntax.ColumnDefinition
columnDefinition :: Typed.TypedTerm Syntax.ColumnName -> Typed.TypedTerm (Maybe Syntax.ColumnDefinitionTypeOrDomainOption) -> Typed.TypedTerm (Maybe Syntax.ReferenceScopeCheck) -> Typed.TypedTerm (Maybe Syntax.ColumnDefinitionDefaultOrIdentityOrGenerationOption) -> Typed.TypedTerm [Syntax.ColumnConstraintDefinition] -> Typed.TypedTerm (Maybe Syntax.CollateClause) -> Typed.TypedTerm Syntax.ColumnDefinition
columnDefinition name typeOrDomain refScope defaultOrIdentityOrGeneration constraints collate =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnDefinition"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "name"),
          Model.fieldTerm = (Typed.unTypedTerm name)},
        Model.Field {
          Model.fieldName = (Model.Name "typeOrDomain"),
          Model.fieldTerm = (Typed.unTypedTerm typeOrDomain)},
        Model.Field {
          Model.fieldName = (Model.Name "refScope"),
          Model.fieldTerm = (Typed.unTypedTerm refScope)},
        Model.Field {
          Model.fieldName = (Model.Name "defaultOrIdentityOrGeneration"),
          Model.fieldTerm = (Typed.unTypedTerm defaultOrIdentityOrGeneration)},
        Model.Field {
          Model.fieldName = (Model.Name "constraints"),
          Model.fieldTerm = (Typed.unTypedTerm constraints)},
        Model.Field {
          Model.fieldName = (Model.Name "collate"),
          Model.fieldTerm = (Typed.unTypedTerm collate)}]}))

-- | DSL accessor for the collate field of hydra.ext.sql.syntax.ColumnDefinition
columnDefinitionCollate :: Typed.TypedTerm Syntax.ColumnDefinition -> Typed.TypedTerm (Maybe Syntax.CollateClause)
columnDefinitionCollate x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnDefinition"),
        Model.projectionFieldName = (Model.Name "collate")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.ColumnDefinition
columnDefinitionColumnDefinition :: Typed.TypedName Syntax.ColumnDefinition
columnDefinitionColumnDefinition = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.ColumnDefinition")

-- | DSL accessor for the constraints field of hydra.ext.sql.syntax.ColumnDefinition
columnDefinitionConstraints :: Typed.TypedTerm Syntax.ColumnDefinition -> Typed.TypedTerm [Syntax.ColumnConstraintDefinition]
columnDefinitionConstraints x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnDefinition"),
        Model.projectionFieldName = (Model.Name "constraints")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the defaultOrIdentityOrGeneration field of hydra.ext.sql.syntax.ColumnDefinition
columnDefinitionDefaultOrIdentityOrGeneration :: Typed.TypedTerm Syntax.ColumnDefinition -> Typed.TypedTerm (Maybe Syntax.ColumnDefinitionDefaultOrIdentityOrGenerationOption)
columnDefinitionDefaultOrIdentityOrGeneration x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnDefinition"),
        Model.projectionFieldName = (Model.Name "defaultOrIdentityOrGeneration")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.ColumnDefinitionDefaultOrIdentityOrGenerationOption
columnDefinitionDefaultOrIdentityOrGenerationOptionColumnDefinitionDefaultOrIdentityOrGenerationOption :: Typed.TypedName Syntax.ColumnDefinitionDefaultOrIdentityOrGenerationOption
columnDefinitionDefaultOrIdentityOrGenerationOptionColumnDefinitionDefaultOrIdentityOrGenerationOption =
    Typed.TypedName (Model.Name "hydra.ext.sql.syntax.ColumnDefinitionDefaultOrIdentityOrGenerationOption")

-- | DSL injection for the DefaultClause variant of hydra.ext.sql.syntax.ColumnDefinitionDefaultOrIdentityOrGenerationOption
columnDefinitionDefaultOrIdentityOrGenerationOptionDefaultClause :: Typed.TypedTerm Syntax.DefaultClause -> Typed.TypedTerm Syntax.ColumnDefinitionDefaultOrIdentityOrGenerationOption
columnDefinitionDefaultOrIdentityOrGenerationOptionDefaultClause x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnDefinitionDefaultOrIdentityOrGenerationOption"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "DefaultClause"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the GenerationClause variant of hydra.ext.sql.syntax.ColumnDefinitionDefaultOrIdentityOrGenerationOption
columnDefinitionDefaultOrIdentityOrGenerationOptionGenerationClause :: Typed.TypedTerm Syntax.GenerationClause -> Typed.TypedTerm Syntax.ColumnDefinitionDefaultOrIdentityOrGenerationOption
columnDefinitionDefaultOrIdentityOrGenerationOptionGenerationClause x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnDefinitionDefaultOrIdentityOrGenerationOption"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "GenerationClause"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the IdentityColumnSpecification variant of hydra.ext.sql.syntax.ColumnDefinitionDefaultOrIdentityOrGenerationOption
columnDefinitionDefaultOrIdentityOrGenerationOptionIdentityColumnSpecification :: Typed.TypedTerm Syntax.IdentityColumnSpecification -> Typed.TypedTerm Syntax.ColumnDefinitionDefaultOrIdentityOrGenerationOption
columnDefinitionDefaultOrIdentityOrGenerationOptionIdentityColumnSpecification x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnDefinitionDefaultOrIdentityOrGenerationOption"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "IdentityColumnSpecification"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL accessor for the name field of hydra.ext.sql.syntax.ColumnDefinition
columnDefinitionName :: Typed.TypedTerm Syntax.ColumnDefinition -> Typed.TypedTerm Syntax.ColumnName
columnDefinitionName x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnDefinition"),
        Model.projectionFieldName = (Model.Name "name")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the refScope field of hydra.ext.sql.syntax.ColumnDefinition
columnDefinitionRefScope :: Typed.TypedTerm Syntax.ColumnDefinition -> Typed.TypedTerm (Maybe Syntax.ReferenceScopeCheck)
columnDefinitionRefScope x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnDefinition"),
        Model.projectionFieldName = (Model.Name "refScope")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the typeOrDomain field of hydra.ext.sql.syntax.ColumnDefinition
columnDefinitionTypeOrDomain :: Typed.TypedTerm Syntax.ColumnDefinition -> Typed.TypedTerm (Maybe Syntax.ColumnDefinitionTypeOrDomainOption)
columnDefinitionTypeOrDomain x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnDefinition"),
        Model.projectionFieldName = (Model.Name "typeOrDomain")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.ColumnDefinitionTypeOrDomainOption
columnDefinitionTypeOrDomainOptionColumnDefinitionTypeOrDomainOption :: Typed.TypedName Syntax.ColumnDefinitionTypeOrDomainOption
columnDefinitionTypeOrDomainOptionColumnDefinitionTypeOrDomainOption =
    Typed.TypedName (Model.Name "hydra.ext.sql.syntax.ColumnDefinitionTypeOrDomainOption")

-- | DSL injection for the DataType variant of hydra.ext.sql.syntax.ColumnDefinitionTypeOrDomainOption
columnDefinitionTypeOrDomainOptionDataType :: Typed.TypedTerm Syntax.DataType -> Typed.TypedTerm Syntax.ColumnDefinitionTypeOrDomainOption
columnDefinitionTypeOrDomainOptionDataType x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnDefinitionTypeOrDomainOption"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "DataType"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the DomainName variant of hydra.ext.sql.syntax.ColumnDefinitionTypeOrDomainOption
columnDefinitionTypeOrDomainOptionDomainName :: Typed.TypedTerm Syntax.DomainName -> Typed.TypedTerm Syntax.ColumnDefinitionTypeOrDomainOption
columnDefinitionTypeOrDomainOptionDomainName x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnDefinitionTypeOrDomainOption"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "DomainName"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL updater for the collate field of hydra.ext.sql.syntax.ColumnDefinition
columnDefinitionWithCollate :: Typed.TypedTerm Syntax.ColumnDefinition -> Typed.TypedTerm (Maybe Syntax.CollateClause) -> Typed.TypedTerm Syntax.ColumnDefinition
columnDefinitionWithCollate original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnDefinition"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "name"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnDefinition"),
              Model.projectionFieldName = (Model.Name "name")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "typeOrDomain"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnDefinition"),
              Model.projectionFieldName = (Model.Name "typeOrDomain")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "refScope"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnDefinition"),
              Model.projectionFieldName = (Model.Name "refScope")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "defaultOrIdentityOrGeneration"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnDefinition"),
              Model.projectionFieldName = (Model.Name "defaultOrIdentityOrGeneration")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "constraints"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnDefinition"),
              Model.projectionFieldName = (Model.Name "constraints")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "collate"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))

-- | DSL updater for the constraints field of hydra.ext.sql.syntax.ColumnDefinition
columnDefinitionWithConstraints :: Typed.TypedTerm Syntax.ColumnDefinition -> Typed.TypedTerm [Syntax.ColumnConstraintDefinition] -> Typed.TypedTerm Syntax.ColumnDefinition
columnDefinitionWithConstraints original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnDefinition"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "name"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnDefinition"),
              Model.projectionFieldName = (Model.Name "name")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "typeOrDomain"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnDefinition"),
              Model.projectionFieldName = (Model.Name "typeOrDomain")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "refScope"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnDefinition"),
              Model.projectionFieldName = (Model.Name "refScope")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "defaultOrIdentityOrGeneration"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnDefinition"),
              Model.projectionFieldName = (Model.Name "defaultOrIdentityOrGeneration")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "constraints"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)},
        Model.Field {
          Model.fieldName = (Model.Name "collate"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnDefinition"),
              Model.projectionFieldName = (Model.Name "collate")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))

-- | DSL updater for the defaultOrIdentityOrGeneration field of hydra.ext.sql.syntax.ColumnDefinition
columnDefinitionWithDefaultOrIdentityOrGeneration :: Typed.TypedTerm Syntax.ColumnDefinition -> Typed.TypedTerm (Maybe Syntax.ColumnDefinitionDefaultOrIdentityOrGenerationOption) -> Typed.TypedTerm Syntax.ColumnDefinition
columnDefinitionWithDefaultOrIdentityOrGeneration original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnDefinition"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "name"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnDefinition"),
              Model.projectionFieldName = (Model.Name "name")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "typeOrDomain"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnDefinition"),
              Model.projectionFieldName = (Model.Name "typeOrDomain")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "refScope"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnDefinition"),
              Model.projectionFieldName = (Model.Name "refScope")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "defaultOrIdentityOrGeneration"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)},
        Model.Field {
          Model.fieldName = (Model.Name "constraints"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnDefinition"),
              Model.projectionFieldName = (Model.Name "constraints")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "collate"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnDefinition"),
              Model.projectionFieldName = (Model.Name "collate")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))

-- | DSL updater for the name field of hydra.ext.sql.syntax.ColumnDefinition
columnDefinitionWithName :: Typed.TypedTerm Syntax.ColumnDefinition -> Typed.TypedTerm Syntax.ColumnName -> Typed.TypedTerm Syntax.ColumnDefinition
columnDefinitionWithName original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnDefinition"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "name"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)},
        Model.Field {
          Model.fieldName = (Model.Name "typeOrDomain"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnDefinition"),
              Model.projectionFieldName = (Model.Name "typeOrDomain")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "refScope"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnDefinition"),
              Model.projectionFieldName = (Model.Name "refScope")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "defaultOrIdentityOrGeneration"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnDefinition"),
              Model.projectionFieldName = (Model.Name "defaultOrIdentityOrGeneration")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "constraints"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnDefinition"),
              Model.projectionFieldName = (Model.Name "constraints")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "collate"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnDefinition"),
              Model.projectionFieldName = (Model.Name "collate")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))

-- | DSL updater for the refScope field of hydra.ext.sql.syntax.ColumnDefinition
columnDefinitionWithRefScope :: Typed.TypedTerm Syntax.ColumnDefinition -> Typed.TypedTerm (Maybe Syntax.ReferenceScopeCheck) -> Typed.TypedTerm Syntax.ColumnDefinition
columnDefinitionWithRefScope original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnDefinition"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "name"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnDefinition"),
              Model.projectionFieldName = (Model.Name "name")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "typeOrDomain"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnDefinition"),
              Model.projectionFieldName = (Model.Name "typeOrDomain")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "refScope"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)},
        Model.Field {
          Model.fieldName = (Model.Name "defaultOrIdentityOrGeneration"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnDefinition"),
              Model.projectionFieldName = (Model.Name "defaultOrIdentityOrGeneration")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "constraints"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnDefinition"),
              Model.projectionFieldName = (Model.Name "constraints")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "collate"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnDefinition"),
              Model.projectionFieldName = (Model.Name "collate")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))

-- | DSL updater for the typeOrDomain field of hydra.ext.sql.syntax.ColumnDefinition
columnDefinitionWithTypeOrDomain :: Typed.TypedTerm Syntax.ColumnDefinition -> Typed.TypedTerm (Maybe Syntax.ColumnDefinitionTypeOrDomainOption) -> Typed.TypedTerm Syntax.ColumnDefinition
columnDefinitionWithTypeOrDomain original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnDefinition"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "name"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnDefinition"),
              Model.projectionFieldName = (Model.Name "name")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "typeOrDomain"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)},
        Model.Field {
          Model.fieldName = (Model.Name "refScope"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnDefinition"),
              Model.projectionFieldName = (Model.Name "refScope")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "defaultOrIdentityOrGeneration"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnDefinition"),
              Model.projectionFieldName = (Model.Name "defaultOrIdentityOrGeneration")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "constraints"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnDefinition"),
              Model.projectionFieldName = (Model.Name "constraints")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "collate"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnDefinition"),
              Model.projectionFieldName = (Model.Name "collate")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))

-- | DSL constructor for the hydra.ext.sql.syntax.ColumnName wrapper
columnName :: Typed.TypedTerm String -> Typed.TypedTerm Syntax.ColumnName
columnName x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnName"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.ColumnName
columnNameColumnName :: Typed.TypedName Syntax.ColumnName
columnNameColumnName = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.ColumnName")

-- | DSL constructor for hydra.ext.sql.syntax.ColumnNameList
columnNameList :: Typed.TypedTerm Syntax.ColumnName -> Typed.TypedTerm [Syntax.ColumnName] -> Typed.TypedTerm Syntax.ColumnNameList
columnNameList first rest =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnNameList"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "first"),
          Model.fieldTerm = (Typed.unTypedTerm first)},
        Model.Field {
          Model.fieldName = (Model.Name "rest"),
          Model.fieldTerm = (Typed.unTypedTerm rest)}]}))

-- | DSL name token for hydra.ext.sql.syntax.ColumnNameList
columnNameListColumnNameList :: Typed.TypedName Syntax.ColumnNameList
columnNameListColumnNameList = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.ColumnNameList")

-- | DSL accessor for the first field of hydra.ext.sql.syntax.ColumnNameList
columnNameListFirst :: Typed.TypedTerm Syntax.ColumnNameList -> Typed.TypedTerm Syntax.ColumnName
columnNameListFirst x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnNameList"),
        Model.projectionFieldName = (Model.Name "first")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the rest field of hydra.ext.sql.syntax.ColumnNameList
columnNameListRest :: Typed.TypedTerm Syntax.ColumnNameList -> Typed.TypedTerm [Syntax.ColumnName]
columnNameListRest x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnNameList"),
        Model.projectionFieldName = (Model.Name "rest")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL updater for the first field of hydra.ext.sql.syntax.ColumnNameList
columnNameListWithFirst :: Typed.TypedTerm Syntax.ColumnNameList -> Typed.TypedTerm Syntax.ColumnName -> Typed.TypedTerm Syntax.ColumnNameList
columnNameListWithFirst original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnNameList"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "first"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)},
        Model.Field {
          Model.fieldName = (Model.Name "rest"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnNameList"),
              Model.projectionFieldName = (Model.Name "rest")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))

-- | DSL updater for the rest field of hydra.ext.sql.syntax.ColumnNameList
columnNameListWithRest :: Typed.TypedTerm Syntax.ColumnNameList -> Typed.TypedTerm [Syntax.ColumnName] -> Typed.TypedTerm Syntax.ColumnNameList
columnNameListWithRest original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnNameList"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "first"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnNameList"),
              Model.projectionFieldName = (Model.Name "first")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "rest"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))

-- | DSL constructor for the hydra.ext.sql.syntax.ColumnOptions wrapper
columnOptions :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.ColumnOptions
columnOptions x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnOptions"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.ColumnOptions
columnOptionsColumnOptions :: Typed.TypedName Syntax.ColumnOptions
columnOptionsColumnOptions = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.ColumnOptions")

-- | DSL constructor for the hydra.ext.sql.syntax.ColumnReference wrapper
columnReference :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.ColumnReference
columnReference x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.ColumnReference"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.ColumnReference
columnReferenceColumnReference :: Typed.TypedName Syntax.ColumnReference
columnReferenceColumnReference = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.ColumnReference")

-- | DSL injection for the collection variant of hydra.ext.sql.syntax.CommonValueExpression
commonValueExpressionCollection :: Typed.TypedTerm Syntax.CollectionValueExpression -> Typed.TypedTerm Syntax.CommonValueExpression
commonValueExpressionCollection x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.CommonValueExpression"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "collection"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL name token for hydra.ext.sql.syntax.CommonValueExpression
commonValueExpressionCommonValueExpression :: Typed.TypedName Syntax.CommonValueExpression
commonValueExpressionCommonValueExpression = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.CommonValueExpression")

-- | DSL injection for the datetime variant of hydra.ext.sql.syntax.CommonValueExpression
commonValueExpressionDatetime :: Typed.TypedTerm Syntax.DatetimeValueExpression -> Typed.TypedTerm Syntax.CommonValueExpression
commonValueExpressionDatetime x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.CommonValueExpression"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "datetime"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the interval variant of hydra.ext.sql.syntax.CommonValueExpression
commonValueExpressionInterval :: Typed.TypedTerm Syntax.IntervalValueExpression -> Typed.TypedTerm Syntax.CommonValueExpression
commonValueExpressionInterval x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.CommonValueExpression"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "interval"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the numeric variant of hydra.ext.sql.syntax.CommonValueExpression
commonValueExpressionNumeric :: Typed.TypedTerm Syntax.NumericValueExpression -> Typed.TypedTerm Syntax.CommonValueExpression
commonValueExpressionNumeric x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.CommonValueExpression"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "numeric"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the reference variant of hydra.ext.sql.syntax.CommonValueExpression
commonValueExpressionReference :: Typed.TypedTerm Syntax.ReferenceValueExpression -> Typed.TypedTerm Syntax.CommonValueExpression
commonValueExpressionReference x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.CommonValueExpression"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "reference"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the string variant of hydra.ext.sql.syntax.CommonValueExpression
commonValueExpressionString :: Typed.TypedTerm Syntax.StringValueExpression -> Typed.TypedTerm Syntax.CommonValueExpression
commonValueExpressionString x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.CommonValueExpression"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "string"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the userDefined variant of hydra.ext.sql.syntax.CommonValueExpression
commonValueExpressionUserDefined :: Typed.TypedTerm Syntax.UserDefinedTypeValueExpression -> Typed.TypedTerm Syntax.CommonValueExpression
commonValueExpressionUserDefined x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.CommonValueExpression"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "userDefined"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL constructor for the hydra.ext.sql.syntax.ContextuallyTypedRowValueConstructor wrapper
contextuallyTypedRowValueConstructor :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.ContextuallyTypedRowValueConstructor
contextuallyTypedRowValueConstructor x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.ContextuallyTypedRowValueConstructor"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.ContextuallyTypedRowValueConstructor
contextuallyTypedRowValueConstructorContextuallyTypedRowValueConstructor :: Typed.TypedName Syntax.ContextuallyTypedRowValueConstructor
contextuallyTypedRowValueConstructorContextuallyTypedRowValueConstructor =
    Typed.TypedName (Model.Name "hydra.ext.sql.syntax.ContextuallyTypedRowValueConstructor")

-- | DSL injection for the constructor variant of hydra.ext.sql.syntax.ContextuallyTypedRowValueExpression
contextuallyTypedRowValueExpressionConstructor :: Typed.TypedTerm Syntax.ContextuallyTypedRowValueConstructor -> Typed.TypedTerm Syntax.ContextuallyTypedRowValueExpression
contextuallyTypedRowValueExpressionConstructor x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.ContextuallyTypedRowValueExpression"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "constructor"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL name token for hydra.ext.sql.syntax.ContextuallyTypedRowValueExpression
contextuallyTypedRowValueExpressionContextuallyTypedRowValueExpression :: Typed.TypedName Syntax.ContextuallyTypedRowValueExpression
contextuallyTypedRowValueExpressionContextuallyTypedRowValueExpression =
    Typed.TypedName (Model.Name "hydra.ext.sql.syntax.ContextuallyTypedRowValueExpression")

-- | DSL constructor for hydra.ext.sql.syntax.ContextuallyTypedRowValueExpressionList
contextuallyTypedRowValueExpressionList :: Typed.TypedTerm Syntax.ContextuallyTypedRowValueExpression -> Typed.TypedTerm [Syntax.ContextuallyTypedRowValueExpression] -> Typed.TypedTerm Syntax.ContextuallyTypedRowValueExpressionList
contextuallyTypedRowValueExpressionList first rest =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.ContextuallyTypedRowValueExpressionList"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "first"),
          Model.fieldTerm = (Typed.unTypedTerm first)},
        Model.Field {
          Model.fieldName = (Model.Name "rest"),
          Model.fieldTerm = (Typed.unTypedTerm rest)}]}))

-- | DSL name token for hydra.ext.sql.syntax.ContextuallyTypedRowValueExpressionList
contextuallyTypedRowValueExpressionListContextuallyTypedRowValueExpressionList :: Typed.TypedName Syntax.ContextuallyTypedRowValueExpressionList
contextuallyTypedRowValueExpressionListContextuallyTypedRowValueExpressionList =
    Typed.TypedName (Model.Name "hydra.ext.sql.syntax.ContextuallyTypedRowValueExpressionList")

-- | DSL accessor for the first field of hydra.ext.sql.syntax.ContextuallyTypedRowValueExpressionList
contextuallyTypedRowValueExpressionListFirst :: Typed.TypedTerm Syntax.ContextuallyTypedRowValueExpressionList -> Typed.TypedTerm Syntax.ContextuallyTypedRowValueExpression
contextuallyTypedRowValueExpressionListFirst x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ContextuallyTypedRowValueExpressionList"),
        Model.projectionFieldName = (Model.Name "first")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the rest field of hydra.ext.sql.syntax.ContextuallyTypedRowValueExpressionList
contextuallyTypedRowValueExpressionListRest :: Typed.TypedTerm Syntax.ContextuallyTypedRowValueExpressionList -> Typed.TypedTerm [Syntax.ContextuallyTypedRowValueExpression]
contextuallyTypedRowValueExpressionListRest x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ContextuallyTypedRowValueExpressionList"),
        Model.projectionFieldName = (Model.Name "rest")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL updater for the first field of hydra.ext.sql.syntax.ContextuallyTypedRowValueExpressionList
contextuallyTypedRowValueExpressionListWithFirst :: Typed.TypedTerm Syntax.ContextuallyTypedRowValueExpressionList -> Typed.TypedTerm Syntax.ContextuallyTypedRowValueExpression -> Typed.TypedTerm Syntax.ContextuallyTypedRowValueExpressionList
contextuallyTypedRowValueExpressionListWithFirst original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.ContextuallyTypedRowValueExpressionList"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "first"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)},
        Model.Field {
          Model.fieldName = (Model.Name "rest"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ContextuallyTypedRowValueExpressionList"),
              Model.projectionFieldName = (Model.Name "rest")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))

-- | DSL updater for the rest field of hydra.ext.sql.syntax.ContextuallyTypedRowValueExpressionList
contextuallyTypedRowValueExpressionListWithRest :: Typed.TypedTerm Syntax.ContextuallyTypedRowValueExpressionList -> Typed.TypedTerm [Syntax.ContextuallyTypedRowValueExpression] -> Typed.TypedTerm Syntax.ContextuallyTypedRowValueExpressionList
contextuallyTypedRowValueExpressionListWithRest original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.ContextuallyTypedRowValueExpressionList"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "first"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ContextuallyTypedRowValueExpressionList"),
              Model.projectionFieldName = (Model.Name "first")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "rest"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))

-- | DSL injection for the specialCase variant of hydra.ext.sql.syntax.ContextuallyTypedRowValueExpression
contextuallyTypedRowValueExpressionSpecialCase :: Typed.TypedTerm Syntax.RowValueSpecialCase -> Typed.TypedTerm Syntax.ContextuallyTypedRowValueExpression
contextuallyTypedRowValueExpressionSpecialCase x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.ContextuallyTypedRowValueExpression"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "specialCase"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL constructor for the hydra.ext.sql.syntax.ContextuallyTypedTableValueConstructor wrapper
contextuallyTypedTableValueConstructor :: Typed.TypedTerm Syntax.ContextuallyTypedRowValueExpressionList -> Typed.TypedTerm Syntax.ContextuallyTypedTableValueConstructor
contextuallyTypedTableValueConstructor x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.ContextuallyTypedTableValueConstructor"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.ContextuallyTypedTableValueConstructor
contextuallyTypedTableValueConstructorContextuallyTypedTableValueConstructor :: Typed.TypedName Syntax.ContextuallyTypedTableValueConstructor
contextuallyTypedTableValueConstructorContextuallyTypedTableValueConstructor =
    Typed.TypedName (Model.Name "hydra.ext.sql.syntax.ContextuallyTypedTableValueConstructor")

-- | DSL injection for the collection variant of hydra.ext.sql.syntax.DataType
dataTypeCollection :: Typed.TypedTerm Syntax.CollectionType -> Typed.TypedTerm Syntax.DataType
dataTypeCollection x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.DataType"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "collection"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL name token for hydra.ext.sql.syntax.DataType
dataTypeDataType :: Typed.TypedName Syntax.DataType
dataTypeDataType = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.DataType")

-- | DSL injection for the named variant of hydra.ext.sql.syntax.DataType
dataTypeNamed :: Typed.TypedTerm Syntax.PathResolvedUserDefinedTypeName -> Typed.TypedTerm Syntax.DataType
dataTypeNamed x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.DataType"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "named"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the predefined variant of hydra.ext.sql.syntax.DataType
dataTypePredefined :: Typed.TypedTerm Syntax.PredefinedType -> Typed.TypedTerm Syntax.DataType
dataTypePredefined x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.DataType"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "predefined"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the reference variant of hydra.ext.sql.syntax.DataType
dataTypeReference :: Typed.TypedTerm Syntax.ReferenceType -> Typed.TypedTerm Syntax.DataType
dataTypeReference x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.DataType"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "reference"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the row variant of hydra.ext.sql.syntax.DataType
dataTypeRow :: Typed.TypedTerm Syntax.RowType -> Typed.TypedTerm Syntax.DataType
dataTypeRow x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.DataType"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "row"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL constructor for the hydra.ext.sql.syntax.DateLiteral wrapper
dateLiteral :: Typed.TypedTerm Syntax.DateString -> Typed.TypedTerm Syntax.DateLiteral
dateLiteral x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.DateLiteral"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.DateLiteral
dateLiteralDateLiteral :: Typed.TypedName Syntax.DateLiteral
dateLiteralDateLiteral = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.DateLiteral")

-- | DSL constructor for the hydra.ext.sql.syntax.DateString wrapper
dateString :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.DateString
dateString x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.DateString"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.DateString
dateStringDateString :: Typed.TypedName Syntax.DateString
dateStringDateString = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.DateString")

-- | DSL injection for the date variant of hydra.ext.sql.syntax.DatetimeLiteral
datetimeLiteralDate :: Typed.TypedTerm Syntax.DateLiteral -> Typed.TypedTerm Syntax.DatetimeLiteral
datetimeLiteralDate x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.DatetimeLiteral"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "date"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL name token for hydra.ext.sql.syntax.DatetimeLiteral
datetimeLiteralDatetimeLiteral :: Typed.TypedName Syntax.DatetimeLiteral
datetimeLiteralDatetimeLiteral = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.DatetimeLiteral")

-- | DSL injection for the time variant of hydra.ext.sql.syntax.DatetimeLiteral
datetimeLiteralTime :: Typed.TypedTerm Syntax.TimeLiteral -> Typed.TypedTerm Syntax.DatetimeLiteral
datetimeLiteralTime x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.DatetimeLiteral"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "time"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the timestamp variant of hydra.ext.sql.syntax.DatetimeLiteral
datetimeLiteralTimestamp :: Typed.TypedTerm Syntax.TimestampLiteral -> Typed.TypedTerm Syntax.DatetimeLiteral
datetimeLiteralTimestamp x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.DatetimeLiteral"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "timestamp"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL constructor for the hydra.ext.sql.syntax.DatetimeType wrapper
datetimeType :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.DatetimeType
datetimeType x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.DatetimeType"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.DatetimeType
datetimeTypeDatetimeType :: Typed.TypedName Syntax.DatetimeType
datetimeTypeDatetimeType = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.DatetimeType")

-- | DSL constructor for the hydra.ext.sql.syntax.DatetimeValueExpression wrapper
datetimeValueExpression :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.DatetimeValueExpression
datetimeValueExpression x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.DatetimeValueExpression"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.DatetimeValueExpression
datetimeValueExpressionDatetimeValueExpression :: Typed.TypedName Syntax.DatetimeValueExpression
datetimeValueExpressionDatetimeValueExpression =
    Typed.TypedName (Model.Name "hydra.ext.sql.syntax.DatetimeValueExpression")

-- | DSL constructor for the hydra.ext.sql.syntax.DefaultClause wrapper
defaultClause :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.DefaultClause
defaultClause x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.DefaultClause"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.DefaultClause
defaultClauseDefaultClause :: Typed.TypedName Syntax.DefaultClause
defaultClauseDefaultClause = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.DefaultClause")

-- | DSL constructor for the hydra.ext.sql.syntax.DomainName wrapper
domainName :: Typed.TypedTerm String -> Typed.TypedTerm Syntax.DomainName
domainName x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.DomainName"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.DomainName
domainNameDomainName :: Typed.TypedName Syntax.DomainName
domainNameDomainName = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.DomainName")

-- | DSL constructor for the hydra.ext.sql.syntax.ExactNumericLiteral wrapper
exactNumericLiteral :: Typed.TypedTerm String -> Typed.TypedTerm Syntax.ExactNumericLiteral
exactNumericLiteral x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.ExactNumericLiteral"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.ExactNumericLiteral
exactNumericLiteralExactNumericLiteral :: Typed.TypedName Syntax.ExactNumericLiteral
exactNumericLiteralExactNumericLiteral = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.ExactNumericLiteral")

-- | DSL injection for the bigint variant of hydra.ext.sql.syntax.ExactNumericType
exactNumericTypeBigint :: Typed.TypedTerm Syntax.ExactNumericType
exactNumericTypeBigint =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.ExactNumericType"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "bigint"),
        Model.fieldTerm = Model.TermUnit}}))

-- | DSL injection for the dec variant of hydra.ext.sql.syntax.ExactNumericType
exactNumericTypeDec :: Typed.TypedTerm (Maybe Syntax.ExactNumericTypeDecOption) -> Typed.TypedTerm Syntax.ExactNumericType
exactNumericTypeDec x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.ExactNumericType"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "dec"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL constructor for hydra.ext.sql.syntax.ExactNumericTypeDecOption
exactNumericTypeDecOption :: Typed.TypedTerm Syntax.Precision -> Typed.TypedTerm (Maybe Syntax.Scale) -> Typed.TypedTerm Syntax.ExactNumericTypeDecOption
exactNumericTypeDecOption precision sequence =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.ExactNumericTypeDecOption"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "Precision"),
          Model.fieldTerm = (Typed.unTypedTerm precision)},
        Model.Field {
          Model.fieldName = (Model.Name "Sequence"),
          Model.fieldTerm = (Typed.unTypedTerm sequence)}]}))

-- | DSL name token for hydra.ext.sql.syntax.ExactNumericTypeDecOption
exactNumericTypeDecOptionExactNumericTypeDecOption :: Typed.TypedName Syntax.ExactNumericTypeDecOption
exactNumericTypeDecOptionExactNumericTypeDecOption =
    Typed.TypedName (Model.Name "hydra.ext.sql.syntax.ExactNumericTypeDecOption")

-- | DSL accessor for the Precision field of hydra.ext.sql.syntax.ExactNumericTypeDecOption
exactNumericTypeDecOptionPrecision :: Typed.TypedTerm Syntax.ExactNumericTypeDecOption -> Typed.TypedTerm Syntax.Precision
exactNumericTypeDecOptionPrecision x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ExactNumericTypeDecOption"),
        Model.projectionFieldName = (Model.Name "Precision")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the Sequence field of hydra.ext.sql.syntax.ExactNumericTypeDecOption
exactNumericTypeDecOptionSequence :: Typed.TypedTerm Syntax.ExactNumericTypeDecOption -> Typed.TypedTerm (Maybe Syntax.Scale)
exactNumericTypeDecOptionSequence x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ExactNumericTypeDecOption"),
        Model.projectionFieldName = (Model.Name "Sequence")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL updater for the Precision field of hydra.ext.sql.syntax.ExactNumericTypeDecOption
exactNumericTypeDecOptionWithPrecision :: Typed.TypedTerm Syntax.ExactNumericTypeDecOption -> Typed.TypedTerm Syntax.Precision -> Typed.TypedTerm Syntax.ExactNumericTypeDecOption
exactNumericTypeDecOptionWithPrecision original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.ExactNumericTypeDecOption"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "Precision"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)},
        Model.Field {
          Model.fieldName = (Model.Name "Sequence"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ExactNumericTypeDecOption"),
              Model.projectionFieldName = (Model.Name "Sequence")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))

-- | DSL updater for the Sequence field of hydra.ext.sql.syntax.ExactNumericTypeDecOption
exactNumericTypeDecOptionWithSequence :: Typed.TypedTerm Syntax.ExactNumericTypeDecOption -> Typed.TypedTerm (Maybe Syntax.Scale) -> Typed.TypedTerm Syntax.ExactNumericTypeDecOption
exactNumericTypeDecOptionWithSequence original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.ExactNumericTypeDecOption"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "Precision"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ExactNumericTypeDecOption"),
              Model.projectionFieldName = (Model.Name "Precision")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "Sequence"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))

-- | DSL injection for the decimal variant of hydra.ext.sql.syntax.ExactNumericType
exactNumericTypeDecimal :: Typed.TypedTerm (Maybe Syntax.ExactNumericTypeDecimalOption) -> Typed.TypedTerm Syntax.ExactNumericType
exactNumericTypeDecimal x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.ExactNumericType"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "decimal"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL constructor for hydra.ext.sql.syntax.ExactNumericTypeDecimalOption
exactNumericTypeDecimalOption :: Typed.TypedTerm Syntax.Precision -> Typed.TypedTerm (Maybe Syntax.Scale) -> Typed.TypedTerm Syntax.ExactNumericTypeDecimalOption
exactNumericTypeDecimalOption precision sequence =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.ExactNumericTypeDecimalOption"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "Precision"),
          Model.fieldTerm = (Typed.unTypedTerm precision)},
        Model.Field {
          Model.fieldName = (Model.Name "Sequence"),
          Model.fieldTerm = (Typed.unTypedTerm sequence)}]}))

-- | DSL name token for hydra.ext.sql.syntax.ExactNumericTypeDecimalOption
exactNumericTypeDecimalOptionExactNumericTypeDecimalOption :: Typed.TypedName Syntax.ExactNumericTypeDecimalOption
exactNumericTypeDecimalOptionExactNumericTypeDecimalOption =
    Typed.TypedName (Model.Name "hydra.ext.sql.syntax.ExactNumericTypeDecimalOption")

-- | DSL accessor for the Precision field of hydra.ext.sql.syntax.ExactNumericTypeDecimalOption
exactNumericTypeDecimalOptionPrecision :: Typed.TypedTerm Syntax.ExactNumericTypeDecimalOption -> Typed.TypedTerm Syntax.Precision
exactNumericTypeDecimalOptionPrecision x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ExactNumericTypeDecimalOption"),
        Model.projectionFieldName = (Model.Name "Precision")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the Sequence field of hydra.ext.sql.syntax.ExactNumericTypeDecimalOption
exactNumericTypeDecimalOptionSequence :: Typed.TypedTerm Syntax.ExactNumericTypeDecimalOption -> Typed.TypedTerm (Maybe Syntax.Scale)
exactNumericTypeDecimalOptionSequence x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ExactNumericTypeDecimalOption"),
        Model.projectionFieldName = (Model.Name "Sequence")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL updater for the Precision field of hydra.ext.sql.syntax.ExactNumericTypeDecimalOption
exactNumericTypeDecimalOptionWithPrecision :: Typed.TypedTerm Syntax.ExactNumericTypeDecimalOption -> Typed.TypedTerm Syntax.Precision -> Typed.TypedTerm Syntax.ExactNumericTypeDecimalOption
exactNumericTypeDecimalOptionWithPrecision original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.ExactNumericTypeDecimalOption"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "Precision"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)},
        Model.Field {
          Model.fieldName = (Model.Name "Sequence"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ExactNumericTypeDecimalOption"),
              Model.projectionFieldName = (Model.Name "Sequence")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))

-- | DSL updater for the Sequence field of hydra.ext.sql.syntax.ExactNumericTypeDecimalOption
exactNumericTypeDecimalOptionWithSequence :: Typed.TypedTerm Syntax.ExactNumericTypeDecimalOption -> Typed.TypedTerm (Maybe Syntax.Scale) -> Typed.TypedTerm Syntax.ExactNumericTypeDecimalOption
exactNumericTypeDecimalOptionWithSequence original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.ExactNumericTypeDecimalOption"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "Precision"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ExactNumericTypeDecimalOption"),
              Model.projectionFieldName = (Model.Name "Precision")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "Sequence"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))

-- | DSL name token for hydra.ext.sql.syntax.ExactNumericType
exactNumericTypeExactNumericType :: Typed.TypedName Syntax.ExactNumericType
exactNumericTypeExactNumericType = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.ExactNumericType")

-- | DSL injection for the int variant of hydra.ext.sql.syntax.ExactNumericType
exactNumericTypeInt :: Typed.TypedTerm Syntax.ExactNumericType
exactNumericTypeInt =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.ExactNumericType"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "int"),
        Model.fieldTerm = Model.TermUnit}}))

-- | DSL injection for the integer variant of hydra.ext.sql.syntax.ExactNumericType
exactNumericTypeInteger :: Typed.TypedTerm Syntax.ExactNumericType
exactNumericTypeInteger =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.ExactNumericType"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "integer"),
        Model.fieldTerm = Model.TermUnit}}))

-- | DSL injection for the numeric variant of hydra.ext.sql.syntax.ExactNumericType
exactNumericTypeNumeric :: Typed.TypedTerm (Maybe Syntax.ExactNumericTypeNumericOption) -> Typed.TypedTerm Syntax.ExactNumericType
exactNumericTypeNumeric x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.ExactNumericType"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "numeric"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL constructor for hydra.ext.sql.syntax.ExactNumericTypeNumericOption
exactNumericTypeNumericOption :: Typed.TypedTerm Syntax.Precision -> Typed.TypedTerm (Maybe Syntax.Scale) -> Typed.TypedTerm Syntax.ExactNumericTypeNumericOption
exactNumericTypeNumericOption precision sequence =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.ExactNumericTypeNumericOption"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "Precision"),
          Model.fieldTerm = (Typed.unTypedTerm precision)},
        Model.Field {
          Model.fieldName = (Model.Name "Sequence"),
          Model.fieldTerm = (Typed.unTypedTerm sequence)}]}))

-- | DSL name token for hydra.ext.sql.syntax.ExactNumericTypeNumericOption
exactNumericTypeNumericOptionExactNumericTypeNumericOption :: Typed.TypedName Syntax.ExactNumericTypeNumericOption
exactNumericTypeNumericOptionExactNumericTypeNumericOption =
    Typed.TypedName (Model.Name "hydra.ext.sql.syntax.ExactNumericTypeNumericOption")

-- | DSL accessor for the Precision field of hydra.ext.sql.syntax.ExactNumericTypeNumericOption
exactNumericTypeNumericOptionPrecision :: Typed.TypedTerm Syntax.ExactNumericTypeNumericOption -> Typed.TypedTerm Syntax.Precision
exactNumericTypeNumericOptionPrecision x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ExactNumericTypeNumericOption"),
        Model.projectionFieldName = (Model.Name "Precision")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the Sequence field of hydra.ext.sql.syntax.ExactNumericTypeNumericOption
exactNumericTypeNumericOptionSequence :: Typed.TypedTerm Syntax.ExactNumericTypeNumericOption -> Typed.TypedTerm (Maybe Syntax.Scale)
exactNumericTypeNumericOptionSequence x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ExactNumericTypeNumericOption"),
        Model.projectionFieldName = (Model.Name "Sequence")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL updater for the Precision field of hydra.ext.sql.syntax.ExactNumericTypeNumericOption
exactNumericTypeNumericOptionWithPrecision :: Typed.TypedTerm Syntax.ExactNumericTypeNumericOption -> Typed.TypedTerm Syntax.Precision -> Typed.TypedTerm Syntax.ExactNumericTypeNumericOption
exactNumericTypeNumericOptionWithPrecision original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.ExactNumericTypeNumericOption"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "Precision"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)},
        Model.Field {
          Model.fieldName = (Model.Name "Sequence"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ExactNumericTypeNumericOption"),
              Model.projectionFieldName = (Model.Name "Sequence")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))

-- | DSL updater for the Sequence field of hydra.ext.sql.syntax.ExactNumericTypeNumericOption
exactNumericTypeNumericOptionWithSequence :: Typed.TypedTerm Syntax.ExactNumericTypeNumericOption -> Typed.TypedTerm (Maybe Syntax.Scale) -> Typed.TypedTerm Syntax.ExactNumericTypeNumericOption
exactNumericTypeNumericOptionWithSequence original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.ExactNumericTypeNumericOption"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "Precision"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.ExactNumericTypeNumericOption"),
              Model.projectionFieldName = (Model.Name "Precision")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "Sequence"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))

-- | DSL injection for the smallint variant of hydra.ext.sql.syntax.ExactNumericType
exactNumericTypeSmallint :: Typed.TypedTerm Syntax.ExactNumericType
exactNumericTypeSmallint =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.ExactNumericType"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "smallint"),
        Model.fieldTerm = Model.TermUnit}}))

-- | DSL constructor for the hydra.ext.sql.syntax.FieldReference wrapper
fieldReference :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.FieldReference
fieldReference x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.FieldReference"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.FieldReference
fieldReferenceFieldReference :: Typed.TypedName Syntax.FieldReference
fieldReferenceFieldReference = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.FieldReference")

-- | DSL constructor for hydra.ext.sql.syntax.FromConstructor
fromConstructor :: Typed.TypedTerm (Maybe Syntax.InsertColumnList) -> Typed.TypedTerm (Maybe Syntax.OverrideClause) -> Typed.TypedTerm Syntax.ContextuallyTypedTableValueConstructor -> Typed.TypedTerm Syntax.FromConstructor
fromConstructor columns override values =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.FromConstructor"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "columns"),
          Model.fieldTerm = (Typed.unTypedTerm columns)},
        Model.Field {
          Model.fieldName = (Model.Name "override"),
          Model.fieldTerm = (Typed.unTypedTerm override)},
        Model.Field {
          Model.fieldName = (Model.Name "values"),
          Model.fieldTerm = (Typed.unTypedTerm values)}]}))

-- | DSL accessor for the columns field of hydra.ext.sql.syntax.FromConstructor
fromConstructorColumns :: Typed.TypedTerm Syntax.FromConstructor -> Typed.TypedTerm (Maybe Syntax.InsertColumnList)
fromConstructorColumns x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.FromConstructor"),
        Model.projectionFieldName = (Model.Name "columns")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.FromConstructor
fromConstructorFromConstructor :: Typed.TypedName Syntax.FromConstructor
fromConstructorFromConstructor = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.FromConstructor")

-- | DSL accessor for the override field of hydra.ext.sql.syntax.FromConstructor
fromConstructorOverride :: Typed.TypedTerm Syntax.FromConstructor -> Typed.TypedTerm (Maybe Syntax.OverrideClause)
fromConstructorOverride x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.FromConstructor"),
        Model.projectionFieldName = (Model.Name "override")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the values field of hydra.ext.sql.syntax.FromConstructor
fromConstructorValues :: Typed.TypedTerm Syntax.FromConstructor -> Typed.TypedTerm Syntax.ContextuallyTypedTableValueConstructor
fromConstructorValues x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.FromConstructor"),
        Model.projectionFieldName = (Model.Name "values")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL updater for the columns field of hydra.ext.sql.syntax.FromConstructor
fromConstructorWithColumns :: Typed.TypedTerm Syntax.FromConstructor -> Typed.TypedTerm (Maybe Syntax.InsertColumnList) -> Typed.TypedTerm Syntax.FromConstructor
fromConstructorWithColumns original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.FromConstructor"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "columns"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)},
        Model.Field {
          Model.fieldName = (Model.Name "override"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.FromConstructor"),
              Model.projectionFieldName = (Model.Name "override")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "values"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.FromConstructor"),
              Model.projectionFieldName = (Model.Name "values")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))

-- | DSL updater for the override field of hydra.ext.sql.syntax.FromConstructor
fromConstructorWithOverride :: Typed.TypedTerm Syntax.FromConstructor -> Typed.TypedTerm (Maybe Syntax.OverrideClause) -> Typed.TypedTerm Syntax.FromConstructor
fromConstructorWithOverride original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.FromConstructor"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "columns"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.FromConstructor"),
              Model.projectionFieldName = (Model.Name "columns")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "override"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)},
        Model.Field {
          Model.fieldName = (Model.Name "values"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.FromConstructor"),
              Model.projectionFieldName = (Model.Name "values")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))

-- | DSL updater for the values field of hydra.ext.sql.syntax.FromConstructor
fromConstructorWithValues :: Typed.TypedTerm Syntax.FromConstructor -> Typed.TypedTerm Syntax.ContextuallyTypedTableValueConstructor -> Typed.TypedTerm Syntax.FromConstructor
fromConstructorWithValues original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.FromConstructor"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "columns"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.FromConstructor"),
              Model.projectionFieldName = (Model.Name "columns")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "override"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.FromConstructor"),
              Model.projectionFieldName = (Model.Name "override")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "values"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))

-- | DSL constructor for the hydra.ext.sql.syntax.FromDefault wrapper
fromDefault :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.FromDefault
fromDefault x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.FromDefault"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.FromDefault
fromDefaultFromDefault :: Typed.TypedName Syntax.FromDefault
fromDefaultFromDefault = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.FromDefault")

-- | DSL constructor for the hydra.ext.sql.syntax.FromSubquery wrapper
fromSubquery :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.FromSubquery
fromSubquery x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.FromSubquery"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.FromSubquery
fromSubqueryFromSubquery :: Typed.TypedName Syntax.FromSubquery
fromSubqueryFromSubquery = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.FromSubquery")

-- | DSL injection for the binary variant of hydra.ext.sql.syntax.GeneralLiteral
generalLiteralBinary :: Typed.TypedTerm Syntax.BinaryStringLiteral -> Typed.TypedTerm Syntax.GeneralLiteral
generalLiteralBinary x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.GeneralLiteral"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "binary"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the boolean variant of hydra.ext.sql.syntax.GeneralLiteral
generalLiteralBoolean :: Typed.TypedTerm Syntax.BooleanLiteral -> Typed.TypedTerm Syntax.GeneralLiteral
generalLiteralBoolean x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.GeneralLiteral"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "boolean"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the dateTime variant of hydra.ext.sql.syntax.GeneralLiteral
generalLiteralDateTime :: Typed.TypedTerm Syntax.DatetimeLiteral -> Typed.TypedTerm Syntax.GeneralLiteral
generalLiteralDateTime x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.GeneralLiteral"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "dateTime"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL name token for hydra.ext.sql.syntax.GeneralLiteral
generalLiteralGeneralLiteral :: Typed.TypedName Syntax.GeneralLiteral
generalLiteralGeneralLiteral = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.GeneralLiteral")

-- | DSL injection for the interval variant of hydra.ext.sql.syntax.GeneralLiteral
generalLiteralInterval :: Typed.TypedTerm Syntax.IntervalLiteral -> Typed.TypedTerm Syntax.GeneralLiteral
generalLiteralInterval x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.GeneralLiteral"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "interval"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the nationalString variant of hydra.ext.sql.syntax.GeneralLiteral
generalLiteralNationalString :: Typed.TypedTerm Syntax.NationalCharacterStringLiteral -> Typed.TypedTerm Syntax.GeneralLiteral
generalLiteralNationalString x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.GeneralLiteral"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "nationalString"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the string variant of hydra.ext.sql.syntax.GeneralLiteral
generalLiteralString :: Typed.TypedTerm Syntax.CharacterStringLiteral -> Typed.TypedTerm Syntax.GeneralLiteral
generalLiteralString x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.GeneralLiteral"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "string"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the unicode variant of hydra.ext.sql.syntax.GeneralLiteral
generalLiteralUnicode :: Typed.TypedTerm Syntax.UnicodeCharacterStringLiteral -> Typed.TypedTerm Syntax.GeneralLiteral
generalLiteralUnicode x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.GeneralLiteral"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "unicode"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL constructor for the hydra.ext.sql.syntax.GeneralValueSpecification wrapper
generalValueSpecification :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.GeneralValueSpecification
generalValueSpecification x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.GeneralValueSpecification"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.GeneralValueSpecification
generalValueSpecificationGeneralValueSpecification :: Typed.TypedName Syntax.GeneralValueSpecification
generalValueSpecificationGeneralValueSpecification =
    Typed.TypedName (Model.Name "hydra.ext.sql.syntax.GeneralValueSpecification")

-- | DSL constructor for the hydra.ext.sql.syntax.GenerationClause wrapper
generationClause :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.GenerationClause
generationClause x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.GenerationClause"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.GenerationClause
generationClauseGenerationClause :: Typed.TypedName Syntax.GenerationClause
generationClauseGenerationClause = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.GenerationClause")

-- | DSL injection for the global variant of hydra.ext.sql.syntax.GlobalOrLocal
globalOrLocalGlobal :: Typed.TypedTerm Syntax.GlobalOrLocal
globalOrLocalGlobal =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.GlobalOrLocal"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "global"),
        Model.fieldTerm = Model.TermUnit}}))

-- | DSL name token for hydra.ext.sql.syntax.GlobalOrLocal
globalOrLocalGlobalOrLocal :: Typed.TypedName Syntax.GlobalOrLocal
globalOrLocalGlobalOrLocal = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.GlobalOrLocal")

-- | DSL injection for the local variant of hydra.ext.sql.syntax.GlobalOrLocal
globalOrLocalLocal :: Typed.TypedTerm Syntax.GlobalOrLocal
globalOrLocalLocal =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.GlobalOrLocal"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "local"),
        Model.fieldTerm = Model.TermUnit}}))

-- | DSL constructor for the hydra.ext.sql.syntax.IdentityColumnSpecification wrapper
identityColumnSpecification :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.IdentityColumnSpecification
identityColumnSpecification x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.IdentityColumnSpecification"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.IdentityColumnSpecification
identityColumnSpecificationIdentityColumnSpecification :: Typed.TypedName Syntax.IdentityColumnSpecification
identityColumnSpecificationIdentityColumnSpecification =
    Typed.TypedName (Model.Name "hydra.ext.sql.syntax.IdentityColumnSpecification")

-- | DSL constructor for the hydra.ext.sql.syntax.InsertColumnList wrapper
insertColumnList :: Typed.TypedTerm Syntax.ColumnNameList -> Typed.TypedTerm Syntax.InsertColumnList
insertColumnList x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.InsertColumnList"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.InsertColumnList
insertColumnListInsertColumnList :: Typed.TypedName Syntax.InsertColumnList
insertColumnListInsertColumnList = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.InsertColumnList")

-- | DSL injection for the constructor variant of hydra.ext.sql.syntax.InsertColumnsAndSource
insertColumnsAndSourceConstructor :: Typed.TypedTerm Syntax.FromConstructor -> Typed.TypedTerm Syntax.InsertColumnsAndSource
insertColumnsAndSourceConstructor x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.InsertColumnsAndSource"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "constructor"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the default variant of hydra.ext.sql.syntax.InsertColumnsAndSource
insertColumnsAndSourceDefault :: Typed.TypedTerm Syntax.FromDefault -> Typed.TypedTerm Syntax.InsertColumnsAndSource
insertColumnsAndSourceDefault x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.InsertColumnsAndSource"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "default"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL name token for hydra.ext.sql.syntax.InsertColumnsAndSource
insertColumnsAndSourceInsertColumnsAndSource :: Typed.TypedName Syntax.InsertColumnsAndSource
insertColumnsAndSourceInsertColumnsAndSource = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.InsertColumnsAndSource")

-- | DSL injection for the subquery variant of hydra.ext.sql.syntax.InsertColumnsAndSource
insertColumnsAndSourceSubquery :: Typed.TypedTerm Syntax.FromSubquery -> Typed.TypedTerm Syntax.InsertColumnsAndSource
insertColumnsAndSourceSubquery x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.InsertColumnsAndSource"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "subquery"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL constructor for hydra.ext.sql.syntax.InsertStatement
insertStatement :: Typed.TypedTerm Syntax.InsertionTarget -> Typed.TypedTerm Syntax.InsertColumnsAndSource -> Typed.TypedTerm Syntax.InsertStatement
insertStatement target columnsAndSource =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.InsertStatement"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "target"),
          Model.fieldTerm = (Typed.unTypedTerm target)},
        Model.Field {
          Model.fieldName = (Model.Name "columnsAndSource"),
          Model.fieldTerm = (Typed.unTypedTerm columnsAndSource)}]}))

-- | DSL accessor for the columnsAndSource field of hydra.ext.sql.syntax.InsertStatement
insertStatementColumnsAndSource :: Typed.TypedTerm Syntax.InsertStatement -> Typed.TypedTerm Syntax.InsertColumnsAndSource
insertStatementColumnsAndSource x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.InsertStatement"),
        Model.projectionFieldName = (Model.Name "columnsAndSource")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.InsertStatement
insertStatementInsertStatement :: Typed.TypedName Syntax.InsertStatement
insertStatementInsertStatement = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.InsertStatement")

-- | DSL accessor for the target field of hydra.ext.sql.syntax.InsertStatement
insertStatementTarget :: Typed.TypedTerm Syntax.InsertStatement -> Typed.TypedTerm Syntax.InsertionTarget
insertStatementTarget x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.InsertStatement"),
        Model.projectionFieldName = (Model.Name "target")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL updater for the columnsAndSource field of hydra.ext.sql.syntax.InsertStatement
insertStatementWithColumnsAndSource :: Typed.TypedTerm Syntax.InsertStatement -> Typed.TypedTerm Syntax.InsertColumnsAndSource -> Typed.TypedTerm Syntax.InsertStatement
insertStatementWithColumnsAndSource original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.InsertStatement"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "target"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.InsertStatement"),
              Model.projectionFieldName = (Model.Name "target")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "columnsAndSource"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))

-- | DSL updater for the target field of hydra.ext.sql.syntax.InsertStatement
insertStatementWithTarget :: Typed.TypedTerm Syntax.InsertStatement -> Typed.TypedTerm Syntax.InsertionTarget -> Typed.TypedTerm Syntax.InsertStatement
insertStatementWithTarget original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.InsertStatement"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "target"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)},
        Model.Field {
          Model.fieldName = (Model.Name "columnsAndSource"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.InsertStatement"),
              Model.projectionFieldName = (Model.Name "columnsAndSource")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))

-- | DSL constructor for the hydra.ext.sql.syntax.InsertionTarget wrapper
insertionTarget :: Typed.TypedTerm Syntax.TableName -> Typed.TypedTerm Syntax.InsertionTarget
insertionTarget x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.InsertionTarget"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.InsertionTarget
insertionTargetInsertionTarget :: Typed.TypedName Syntax.InsertionTarget
insertionTargetInsertionTarget = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.InsertionTarget")

-- | DSL constructor for the hydra.ext.sql.syntax.IntervalLiteral wrapper
intervalLiteral :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.IntervalLiteral
intervalLiteral x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.IntervalLiteral"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.IntervalLiteral
intervalLiteralIntervalLiteral :: Typed.TypedName Syntax.IntervalLiteral
intervalLiteralIntervalLiteral = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.IntervalLiteral")

-- | DSL constructor for the hydra.ext.sql.syntax.IntervalType wrapper
intervalType :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.IntervalType
intervalType x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.IntervalType"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.IntervalType
intervalTypeIntervalType :: Typed.TypedName Syntax.IntervalType
intervalTypeIntervalType = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.IntervalType")

-- | DSL constructor for the hydra.ext.sql.syntax.IntervalValueExpression wrapper
intervalValueExpression :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.IntervalValueExpression
intervalValueExpression x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.IntervalValueExpression"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.IntervalValueExpression
intervalValueExpressionIntervalValueExpression :: Typed.TypedName Syntax.IntervalValueExpression
intervalValueExpressionIntervalValueExpression =
    Typed.TypedName (Model.Name "hydra.ext.sql.syntax.IntervalValueExpression")

-- | DSL constructor for the hydra.ext.sql.syntax.LargeObjectLength wrapper
largeObjectLength :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.LargeObjectLength
largeObjectLength x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.LargeObjectLength"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.LargeObjectLength
largeObjectLengthLargeObjectLength :: Typed.TypedName Syntax.LargeObjectLength
largeObjectLengthLargeObjectLength = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.LargeObjectLength")

-- | DSL constructor for the hydra.ext.sql.syntax.LeftBracketOrTrigraph wrapper
leftBracketOrTrigraph :: Typed.TypedTerm String -> Typed.TypedTerm Syntax.LeftBracketOrTrigraph
leftBracketOrTrigraph x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.LeftBracketOrTrigraph"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.LeftBracketOrTrigraph
leftBracketOrTrigraphLeftBracketOrTrigraph :: Typed.TypedName Syntax.LeftBracketOrTrigraph
leftBracketOrTrigraphLeftBracketOrTrigraph = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.LeftBracketOrTrigraph")

-- | DSL constructor for the hydra.ext.sql.syntax.Length wrapper
length :: Typed.TypedTerm Syntax.UnsignedInteger -> Typed.TypedTerm Syntax.Length
length x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.Length"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.Length
lengthLength :: Typed.TypedName Syntax.Length
lengthLength = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.Length")

-- | DSL constructor for the hydra.ext.sql.syntax.LikeClause wrapper
likeClause :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.LikeClause
likeClause x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.LikeClause"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.LikeClause
likeClauseLikeClause :: Typed.TypedName Syntax.LikeClause
likeClauseLikeClause = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.LikeClause")

-- | DSL constructor for the hydra.ext.sql.syntax.MethodInvocation wrapper
methodInvocation :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.MethodInvocation
methodInvocation x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.MethodInvocation"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.MethodInvocation
methodInvocationMethodInvocation :: Typed.TypedName Syntax.MethodInvocation
methodInvocationMethodInvocation = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.MethodInvocation")

-- | DSL constructor for the hydra.ext.sql.syntax.MultisetElementReference wrapper
multisetElementReference :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.MultisetElementReference
multisetElementReference x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.MultisetElementReference"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.MultisetElementReference
multisetElementReferenceMultisetElementReference :: Typed.TypedName Syntax.MultisetElementReference
multisetElementReferenceMultisetElementReference =
    Typed.TypedName (Model.Name "hydra.ext.sql.syntax.MultisetElementReference")

-- | DSL constructor for the hydra.ext.sql.syntax.MultisetType wrapper
multisetType :: Typed.TypedTerm Syntax.DataType -> Typed.TypedTerm Syntax.MultisetType
multisetType x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.MultisetType"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.MultisetType
multisetTypeMultisetType :: Typed.TypedName Syntax.MultisetType
multisetTypeMultisetType = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.MultisetType")

-- | DSL constructor for the hydra.ext.sql.syntax.MultisetValueConstructor wrapper
multisetValueConstructor :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.MultisetValueConstructor
multisetValueConstructor x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.MultisetValueConstructor"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.MultisetValueConstructor
multisetValueConstructorMultisetValueConstructor :: Typed.TypedName Syntax.MultisetValueConstructor
multisetValueConstructorMultisetValueConstructor =
    Typed.TypedName (Model.Name "hydra.ext.sql.syntax.MultisetValueConstructor")

-- | DSL constructor for the hydra.ext.sql.syntax.MultisetValueExpression wrapper
multisetValueExpression :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.MultisetValueExpression
multisetValueExpression x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.MultisetValueExpression"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.MultisetValueExpression
multisetValueExpressionMultisetValueExpression :: Typed.TypedName Syntax.MultisetValueExpression
multisetValueExpressionMultisetValueExpression =
    Typed.TypedName (Model.Name "hydra.ext.sql.syntax.MultisetValueExpression")

-- | DSL constructor for the hydra.ext.sql.syntax.NationalCharacterStringLiteral wrapper
nationalCharacterStringLiteral :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.NationalCharacterStringLiteral
nationalCharacterStringLiteral x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.NationalCharacterStringLiteral"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.NationalCharacterStringLiteral
nationalCharacterStringLiteralNationalCharacterStringLiteral :: Typed.TypedName Syntax.NationalCharacterStringLiteral
nationalCharacterStringLiteralNationalCharacterStringLiteral =
    Typed.TypedName (Model.Name "hydra.ext.sql.syntax.NationalCharacterStringLiteral")

-- | DSL constructor for the hydra.ext.sql.syntax.NationalCharacterStringType wrapper
nationalCharacterStringType :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.NationalCharacterStringType
nationalCharacterStringType x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.NationalCharacterStringType"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.NationalCharacterStringType
nationalCharacterStringTypeNationalCharacterStringType :: Typed.TypedName Syntax.NationalCharacterStringType
nationalCharacterStringTypeNationalCharacterStringType =
    Typed.TypedName (Model.Name "hydra.ext.sql.syntax.NationalCharacterStringType")

-- | DSL constructor for the hydra.ext.sql.syntax.NewSpecification wrapper
newSpecification :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.NewSpecification
newSpecification x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.NewSpecification"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.NewSpecification
newSpecificationNewSpecification :: Typed.TypedName Syntax.NewSpecification
newSpecificationNewSpecification = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.NewSpecification")

-- | DSL constructor for the hydra.ext.sql.syntax.NextValueExpression wrapper
nextValueExpression :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.NextValueExpression
nextValueExpression x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.NextValueExpression"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.NextValueExpression
nextValueExpressionNextValueExpression :: Typed.TypedName Syntax.NextValueExpression
nextValueExpressionNextValueExpression = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.NextValueExpression")

-- | DSL injection for the arrayElement variant of hydra.ext.sql.syntax.NonparenthesizedValueExpressionPrimary
nonparenthesizedValueExpressionPrimaryArrayElement :: Typed.TypedTerm Syntax.ArrayElementReference -> Typed.TypedTerm Syntax.NonparenthesizedValueExpressionPrimary
nonparenthesizedValueExpressionPrimaryArrayElement x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.NonparenthesizedValueExpressionPrimary"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "arrayElement"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the attributeOrMethod variant of hydra.ext.sql.syntax.NonparenthesizedValueExpressionPrimary
nonparenthesizedValueExpressionPrimaryAttributeOrMethod :: Typed.TypedTerm Syntax.AttributeOrMethodReference -> Typed.TypedTerm Syntax.NonparenthesizedValueExpressionPrimary
nonparenthesizedValueExpressionPrimaryAttributeOrMethod x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.NonparenthesizedValueExpressionPrimary"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "attributeOrMethod"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the cases variant of hydra.ext.sql.syntax.NonparenthesizedValueExpressionPrimary
nonparenthesizedValueExpressionPrimaryCases :: Typed.TypedTerm Syntax.CaseExpression -> Typed.TypedTerm Syntax.NonparenthesizedValueExpressionPrimary
nonparenthesizedValueExpressionPrimaryCases x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.NonparenthesizedValueExpressionPrimary"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "cases"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the cast variant of hydra.ext.sql.syntax.NonparenthesizedValueExpressionPrimary
nonparenthesizedValueExpressionPrimaryCast :: Typed.TypedTerm Syntax.CastSpecification -> Typed.TypedTerm Syntax.NonparenthesizedValueExpressionPrimary
nonparenthesizedValueExpressionPrimaryCast x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.NonparenthesizedValueExpressionPrimary"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "cast"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the collection variant of hydra.ext.sql.syntax.NonparenthesizedValueExpressionPrimary
nonparenthesizedValueExpressionPrimaryCollection :: Typed.TypedTerm Syntax.CollectionValueConstructor -> Typed.TypedTerm Syntax.NonparenthesizedValueExpressionPrimary
nonparenthesizedValueExpressionPrimaryCollection x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.NonparenthesizedValueExpressionPrimary"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "collection"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the column variant of hydra.ext.sql.syntax.NonparenthesizedValueExpressionPrimary
nonparenthesizedValueExpressionPrimaryColumn :: Typed.TypedTerm Syntax.ColumnReference -> Typed.TypedTerm Syntax.NonparenthesizedValueExpressionPrimary
nonparenthesizedValueExpressionPrimaryColumn x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.NonparenthesizedValueExpressionPrimary"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "column"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the field variant of hydra.ext.sql.syntax.NonparenthesizedValueExpressionPrimary
nonparenthesizedValueExpressionPrimaryField :: Typed.TypedTerm Syntax.FieldReference -> Typed.TypedTerm Syntax.NonparenthesizedValueExpressionPrimary
nonparenthesizedValueExpressionPrimaryField x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.NonparenthesizedValueExpressionPrimary"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "field"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the method variant of hydra.ext.sql.syntax.NonparenthesizedValueExpressionPrimary
nonparenthesizedValueExpressionPrimaryMethod :: Typed.TypedTerm Syntax.MethodInvocation -> Typed.TypedTerm Syntax.NonparenthesizedValueExpressionPrimary
nonparenthesizedValueExpressionPrimaryMethod x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.NonparenthesizedValueExpressionPrimary"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "method"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the multisetElement variant of hydra.ext.sql.syntax.NonparenthesizedValueExpressionPrimary
nonparenthesizedValueExpressionPrimaryMultisetElement :: Typed.TypedTerm Syntax.MultisetElementReference -> Typed.TypedTerm Syntax.NonparenthesizedValueExpressionPrimary
nonparenthesizedValueExpressionPrimaryMultisetElement x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.NonparenthesizedValueExpressionPrimary"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "multisetElement"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the new variant of hydra.ext.sql.syntax.NonparenthesizedValueExpressionPrimary
nonparenthesizedValueExpressionPrimaryNew :: Typed.TypedTerm Syntax.NewSpecification -> Typed.TypedTerm Syntax.NonparenthesizedValueExpressionPrimary
nonparenthesizedValueExpressionPrimaryNew x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.NonparenthesizedValueExpressionPrimary"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "new"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the next variant of hydra.ext.sql.syntax.NonparenthesizedValueExpressionPrimary
nonparenthesizedValueExpressionPrimaryNext :: Typed.TypedTerm Syntax.NextValueExpression -> Typed.TypedTerm Syntax.NonparenthesizedValueExpressionPrimary
nonparenthesizedValueExpressionPrimaryNext x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.NonparenthesizedValueExpressionPrimary"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "next"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL name token for hydra.ext.sql.syntax.NonparenthesizedValueExpressionPrimary
nonparenthesizedValueExpressionPrimaryNonparenthesizedValueExpressionPrimary :: Typed.TypedName Syntax.NonparenthesizedValueExpressionPrimary
nonparenthesizedValueExpressionPrimaryNonparenthesizedValueExpressionPrimary =
    Typed.TypedName (Model.Name "hydra.ext.sql.syntax.NonparenthesizedValueExpressionPrimary")

-- | DSL injection for the reference variant of hydra.ext.sql.syntax.NonparenthesizedValueExpressionPrimary
nonparenthesizedValueExpressionPrimaryReference :: Typed.TypedTerm Syntax.ReferenceResolution -> Typed.TypedTerm Syntax.NonparenthesizedValueExpressionPrimary
nonparenthesizedValueExpressionPrimaryReference x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.NonparenthesizedValueExpressionPrimary"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "reference"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the routine variant of hydra.ext.sql.syntax.NonparenthesizedValueExpressionPrimary
nonparenthesizedValueExpressionPrimaryRoutine :: Typed.TypedTerm Syntax.RoutineInvocation -> Typed.TypedTerm Syntax.NonparenthesizedValueExpressionPrimary
nonparenthesizedValueExpressionPrimaryRoutine x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.NonparenthesizedValueExpressionPrimary"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "routine"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the scalarSubquery variant of hydra.ext.sql.syntax.NonparenthesizedValueExpressionPrimary
nonparenthesizedValueExpressionPrimaryScalarSubquery :: Typed.TypedTerm Syntax.ScalarSubquery -> Typed.TypedTerm Syntax.NonparenthesizedValueExpressionPrimary
nonparenthesizedValueExpressionPrimaryScalarSubquery x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.NonparenthesizedValueExpressionPrimary"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "scalarSubquery"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the setFunction variant of hydra.ext.sql.syntax.NonparenthesizedValueExpressionPrimary
nonparenthesizedValueExpressionPrimarySetFunction :: Typed.TypedTerm Syntax.SetFunctionSpecification -> Typed.TypedTerm Syntax.NonparenthesizedValueExpressionPrimary
nonparenthesizedValueExpressionPrimarySetFunction x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.NonparenthesizedValueExpressionPrimary"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "setFunction"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the staticMethod variant of hydra.ext.sql.syntax.NonparenthesizedValueExpressionPrimary
nonparenthesizedValueExpressionPrimaryStaticMethod :: Typed.TypedTerm Syntax.StaticMethodInvocation -> Typed.TypedTerm Syntax.NonparenthesizedValueExpressionPrimary
nonparenthesizedValueExpressionPrimaryStaticMethod x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.NonparenthesizedValueExpressionPrimary"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "staticMethod"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the subtype variant of hydra.ext.sql.syntax.NonparenthesizedValueExpressionPrimary
nonparenthesizedValueExpressionPrimarySubtype :: Typed.TypedTerm Syntax.SubtypeTreatment -> Typed.TypedTerm Syntax.NonparenthesizedValueExpressionPrimary
nonparenthesizedValueExpressionPrimarySubtype x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.NonparenthesizedValueExpressionPrimary"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "subtype"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the unsigned variant of hydra.ext.sql.syntax.NonparenthesizedValueExpressionPrimary
nonparenthesizedValueExpressionPrimaryUnsigned :: Typed.TypedTerm Syntax.UnsignedValueSpecification -> Typed.TypedTerm Syntax.NonparenthesizedValueExpressionPrimary
nonparenthesizedValueExpressionPrimaryUnsigned x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.NonparenthesizedValueExpressionPrimary"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "unsigned"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the windowFunction variant of hydra.ext.sql.syntax.NonparenthesizedValueExpressionPrimary
nonparenthesizedValueExpressionPrimaryWindowFunction :: Typed.TypedTerm Syntax.WindowFunction -> Typed.TypedTerm Syntax.NonparenthesizedValueExpressionPrimary
nonparenthesizedValueExpressionPrimaryWindowFunction x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.NonparenthesizedValueExpressionPrimary"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "windowFunction"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the approximate variant of hydra.ext.sql.syntax.NumericType
numericTypeApproximate :: Typed.TypedTerm Syntax.ApproximateNumericType -> Typed.TypedTerm Syntax.NumericType
numericTypeApproximate x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.NumericType"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "approximate"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the exact variant of hydra.ext.sql.syntax.NumericType
numericTypeExact :: Typed.TypedTerm Syntax.ExactNumericType -> Typed.TypedTerm Syntax.NumericType
numericTypeExact x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.NumericType"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "exact"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL name token for hydra.ext.sql.syntax.NumericType
numericTypeNumericType :: Typed.TypedName Syntax.NumericType
numericTypeNumericType = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.NumericType")

-- | DSL constructor for the hydra.ext.sql.syntax.NumericValueExpression wrapper
numericValueExpression :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.NumericValueExpression
numericValueExpression x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.NumericValueExpression"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.NumericValueExpression
numericValueExpressionNumericValueExpression :: Typed.TypedName Syntax.NumericValueExpression
numericValueExpressionNumericValueExpression = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.NumericValueExpression")

-- | DSL injection for the OVERRIDINGspSYSTEMspVALUE variant of hydra.ext.sql.syntax.OverrideClause
overrideClauseOVERRIDINGspSYSTEMspVALUE :: Typed.TypedTerm Syntax.OverrideClause
overrideClauseOVERRIDINGspSYSTEMspVALUE =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.OverrideClause"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "OVERRIDINGspSYSTEMspVALUE"),
        Model.fieldTerm = Model.TermUnit}}))

-- | DSL injection for the OVERRIDINGspUSERspVALUE variant of hydra.ext.sql.syntax.OverrideClause
overrideClauseOVERRIDINGspUSERspVALUE :: Typed.TypedTerm Syntax.OverrideClause
overrideClauseOVERRIDINGspUSERspVALUE =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.OverrideClause"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "OVERRIDINGspUSERspVALUE"),
        Model.fieldTerm = Model.TermUnit}}))

-- | DSL name token for hydra.ext.sql.syntax.OverrideClause
overrideClauseOverrideClause :: Typed.TypedName Syntax.OverrideClause
overrideClauseOverrideClause = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.OverrideClause")

-- | DSL constructor for the hydra.ext.sql.syntax.ParenthesizedValueExpression wrapper
parenthesizedValueExpression :: Typed.TypedTerm Syntax.ValueExpression -> Typed.TypedTerm Syntax.ParenthesizedValueExpression
parenthesizedValueExpression x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.ParenthesizedValueExpression"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.ParenthesizedValueExpression
parenthesizedValueExpressionParenthesizedValueExpression :: Typed.TypedName Syntax.ParenthesizedValueExpression
parenthesizedValueExpressionParenthesizedValueExpression =
    Typed.TypedName (Model.Name "hydra.ext.sql.syntax.ParenthesizedValueExpression")

-- | DSL constructor for the hydra.ext.sql.syntax.PathResolvedUserDefinedTypeName wrapper
pathResolvedUserDefinedTypeName :: Typed.TypedTerm String -> Typed.TypedTerm Syntax.PathResolvedUserDefinedTypeName
pathResolvedUserDefinedTypeName x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.PathResolvedUserDefinedTypeName"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.PathResolvedUserDefinedTypeName
pathResolvedUserDefinedTypeNamePathResolvedUserDefinedTypeName :: Typed.TypedName Syntax.PathResolvedUserDefinedTypeName
pathResolvedUserDefinedTypeNamePathResolvedUserDefinedTypeName =
    Typed.TypedName (Model.Name "hydra.ext.sql.syntax.PathResolvedUserDefinedTypeName")

-- | DSL constructor for the hydra.ext.sql.syntax.Precision wrapper
precision :: Typed.TypedTerm Syntax.UnsignedInteger -> Typed.TypedTerm Syntax.Precision
precision x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.Precision"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.Precision
precisionPrecision :: Typed.TypedName Syntax.Precision
precisionPrecision = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.Precision")

-- | DSL injection for the blob variant of hydra.ext.sql.syntax.PredefinedType
predefinedTypeBlob :: Typed.TypedTerm Syntax.BinaryLargeObjectStringType -> Typed.TypedTerm Syntax.PredefinedType
predefinedTypeBlob x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.PredefinedType"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "blob"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the boolean variant of hydra.ext.sql.syntax.PredefinedType
predefinedTypeBoolean :: Typed.TypedTerm Syntax.BooleanType -> Typed.TypedTerm Syntax.PredefinedType
predefinedTypeBoolean x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.PredefinedType"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "boolean"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the datetime variant of hydra.ext.sql.syntax.PredefinedType
predefinedTypeDatetime :: Typed.TypedTerm Syntax.DatetimeType -> Typed.TypedTerm Syntax.PredefinedType
predefinedTypeDatetime x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.PredefinedType"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "datetime"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the interval variant of hydra.ext.sql.syntax.PredefinedType
predefinedTypeInterval :: Typed.TypedTerm Syntax.IntervalType -> Typed.TypedTerm Syntax.PredefinedType
predefinedTypeInterval x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.PredefinedType"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "interval"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL constructor for hydra.ext.sql.syntax.PredefinedTypeNationalString
predefinedTypeNationalString :: Typed.TypedTerm Syntax.NationalCharacterStringType -> Typed.TypedTerm (Maybe Syntax.CollateClause) -> Typed.TypedTerm Syntax.PredefinedTypeNationalString
predefinedTypeNationalString type_ collate =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.PredefinedTypeNationalString"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "type"),
          Model.fieldTerm = (Typed.unTypedTerm type_)},
        Model.Field {
          Model.fieldName = (Model.Name "collate"),
          Model.fieldTerm = (Typed.unTypedTerm collate)}]}))

-- | DSL accessor for the collate field of hydra.ext.sql.syntax.PredefinedTypeNationalString
predefinedTypeNationalStringCollate :: Typed.TypedTerm Syntax.PredefinedTypeNationalString -> Typed.TypedTerm (Maybe Syntax.CollateClause)
predefinedTypeNationalStringCollate x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.PredefinedTypeNationalString"),
        Model.projectionFieldName = (Model.Name "collate")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.PredefinedTypeNationalString
predefinedTypeNationalStringPredefinedTypeNationalString :: Typed.TypedName Syntax.PredefinedTypeNationalString
predefinedTypeNationalStringPredefinedTypeNationalString =
    Typed.TypedName (Model.Name "hydra.ext.sql.syntax.PredefinedTypeNationalString")

-- | DSL injection for the nationalStringType variant of hydra.ext.sql.syntax.PredefinedType
predefinedTypeNationalStringType :: Typed.TypedTerm Syntax.PredefinedTypeNationalString -> Typed.TypedTerm Syntax.PredefinedType
predefinedTypeNationalStringType x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.PredefinedType"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "nationalStringType"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL accessor for the type field of hydra.ext.sql.syntax.PredefinedTypeNationalString
predefinedTypeNationalStringType2 :: Typed.TypedTerm Syntax.PredefinedTypeNationalString -> Typed.TypedTerm Syntax.NationalCharacterStringType
predefinedTypeNationalStringType2 x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.PredefinedTypeNationalString"),
        Model.projectionFieldName = (Model.Name "type")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL updater for the collate field of hydra.ext.sql.syntax.PredefinedTypeNationalString
predefinedTypeNationalStringWithCollate :: Typed.TypedTerm Syntax.PredefinedTypeNationalString -> Typed.TypedTerm (Maybe Syntax.CollateClause) -> Typed.TypedTerm Syntax.PredefinedTypeNationalString
predefinedTypeNationalStringWithCollate original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.PredefinedTypeNationalString"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "type"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.PredefinedTypeNationalString"),
              Model.projectionFieldName = (Model.Name "type")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "collate"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))

-- | DSL updater for the type field of hydra.ext.sql.syntax.PredefinedTypeNationalString
predefinedTypeNationalStringWithType :: Typed.TypedTerm Syntax.PredefinedTypeNationalString -> Typed.TypedTerm Syntax.NationalCharacterStringType -> Typed.TypedTerm Syntax.PredefinedTypeNationalString
predefinedTypeNationalStringWithType original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.PredefinedTypeNationalString"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "type"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)},
        Model.Field {
          Model.fieldName = (Model.Name "collate"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.PredefinedTypeNationalString"),
              Model.projectionFieldName = (Model.Name "collate")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))

-- | DSL injection for the numeric variant of hydra.ext.sql.syntax.PredefinedType
predefinedTypeNumeric :: Typed.TypedTerm Syntax.NumericType -> Typed.TypedTerm Syntax.PredefinedType
predefinedTypeNumeric x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.PredefinedType"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "numeric"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL name token for hydra.ext.sql.syntax.PredefinedType
predefinedTypePredefinedType :: Typed.TypedName Syntax.PredefinedType
predefinedTypePredefinedType = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.PredefinedType")

-- | DSL constructor for hydra.ext.sql.syntax.PredefinedTypeString
predefinedTypeString :: Typed.TypedTerm Syntax.CharacterStringType -> Typed.TypedTerm (Maybe Syntax.CharacterSetSpecification) -> Typed.TypedTerm (Maybe Syntax.CollateClause) -> Typed.TypedTerm Syntax.PredefinedTypeString
predefinedTypeString type_ characters collate =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.PredefinedTypeString"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "type"),
          Model.fieldTerm = (Typed.unTypedTerm type_)},
        Model.Field {
          Model.fieldName = (Model.Name "characters"),
          Model.fieldTerm = (Typed.unTypedTerm characters)},
        Model.Field {
          Model.fieldName = (Model.Name "collate"),
          Model.fieldTerm = (Typed.unTypedTerm collate)}]}))

-- | DSL accessor for the characters field of hydra.ext.sql.syntax.PredefinedTypeString
predefinedTypeStringCharacters :: Typed.TypedTerm Syntax.PredefinedTypeString -> Typed.TypedTerm (Maybe Syntax.CharacterSetSpecification)
predefinedTypeStringCharacters x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.PredefinedTypeString"),
        Model.projectionFieldName = (Model.Name "characters")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the collate field of hydra.ext.sql.syntax.PredefinedTypeString
predefinedTypeStringCollate :: Typed.TypedTerm Syntax.PredefinedTypeString -> Typed.TypedTerm (Maybe Syntax.CollateClause)
predefinedTypeStringCollate x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.PredefinedTypeString"),
        Model.projectionFieldName = (Model.Name "collate")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.PredefinedTypeString
predefinedTypeStringPredefinedTypeString :: Typed.TypedName Syntax.PredefinedTypeString
predefinedTypeStringPredefinedTypeString = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.PredefinedTypeString")

-- | DSL injection for the stringType variant of hydra.ext.sql.syntax.PredefinedType
predefinedTypeStringType :: Typed.TypedTerm Syntax.PredefinedTypeString -> Typed.TypedTerm Syntax.PredefinedType
predefinedTypeStringType x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.PredefinedType"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "stringType"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL accessor for the type field of hydra.ext.sql.syntax.PredefinedTypeString
predefinedTypeStringType2 :: Typed.TypedTerm Syntax.PredefinedTypeString -> Typed.TypedTerm Syntax.CharacterStringType
predefinedTypeStringType2 x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.PredefinedTypeString"),
        Model.projectionFieldName = (Model.Name "type")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL updater for the characters field of hydra.ext.sql.syntax.PredefinedTypeString
predefinedTypeStringWithCharacters :: Typed.TypedTerm Syntax.PredefinedTypeString -> Typed.TypedTerm (Maybe Syntax.CharacterSetSpecification) -> Typed.TypedTerm Syntax.PredefinedTypeString
predefinedTypeStringWithCharacters original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.PredefinedTypeString"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "type"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.PredefinedTypeString"),
              Model.projectionFieldName = (Model.Name "type")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "characters"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)},
        Model.Field {
          Model.fieldName = (Model.Name "collate"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.PredefinedTypeString"),
              Model.projectionFieldName = (Model.Name "collate")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))

-- | DSL updater for the collate field of hydra.ext.sql.syntax.PredefinedTypeString
predefinedTypeStringWithCollate :: Typed.TypedTerm Syntax.PredefinedTypeString -> Typed.TypedTerm (Maybe Syntax.CollateClause) -> Typed.TypedTerm Syntax.PredefinedTypeString
predefinedTypeStringWithCollate original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.PredefinedTypeString"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "type"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.PredefinedTypeString"),
              Model.projectionFieldName = (Model.Name "type")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "characters"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.PredefinedTypeString"),
              Model.projectionFieldName = (Model.Name "characters")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "collate"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))

-- | DSL updater for the type field of hydra.ext.sql.syntax.PredefinedTypeString
predefinedTypeStringWithType :: Typed.TypedTerm Syntax.PredefinedTypeString -> Typed.TypedTerm Syntax.CharacterStringType -> Typed.TypedTerm Syntax.PredefinedTypeString
predefinedTypeStringWithType original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.PredefinedTypeString"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "type"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)},
        Model.Field {
          Model.fieldName = (Model.Name "characters"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.PredefinedTypeString"),
              Model.projectionFieldName = (Model.Name "characters")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "collate"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.PredefinedTypeString"),
              Model.projectionFieldName = (Model.Name "collate")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))

-- | DSL constructor for the hydra.ext.sql.syntax.Predicate wrapper
predicate :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.Predicate
predicate x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.Predicate"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.Predicate
predicatePredicate :: Typed.TypedName Syntax.Predicate
predicatePredicate = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.Predicate")

-- | DSL constructor for the hydra.ext.sql.syntax.QueryExpression wrapper
queryExpression :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.QueryExpression
queryExpression x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.QueryExpression"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.QueryExpression
queryExpressionQueryExpression :: Typed.TypedName Syntax.QueryExpression
queryExpressionQueryExpression = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.QueryExpression")

-- | DSL constructor for the hydra.ext.sql.syntax.ReferenceResolution wrapper
referenceResolution :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.ReferenceResolution
referenceResolution x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.ReferenceResolution"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.ReferenceResolution
referenceResolutionReferenceResolution :: Typed.TypedName Syntax.ReferenceResolution
referenceResolutionReferenceResolution = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.ReferenceResolution")

-- | DSL constructor for the hydra.ext.sql.syntax.ReferenceScopeCheck wrapper
referenceScopeCheck :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.ReferenceScopeCheck
referenceScopeCheck x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.ReferenceScopeCheck"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.ReferenceScopeCheck
referenceScopeCheckReferenceScopeCheck :: Typed.TypedName Syntax.ReferenceScopeCheck
referenceScopeCheckReferenceScopeCheck = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.ReferenceScopeCheck")

-- | DSL constructor for the hydra.ext.sql.syntax.ReferenceType wrapper
referenceType :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.ReferenceType
referenceType x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.ReferenceType"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.ReferenceType
referenceTypeReferenceType :: Typed.TypedName Syntax.ReferenceType
referenceTypeReferenceType = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.ReferenceType")

-- | DSL constructor for the hydra.ext.sql.syntax.ReferenceValueExpression wrapper
referenceValueExpression :: Typed.TypedTerm Syntax.ValueExpressionPrimary -> Typed.TypedTerm Syntax.ReferenceValueExpression
referenceValueExpression x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.ReferenceValueExpression"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.ReferenceValueExpression
referenceValueExpressionReferenceValueExpression :: Typed.TypedName Syntax.ReferenceValueExpression
referenceValueExpressionReferenceValueExpression =
    Typed.TypedName (Model.Name "hydra.ext.sql.syntax.ReferenceValueExpression")

-- | DSL constructor for the hydra.ext.sql.syntax.RightBracketOrTrigraph wrapper
rightBracketOrTrigraph :: Typed.TypedTerm String -> Typed.TypedTerm Syntax.RightBracketOrTrigraph
rightBracketOrTrigraph x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.RightBracketOrTrigraph"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.RightBracketOrTrigraph
rightBracketOrTrigraphRightBracketOrTrigraph :: Typed.TypedName Syntax.RightBracketOrTrigraph
rightBracketOrTrigraphRightBracketOrTrigraph = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.RightBracketOrTrigraph")

-- | DSL constructor for the hydra.ext.sql.syntax.RoutineInvocation wrapper
routineInvocation :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.RoutineInvocation
routineInvocation x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.RoutineInvocation"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.RoutineInvocation
routineInvocationRoutineInvocation :: Typed.TypedName Syntax.RoutineInvocation
routineInvocationRoutineInvocation = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.RoutineInvocation")

-- | DSL constructor for the hydra.ext.sql.syntax.RowType wrapper
rowType :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.RowType
rowType x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.RowType"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.RowType
rowTypeRowType :: Typed.TypedName Syntax.RowType
rowTypeRowType = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.RowType")

-- | DSL constructor for the hydra.ext.sql.syntax.RowValueExpression wrapper
rowValueExpression :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.RowValueExpression
rowValueExpression x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.RowValueExpression"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.RowValueExpression
rowValueExpressionRowValueExpression :: Typed.TypedName Syntax.RowValueExpression
rowValueExpressionRowValueExpression = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.RowValueExpression")

-- | DSL constructor for the hydra.ext.sql.syntax.RowValueSpecialCase wrapper
rowValueSpecialCase :: Typed.TypedTerm Syntax.NonparenthesizedValueExpressionPrimary -> Typed.TypedTerm Syntax.RowValueSpecialCase
rowValueSpecialCase x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.RowValueSpecialCase"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.RowValueSpecialCase
rowValueSpecialCaseRowValueSpecialCase :: Typed.TypedName Syntax.RowValueSpecialCase
rowValueSpecialCaseRowValueSpecialCase = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.RowValueSpecialCase")

-- | DSL constructor for the hydra.ext.sql.syntax.ScalarSubquery wrapper
scalarSubquery :: Typed.TypedTerm Syntax.Subquery -> Typed.TypedTerm Syntax.ScalarSubquery
scalarSubquery x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.ScalarSubquery"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.ScalarSubquery
scalarSubqueryScalarSubquery :: Typed.TypedName Syntax.ScalarSubquery
scalarSubqueryScalarSubquery = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.ScalarSubquery")

-- | DSL constructor for the hydra.ext.sql.syntax.Scale wrapper
scale :: Typed.TypedTerm Syntax.UnsignedInteger -> Typed.TypedTerm Syntax.Scale
scale x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.Scale"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.Scale
scaleScale :: Typed.TypedName Syntax.Scale
scaleScale = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.Scale")

-- | DSL constructor for the hydra.ext.sql.syntax.SelfReferencingColumnSpecification wrapper
selfReferencingColumnSpecification :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.SelfReferencingColumnSpecification
selfReferencingColumnSpecification x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.SelfReferencingColumnSpecification"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.SelfReferencingColumnSpecification
selfReferencingColumnSpecificationSelfReferencingColumnSpecification :: Typed.TypedName Syntax.SelfReferencingColumnSpecification
selfReferencingColumnSpecificationSelfReferencingColumnSpecification =
    Typed.TypedName (Model.Name "hydra.ext.sql.syntax.SelfReferencingColumnSpecification")

-- | DSL constructor for the hydra.ext.sql.syntax.SetFunctionSpecification wrapper
setFunctionSpecification :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.SetFunctionSpecification
setFunctionSpecification x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.SetFunctionSpecification"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.SetFunctionSpecification
setFunctionSpecificationSetFunctionSpecification :: Typed.TypedName Syntax.SetFunctionSpecification
setFunctionSpecificationSetFunctionSpecification =
    Typed.TypedName (Model.Name "hydra.ext.sql.syntax.SetFunctionSpecification")

-- | DSL constructor for the hydra.ext.sql.syntax.StaticMethodInvocation wrapper
staticMethodInvocation :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.StaticMethodInvocation
staticMethodInvocation x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.StaticMethodInvocation"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.StaticMethodInvocation
staticMethodInvocationStaticMethodInvocation :: Typed.TypedName Syntax.StaticMethodInvocation
staticMethodInvocationStaticMethodInvocation = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.StaticMethodInvocation")

-- | DSL constructor for the hydra.ext.sql.syntax.StringValueExpression wrapper
stringValueExpression :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.StringValueExpression
stringValueExpression x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.StringValueExpression"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.StringValueExpression
stringValueExpressionStringValueExpression :: Typed.TypedName Syntax.StringValueExpression
stringValueExpressionStringValueExpression = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.StringValueExpression")

-- | DSL constructor for the hydra.ext.sql.syntax.Subquery wrapper
subquery :: Typed.TypedTerm Syntax.QueryExpression -> Typed.TypedTerm Syntax.Subquery
subquery x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.Subquery"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.Subquery
subquerySubquery :: Typed.TypedName Syntax.Subquery
subquerySubquery = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.Subquery")

-- | DSL constructor for the hydra.ext.sql.syntax.SubtableClause wrapper
subtableClause :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.SubtableClause
subtableClause x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.SubtableClause"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.SubtableClause
subtableClauseSubtableClause :: Typed.TypedName Syntax.SubtableClause
subtableClauseSubtableClause = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.SubtableClause")

-- | DSL constructor for the hydra.ext.sql.syntax.SubtypeTreatment wrapper
subtypeTreatment :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.SubtypeTreatment
subtypeTreatment x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.SubtypeTreatment"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.SubtypeTreatment
subtypeTreatmentSubtypeTreatment :: Typed.TypedName Syntax.SubtypeTreatment
subtypeTreatmentSubtypeTreatment = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.SubtypeTreatment")

-- | DSL injection for the delete variant of hydra.ext.sql.syntax.TableCommitAction
tableCommitActionDelete :: Typed.TypedTerm Syntax.TableCommitAction
tableCommitActionDelete =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.TableCommitAction"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "delete"),
        Model.fieldTerm = Model.TermUnit}}))

-- | DSL injection for the preserve variant of hydra.ext.sql.syntax.TableCommitAction
tableCommitActionPreserve :: Typed.TypedTerm Syntax.TableCommitAction
tableCommitActionPreserve =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.TableCommitAction"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "preserve"),
        Model.fieldTerm = Model.TermUnit}}))

-- | DSL name token for hydra.ext.sql.syntax.TableCommitAction
tableCommitActionTableCommitAction :: Typed.TypedName Syntax.TableCommitAction
tableCommitActionTableCommitAction = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.TableCommitAction")

-- | DSL constructor for the hydra.ext.sql.syntax.TableConstraintDefinition wrapper
tableConstraintDefinition :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.TableConstraintDefinition
tableConstraintDefinition x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.TableConstraintDefinition"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.TableConstraintDefinition
tableConstraintDefinitionTableConstraintDefinition :: Typed.TypedName Syntax.TableConstraintDefinition
tableConstraintDefinitionTableConstraintDefinition =
    Typed.TypedName (Model.Name "hydra.ext.sql.syntax.TableConstraintDefinition")

-- | DSL injection for the list variant of hydra.ext.sql.syntax.TableContentsSource
tableContentsSourceList :: Typed.TypedTerm Syntax.TableElementList -> Typed.TypedTerm Syntax.TableContentsSource
tableContentsSourceList x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.TableContentsSource"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "list"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the subquery variant of hydra.ext.sql.syntax.TableContentsSource
tableContentsSourceSubquery :: Typed.TypedTerm Syntax.AsSubqueryClause -> Typed.TypedTerm Syntax.TableContentsSource
tableContentsSourceSubquery x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.TableContentsSource"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "subquery"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL constructor for hydra.ext.sql.syntax.TableContentsSourceSubtable
tableContentsSourceSubtable :: Typed.TypedTerm Syntax.PathResolvedUserDefinedTypeName -> Typed.TypedTerm (Maybe Syntax.SubtableClause) -> Typed.TypedTerm (Maybe Syntax.TableElementList) -> Typed.TypedTerm Syntax.TableContentsSourceSubtable
tableContentsSourceSubtable type_ subtable elements =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.TableContentsSourceSubtable"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "type"),
          Model.fieldTerm = (Typed.unTypedTerm type_)},
        Model.Field {
          Model.fieldName = (Model.Name "subtable"),
          Model.fieldTerm = (Typed.unTypedTerm subtable)},
        Model.Field {
          Model.fieldName = (Model.Name "elements"),
          Model.fieldTerm = (Typed.unTypedTerm elements)}]}))

-- | DSL accessor for the elements field of hydra.ext.sql.syntax.TableContentsSourceSubtable
tableContentsSourceSubtableElements :: Typed.TypedTerm Syntax.TableContentsSourceSubtable -> Typed.TypedTerm (Maybe Syntax.TableElementList)
tableContentsSourceSubtableElements x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.TableContentsSourceSubtable"),
        Model.projectionFieldName = (Model.Name "elements")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL injection for the subtableOf variant of hydra.ext.sql.syntax.TableContentsSource
tableContentsSourceSubtableOf :: Typed.TypedTerm Syntax.TableContentsSourceSubtable -> Typed.TypedTerm Syntax.TableContentsSource
tableContentsSourceSubtableOf x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.TableContentsSource"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "subtableOf"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL accessor for the subtable field of hydra.ext.sql.syntax.TableContentsSourceSubtable
tableContentsSourceSubtableSubtable :: Typed.TypedTerm Syntax.TableContentsSourceSubtable -> Typed.TypedTerm (Maybe Syntax.SubtableClause)
tableContentsSourceSubtableSubtable x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.TableContentsSourceSubtable"),
        Model.projectionFieldName = (Model.Name "subtable")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.TableContentsSourceSubtable
tableContentsSourceSubtableTableContentsSourceSubtable :: Typed.TypedName Syntax.TableContentsSourceSubtable
tableContentsSourceSubtableTableContentsSourceSubtable =
    Typed.TypedName (Model.Name "hydra.ext.sql.syntax.TableContentsSourceSubtable")

-- | DSL accessor for the type field of hydra.ext.sql.syntax.TableContentsSourceSubtable
tableContentsSourceSubtableType :: Typed.TypedTerm Syntax.TableContentsSourceSubtable -> Typed.TypedTerm Syntax.PathResolvedUserDefinedTypeName
tableContentsSourceSubtableType x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.TableContentsSourceSubtable"),
        Model.projectionFieldName = (Model.Name "type")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL updater for the elements field of hydra.ext.sql.syntax.TableContentsSourceSubtable
tableContentsSourceSubtableWithElements :: Typed.TypedTerm Syntax.TableContentsSourceSubtable -> Typed.TypedTerm (Maybe Syntax.TableElementList) -> Typed.TypedTerm Syntax.TableContentsSourceSubtable
tableContentsSourceSubtableWithElements original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.TableContentsSourceSubtable"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "type"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.TableContentsSourceSubtable"),
              Model.projectionFieldName = (Model.Name "type")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "subtable"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.TableContentsSourceSubtable"),
              Model.projectionFieldName = (Model.Name "subtable")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "elements"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))

-- | DSL updater for the subtable field of hydra.ext.sql.syntax.TableContentsSourceSubtable
tableContentsSourceSubtableWithSubtable :: Typed.TypedTerm Syntax.TableContentsSourceSubtable -> Typed.TypedTerm (Maybe Syntax.SubtableClause) -> Typed.TypedTerm Syntax.TableContentsSourceSubtable
tableContentsSourceSubtableWithSubtable original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.TableContentsSourceSubtable"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "type"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.TableContentsSourceSubtable"),
              Model.projectionFieldName = (Model.Name "type")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "subtable"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)},
        Model.Field {
          Model.fieldName = (Model.Name "elements"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.TableContentsSourceSubtable"),
              Model.projectionFieldName = (Model.Name "elements")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))

-- | DSL updater for the type field of hydra.ext.sql.syntax.TableContentsSourceSubtable
tableContentsSourceSubtableWithType :: Typed.TypedTerm Syntax.TableContentsSourceSubtable -> Typed.TypedTerm Syntax.PathResolvedUserDefinedTypeName -> Typed.TypedTerm Syntax.TableContentsSourceSubtable
tableContentsSourceSubtableWithType original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.TableContentsSourceSubtable"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "type"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)},
        Model.Field {
          Model.fieldName = (Model.Name "subtable"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.TableContentsSourceSubtable"),
              Model.projectionFieldName = (Model.Name "subtable")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "elements"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.TableContentsSourceSubtable"),
              Model.projectionFieldName = (Model.Name "elements")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))

-- | DSL name token for hydra.ext.sql.syntax.TableContentsSource
tableContentsSourceTableContentsSource :: Typed.TypedName Syntax.TableContentsSource
tableContentsSourceTableContentsSource = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.TableContentsSource")

-- | DSL constructor for hydra.ext.sql.syntax.TableDefinition
tableDefinition :: Typed.TypedTerm (Maybe Syntax.TableScope) -> Typed.TypedTerm Syntax.TableName -> Typed.TypedTerm Syntax.TableContentsSource -> Typed.TypedTerm (Maybe Syntax.TableCommitAction) -> Typed.TypedTerm Syntax.TableDefinition
tableDefinition scope name source commitActions =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.TableDefinition"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "scope"),
          Model.fieldTerm = (Typed.unTypedTerm scope)},
        Model.Field {
          Model.fieldName = (Model.Name "name"),
          Model.fieldTerm = (Typed.unTypedTerm name)},
        Model.Field {
          Model.fieldName = (Model.Name "source"),
          Model.fieldTerm = (Typed.unTypedTerm source)},
        Model.Field {
          Model.fieldName = (Model.Name "commitActions"),
          Model.fieldTerm = (Typed.unTypedTerm commitActions)}]}))

-- | DSL accessor for the commitActions field of hydra.ext.sql.syntax.TableDefinition
tableDefinitionCommitActions :: Typed.TypedTerm Syntax.TableDefinition -> Typed.TypedTerm (Maybe Syntax.TableCommitAction)
tableDefinitionCommitActions x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.TableDefinition"),
        Model.projectionFieldName = (Model.Name "commitActions")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the name field of hydra.ext.sql.syntax.TableDefinition
tableDefinitionName :: Typed.TypedTerm Syntax.TableDefinition -> Typed.TypedTerm Syntax.TableName
tableDefinitionName x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.TableDefinition"),
        Model.projectionFieldName = (Model.Name "name")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the scope field of hydra.ext.sql.syntax.TableDefinition
tableDefinitionScope :: Typed.TypedTerm Syntax.TableDefinition -> Typed.TypedTerm (Maybe Syntax.TableScope)
tableDefinitionScope x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.TableDefinition"),
        Model.projectionFieldName = (Model.Name "scope")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the source field of hydra.ext.sql.syntax.TableDefinition
tableDefinitionSource :: Typed.TypedTerm Syntax.TableDefinition -> Typed.TypedTerm Syntax.TableContentsSource
tableDefinitionSource x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.TableDefinition"),
        Model.projectionFieldName = (Model.Name "source")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.TableDefinition
tableDefinitionTableDefinition :: Typed.TypedName Syntax.TableDefinition
tableDefinitionTableDefinition = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.TableDefinition")

-- | DSL updater for the commitActions field of hydra.ext.sql.syntax.TableDefinition
tableDefinitionWithCommitActions :: Typed.TypedTerm Syntax.TableDefinition -> Typed.TypedTerm (Maybe Syntax.TableCommitAction) -> Typed.TypedTerm Syntax.TableDefinition
tableDefinitionWithCommitActions original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.TableDefinition"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "scope"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.TableDefinition"),
              Model.projectionFieldName = (Model.Name "scope")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "name"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.TableDefinition"),
              Model.projectionFieldName = (Model.Name "name")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "source"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.TableDefinition"),
              Model.projectionFieldName = (Model.Name "source")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "commitActions"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))

-- | DSL updater for the name field of hydra.ext.sql.syntax.TableDefinition
tableDefinitionWithName :: Typed.TypedTerm Syntax.TableDefinition -> Typed.TypedTerm Syntax.TableName -> Typed.TypedTerm Syntax.TableDefinition
tableDefinitionWithName original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.TableDefinition"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "scope"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.TableDefinition"),
              Model.projectionFieldName = (Model.Name "scope")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "name"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)},
        Model.Field {
          Model.fieldName = (Model.Name "source"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.TableDefinition"),
              Model.projectionFieldName = (Model.Name "source")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "commitActions"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.TableDefinition"),
              Model.projectionFieldName = (Model.Name "commitActions")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))

-- | DSL updater for the scope field of hydra.ext.sql.syntax.TableDefinition
tableDefinitionWithScope :: Typed.TypedTerm Syntax.TableDefinition -> Typed.TypedTerm (Maybe Syntax.TableScope) -> Typed.TypedTerm Syntax.TableDefinition
tableDefinitionWithScope original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.TableDefinition"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "scope"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)},
        Model.Field {
          Model.fieldName = (Model.Name "name"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.TableDefinition"),
              Model.projectionFieldName = (Model.Name "name")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "source"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.TableDefinition"),
              Model.projectionFieldName = (Model.Name "source")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "commitActions"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.TableDefinition"),
              Model.projectionFieldName = (Model.Name "commitActions")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))

-- | DSL updater for the source field of hydra.ext.sql.syntax.TableDefinition
tableDefinitionWithSource :: Typed.TypedTerm Syntax.TableDefinition -> Typed.TypedTerm Syntax.TableContentsSource -> Typed.TypedTerm Syntax.TableDefinition
tableDefinitionWithSource original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.TableDefinition"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "scope"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.TableDefinition"),
              Model.projectionFieldName = (Model.Name "scope")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "name"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.TableDefinition"),
              Model.projectionFieldName = (Model.Name "name")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "source"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)},
        Model.Field {
          Model.fieldName = (Model.Name "commitActions"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.TableDefinition"),
              Model.projectionFieldName = (Model.Name "commitActions")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))

-- | DSL injection for the columOptions variant of hydra.ext.sql.syntax.TableElement
tableElementColumOptions :: Typed.TypedTerm Syntax.ColumnOptions -> Typed.TypedTerm Syntax.TableElement
tableElementColumOptions x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.TableElement"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "columOptions"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the column variant of hydra.ext.sql.syntax.TableElement
tableElementColumn :: Typed.TypedTerm Syntax.ColumnDefinition -> Typed.TypedTerm Syntax.TableElement
tableElementColumn x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.TableElement"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "column"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the like variant of hydra.ext.sql.syntax.TableElement
tableElementLike :: Typed.TypedTerm Syntax.LikeClause -> Typed.TypedTerm Syntax.TableElement
tableElementLike x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.TableElement"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "like"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL constructor for hydra.ext.sql.syntax.TableElementList
tableElementList :: Typed.TypedTerm Syntax.TableElement -> Typed.TypedTerm [Syntax.TableElement] -> Typed.TypedTerm Syntax.TableElementList
tableElementList first rest =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.TableElementList"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "first"),
          Model.fieldTerm = (Typed.unTypedTerm first)},
        Model.Field {
          Model.fieldName = (Model.Name "rest"),
          Model.fieldTerm = (Typed.unTypedTerm rest)}]}))

-- | DSL accessor for the first field of hydra.ext.sql.syntax.TableElementList
tableElementListFirst :: Typed.TypedTerm Syntax.TableElementList -> Typed.TypedTerm Syntax.TableElement
tableElementListFirst x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.TableElementList"),
        Model.projectionFieldName = (Model.Name "first")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the rest field of hydra.ext.sql.syntax.TableElementList
tableElementListRest :: Typed.TypedTerm Syntax.TableElementList -> Typed.TypedTerm [Syntax.TableElement]
tableElementListRest x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermProject (Model.Projection {
        Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.TableElementList"),
        Model.projectionFieldName = (Model.Name "rest")})),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.TableElementList
tableElementListTableElementList :: Typed.TypedName Syntax.TableElementList
tableElementListTableElementList = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.TableElementList")

-- | DSL updater for the first field of hydra.ext.sql.syntax.TableElementList
tableElementListWithFirst :: Typed.TypedTerm Syntax.TableElementList -> Typed.TypedTerm Syntax.TableElement -> Typed.TypedTerm Syntax.TableElementList
tableElementListWithFirst original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.TableElementList"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "first"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)},
        Model.Field {
          Model.fieldName = (Model.Name "rest"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.TableElementList"),
              Model.projectionFieldName = (Model.Name "rest")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))

-- | DSL updater for the rest field of hydra.ext.sql.syntax.TableElementList
tableElementListWithRest :: Typed.TypedTerm Syntax.TableElementList -> Typed.TypedTerm [Syntax.TableElement] -> Typed.TypedTerm Syntax.TableElementList
tableElementListWithRest original newVal =
    Typed.TypedTerm (Model.TermRecord (Model.Record {
      Model.recordTypeName = (Model.Name "hydra.ext.sql.syntax.TableElementList"),
      Model.recordFields = [
        Model.Field {
          Model.fieldName = (Model.Name "first"),
          Model.fieldTerm = (Model.TermApplication (Model.Application {
            Model.applicationFunction = (Model.TermProject (Model.Projection {
              Model.projectionTypeName = (Model.Name "hydra.ext.sql.syntax.TableElementList"),
              Model.projectionFieldName = (Model.Name "first")})),
            Model.applicationArgument = (Typed.unTypedTerm original)}))},
        Model.Field {
          Model.fieldName = (Model.Name "rest"),
          Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))

-- | DSL injection for the selfReferencingColumn variant of hydra.ext.sql.syntax.TableElement
tableElementSelfReferencingColumn :: Typed.TypedTerm Syntax.SelfReferencingColumnSpecification -> Typed.TypedTerm Syntax.TableElement
tableElementSelfReferencingColumn x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.TableElement"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "selfReferencingColumn"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the tableConstraint variant of hydra.ext.sql.syntax.TableElement
tableElementTableConstraint :: Typed.TypedTerm Syntax.TableConstraintDefinition -> Typed.TypedTerm Syntax.TableElement
tableElementTableConstraint x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.TableElement"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "tableConstraint"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL name token for hydra.ext.sql.syntax.TableElement
tableElementTableElement :: Typed.TypedName Syntax.TableElement
tableElementTableElement = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.TableElement")

-- | DSL constructor for the hydra.ext.sql.syntax.TableName wrapper
tableName :: Typed.TypedTerm String -> Typed.TypedTerm Syntax.TableName
tableName x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.TableName"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.TableName
tableNameTableName :: Typed.TypedName Syntax.TableName
tableNameTableName = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.TableName")

-- | DSL constructor for the hydra.ext.sql.syntax.TableScope wrapper
tableScope :: Typed.TypedTerm Syntax.GlobalOrLocal -> Typed.TypedTerm Syntax.TableScope
tableScope x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.TableScope"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.TableScope
tableScopeTableScope :: Typed.TypedName Syntax.TableScope
tableScopeTableScope = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.TableScope")

-- | DSL constructor for the hydra.ext.sql.syntax.TimeLiteral wrapper
timeLiteral :: Typed.TypedTerm Syntax.TimeString -> Typed.TypedTerm Syntax.TimeLiteral
timeLiteral x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.TimeLiteral"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.TimeLiteral
timeLiteralTimeLiteral :: Typed.TypedName Syntax.TimeLiteral
timeLiteralTimeLiteral = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.TimeLiteral")

-- | DSL constructor for the hydra.ext.sql.syntax.TimeString wrapper
timeString :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.TimeString
timeString x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.TimeString"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.TimeString
timeStringTimeString :: Typed.TypedName Syntax.TimeString
timeStringTimeString = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.TimeString")

-- | DSL constructor for the hydra.ext.sql.syntax.TimestampLiteral wrapper
timestampLiteral :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.TimestampLiteral
timestampLiteral x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.TimestampLiteral"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.TimestampLiteral
timestampLiteralTimestampLiteral :: Typed.TypedName Syntax.TimestampLiteral
timestampLiteralTimestampLiteral = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.TimestampLiteral")

-- | DSL injection for the FALSE variant of hydra.ext.sql.syntax.TruthValue
truthValueFALSE :: Typed.TypedTerm Syntax.TruthValue
truthValueFALSE =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.TruthValue"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "FALSE"),
        Model.fieldTerm = Model.TermUnit}}))

-- | DSL injection for the TRUE variant of hydra.ext.sql.syntax.TruthValue
truthValueTRUE :: Typed.TypedTerm Syntax.TruthValue
truthValueTRUE =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.TruthValue"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "TRUE"),
        Model.fieldTerm = Model.TermUnit}}))

-- | DSL name token for hydra.ext.sql.syntax.TruthValue
truthValueTruthValue :: Typed.TypedName Syntax.TruthValue
truthValueTruthValue = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.TruthValue")

-- | DSL injection for the UNKNOWN variant of hydra.ext.sql.syntax.TruthValue
truthValueUNKNOWN :: Typed.TypedTerm Syntax.TruthValue
truthValueUNKNOWN =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.TruthValue"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "UNKNOWN"),
        Model.fieldTerm = Model.TermUnit}}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.ApproximateNumericLiteral
unApproximateNumericLiteral :: Typed.TypedTerm Syntax.ApproximateNumericLiteral -> Typed.TypedTerm String
unApproximateNumericLiteral x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.ApproximateNumericLiteral")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.ArrayElement
unArrayElement :: Typed.TypedTerm Syntax.ArrayElement -> Typed.TypedTerm Syntax.ValueExpression
unArrayElement x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.ArrayElement")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.ArrayElementReference
unArrayElementReference :: Typed.TypedTerm Syntax.ArrayElementReference -> Typed.TypedTerm ()
unArrayElementReference x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.ArrayElementReference")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.ArrayType
unArrayType :: Typed.TypedTerm Syntax.ArrayType -> Typed.TypedTerm ()
unArrayType x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.ArrayType")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.ArrayValueConstructorByQuery
unArrayValueConstructorByQuery :: Typed.TypedTerm Syntax.ArrayValueConstructorByQuery -> Typed.TypedTerm ()
unArrayValueConstructorByQuery x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.ArrayValueConstructorByQuery")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.ArrayValueExpression
unArrayValueExpression :: Typed.TypedTerm Syntax.ArrayValueExpression -> Typed.TypedTerm ()
unArrayValueExpression x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.ArrayValueExpression")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.AsSubqueryClause
unAsSubqueryClause :: Typed.TypedTerm Syntax.AsSubqueryClause -> Typed.TypedTerm ()
unAsSubqueryClause x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.AsSubqueryClause")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.AttributeOrMethodReference
unAttributeOrMethodReference :: Typed.TypedTerm Syntax.AttributeOrMethodReference -> Typed.TypedTerm ()
unAttributeOrMethodReference x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.AttributeOrMethodReference")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.BinaryStringLiteral
unBinaryStringLiteral :: Typed.TypedTerm Syntax.BinaryStringLiteral -> Typed.TypedTerm ()
unBinaryStringLiteral x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.BinaryStringLiteral")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.BooleanPredicand
unBooleanPredicand :: Typed.TypedTerm Syntax.BooleanPredicand -> Typed.TypedTerm ()
unBooleanPredicand x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.BooleanPredicand")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.BooleanType
unBooleanType :: Typed.TypedTerm Syntax.BooleanType -> Typed.TypedTerm ()
unBooleanType x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.BooleanType")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.CaseExpression
unCaseExpression :: Typed.TypedTerm Syntax.CaseExpression -> Typed.TypedTerm ()
unCaseExpression x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.CaseExpression")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.CastSpecification
unCastSpecification :: Typed.TypedTerm Syntax.CastSpecification -> Typed.TypedTerm ()
unCastSpecification x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.CastSpecification")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.CharacterSetSpecification
unCharacterSetSpecification :: Typed.TypedTerm Syntax.CharacterSetSpecification -> Typed.TypedTerm ()
unCharacterSetSpecification x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.CharacterSetSpecification")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.CharacterStringLiteral
unCharacterStringLiteral :: Typed.TypedTerm Syntax.CharacterStringLiteral -> Typed.TypedTerm String
unCharacterStringLiteral x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.CharacterStringLiteral")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.CollateClause
unCollateClause :: Typed.TypedTerm Syntax.CollateClause -> Typed.TypedTerm ()
unCollateClause x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.CollateClause")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.ColumnConstraintDefinition
unColumnConstraintDefinition :: Typed.TypedTerm Syntax.ColumnConstraintDefinition -> Typed.TypedTerm ()
unColumnConstraintDefinition x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.ColumnConstraintDefinition")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.ColumnName
unColumnName :: Typed.TypedTerm Syntax.ColumnName -> Typed.TypedTerm String
unColumnName x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.ColumnName")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.ColumnOptions
unColumnOptions :: Typed.TypedTerm Syntax.ColumnOptions -> Typed.TypedTerm ()
unColumnOptions x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.ColumnOptions")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.ColumnReference
unColumnReference :: Typed.TypedTerm Syntax.ColumnReference -> Typed.TypedTerm ()
unColumnReference x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.ColumnReference")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.ContextuallyTypedRowValueConstructor
unContextuallyTypedRowValueConstructor :: Typed.TypedTerm Syntax.ContextuallyTypedRowValueConstructor -> Typed.TypedTerm ()
unContextuallyTypedRowValueConstructor x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.ContextuallyTypedRowValueConstructor")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.ContextuallyTypedTableValueConstructor
unContextuallyTypedTableValueConstructor :: Typed.TypedTerm Syntax.ContextuallyTypedTableValueConstructor -> Typed.TypedTerm Syntax.ContextuallyTypedRowValueExpressionList
unContextuallyTypedTableValueConstructor x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.ContextuallyTypedTableValueConstructor")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.DateLiteral
unDateLiteral :: Typed.TypedTerm Syntax.DateLiteral -> Typed.TypedTerm Syntax.DateString
unDateLiteral x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.DateLiteral")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.DateString
unDateString :: Typed.TypedTerm Syntax.DateString -> Typed.TypedTerm ()
unDateString x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.DateString")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.DatetimeType
unDatetimeType :: Typed.TypedTerm Syntax.DatetimeType -> Typed.TypedTerm ()
unDatetimeType x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.DatetimeType")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.DatetimeValueExpression
unDatetimeValueExpression :: Typed.TypedTerm Syntax.DatetimeValueExpression -> Typed.TypedTerm ()
unDatetimeValueExpression x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.DatetimeValueExpression")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.DefaultClause
unDefaultClause :: Typed.TypedTerm Syntax.DefaultClause -> Typed.TypedTerm ()
unDefaultClause x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.DefaultClause")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.DomainName
unDomainName :: Typed.TypedTerm Syntax.DomainName -> Typed.TypedTerm String
unDomainName x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.DomainName")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.ExactNumericLiteral
unExactNumericLiteral :: Typed.TypedTerm Syntax.ExactNumericLiteral -> Typed.TypedTerm String
unExactNumericLiteral x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.ExactNumericLiteral")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.FieldReference
unFieldReference :: Typed.TypedTerm Syntax.FieldReference -> Typed.TypedTerm ()
unFieldReference x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.FieldReference")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.FromDefault
unFromDefault :: Typed.TypedTerm Syntax.FromDefault -> Typed.TypedTerm ()
unFromDefault x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.FromDefault")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.FromSubquery
unFromSubquery :: Typed.TypedTerm Syntax.FromSubquery -> Typed.TypedTerm ()
unFromSubquery x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.FromSubquery")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.GeneralValueSpecification
unGeneralValueSpecification :: Typed.TypedTerm Syntax.GeneralValueSpecification -> Typed.TypedTerm ()
unGeneralValueSpecification x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.GeneralValueSpecification")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.GenerationClause
unGenerationClause :: Typed.TypedTerm Syntax.GenerationClause -> Typed.TypedTerm ()
unGenerationClause x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.GenerationClause")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.IdentityColumnSpecification
unIdentityColumnSpecification :: Typed.TypedTerm Syntax.IdentityColumnSpecification -> Typed.TypedTerm ()
unIdentityColumnSpecification x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.IdentityColumnSpecification")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.InsertColumnList
unInsertColumnList :: Typed.TypedTerm Syntax.InsertColumnList -> Typed.TypedTerm Syntax.ColumnNameList
unInsertColumnList x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.InsertColumnList")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.InsertionTarget
unInsertionTarget :: Typed.TypedTerm Syntax.InsertionTarget -> Typed.TypedTerm Syntax.TableName
unInsertionTarget x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.InsertionTarget")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.IntervalLiteral
unIntervalLiteral :: Typed.TypedTerm Syntax.IntervalLiteral -> Typed.TypedTerm ()
unIntervalLiteral x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.IntervalLiteral")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.IntervalType
unIntervalType :: Typed.TypedTerm Syntax.IntervalType -> Typed.TypedTerm ()
unIntervalType x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.IntervalType")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.IntervalValueExpression
unIntervalValueExpression :: Typed.TypedTerm Syntax.IntervalValueExpression -> Typed.TypedTerm ()
unIntervalValueExpression x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.IntervalValueExpression")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.LargeObjectLength
unLargeObjectLength :: Typed.TypedTerm Syntax.LargeObjectLength -> Typed.TypedTerm ()
unLargeObjectLength x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.LargeObjectLength")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.LeftBracketOrTrigraph
unLeftBracketOrTrigraph :: Typed.TypedTerm Syntax.LeftBracketOrTrigraph -> Typed.TypedTerm String
unLeftBracketOrTrigraph x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.LeftBracketOrTrigraph")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.Length
unLength :: Typed.TypedTerm Syntax.Length -> Typed.TypedTerm Syntax.UnsignedInteger
unLength x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.Length")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.LikeClause
unLikeClause :: Typed.TypedTerm Syntax.LikeClause -> Typed.TypedTerm ()
unLikeClause x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.LikeClause")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.MethodInvocation
unMethodInvocation :: Typed.TypedTerm Syntax.MethodInvocation -> Typed.TypedTerm ()
unMethodInvocation x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.MethodInvocation")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.MultisetElementReference
unMultisetElementReference :: Typed.TypedTerm Syntax.MultisetElementReference -> Typed.TypedTerm ()
unMultisetElementReference x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.MultisetElementReference")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.MultisetType
unMultisetType :: Typed.TypedTerm Syntax.MultisetType -> Typed.TypedTerm Syntax.DataType
unMultisetType x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.MultisetType")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.MultisetValueConstructor
unMultisetValueConstructor :: Typed.TypedTerm Syntax.MultisetValueConstructor -> Typed.TypedTerm ()
unMultisetValueConstructor x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.MultisetValueConstructor")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.MultisetValueExpression
unMultisetValueExpression :: Typed.TypedTerm Syntax.MultisetValueExpression -> Typed.TypedTerm ()
unMultisetValueExpression x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.MultisetValueExpression")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.NationalCharacterStringLiteral
unNationalCharacterStringLiteral :: Typed.TypedTerm Syntax.NationalCharacterStringLiteral -> Typed.TypedTerm ()
unNationalCharacterStringLiteral x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.NationalCharacterStringLiteral")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.NationalCharacterStringType
unNationalCharacterStringType :: Typed.TypedTerm Syntax.NationalCharacterStringType -> Typed.TypedTerm ()
unNationalCharacterStringType x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.NationalCharacterStringType")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.NewSpecification
unNewSpecification :: Typed.TypedTerm Syntax.NewSpecification -> Typed.TypedTerm ()
unNewSpecification x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.NewSpecification")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.NextValueExpression
unNextValueExpression :: Typed.TypedTerm Syntax.NextValueExpression -> Typed.TypedTerm ()
unNextValueExpression x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.NextValueExpression")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.NumericValueExpression
unNumericValueExpression :: Typed.TypedTerm Syntax.NumericValueExpression -> Typed.TypedTerm ()
unNumericValueExpression x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.NumericValueExpression")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.ParenthesizedValueExpression
unParenthesizedValueExpression :: Typed.TypedTerm Syntax.ParenthesizedValueExpression -> Typed.TypedTerm Syntax.ValueExpression
unParenthesizedValueExpression x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.ParenthesizedValueExpression")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.PathResolvedUserDefinedTypeName
unPathResolvedUserDefinedTypeName :: Typed.TypedTerm Syntax.PathResolvedUserDefinedTypeName -> Typed.TypedTerm String
unPathResolvedUserDefinedTypeName x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.PathResolvedUserDefinedTypeName")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.Precision
unPrecision :: Typed.TypedTerm Syntax.Precision -> Typed.TypedTerm Syntax.UnsignedInteger
unPrecision x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.Precision")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.Predicate
unPredicate :: Typed.TypedTerm Syntax.Predicate -> Typed.TypedTerm ()
unPredicate x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.Predicate")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.QueryExpression
unQueryExpression :: Typed.TypedTerm Syntax.QueryExpression -> Typed.TypedTerm ()
unQueryExpression x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.QueryExpression")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.ReferenceResolution
unReferenceResolution :: Typed.TypedTerm Syntax.ReferenceResolution -> Typed.TypedTerm ()
unReferenceResolution x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.ReferenceResolution")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.ReferenceScopeCheck
unReferenceScopeCheck :: Typed.TypedTerm Syntax.ReferenceScopeCheck -> Typed.TypedTerm ()
unReferenceScopeCheck x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.ReferenceScopeCheck")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.ReferenceType
unReferenceType :: Typed.TypedTerm Syntax.ReferenceType -> Typed.TypedTerm ()
unReferenceType x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.ReferenceType")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.ReferenceValueExpression
unReferenceValueExpression :: Typed.TypedTerm Syntax.ReferenceValueExpression -> Typed.TypedTerm Syntax.ValueExpressionPrimary
unReferenceValueExpression x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.ReferenceValueExpression")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.RightBracketOrTrigraph
unRightBracketOrTrigraph :: Typed.TypedTerm Syntax.RightBracketOrTrigraph -> Typed.TypedTerm String
unRightBracketOrTrigraph x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.RightBracketOrTrigraph")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.RoutineInvocation
unRoutineInvocation :: Typed.TypedTerm Syntax.RoutineInvocation -> Typed.TypedTerm ()
unRoutineInvocation x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.RoutineInvocation")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.RowType
unRowType :: Typed.TypedTerm Syntax.RowType -> Typed.TypedTerm ()
unRowType x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.RowType")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.RowValueExpression
unRowValueExpression :: Typed.TypedTerm Syntax.RowValueExpression -> Typed.TypedTerm ()
unRowValueExpression x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.RowValueExpression")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.RowValueSpecialCase
unRowValueSpecialCase :: Typed.TypedTerm Syntax.RowValueSpecialCase -> Typed.TypedTerm Syntax.NonparenthesizedValueExpressionPrimary
unRowValueSpecialCase x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.RowValueSpecialCase")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.ScalarSubquery
unScalarSubquery :: Typed.TypedTerm Syntax.ScalarSubquery -> Typed.TypedTerm Syntax.Subquery
unScalarSubquery x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.ScalarSubquery")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.Scale
unScale :: Typed.TypedTerm Syntax.Scale -> Typed.TypedTerm Syntax.UnsignedInteger
unScale x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.Scale")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.SelfReferencingColumnSpecification
unSelfReferencingColumnSpecification :: Typed.TypedTerm Syntax.SelfReferencingColumnSpecification -> Typed.TypedTerm ()
unSelfReferencingColumnSpecification x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.SelfReferencingColumnSpecification")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.SetFunctionSpecification
unSetFunctionSpecification :: Typed.TypedTerm Syntax.SetFunctionSpecification -> Typed.TypedTerm ()
unSetFunctionSpecification x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.SetFunctionSpecification")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.StaticMethodInvocation
unStaticMethodInvocation :: Typed.TypedTerm Syntax.StaticMethodInvocation -> Typed.TypedTerm ()
unStaticMethodInvocation x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.StaticMethodInvocation")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.StringValueExpression
unStringValueExpression :: Typed.TypedTerm Syntax.StringValueExpression -> Typed.TypedTerm ()
unStringValueExpression x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.StringValueExpression")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.Subquery
unSubquery :: Typed.TypedTerm Syntax.Subquery -> Typed.TypedTerm Syntax.QueryExpression
unSubquery x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.Subquery")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.SubtableClause
unSubtableClause :: Typed.TypedTerm Syntax.SubtableClause -> Typed.TypedTerm ()
unSubtableClause x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.SubtableClause")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.SubtypeTreatment
unSubtypeTreatment :: Typed.TypedTerm Syntax.SubtypeTreatment -> Typed.TypedTerm ()
unSubtypeTreatment x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.SubtypeTreatment")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.TableConstraintDefinition
unTableConstraintDefinition :: Typed.TypedTerm Syntax.TableConstraintDefinition -> Typed.TypedTerm ()
unTableConstraintDefinition x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.TableConstraintDefinition")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.TableName
unTableName :: Typed.TypedTerm Syntax.TableName -> Typed.TypedTerm String
unTableName x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.TableName")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.TableScope
unTableScope :: Typed.TypedTerm Syntax.TableScope -> Typed.TypedTerm Syntax.GlobalOrLocal
unTableScope x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.TableScope")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.TimeLiteral
unTimeLiteral :: Typed.TypedTerm Syntax.TimeLiteral -> Typed.TypedTerm Syntax.TimeString
unTimeLiteral x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.TimeLiteral")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.TimeString
unTimeString :: Typed.TypedTerm Syntax.TimeString -> Typed.TypedTerm ()
unTimeString x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.TimeString")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.TimestampLiteral
unTimestampLiteral :: Typed.TypedTerm Syntax.TimestampLiteral -> Typed.TypedTerm ()
unTimestampLiteral x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.TimestampLiteral")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.UnicodeCharacterStringLiteral
unUnicodeCharacterStringLiteral :: Typed.TypedTerm Syntax.UnicodeCharacterStringLiteral -> Typed.TypedTerm ()
unUnicodeCharacterStringLiteral x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.UnicodeCharacterStringLiteral")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.UnsignedInteger
unUnsignedInteger :: Typed.TypedTerm Syntax.UnsignedInteger -> Typed.TypedTerm String
unUnsignedInteger x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.UnsignedInteger")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.UserDefinedTypeValueExpression
unUserDefinedTypeValueExpression :: Typed.TypedTerm Syntax.UserDefinedTypeValueExpression -> Typed.TypedTerm Syntax.ValueExpressionPrimary
unUserDefinedTypeValueExpression x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.UserDefinedTypeValueExpression")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL accessor for the body of hydra.ext.sql.syntax.WindowFunction
unWindowFunction :: Typed.TypedTerm Syntax.WindowFunction -> Typed.TypedTerm ()
unWindowFunction x =
    Typed.TypedTerm (Model.TermApplication (Model.Application {
      Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.ext.sql.syntax.WindowFunction")),
      Model.applicationArgument = (Typed.unTypedTerm x)}))

-- | DSL constructor for the hydra.ext.sql.syntax.UnicodeCharacterStringLiteral wrapper
unicodeCharacterStringLiteral :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.UnicodeCharacterStringLiteral
unicodeCharacterStringLiteral x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.UnicodeCharacterStringLiteral"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.UnicodeCharacterStringLiteral
unicodeCharacterStringLiteralUnicodeCharacterStringLiteral :: Typed.TypedName Syntax.UnicodeCharacterStringLiteral
unicodeCharacterStringLiteralUnicodeCharacterStringLiteral =
    Typed.TypedName (Model.Name "hydra.ext.sql.syntax.UnicodeCharacterStringLiteral")

-- | DSL constructor for the hydra.ext.sql.syntax.UnsignedInteger wrapper
unsignedInteger :: Typed.TypedTerm String -> Typed.TypedTerm Syntax.UnsignedInteger
unsignedInteger x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.UnsignedInteger"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.UnsignedInteger
unsignedIntegerUnsignedInteger :: Typed.TypedName Syntax.UnsignedInteger
unsignedIntegerUnsignedInteger = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.UnsignedInteger")

-- | DSL injection for the general variant of hydra.ext.sql.syntax.UnsignedLiteral
unsignedLiteralGeneral :: Typed.TypedTerm Syntax.GeneralLiteral -> Typed.TypedTerm Syntax.UnsignedLiteral
unsignedLiteralGeneral x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.UnsignedLiteral"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "general"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the numeric variant of hydra.ext.sql.syntax.UnsignedLiteral
unsignedLiteralNumeric :: Typed.TypedTerm Syntax.UnsignedNumericLiteral -> Typed.TypedTerm Syntax.UnsignedLiteral
unsignedLiteralNumeric x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.UnsignedLiteral"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "numeric"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL name token for hydra.ext.sql.syntax.UnsignedLiteral
unsignedLiteralUnsignedLiteral :: Typed.TypedName Syntax.UnsignedLiteral
unsignedLiteralUnsignedLiteral = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.UnsignedLiteral")

-- | DSL injection for the approximate variant of hydra.ext.sql.syntax.UnsignedNumericLiteral
unsignedNumericLiteralApproximate :: Typed.TypedTerm Syntax.ApproximateNumericLiteral -> Typed.TypedTerm Syntax.UnsignedNumericLiteral
unsignedNumericLiteralApproximate x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.UnsignedNumericLiteral"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "approximate"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the exact variant of hydra.ext.sql.syntax.UnsignedNumericLiteral
unsignedNumericLiteralExact :: Typed.TypedTerm Syntax.ExactNumericLiteral -> Typed.TypedTerm Syntax.UnsignedNumericLiteral
unsignedNumericLiteralExact x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.UnsignedNumericLiteral"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "exact"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL name token for hydra.ext.sql.syntax.UnsignedNumericLiteral
unsignedNumericLiteralUnsignedNumericLiteral :: Typed.TypedName Syntax.UnsignedNumericLiteral
unsignedNumericLiteralUnsignedNumericLiteral = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.UnsignedNumericLiteral")

-- | DSL injection for the general variant of hydra.ext.sql.syntax.UnsignedValueSpecification
unsignedValueSpecificationGeneral :: Typed.TypedTerm Syntax.GeneralValueSpecification -> Typed.TypedTerm Syntax.UnsignedValueSpecification
unsignedValueSpecificationGeneral x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.UnsignedValueSpecification"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "general"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the literal variant of hydra.ext.sql.syntax.UnsignedValueSpecification
unsignedValueSpecificationLiteral :: Typed.TypedTerm Syntax.UnsignedLiteral -> Typed.TypedTerm Syntax.UnsignedValueSpecification
unsignedValueSpecificationLiteral x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.UnsignedValueSpecification"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "literal"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL name token for hydra.ext.sql.syntax.UnsignedValueSpecification
unsignedValueSpecificationUnsignedValueSpecification :: Typed.TypedName Syntax.UnsignedValueSpecification
unsignedValueSpecificationUnsignedValueSpecification =
    Typed.TypedName (Model.Name "hydra.ext.sql.syntax.UnsignedValueSpecification")

-- | DSL constructor for the hydra.ext.sql.syntax.UserDefinedTypeValueExpression wrapper
userDefinedTypeValueExpression :: Typed.TypedTerm Syntax.ValueExpressionPrimary -> Typed.TypedTerm Syntax.UserDefinedTypeValueExpression
userDefinedTypeValueExpression x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.UserDefinedTypeValueExpression"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.UserDefinedTypeValueExpression
userDefinedTypeValueExpressionUserDefinedTypeValueExpression :: Typed.TypedName Syntax.UserDefinedTypeValueExpression
userDefinedTypeValueExpressionUserDefinedTypeValueExpression =
    Typed.TypedName (Model.Name "hydra.ext.sql.syntax.UserDefinedTypeValueExpression")

-- | DSL injection for the boolean variant of hydra.ext.sql.syntax.ValueExpression
valueExpressionBoolean :: Typed.TypedTerm Syntax.BooleanValueExpression -> Typed.TypedTerm Syntax.ValueExpression
valueExpressionBoolean x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.ValueExpression"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "boolean"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the common variant of hydra.ext.sql.syntax.ValueExpression
valueExpressionCommon :: Typed.TypedTerm Syntax.CommonValueExpression -> Typed.TypedTerm Syntax.ValueExpression
valueExpressionCommon x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.ValueExpression"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "common"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the noparens variant of hydra.ext.sql.syntax.ValueExpressionPrimary
valueExpressionPrimaryNoparens :: Typed.TypedTerm Syntax.NonparenthesizedValueExpressionPrimary -> Typed.TypedTerm Syntax.ValueExpressionPrimary
valueExpressionPrimaryNoparens x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.ValueExpressionPrimary"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "noparens"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL injection for the parens variant of hydra.ext.sql.syntax.ValueExpressionPrimary
valueExpressionPrimaryParens :: Typed.TypedTerm Syntax.ParenthesizedValueExpression -> Typed.TypedTerm Syntax.ValueExpressionPrimary
valueExpressionPrimaryParens x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.ValueExpressionPrimary"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "parens"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL name token for hydra.ext.sql.syntax.ValueExpressionPrimary
valueExpressionPrimaryValueExpressionPrimary :: Typed.TypedName Syntax.ValueExpressionPrimary
valueExpressionPrimaryValueExpressionPrimary = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.ValueExpressionPrimary")

-- | DSL injection for the row variant of hydra.ext.sql.syntax.ValueExpression
valueExpressionRow :: Typed.TypedTerm Syntax.RowValueExpression -> Typed.TypedTerm Syntax.ValueExpression
valueExpressionRow x =
    Typed.TypedTerm (Model.TermInject (Model.Injection {
      Model.injectionTypeName = (Model.Name "hydra.ext.sql.syntax.ValueExpression"),
      Model.injectionField = Model.Field {
        Model.fieldName = (Model.Name "row"),
        Model.fieldTerm = (Typed.unTypedTerm x)}}))

-- | DSL name token for hydra.ext.sql.syntax.ValueExpression
valueExpressionValueExpression :: Typed.TypedName Syntax.ValueExpression
valueExpressionValueExpression = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.ValueExpression")

-- | DSL constructor for the hydra.ext.sql.syntax.WindowFunction wrapper
windowFunction :: Typed.TypedTerm () -> Typed.TypedTerm Syntax.WindowFunction
windowFunction x =
    Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {
      Model.wrappedTermTypeName = (Model.Name "hydra.ext.sql.syntax.WindowFunction"),
      Model.wrappedTermBody = (Typed.unTypedTerm x)}))

-- | DSL name token for hydra.ext.sql.syntax.WindowFunction
windowFunctionWindowFunction :: Typed.TypedName Syntax.WindowFunction
windowFunctionWindowFunction = Typed.TypedName (Model.Name "hydra.ext.sql.syntax.WindowFunction")