mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-18 04:51:35 +03:00
86aef93d31
GitOrigin-RevId: b5679e9579d226f7209b73ac966d29391c308c06
19 lines
561 B
Haskell
19 lines
561 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 :: AnnDel 'Postgres -> 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
|