mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-17 12:31:52 +03:00
ba70ca427a
GitOrigin-RevId: 660126d5f65620fb58a3ffcbed564e9e35f59938
22 lines
606 B
Haskell
22 lines
606 B
Haskell
module Hasura.Backends.Postgres.Translate.Delete
|
|
( mkDelete
|
|
) where
|
|
|
|
import Hasura.Prelude
|
|
|
|
import qualified Hasura.Backends.Postgres.SQL.DML as S
|
|
|
|
import Hasura.Backends.Postgres.Translate.BoolExp
|
|
import Hasura.RQL.IR.Delete
|
|
import Hasura.RQL.Types
|
|
|
|
mkDelete
|
|
:: Backend ('Postgres pgKind)
|
|
=> AnnDel ('Postgres pgKind)
|
|
-> S.SQLDelete
|
|
mkDelete (AnnDel tn (fltr, wc) _ _) =
|
|
S.SQLDelete tn Nothing tableFltr $ Just S.returningStar
|
|
where
|
|
tableFltr = Just $ S.WhereFrag $
|
|
toSQLBoolExp (S.QualTable tn) $ andAnnBoolExps fltr wc
|