graphql-engine/server/src-lib/Hasura/Backends/MSSQL/Connection.hs
Vladimir Ciobanu 281cb771ff server: add MSSQL support
Co-authored-by: Rakesh Emmadi <12475069+rakeshkky@users.noreply.github.com>
Co-authored-by: Antoine Leblanc <1618949+nicuveo@users.noreply.github.com>
Co-authored-by: Vamshi Surabhi <6562944+0x777@users.noreply.github.com>
Co-authored-by: Aravind K P <8335904+scriptonist@users.noreply.github.com>
GitOrigin-RevId: 699c453b9692e1b822f393f23ff5e6db4e010d57
2021-02-23 17:38:36 +00:00

37 lines
1.1 KiB
Haskell

module Hasura.Backends.MSSQL.Connection where
import Hasura.Prelude
import Data.Aeson
import Data.Aeson.TH
import Hasura.Incremental (Cacheable (..))
-- | ODBC connection string for MSSQL server
newtype MSSQLConnectionString
= MSSQLConnectionString {unMSSQLConnectionString :: Text}
deriving (Show, Eq, ToJSON, FromJSON, Cacheable, Hashable, NFData, Arbitrary)
data MSSQLConnectionInfo
= MSSQLConnectionInfo
{ _mciConnectionString :: !MSSQLConnectionString
} deriving (Show, Eq, Generic)
instance Cacheable MSSQLConnectionInfo
instance Hashable MSSQLConnectionInfo
instance NFData MSSQLConnectionInfo
instance Arbitrary MSSQLConnectionInfo where
arbitrary = genericArbitrary
$(deriveJSON hasuraJSON ''MSSQLConnectionInfo)
data MSSQLConnConfiguration
= MSSQLConnConfiguration
{ _mccConnectionInfo :: !MSSQLConnectionInfo
} deriving (Show, Eq, Generic)
instance Cacheable MSSQLConnConfiguration
instance Hashable MSSQLConnConfiguration
instance NFData MSSQLConnConfiguration
$(deriveJSON hasuraJSON ''MSSQLConnConfiguration)
instance Arbitrary MSSQLConnConfiguration where
arbitrary = genericArbitrary