mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-18 04:51:35 +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>
36 lines
919 B
Haskell
36 lines
919 B
Haskell
module Hasura.RQL.IR.Delete 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.SQL.Backend
|
|
|
|
|
|
data AnnDelG (b :: Backend) v
|
|
= AnnDel
|
|
{ dqp1Table :: !QualifiedTable
|
|
, dqp1Where :: !(AnnBoolExp b v, AnnBoolExp b v)
|
|
, dqp1Output :: !(MutationOutputG b v)
|
|
, dqp1AllCols :: ![ColumnInfo b]
|
|
}
|
|
|
|
type AnnDel b = AnnDelG b S.SQLExp
|
|
|
|
traverseAnnDel
|
|
:: (Applicative f)
|
|
=> (a -> f b)
|
|
-> AnnDelG backend a
|
|
-> f (AnnDelG backend b)
|
|
traverseAnnDel f annUpd =
|
|
AnnDel tn
|
|
<$> ((,) <$> traverseAnnBoolExp f whr <*> traverseAnnBoolExp f fltr)
|
|
<*> traverseMutationOutput f mutOutput
|
|
<*> pure allCols
|
|
where
|
|
AnnDel tn (whr, fltr) mutOutput allCols = annUpd
|