Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Postgres Translate Returning
Combinators and helpers for dealing with GraphQL returning statements.
Synopsis
- data MutationCTE
- getMutationCTE :: MutationCTE -> TopLevelCTE
- checkPermissionRequired :: MutationCTE -> Bool
- mkDefaultMutFlds :: Backend ('Postgres pgKind) => Maybe [ColumnInfo ('Postgres pgKind)] -> MutationOutput ('Postgres pgKind)
- mkMutFldExp :: (Backend ('Postgres pgKind), PostgresAnnotatedFieldJSON pgKind, MonadWriter CustomSQLCTEs m) => TableIdentifier -> Maybe Int -> StringifyNumbers -> Maybe NamingCase -> MutFld ('Postgres pgKind) -> m SQLExp
- mkMutationOutputExp :: (Backend ('Postgres pgKind), PostgresAnnotatedFieldJSON pgKind) => QualifiedTable -> [ColumnInfo ('Postgres pgKind)] -> Maybe Int -> MutationCTE -> MutationOutput ('Postgres pgKind) -> StringifyNumbers -> Maybe NamingCase -> SelectWith
- mkCheckErrorExp :: TableIdentifier -> SQLExp
- checkConstraintIdentifier :: Identifier
- asCheckErrorExtractor :: SQLExp -> Extractor
Documentation
data MutationCTE Source #
The postgres common table expression (CTE) for mutation queries. This CTE expression is used to generate mutation field output expression, see Note [Mutation output expression].
MCCheckConstraint TopLevelCTE | A Mutation with check constraint validation (Insert or Update) |
MCSelectValues Select | A Select statement which emits mutated table rows |
MCDelete SQLDelete | A Delete statement |
Instances
Show MutationCTE Source # | |
Defined in Hasura.Backends.Postgres.Translate.Returning showsPrec :: Int -> MutationCTE -> ShowS # show :: MutationCTE -> String # showList :: [MutationCTE] -> ShowS # | |
Eq MutationCTE Source # | |
Defined in Hasura.Backends.Postgres.Translate.Returning (==) :: MutationCTE -> MutationCTE -> Bool # (/=) :: MutationCTE -> MutationCTE -> Bool # |
mkDefaultMutFlds :: Backend ('Postgres pgKind) => Maybe [ColumnInfo ('Postgres pgKind)] -> MutationOutput ('Postgres pgKind) Source #
mkMutFldExp :: (Backend ('Postgres pgKind), PostgresAnnotatedFieldJSON pgKind, MonadWriter CustomSQLCTEs m) => TableIdentifier -> Maybe Int -> StringifyNumbers -> Maybe NamingCase -> MutFld ('Postgres pgKind) -> m SQLExp Source #
mkMutationOutputExp :: (Backend ('Postgres pgKind), PostgresAnnotatedFieldJSON pgKind) => QualifiedTable -> [ColumnInfo ('Postgres pgKind)] -> Maybe Int -> MutationCTE -> MutationOutput ('Postgres pgKind) -> StringifyNumbers -> Maybe NamingCase -> SelectWith Source #
Generate mutation output expression with given mutation CTE statement. See Note [Mutation output expression].