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>
24 lines
620 B
Haskell
24 lines
620 B
Haskell
module Hasura.Backends.Postgres.Translate.Delete
|
|
( mkDeleteCTE
|
|
) where
|
|
|
|
import Hasura.Prelude
|
|
|
|
import Instances.TH.Lift ()
|
|
|
|
import qualified Hasura.Backends.Postgres.SQL.DML as S
|
|
|
|
import Hasura.RQL.GBoolExp
|
|
import Hasura.RQL.IR.Delete
|
|
import Hasura.RQL.Types
|
|
|
|
|
|
mkDeleteCTE
|
|
:: AnnDel 'Postgres -> S.CTE
|
|
mkDeleteCTE (AnnDel tn (fltr, wc) _ _) =
|
|
S.CTEDelete delete
|
|
where
|
|
delete = S.SQLDelete tn Nothing tableFltr $ Just S.returningStar
|
|
tableFltr = Just $ S.WhereFrag $
|
|
toSQLBoolExp (S.QualTable tn) $ andAnnBoolExps fltr wc
|