graphql-engine/server/src-lib/Hasura/RQL/IR/Insert.hs
Antoine Leblanc 61c990f177
server: split RQL.DML into four different parts (#6072)
* WIP: shuffle everything around

* remove all unused imports & unused top-level binds

* move types to IR subfolder

* revert unrelated changes to Query and Prepare

* reduce differences in remote join, deprecate Translate module

* clean mutation module

* cosmetic: code formatting

* moved some RQL-specific stuff out of IR

* fix misc compilation issues

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-10-29 16:58:13 +00:00

38 lines
1.0 KiB
Haskell

module Hasura.RQL.IR.Insert where
import Hasura.Prelude
import qualified Hasura.Backends.Postgres.SQL.DML as S
import Hasura.Backends.Postgres.SQL.Types
import Hasura.RQL.IR.Returning
import Hasura.RQL.Types.BoolExp
import Hasura.RQL.Types.Column
import Hasura.RQL.Types.Common
import Hasura.SQL.Backend
data ConflictTarget
= CTColumn ![PGCol]
| CTConstraint !ConstraintName
deriving (Show, Eq)
data ConflictClauseP1 (b :: Backend) v
= CP1DoNothing !(Maybe ConflictTarget)
| CP1Update !ConflictTarget ![Column b] !(PreSetColsG b v) (AnnBoolExp b v)
deriving (Functor, Foldable, Traversable)
data InsertQueryP1 (b :: Backend)
= InsertQueryP1
{ iqp1Table :: !QualifiedTable
, iqp1Cols :: ![Column b]
, iqp1Tuples :: ![[S.SQLExp]]
, iqp1Conflict :: !(Maybe (ConflictClauseP1 b S.SQLExp))
, iqp1CheckCond :: !(AnnBoolExpSQL b, Maybe (AnnBoolExpSQL b))
, iqp1Output :: !(MutationOutput b)
, iqp1AllCols :: ![ColumnInfo b]
}