graphql-engine/server/src-lib/Hasura/Backends/Postgres/Translate/Delete.hs
Auke Booij 86aef93d31 server: remove a few unused Lift instances (#114)
GitOrigin-RevId: b5679e9579d226f7209b73ac966d29391c308c06
2020-11-26 13:58:07 +00:00

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