mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-17 20:41:49 +03:00
61c990f177
* 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>
38 lines
1.0 KiB
Haskell
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]
|
|
}
|