{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Hasura.Backends.MySQL.Types.Instances () where
import Autodocodec (HasCodec (codec), named)
import Control.DeepSeq
import Data.Aeson qualified as J
import Data.Aeson.Casing qualified as J
import Data.Aeson.Extended
import Data.Aeson.TH qualified as J
import Data.Aeson.Types
import Data.Pool
import Data.Text.Extended (ToTxt (..))
import Database.MySQL.Base (Connection)
import Database.MySQL.Base.Types qualified as MySQLTypes (Type (..))
import Hasura.Backends.MySQL.Types.Internal
import Hasura.Base.ErrorValue qualified as ErrorValue
import Hasura.Base.ToErrorValue
import Hasura.Incremental.Internal.Dependency
import Hasura.Metadata.DTO.Placeholder (placeholderCodecViaJSON)
import Hasura.Prelude
import Language.Haskell.TH
import Language.Haskell.TH.Syntax
deriving instance Generic (Countable n)
instance Hashable n => Hashable (Countable n)
instance Cacheable n => Cacheable (Countable n)
deriving instance Eq n => Eq (Countable n)
deriving instance Show n => Show (Countable n)
deriving instance Data n => Data (Countable n)
instance NFData n => NFData (Countable n)
instance ToJSON n => ToJSON (Countable n)
instance FromJSON n => FromJSON (Countable n)
$( concat <$> for
[ ''ScalarType
]
\name ->
[d|
deriving instance Generic $(conT name)
instance Hashable $(conT name)
instance Cacheable $(conT name)
deriving instance Data $(conT name)
instance NFData $(conT name)
|]
)
$( fmap concat $ for
[''Aliased]
\name ->
[d|
deriving instance Generic ($(conT name) a)
instance Hashable a => Hashable ($(conT name) a)
instance Cacheable a => Cacheable ($(conT name) a)
deriving instance Eq a => Eq ($(conT name) a)
instance NFData a => NFData ($(conT name) a)
deriving instance Show a => Show ($(conT name) a)
deriving instance Functor $(conT name)
deriving instance Data a => Data ($(conT name) a)
|]
)
$(