server: add MSSQL module haddocks

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3293
GitOrigin-RevId: 3062d5b1f41ce1fb18afc78773a2c947d8765309
This commit is contained in:
Evie Ciobanu 2022-01-11 00:54:51 +02:00 committed by hasura-bot
parent 866476ab36
commit 463a303390
19 changed files with 79 additions and 17 deletions

View File

@ -1,3 +1,11 @@
-- | MSSQL DDL
--
-- Implements the DDL related methods of the
-- 'Hasura.RQL.Types.Metadata.Backend.BackendMetadata' type class
-- for the MSSQL backend, which provides an interface for fetching information about
-- the objects in the database, such as tables, relationships, etc.
--
-- The actual instance is defined in "Hasura.Backends.MSSQL.Instances.Metadata".
module Hasura.Backends.MSSQL.DDL
( buildComputedFieldInfo,
fetchAndValidateEnumValues,

View File

@ -1,4 +1,6 @@
-- | How to parse the boolean expressions and operations relevant for MSSQL.
-- | MSSQL DDL BoolExp
--
-- How to parse the boolean expressions and operations relevant for MSSQL.
module Hasura.Backends.MSSQL.DDL.BoolExp
( parseBoolExpOperations,
)

View File

@ -1,5 +1,8 @@
{-# LANGUAGE ViewPatterns #-}
-- | MSSQL DDL RunSQL
--
-- Provides primitives for running raw text SQL on MSSQL backends.
module Hasura.Backends.MSSQL.DDL.RunSQL
( runSQL,
MSSQLRunSQL (..),

View File

@ -1,3 +1,11 @@
-- | MSSQL Source
--
-- Implements the Source related methods of the
-- 'Hasura.RQL.Types.Metadata.Backend.BackendMetadata' type class
-- for the MSSQL backend, which provides an interface for identifying the
-- MSSQL database instance (source) and manipulate it.
--
-- The actual instance is defined in "Hasura.Backends.MSSQL.Instances.Metadata".
module Hasura.Backends.MSSQL.DDL.Source
( resolveSourceConfig,
resolveDatabaseMetadata,
@ -33,7 +41,7 @@ resolveDatabaseMetadata ::
SourceTypeCustomization ->
m (Either QErr (ResolvedSource 'MSSQL))
resolveDatabaseMetadata config customization = runExceptT do
dbTablesMetadata <- (mssqlRunReadOnly mssqlExecCtx) $ Tx.runTxE fromMSSQLTxError loadDBMetadata
dbTablesMetadata <- mssqlRunReadOnly mssqlExecCtx $ Tx.runTxE fromMSSQLTxError loadDBMetadata
pure $ ResolvedSource config customization dbTablesMetadata mempty mempty
where
MSSQLSourceConfig _connString mssqlExecCtx = config

View File

@ -1,5 +1,8 @@
{-# OPTIONS_GHC -fno-warn-orphans #-}
-- | MSSQL Instances API
--
-- Defines a 'Hasura.Server.API.Backend.BackendAPI' type class instance for MSSQL.
module Hasura.Backends.MSSQL.Instances.API () where
import Hasura.Prelude

View File

@ -1,6 +1,8 @@
{-# OPTIONS_GHC -fno-warn-orphans #-}
-- | Defines a 'BackendExecute' type class instance for MSSQL.
-- | MSSQL Instances Execute
--
-- Defines a 'BackendExecute' type class instance for MSSQL.
--
-- This module implements the needed functionality for implementing a 'BackendExecute'
-- instance for MSSQL, which defines an interface for translating a root field into an execution plan

View File

@ -1,6 +1,9 @@
{-# LANGUAGE UndecidableInstances #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
-- | MSSQL Instances Metadata
--
-- Defines a 'Hasura.RQL.Types.Metadata.Backend.BackendMetadata' type class instance for MSSQL.
module Hasura.Backends.MSSQL.Instances.Metadata () where
import Hasura.Backends.MSSQL.DDL qualified as MSSQL

View File

@ -1,6 +1,9 @@
{-# LANGUAGE ApplicativeDo #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
-- | MSSQL Instances Schema
--
-- Defines a 'Hasura.GraphQL.Schema.Backend.BackendSchema' type class instance for MSSQL.
module Hasura.Backends.MSSQL.Instances.Schema () where
import Data.Has

View File

@ -1,8 +1,10 @@
{-# OPTIONS_GHC -fno-warn-orphans #-}
-- | Defines the MSSQL instance of 'BackendTransport' and how to
-- interact with the database for running queries, mutations, subscriptions,
-- and so on.
-- | MSSQL Instances Transport
--
-- Defines the MSSQL instance of 'BackendTransport' and how to
-- interact with the database for running queries, mutations, subscriptions,
-- and so on.
module Hasura.Backends.MSSQL.Instances.Transport () where
import Data.Aeson qualified as J

View File

@ -1,6 +1,8 @@
{-# OPTIONS_GHC -fno-warn-orphans #-}
-- | Defines the ''MSSQL' instance of the 'Backend' type class.
-- | MSSQL Instances Types
--
-- Defines a 'Hasura.RQL.Types.Backend.Backend' type class instance for MSSQL.
module Hasura.Backends.MSSQL.Instances.Types () where
import Data.Aeson

View File

@ -1,4 +1,10 @@
-- | Metadata related types, functions and helpers.
--
-- Provides a single function which loads the MSSQL database metadata.
-- See the file at src-rsr/mssql_table_metadata.sql for the SQL we use to build
-- this metadata.
-- See 'Hasura.RQL.Types.Table.DBTableMetadata' for the Haskell type we use forall
-- storing this metadata.
module Hasura.Backends.MSSQL.Meta
( loadDBMetadata,
)

View File

@ -1,4 +1,7 @@
-- | Planning T-SQL queries and subscriptions.
-- | MSSQL Plan
--
-- Planning T-SQL queries and subscription by translating IR to MSSQL-specific
-- SQL query types.
module Hasura.Backends.MSSQL.Plan
( PrepareState (..),
planQuery,

View File

@ -1,3 +1,7 @@
-- | MSSQL SQL Value
--
-- Provide a function to translate from a column value to its literal (textual)
-- value specific to MSSQL. Used in the 'BackendExecute' instance.
module Hasura.Backends.MSSQL.SQL.Value (txtEncodedColVal) where
import Data.Text.Encoding (decodeUtf8)

View File

@ -1,8 +1,11 @@
{-# LANGUAGE ApplicativeDo #-}
-- | 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.
-- | 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 'Hasura.Backends.MSSQL.Instances.Schema.backendInsertParser' to
-- construct a mssql-specific schema parser for insert (and upsert) mutations.
module Hasura.Backends.MSSQL.Schema.IfMatched

View File

@ -1,7 +1,9 @@
{-# OPTIONS_GHC -fno-warn-orphans #-}
-- | Convert the simple T-SQL AST to an SQL query, ready to be passed
-- to the odbc package's query/exec functions.
-- | MSSQL ToQuery
--
-- Convert the simple T-SQL AST to an SQL query, ready to be passed to the odbc
-- package's query/exec functions.
--
-- We define a custom prettyprinter with the type 'Printer'.
--

View File

@ -1,6 +1,8 @@
{-# LANGUAGE UndecidableInstances #-}
-- | Types for MSSQL Insert IR.
-- | MSSQL Types Insert
--
-- Types for MSSQL Insert IR.
module Hasura.Backends.MSSQL.Types.Insert
( BackendInsert (..),
IfMatched (..),

View File

@ -1,6 +1,8 @@
{-# OPTIONS_GHC -fno-warn-orphans #-}
-- | Instances for types from "Hasura.Backends.MSSQL.Types.Internal" that're slow to compile.
-- | MSSQL Types Instances
--
-- Instances for types from "Hasura.Backends.MSSQL.Types.Internal" that're slow to compile.
module Hasura.Backends.MSSQL.Types.Instances () where
import Data.Aeson.Extended

View File

@ -1,6 +1,8 @@
{-# LANGUAGE DuplicateRecordFields #-}
-- | Types for Transact-SQL aka T-SQL; the language of SQL Server.
-- | MSSQL Types Internal
--
-- Types for Transact-SQL aka T-SQL; the language of SQL Server.
--
-- In this module we define various MS SQL Server specific data types used for T-SQL generation.
--

View File

@ -1,4 +1,6 @@
-- | This module defines the Update-related IR types specific to MSSQL.
-- | MSSQL Types Update
--
-- This module defines the Update-related IR types specific to MSSQL.
module Hasura.Backends.MSSQL.Types.Update
( BackendUpdate (..),
UpdateOperator (..),