{-# language DeriveFunctor #-}
{-# language DerivingStrategies #-}
{-# language DisambiguateRecordFields #-}
{-# language NamedFieldPuns #-}
{-# language StandaloneKindSignatures #-}
module Rel8.Schema.Table
( TableSchema(..)
, ppTable
)
where
import Data.Kind ( Type )
import Prelude
import qualified Opaleye.Internal.HaskellDB.Sql as Opaleye
import qualified Opaleye.Internal.HaskellDB.Sql.Print as Opaleye
import Text.PrettyPrint ( Doc )
type TableSchema :: Type -> Type
data TableSchema names = TableSchema
{ forall names. TableSchema names -> String
name :: String
, forall names. TableSchema names -> Maybe String
schema :: Maybe String
, forall names. TableSchema names -> names
columns :: names
}
deriving stock forall a b. a -> TableSchema b -> TableSchema a
forall a b. (a -> b) -> TableSchema a -> TableSchema b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: forall a b. a -> TableSchema b -> TableSchema a
$c<$ :: forall a b. a -> TableSchema b -> TableSchema a
fmap :: forall a b. (a -> b) -> TableSchema a -> TableSchema b
$cfmap :: forall a b. (a -> b) -> TableSchema a -> TableSchema b
Functor
ppTable :: TableSchema a -> Doc
ppTable :: forall a. TableSchema a -> Doc
ppTable TableSchema {String
name :: String
name :: forall names. TableSchema names -> String
name, Maybe String
schema :: Maybe String
schema :: forall names. TableSchema names -> Maybe String
schema} = SqlTable -> Doc
Opaleye.ppTable Opaleye.SqlTable
{ sqlTableSchemaName :: Maybe String
sqlTableSchemaName = Maybe String
schema
, sqlTableName :: String
sqlTableName = String
name
}