graphql-engine-1.0.0: GraphQL API over Postgres
Safe HaskellNone
LanguageHaskell2010

Hasura.Backends.MSSQL.Schema.IfMatched

Description

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

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.