module Hasura.Backends.Postgres.Types.CitusExtraTableMetadata
( ExtraTableMetadata (..),
)
where
import Data.Aeson qualified as J
import Data.Aeson.Casing qualified as JC
import Data.Typeable (Typeable)
import Hasura.Prelude
import Hasura.RQL.Types.Source.Table (SourceTableType)
data
= Local {ExtraTableMetadata -> SourceTableType
tableType :: SourceTableType}
| Reference {tableType :: SourceTableType}
| Distributed {ExtraTableMetadata -> Text
distributionColumn :: Text, tableType :: SourceTableType}
deriving stock (Int -> ExtraTableMetadata -> ShowS
[ExtraTableMetadata] -> ShowS
ExtraTableMetadata -> String
(Int -> ExtraTableMetadata -> ShowS)
-> (ExtraTableMetadata -> String)
-> ([ExtraTableMetadata] -> ShowS)
-> Show ExtraTableMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ExtraTableMetadata -> ShowS
showsPrec :: Int -> ExtraTableMetadata -> ShowS
$cshow :: ExtraTableMetadata -> String
show :: ExtraTableMetadata -> String
$cshowList :: [ExtraTableMetadata] -> ShowS
showList :: [ExtraTableMetadata] -> ShowS
Show, ExtraTableMetadata -> ExtraTableMetadata -> Bool
(ExtraTableMetadata -> ExtraTableMetadata -> Bool)
-> (ExtraTableMetadata -> ExtraTableMetadata -> Bool)
-> Eq ExtraTableMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ExtraTableMetadata -> ExtraTableMetadata -> Bool
== :: ExtraTableMetadata -> ExtraTableMetadata -> Bool
$c/= :: ExtraTableMetadata -> ExtraTableMetadata -> Bool
/= :: ExtraTableMetadata -> ExtraTableMetadata -> Bool
Eq, (forall x. ExtraTableMetadata -> Rep ExtraTableMetadata x)
-> (forall x. Rep ExtraTableMetadata x -> ExtraTableMetadata)
-> Generic ExtraTableMetadata
forall x. Rep ExtraTableMetadata x -> ExtraTableMetadata
forall x. ExtraTableMetadata -> Rep ExtraTableMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ExtraTableMetadata -> Rep ExtraTableMetadata x
from :: forall x. ExtraTableMetadata -> Rep ExtraTableMetadata x
$cto :: forall x. Rep ExtraTableMetadata x -> ExtraTableMetadata
to :: forall x. Rep ExtraTableMetadata x -> ExtraTableMetadata
Generic, Typeable)
instance Hashable ExtraTableMetadata
instance NFData ExtraTableMetadata
instance J.FromJSON ExtraTableMetadata where
parseJSON :: Value -> Parser ExtraTableMetadata
parseJSON =
Options -> Value -> Parser ExtraTableMetadata
forall a.
(Generic a, GFromJSON Zero (Rep a)) =>
Options -> Value -> Parser a
J.genericParseJSON
Options
J.defaultOptions
{ constructorTagModifier :: ShowS
J.constructorTagModifier = ShowS
JC.snakeCase,
fieldLabelModifier :: ShowS
J.fieldLabelModifier = ShowS
JC.snakeCase
}
instance J.ToJSON ExtraTableMetadata where
toJSON :: ExtraTableMetadata -> Value
toJSON =
Options -> ExtraTableMetadata -> Value
forall a.
(Generic a, GToJSON' Value Zero (Rep a)) =>
Options -> a -> Value
J.genericToJSON
Options
J.defaultOptions
{ constructorTagModifier :: ShowS
J.constructorTagModifier = ShowS
JC.snakeCase,
fieldLabelModifier :: ShowS
J.fieldLabelModifier = ShowS
JC.snakeCase
}
toEncoding :: ExtraTableMetadata -> Encoding
toEncoding =
Options -> ExtraTableMetadata -> Encoding
forall a.
(Generic a, GToJSON' Encoding Zero (Rep a)) =>
Options -> a -> Encoding
J.genericToEncoding
Options
J.defaultOptions
{ constructorTagModifier :: ShowS
J.constructorTagModifier = ShowS
JC.snakeCase,
fieldLabelModifier :: ShowS
J.fieldLabelModifier = ShowS
JC.snakeCase
}