Safe Haskell | None |
---|---|
Language | Haskell2010 |
MSSQL Schema IfMatched
This module contains the building blocks for parsing if_matched
clauses
(represented as IfMatched
), which in the MSSQL backend are used to
implement upsert functionality.
These are used by backendInsertParser
to
construct a mssql-specific schema parser for insert (and upsert) mutations.
Synopsis
- ifMatchedFieldParser :: forall r m n. (MonadBuildSchema 'MSSQL r m n, AggregationPredicatesSchema 'MSSQL) => SourceInfo 'MSSQL -> TableInfo 'MSSQL -> m (InputFieldsParser n (Maybe (IfMatched (UnpreparedValue 'MSSQL))))
- ifMatchedObjectParser :: forall r m n. (MonadBuildSchema 'MSSQL r m n, AggregationPredicatesSchema 'MSSQL) => SourceInfo 'MSSQL -> TableInfo 'MSSQL -> m (Maybe (Parser 'Input n (IfMatched (UnpreparedValue 'MSSQL))))
- tableInsertMatchColumnsEnum :: forall r m n. MonadBuildSchemaBase r m n => SourceInfo 'MSSQL -> TableInfo 'MSSQL -> m (Maybe (Parser 'Both n (Column 'MSSQL)))
- isMatchColumnValid :: ColumnInfo 'MSSQL -> Bool
Documentation
ifMatchedFieldParser :: forall r m n. (MonadBuildSchema 'MSSQL r m n, AggregationPredicatesSchema 'MSSQL) => SourceInfo 'MSSQL -> TableInfo 'MSSQL -> m (InputFieldsParser n (Maybe (IfMatched (UnpreparedValue 'MSSQL)))) Source #
Field-parser for:
if_matched: tablename_if_matched input tablename_if_matched { match_columns: [tablename_select_column!] update_columns: [tablename_update_columns!] where: tablename_bool_exp }
Note that the types ordinarily produced by this parser are only created if
the active role has both select and update permissions to the table
tablename
defined and these grant non-empty column permissions.
ifMatchedObjectParser :: forall r m n. (MonadBuildSchema 'MSSQL r m n, AggregationPredicatesSchema 'MSSQL) => SourceInfo 'MSSQL -> TableInfo 'MSSQL -> m (Maybe (Parser 'Input n (IfMatched (UnpreparedValue 'MSSQL)))) Source #
Parse a tablename_if_matched
object.
tableInsertMatchColumnsEnum :: forall r m n. MonadBuildSchemaBase r m n => SourceInfo 'MSSQL -> TableInfo 'MSSQL -> m (Maybe (Parser 'Both n (Column 'MSSQL))) Source #
Table insert_match_columns enum
Parser for an enum type that matches the columns that can be used for insert match_columns for a given table. Maps to the insert_match_columns object.
Return Nothing if there's no column the current user has "select" permissions for.
isMatchColumnValid :: ColumnInfo 'MSSQL -> Bool Source #
Check whether a column can be used for match_columns.