Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- convertToSQLTransaction :: forall pgKind m. (MonadTx m, MonadIO m, MonadTrace m, Backend ('Postgres pgKind), PostgresAnnotatedFieldJSON pgKind, MonadReader QueryTagsComment m) => AnnotatedInsert ('Postgres pgKind) Void SQLExp -> UserInfo -> Seq PrepArg -> StringifyNumbers -> Maybe NamingCase -> m EncJSON
- insertMultipleObjects :: forall pgKind m. (MonadTx m, MonadIO m, MonadTrace m, Backend ('Postgres pgKind), PostgresAnnotatedFieldJSON pgKind, MonadReader QueryTagsComment m) => MultiObjectInsert ('Postgres pgKind) SQLExp -> HashMap PGCol SQLExp -> UserInfo -> MutationOutput ('Postgres pgKind) -> Seq PrepArg -> StringifyNumbers -> Maybe NamingCase -> m EncJSON
- insertObject :: forall pgKind m. (MonadTx m, MonadIO m, MonadTrace m, Backend ('Postgres pgKind), PostgresAnnotatedFieldJSON pgKind, MonadReader QueryTagsComment m) => SingleObjectInsert ('Postgres pgKind) SQLExp -> HashMap PGCol SQLExp -> UserInfo -> Seq PrepArg -> StringifyNumbers -> Maybe NamingCase -> m (Int, Maybe (ColumnValues ('Postgres pgKind) TxtEncodedVal))
- insertObjRel :: forall pgKind m. (MonadTx m, MonadIO m, MonadTrace m, Backend ('Postgres pgKind), PostgresAnnotatedFieldJSON pgKind, MonadReader QueryTagsComment m) => Seq PrepArg -> UserInfo -> StringifyNumbers -> Maybe NamingCase -> ObjectRelationInsert ('Postgres pgKind) SQLExp -> m (Int, [(PGCol, SQLExp)])
- insertArrRel :: (MonadTx m, MonadIO m, MonadTrace m, Backend ('Postgres pgKind), PostgresAnnotatedFieldJSON pgKind, MonadReader QueryTagsComment m) => [(PGCol, SQLExp)] -> UserInfo -> Seq PrepArg -> StringifyNumbers -> Maybe NamingCase -> ArrayRelationInsert ('Postgres pgKind) SQLExp -> m Int
- validateInsert :: MonadError QErr m => [PGCol] -> [RelInfo ('Postgres pgKind)] -> [PGCol] -> m ()
- mkInsertQ :: Backend ('Postgres pgKind) => QualifiedTable -> Maybe (OnConflictClause ('Postgres pgKind) SQLExp) -> HashMap PGCol SQLExp -> (AnnBoolExpSQL ('Postgres pgKind), Maybe (AnnBoolExpSQL ('Postgres pgKind))) -> TopLevelCTE
- fetchFromColVals :: MonadError QErr m => ColumnValues ('Postgres pgKind) TxtEncodedVal -> [ColumnInfo ('Postgres pgKind)] -> m [(PGCol, SQLExp)]
- decodeEncJSON :: (FromJSON a, QErrM m) => EncJSON -> m a
Documentation
convertToSQLTransaction :: forall pgKind m. (MonadTx m, MonadIO m, MonadTrace m, Backend ('Postgres pgKind), PostgresAnnotatedFieldJSON pgKind, MonadReader QueryTagsComment m) => AnnotatedInsert ('Postgres pgKind) Void SQLExp -> UserInfo -> Seq PrepArg -> StringifyNumbers -> Maybe NamingCase -> m EncJSON Source #
insertMultipleObjects :: forall pgKind m. (MonadTx m, MonadIO m, MonadTrace m, Backend ('Postgres pgKind), PostgresAnnotatedFieldJSON pgKind, MonadReader QueryTagsComment m) => MultiObjectInsert ('Postgres pgKind) SQLExp -> HashMap PGCol SQLExp -> UserInfo -> MutationOutput ('Postgres pgKind) -> Seq PrepArg -> StringifyNumbers -> Maybe NamingCase -> m EncJSON Source #
insertObject :: forall pgKind m. (MonadTx m, MonadIO m, MonadTrace m, Backend ('Postgres pgKind), PostgresAnnotatedFieldJSON pgKind, MonadReader QueryTagsComment m) => SingleObjectInsert ('Postgres pgKind) SQLExp -> HashMap PGCol SQLExp -> UserInfo -> Seq PrepArg -> StringifyNumbers -> Maybe NamingCase -> m (Int, Maybe (ColumnValues ('Postgres pgKind) TxtEncodedVal)) Source #
insertObjRel :: forall pgKind m. (MonadTx m, MonadIO m, MonadTrace m, Backend ('Postgres pgKind), PostgresAnnotatedFieldJSON pgKind, MonadReader QueryTagsComment m) => Seq PrepArg -> UserInfo -> StringifyNumbers -> Maybe NamingCase -> ObjectRelationInsert ('Postgres pgKind) SQLExp -> m (Int, [(PGCol, SQLExp)]) Source #
insertArrRel :: (MonadTx m, MonadIO m, MonadTrace m, Backend ('Postgres pgKind), PostgresAnnotatedFieldJSON pgKind, MonadReader QueryTagsComment m) => [(PGCol, SQLExp)] -> UserInfo -> Seq PrepArg -> StringifyNumbers -> Maybe NamingCase -> ArrayRelationInsert ('Postgres pgKind) SQLExp -> m Int Source #
:: MonadError QErr m | |
=> [PGCol] | inserting columns |
-> [RelInfo ('Postgres pgKind)] | object relation inserts |
-> [PGCol] | additional fields from parent |
-> m () |
Validate an insert object based on insert columns, insert object relations and additional columns from parent:
- There should be no overlap between
insCols
andaddCols
. - There should be no overlap between any object relationship columns and
insCols
andaddCols
.
mkInsertQ :: Backend ('Postgres pgKind) => QualifiedTable -> Maybe (OnConflictClause ('Postgres pgKind) SQLExp) -> HashMap PGCol SQLExp -> (AnnBoolExpSQL ('Postgres pgKind), Maybe (AnnBoolExpSQL ('Postgres pgKind))) -> TopLevelCTE Source #
fetchFromColVals :: MonadError QErr m => ColumnValues ('Postgres pgKind) TxtEncodedVal -> [ColumnInfo ('Postgres pgKind)] -> m [(PGCol, SQLExp)] Source #
decodeEncJSON :: (FromJSON a, QErrM m) => EncJSON -> m a Source #