2022-05-02 08:03:12 +03:00
|
|
|
module Hasura.Backends.DataConnector.Schema.Column
|
2021-12-22 03:10:28 +03:00
|
|
|
( Column (..),
|
|
|
|
)
|
|
|
|
where
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
2022-05-02 08:03:12 +03:00
|
|
|
import Hasura.Backends.DataConnector.IR.Column qualified as Column (Name)
|
|
|
|
import Hasura.Backends.DataConnector.IR.Scalar.Type qualified as Scalar (Type)
|
2021-12-22 03:10:28 +03:00
|
|
|
import Hasura.Prelude
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
-- | A schematic representation which captures common attributes associated
|
|
|
|
-- with a piece of data that is stored in a given backend.
|
|
|
|
--
|
|
|
|
-- These attributes ascribe meaningful semantics to the data that they are
|
|
|
|
-- associated with.
|
|
|
|
--
|
|
|
|
-- cf. https://en.wikipedia.org/wiki/Column_(database)
|
|
|
|
-- https://www.postgresql.org/docs/13/ddl-basics.html
|
|
|
|
--
|
2022-02-25 19:08:18 +03:00
|
|
|
-- XXX: Instead of an @isNullable@ flag, should we instead add a @Nullable@
|
|
|
|
-- data constructor to 'Scalar.Type'?
|
2021-12-22 03:10:28 +03:00
|
|
|
data Column = Column
|
|
|
|
{ name :: Column.Name,
|
|
|
|
type_ :: Scalar.Type,
|
|
|
|
isNullable :: Bool,
|
|
|
|
description :: Maybe Text
|
|
|
|
}
|
|
|
|
deriving stock (Data, Eq, Generic, Ord, Show)
|