Safe Haskell | None |
---|---|
Language | Haskell2010 |
Postgres Translate Returning
Combinators and helpers for dealing with GraphQL returning statements.
Synopsis
- data MutationCTE
- getMutationCTE :: MutationCTE -> TopLevelCTE
- checkPermissionRequired :: MutationCTE -> Bool
- pgColsToSelFlds :: forall pgKind. Backend ('Postgres pgKind) => [ColumnInfo ('Postgres pgKind)] -> [(FieldName, AnnField ('Postgres pgKind))]
- mkDefaultMutFlds :: Backend ('Postgres pgKind) => Maybe [ColumnInfo ('Postgres pgKind)] -> MutationOutput ('Postgres pgKind)
- mkMutFldExp :: (Backend ('Postgres pgKind), PostgresAnnotatedFieldJSON pgKind) => Identifier -> Maybe Int -> StringifyNumbers -> Maybe NamingCase -> MutFld ('Postgres pgKind) -> SQLExp
- toFIIdentifier :: Identifier -> FIIdentifier
- mkMutationOutputExp :: (Backend ('Postgres pgKind), PostgresAnnotatedFieldJSON pgKind) => QualifiedTable -> [ColumnInfo ('Postgres pgKind)] -> Maybe Int -> MutationCTE -> MutationOutput ('Postgres pgKind) -> StringifyNumbers -> Maybe NamingCase -> SelectWith
- mkCheckErrorExp :: IsIdentifier a => a -> 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
Eq MutationCTE Source # | |
Defined in Hasura.Backends.Postgres.Translate.Returning (==) :: MutationCTE -> MutationCTE -> Bool # (/=) :: MutationCTE -> MutationCTE -> Bool # | |
Show MutationCTE Source # | |
Defined in Hasura.Backends.Postgres.Translate.Returning showsPrec :: Int -> MutationCTE -> ShowS # show :: MutationCTE -> String # showList :: [MutationCTE] -> ShowS # |
pgColsToSelFlds :: forall pgKind. Backend ('Postgres pgKind) => [ColumnInfo ('Postgres pgKind)] -> [(FieldName, AnnField ('Postgres pgKind))] Source #
mkDefaultMutFlds :: Backend ('Postgres pgKind) => Maybe [ColumnInfo ('Postgres pgKind)] -> MutationOutput ('Postgres pgKind) Source #
mkMutFldExp :: (Backend ('Postgres pgKind), PostgresAnnotatedFieldJSON pgKind) => Identifier -> Maybe Int -> StringifyNumbers -> Maybe NamingCase -> MutFld ('Postgres pgKind) -> 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].
mkCheckErrorExp :: IsIdentifier a => a -> SQLExp Source #