graphql-engine/server/src-lib/Hasura/Experimental/Schema/Table.hs
jkachmar 63cff8b731 Experimental backend adapter
This commit introduces an "experimental" backend adapter to the GraphQL Engine.

It defines a high-level interface which will eventually be used as the basis for implementing separate data source query generation & marshaling services that communicate with the GraphQL Engine Server via some protocol.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2684
Co-authored-by: awjchen <13142944+awjchen@users.noreply.github.com>
Co-authored-by: Chris Parks <592078+cdparks@users.noreply.github.com>
GitOrigin-RevId: 4463b682142ad6e069e223b88b14db511f634768
2021-12-22 00:11:28 +00:00

35 lines
1.2 KiB
Haskell

module Hasura.Experimental.Schema.Table
( Table (..),
)
where
--------------------------------------------------------------------------------
import Hasura.Experimental.IR.Table qualified as Table (Name)
import Hasura.Experimental.Schema.Column (Column)
import Hasura.Prelude
--------------------------------------------------------------------------------
-- | A schematic representation which captures a named collection of columns
--
-- TODO(cdparks): schematic in the sense of "relating to a schema" or symbolic?
-- This language is also used in the @Column@ documentation
--
-- An element of a table is known as a row, record, tuple, or object,
-- and conforms to the shape specified by the list of @Column@s below.
--
-- cf. https://en.wikipedia.org/wiki/Table_(database)
-- https://www.postgresql.org/docs/13/ddl-basics.html
--
-- NOTE(jkachmar): This type shouldn't _need_ ser/de instances, but they're
-- imposed by the 'Backend' class.
data Table = Table
{ name :: Table.Name,
columns :: [Column],
-- TODO(cdparks): Composite primary keys
primaryKey :: Maybe Text,
description :: Maybe Text
}
deriving stock (Data, Eq, Generic, Ord, Show)