mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-16 09:51:59 +03:00
974113c80e
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3181 GitOrigin-RevId: 0ded0f2776fcbaaf51420f796673cf132b8cc248
37 lines
1.0 KiB
Haskell
37 lines
1.0 KiB
Haskell
module Hasura.RQL.IR.Conflict
|
|
( OnConflictClause (..),
|
|
OnConflictClauseData (..),
|
|
ConflictTarget (..),
|
|
)
|
|
where
|
|
|
|
import Hasura.Prelude
|
|
import Hasura.RQL.IR.BoolExp
|
|
import Hasura.RQL.Types.Backend
|
|
import Hasura.SQL.Backend
|
|
|
|
-- TODO: When adding support for other backends, consider whether these types
|
|
-- really are generic. If not, please start by moving them to a Postgres-specific
|
|
-- module.
|
|
|
|
data ConflictTarget (b :: BackendType)
|
|
= CTColumn [Column b]
|
|
| CTConstraint (ConstraintName b)
|
|
|
|
deriving instance Backend b => Show (ConflictTarget b)
|
|
|
|
deriving instance Backend b => Eq (ConflictTarget b)
|
|
|
|
data OnConflictClauseData b v = OnConflictClauseData
|
|
{ cp1udConflictTarget :: ConflictTarget b,
|
|
cp1udAffectedColumns :: [Column b],
|
|
cp1udValues :: PreSetColsG b v,
|
|
cp1udFilter :: AnnBoolExp b v
|
|
}
|
|
deriving (Functor, Foldable, Traversable)
|
|
|
|
data OnConflictClause (b :: BackendType) v
|
|
= OCCDoNothing (Maybe (ConflictTarget b))
|
|
| OCCUpdate (OnConflictClauseData b v)
|
|
deriving (Functor, Foldable, Traversable)
|