on 70ce05d help sign in
rel8/src/Rel8/Schema/Table.hs
29 lines 934 B history raw
1{-# language DeriveFunctor #-}
2{-# language DerivingStrategies #-}
4module Rel8.Schema.Table
5 ( TableSchema(..)
6 )
7where
9-- base
10import Prelude
13-- | The schema for a table. This is used to specify the name and schema that a
14-- table belongs to (the @FROM@ part of a SQL query), along with the schema of
15-- the columns within this table.
16--
17-- For each selectable table in your database, you should provide a
18-- @TableSchema@ in order to interact with the table via Rel8.
19data TableSchema names = TableSchema
20 { name :: String
21 -- ^ The name of the table.
22 , schema :: Maybe String
23 -- ^ The schema that this table belongs to. If 'Nothing', whatever is on
24 -- the connection's @search_path@ will be used.
25 , columns :: names
26 -- ^ The columns of the table. Typically you would use a a higher-kinded
27 -- data type here, parameterized by the 'Rel8.ColumnSchema.ColumnSchema' functor.
28 }
29 deriving stock Functor