mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-20 22:11:45 +03:00
4ccc830bb8
## Description We go through the module `Hasura.Backends.MSSQL.FromIr` and split it into separate self-contained units, which we document. Note that this PR has a slightly opinionated follow-up PR #3909 . ### Related Issues Fix #3666 ### Solution and Design The module `FromIr` has given rise to: * `FromIr.Expression` * `FromIr.Query` * `FromIr.Delete` * `FromIr.Insert` * `FromIr.Update` * `FromIr.SelectIntoTempTable` And `Execute.MutationResponse` has become `FromIr.MutationResponse` (after some slight adaptation of types). PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3908 GitOrigin-RevId: 364acf1bcdf74f2e19464c31cdded12bd8e9aa59
57 lines
1.4 KiB
Haskell
57 lines
1.4 KiB
Haskell
-- | This module provides constants that are either:
|
|
--
|
|
-- * Simply in common user
|
|
-- * Define names that that multiple pieces of code reference.
|
|
module Hasura.Backends.MSSQL.FromIr.Constants
|
|
( trueExpression,
|
|
nullExpression,
|
|
emptyArrayExpression,
|
|
jsonFieldName,
|
|
aggSubselectName,
|
|
existsFieldName,
|
|
aggFieldName,
|
|
tempTableNameInserted,
|
|
tempTableNameValues,
|
|
tempTableNameDeleted,
|
|
tempTableNameUpdated,
|
|
)
|
|
where
|
|
|
|
import Database.ODBC.SQLServer qualified as ODBC
|
|
import Hasura.Backends.MSSQL.Instances.Types ()
|
|
import Hasura.Backends.MSSQL.Types.Internal as TSQL
|
|
import Hasura.Prelude
|
|
|
|
trueExpression :: Expression
|
|
trueExpression = ValueExpression (ODBC.BoolValue True)
|
|
|
|
nullExpression :: Expression
|
|
nullExpression = ValueExpression $ ODBC.TextValue "null"
|
|
|
|
emptyArrayExpression :: Expression
|
|
emptyArrayExpression = ValueExpression $ ODBC.TextValue "[]"
|
|
|
|
jsonFieldName :: Text
|
|
jsonFieldName = "json"
|
|
|
|
aggSubselectName :: Text
|
|
aggSubselectName = "agg_sub"
|
|
|
|
existsFieldName :: Text
|
|
existsFieldName = "exists_placeholder"
|
|
|
|
aggFieldName :: Text
|
|
aggFieldName = "agg"
|
|
|
|
tempTableNameInserted :: TempTableName
|
|
tempTableNameInserted = TempTableName "inserted"
|
|
|
|
tempTableNameValues :: TempTableName
|
|
tempTableNameValues = TempTableName "values"
|
|
|
|
tempTableNameDeleted :: TempTableName
|
|
tempTableNameDeleted = TempTableName "deleted"
|
|
|
|
tempTableNameUpdated :: TempTableName
|
|
tempTableNameUpdated = TempTableName "updated"
|