mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-10-06 06:48:12 +03:00
server: add MSSQL module haddocks
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3293 GitOrigin-RevId: 3062d5b1f41ce1fb18afc78773a2c947d8765309
This commit is contained in:
parent
866476ab36
commit
463a303390
@ -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,
|
||||
|
@ -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,
|
||||
)
|
||||
|
@ -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 (..),
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
)
|
||||
|
@ -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,
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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'.
|
||||
--
|
||||
|
@ -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 (..),
|
||||
|
@ -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
|
||||
|
@ -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.
|
||||
--
|
||||
|
@ -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 (..),
|
||||
|
Loading…
Reference in New Issue
Block a user