rel8-internal
Safe HaskellNone
LanguageHaskell2010

Rel8.Internal.Table

Synopsis

Documentation

class (HTable (Columns a), context ~ Context a, a ~ Transpose context a) => Table (context :: Context) a | a -> context where Source #

Tables are one of the foundational elements of Rel8, and describe data types that have a finite number of columns. Each of these columns contains data under a shared context, and contexts describe how to interpret the metadata about a column to a particular Haskell type. In Rel8, we have contexts for expressions (the Expr context), aggregations (the Aggregate context), insert values (the Insert context), among others.

In typical usage of Rel8 you don't need to derive instances of Table yourself, as anything that's an instance of Rel8able is always a Table.

Minimal complete definition

Nothing

Associated Types

type Columns a :: HTable Source #

The HTable functor that describes the schema of this table.

type Context a :: Context Source #

The common context that all columns use as an interpretation.

type FromExprs a Source #

The FromExprs type family maps a type in the Expr context to the corresponding Haskell type.

type Transpose (context' :: Context) a Source #

type Transpose (context' :: Context) a = Map (TTranspose context') a

Instances

Instances details
Sql DBType a => Table Expr (Expr a) Source # 
Instance details

Defined in Rel8.Internal.Expr

Associated Types

type Columns (Expr a) 
Instance details

Defined in Rel8.Internal.Expr

type Columns (Expr a) = HIdentity a
type Context (Expr a) 
Instance details

Defined in Rel8.Internal.Expr

type Context (Expr a) = Expr
type FromExprs (Expr a) 
Instance details

Defined in Rel8.Internal.Expr

type FromExprs (Expr a) = a
Sql DBType a => Table Name (Name a) Source # 
Instance details

Defined in Rel8.Internal.Schema.Name

Associated Types

type Columns (Name a) 
Instance details

Defined in Rel8.Internal.Schema.Name

type Columns (Name a) = HIdentity a
type Context (Name a) 
Instance details

Defined in Rel8.Internal.Schema.Name

type Context (Name a) = Name
type FromExprs (Name a) 
Instance details

Defined in Rel8.Internal.Schema.Name

type FromExprs (Name a) = a
Sql DBType a => Table Result (Identity a) Source # 
Instance details

Defined in Rel8.Internal.Table

Associated Types

type Columns (Identity a) 
Instance details

Defined in Rel8.Internal.Table

type Context (Identity a) 
Instance details

Defined in Rel8.Internal.Table

type FromExprs (Identity a) 
Instance details

Defined in Rel8.Internal.Table

type FromExprs (Identity a) = a
(Rel8able t, Reifiable context, context ~ context') => Table context' (t context) Source # 
Instance details

Defined in Rel8.Internal.Table.Rel8able

Associated Types

type Columns (t context) 
Instance details

Defined in Rel8.Internal.Table.Rel8able

type Columns (t context) = GColumns t
type Context (t context) 
Instance details

Defined in Rel8.Internal.Table.Rel8able

type Context (t context) = context
type FromExprs (t context) 
Instance details

Defined in Rel8.Internal.Table.Rel8able

type FromExprs (t context) = GFromExprs t

Methods

toColumns :: t context -> Columns (t context) context' Source #

fromColumns :: Columns (t context) context' -> t context Source #

fromResult :: Columns (t context) Result -> FromExprs (t context) Source #

toResult :: FromExprs (t context) -> Columns (t context) Result Source #

(Table context a, Table context b) => Table context (a, b) Source # 
Instance details

Defined in Rel8.Internal.Table

Associated Types

type Columns (a, b) 
Instance details

Defined in Rel8.Internal.Table

type Columns (a, b) = GColumns TColumns (Rep (Record (a, b)))
type Context (a, b) 
Instance details

Defined in Rel8.Internal.Table

type Context (a, b) = GContext TContext (Rep (Record (a, b)))
type FromExprs (a, b) 
Instance details

Defined in Rel8.Internal.Table

type FromExprs (a, b) = Map TFromExprs (a, b)

Methods

toColumns :: (a, b) -> Columns (a, b) context Source #

fromColumns :: Columns (a, b) context -> (a, b) Source #

fromResult :: Columns (a, b) Result -> FromExprs (a, b) Source #

toResult :: FromExprs (a, b) -> Columns (a, b) Result Source #

(HTable columns, context ~ context') => Table context' (Cols context columns) Source # 
Instance details

Defined in Rel8.Internal.Table.Cols

Associated Types

type Columns (Cols context columns) 
Instance details

Defined in Rel8.Internal.Table.Cols

type Columns (Cols context columns) = columns
type Context (Cols context columns) 
Instance details

Defined in Rel8.Internal.Table.Cols

type Context (Cols context columns) = context
type FromExprs (Cols context columns) 
Instance details

Defined in Rel8.Internal.Table.Cols

type FromExprs (Cols context columns) = Cols Result columns

Methods

toColumns :: Cols context columns -> Columns (Cols context columns) context' Source #

fromColumns :: Columns (Cols context columns) context' -> Cols context columns Source #

fromResult :: Columns (Cols context columns) Result -> FromExprs (Cols context columns) Source #

toResult :: FromExprs (Cols context columns) -> Columns (Cols context columns) Result Source #

(Table context a, context ~ context') => Table context' (ListTable context a) Source # 
Instance details

Defined in Rel8.Internal.Table.List

Associated Types

type Columns (ListTable context a) 
Instance details

Defined in Rel8.Internal.Table.List

type Columns (ListTable context a) = HListTable (Columns a)
type Context (ListTable context a) 
Instance details

Defined in Rel8.Internal.Table.List

type Context (ListTable context a) = Context a
type FromExprs (ListTable context a) 
Instance details

Defined in Rel8.Internal.Table.List

type FromExprs (ListTable context a) = [FromExprs a]

Methods

toColumns :: ListTable context a -> Columns (ListTable context a) context' Source #

fromColumns :: Columns (ListTable context a) context' -> ListTable context a Source #

fromResult :: Columns (ListTable context a) Result -> FromExprs (ListTable context a) Source #

toResult :: FromExprs (ListTable context a) -> Columns (ListTable context a) Result Source #

(Table context a, Reifiable context, context ~ context') => Table context' (MaybeTable context a) Source # 
Instance details

Defined in Rel8.Internal.Table.Maybe

Associated Types

type Columns (MaybeTable context a) 
Instance details

Defined in Rel8.Internal.Table.Maybe

type Columns (MaybeTable context a) = HMaybeTable (Columns a)
type Context (MaybeTable context a) 
Instance details

Defined in Rel8.Internal.Table.Maybe

type Context (MaybeTable context a) = Context a
type FromExprs (MaybeTable context a) 
Instance details

Defined in Rel8.Internal.Table.Maybe

type FromExprs (MaybeTable context a) = Maybe (FromExprs a)

Methods

toColumns :: MaybeTable context a -> Columns (MaybeTable context a) context' Source #

fromColumns :: Columns (MaybeTable context a) context' -> MaybeTable context a Source #

fromResult :: Columns (MaybeTable context a) Result -> FromExprs (MaybeTable context a) Source #

toResult :: FromExprs (MaybeTable context a) -> Columns (MaybeTable context a) Result Source #

(Table context a, context ~ context') => Table context' (NonEmptyTable context a) Source # 
Instance details

Defined in Rel8.Internal.Table.NonEmpty

Associated Types

type Columns (NonEmptyTable context a) 
Instance details

Defined in Rel8.Internal.Table.NonEmpty

type Context (NonEmptyTable context a) 
Instance details

Defined in Rel8.Internal.Table.NonEmpty

type Context (NonEmptyTable context a) = Context a
type FromExprs (NonEmptyTable context a) 
Instance details

Defined in Rel8.Internal.Table.NonEmpty

type FromExprs (NonEmptyTable context a) = NonEmpty (FromExprs a)

Methods

toColumns :: NonEmptyTable context a -> Columns (NonEmptyTable context a) context' Source #

fromColumns :: Columns (NonEmptyTable context a) context' -> NonEmptyTable context a Source #

fromResult :: Columns (NonEmptyTable context a) Result -> FromExprs (NonEmptyTable context a) Source #

toResult :: FromExprs (NonEmptyTable context a) -> Columns (NonEmptyTable context a) Result Source #

(Table context a, Reifiable context, context ~ context') => Table context' (NullTable context a) Source # 
Instance details

Defined in Rel8.Internal.Table.Null

Associated Types

type Columns (NullTable context a) 
Instance details

Defined in Rel8.Internal.Table.Null

type Columns (NullTable context a) = Columns (Nullify context a)
type Context (NullTable context a) 
Instance details

Defined in Rel8.Internal.Table.Null

type Context (NullTable context a) = Context (Nullify context a)
type FromExprs (NullTable context a) 
Instance details

Defined in Rel8.Internal.Table.Null

type FromExprs (NullTable context a) = FromExprs (Nullify context a)

Methods

toColumns :: NullTable context a -> Columns (NullTable context a) context' Source #

fromColumns :: Columns (NullTable context a) context' -> NullTable context a Source #

fromResult :: Columns (NullTable context a) Result -> FromExprs (NullTable context a) Source #

toResult :: FromExprs (NullTable context a) -> Columns (NullTable context a) Result Source #

(Table context a, Reifiable context, context ~ context') => Table context' (Nullify context a) Source # 
Instance details

Defined in Rel8.Internal.Table.Nullify

Associated Types

type Columns (Nullify context a) 
Instance details

Defined in Rel8.Internal.Table.Nullify

type Columns (Nullify context a) = HNullify (Columns a)
type Context (Nullify context a) 
Instance details

Defined in Rel8.Internal.Table.Nullify

type Context (Nullify context a) = Context a
type FromExprs (Nullify context a) 
Instance details

Defined in Rel8.Internal.Table.Nullify

type FromExprs (Nullify context a) = Maybe (FromExprs a)

Methods

toColumns :: Nullify context a -> Columns (Nullify context a) context' Source #

fromColumns :: Columns (Nullify context a) context' -> Nullify context a Source #

fromResult :: Columns (Nullify context a) Result -> FromExprs (Nullify context a) Source #

toResult :: FromExprs (Nullify context a) -> Columns (Nullify context a) Result Source #

(Table context a, Table context b, Table context c) => Table context (a, b, c) Source # 
Instance details

Defined in Rel8.Internal.Table

Associated Types

type Columns (a, b, c) 
Instance details

Defined in Rel8.Internal.Table

type Columns (a, b, c) = GColumns TColumns (Rep (Record (a, b, c)))
type Context (a, b, c) 
Instance details

Defined in Rel8.Internal.Table

type Context (a, b, c) = GContext TContext (Rep (Record (a, b, c)))
type FromExprs (a, b, c) 
Instance details

Defined in Rel8.Internal.Table

type FromExprs (a, b, c) = Map TFromExprs (a, b, c)

Methods

toColumns :: (a, b, c) -> Columns (a, b, c) context Source #

fromColumns :: Columns (a, b, c) context -> (a, b, c) Source #

fromResult :: Columns (a, b, c) Result -> FromExprs (a, b, c) Source #

toResult :: FromExprs (a, b, c) -> Columns (a, b, c) Result Source #

(Table context a, Table context b, Reifiable context, context ~ context') => Table context' (EitherTable context a b) Source # 
Instance details

Defined in Rel8.Internal.Table.Either

Associated Types

type Columns (EitherTable context a b) 
Instance details

Defined in Rel8.Internal.Table.Either

type Columns (EitherTable context a b) = HEitherTable (Columns a) (Columns b)
type Context (EitherTable context a b) 
Instance details

Defined in Rel8.Internal.Table.Either

type Context (EitherTable context a b) = Context a
type FromExprs (EitherTable context a b) 
Instance details

Defined in Rel8.Internal.Table.Either

type FromExprs (EitherTable context a b) = Either (FromExprs a) (FromExprs b)

Methods

toColumns :: EitherTable context a b -> Columns (EitherTable context a b) context' Source #

fromColumns :: Columns (EitherTable context a b) context' -> EitherTable context a b Source #

fromResult :: Columns (EitherTable context a b) Result -> FromExprs (EitherTable context a b) Source #

toResult :: FromExprs (EitherTable context a b) -> Columns (EitherTable context a b) Result Source #

(Table context a, Table context b, Reifiable context, context ~ context') => Table context' (TheseTable context a b) Source # 
Instance details

Defined in Rel8.Internal.Table.These

Associated Types

type Columns (TheseTable context a b) 
Instance details

Defined in Rel8.Internal.Table.These

type Columns (TheseTable context a b) = HTheseTable (Columns a) (Columns b)
type Context (TheseTable context a b) 
Instance details

Defined in Rel8.Internal.Table.These

type Context (TheseTable context a b) = Context a
type FromExprs (TheseTable context a b) 
Instance details

Defined in Rel8.Internal.Table.These

type FromExprs (TheseTable context a b) = These (FromExprs a) (FromExprs b)

Methods

toColumns :: TheseTable context a b -> Columns (TheseTable context a b) context' Source #

fromColumns :: Columns (TheseTable context a b) context' -> TheseTable context a b Source #

fromResult :: Columns (TheseTable context a b) Result -> FromExprs (TheseTable context a b) Source #

toResult :: FromExprs (TheseTable context a b) -> Columns (TheseTable context a b) Result Source #

(Table context a, Table context b, Table context c, Table context d) => Table context (a, b, c, d) Source # 
Instance details

Defined in Rel8.Internal.Table

Associated Types

type Columns (a, b, c, d) 
Instance details

Defined in Rel8.Internal.Table

type Columns (a, b, c, d) = GColumns TColumns (Rep (Record (a, b, c, d)))
type Context (a, b, c, d) 
Instance details

Defined in Rel8.Internal.Table

type Context (a, b, c, d) = GContext TContext (Rep (Record (a, b, c, d)))
type FromExprs (a, b, c, d) 
Instance details

Defined in Rel8.Internal.Table

type FromExprs (a, b, c, d) = Map TFromExprs (a, b, c, d)

Methods

toColumns :: (a, b, c, d) -> Columns (a, b, c, d) context Source #

fromColumns :: Columns (a, b, c, d) context -> (a, b, c, d) Source #

fromResult :: Columns (a, b, c, d) Result -> FromExprs (a, b, c, d) Source #

toResult :: FromExprs (a, b, c, d) -> Columns (a, b, c, d) Result Source #

(Table context a, Table context b, Table context c, Table context d, Table context e) => Table context (a, b, c, d, e) Source # 
Instance details

Defined in Rel8.Internal.Table

Associated Types

type Columns (a, b, c, d, e) 
Instance details

Defined in Rel8.Internal.Table

type Columns (a, b, c, d, e) = GColumns TColumns (Rep (Record (a, b, c, d, e)))
type Context (a, b, c, d, e) 
Instance details

Defined in Rel8.Internal.Table

type Context (a, b, c, d, e) = GContext TContext (Rep (Record (a, b, c, d, e)))
type FromExprs (a, b, c, d, e) 
Instance details

Defined in Rel8.Internal.Table

type FromExprs (a, b, c, d, e) = Map TFromExprs (a, b, c, d, e)

Methods

toColumns :: (a, b, c, d, e) -> Columns (a, b, c, d, e) context Source #

fromColumns :: Columns (a, b, c, d, e) context -> (a, b, c, d, e) Source #

fromResult :: Columns (a, b, c, d, e) Result -> FromExprs (a, b, c, d, e) Source #

toResult :: FromExprs (a, b, c, d, e) -> Columns (a, b, c, d, e) Result Source #

(Table context a, Table context b, Table context c, Table context d, Table context e, Table context f) => Table context (a, b, c, d, e, f) Source # 
Instance details

Defined in Rel8.Internal.Table

Associated Types

type Columns (a, b, c, d, e, f) 
Instance details

Defined in Rel8.Internal.Table

type Columns (a, b, c, d, e, f) = GColumns TColumns (Rep (Record (a, b, c, d, e, f)))
type Context (a, b, c, d, e, f) 
Instance details

Defined in Rel8.Internal.Table

type Context (a, b, c, d, e, f) = GContext TContext (Rep (Record (a, b, c, d, e, f)))
type FromExprs (a, b, c, d, e, f) 
Instance details

Defined in Rel8.Internal.Table

type FromExprs (a, b, c, d, e, f) = Map TFromExprs (a, b, c, d, e, f)

Methods

toColumns :: (a, b, c, d, e, f) -> Columns (a, b, c, d, e, f) context Source #

fromColumns :: Columns (a, b, c, d, e, f) context -> (a, b, c, d, e, f) Source #

fromResult :: Columns (a, b, c, d, e, f) Result -> FromExprs (a, b, c, d, e, f) Source #

toResult :: FromExprs (a, b, c, d, e, f) -> Columns (a, b, c, d, e, f) Result Source #

(Table context a, Table context b, Table context c, Table context d, Table context e, Table context f, Table context g) => Table context (a, b, c, d, e, f, g) Source # 
Instance details

Defined in Rel8.Internal.Table

Associated Types

type Columns (a, b, c, d, e, f, g) 
Instance details

Defined in Rel8.Internal.Table

type Columns (a, b, c, d, e, f, g) = GColumns TColumns (Rep (Record (a, b, c, d, e, f, g)))
type Context (a, b, c, d, e, f, g) 
Instance details

Defined in Rel8.Internal.Table

type Context (a, b, c, d, e, f, g) = GContext TContext (Rep (Record (a, b, c, d, e, f, g)))
type FromExprs (a, b, c, d, e, f, g) 
Instance details

Defined in Rel8.Internal.Table

type FromExprs (a, b, c, d, e, f, g) = Map TFromExprs (a, b, c, d, e, f, g)

Methods

toColumns :: (a, b, c, d, e, f, g) -> Columns (a, b, c, d, e, f, g) context Source #

fromColumns :: Columns (a, b, c, d, e, f, g) context -> (a, b, c, d, e, f, g) Source #

fromResult :: Columns (a, b, c, d, e, f, g) Result -> FromExprs (a, b, c, d, e, f, g) Source #

toResult :: FromExprs (a, b, c, d, e, f, g) -> Columns (a, b, c, d, e, f, g) Result Source #

Sql DBType a => Table (Field table) (Field table a) Source # 
Instance details

Defined in Rel8.Internal.Schema.Field

Associated Types

type Columns (Field table a) 
Instance details

Defined in Rel8.Internal.Schema.Field

type Columns (Field table a) = HIdentity a
type Context (Field table a) 
Instance details

Defined in Rel8.Internal.Schema.Field

type Context (Field table a) = Field table
type FromExprs (Field table a) 
Instance details

Defined in Rel8.Internal.Schema.Field

type FromExprs (Field table a) = a

Methods

toColumns :: Field table a -> Columns (Field table a) (Field table) Source #

fromColumns :: Columns (Field table a) (Field table) -> Field table a Source #

fromResult :: Columns (Field table a) Result -> FromExprs (Field table a) Source #

toResult :: FromExprs (Field table a) -> Columns (Field table a) Result Source #

class Columns a ~ Columns b => Congruent a b Source #

Instances

Instances details
Columns a ~ Columns b => Congruent a b Source # 
Instance details

Defined in Rel8.Internal.Table

data TTable (a :: Context) b c Source #

Instances

Instances details
type Eval (TTable context a :: Constraint -> Type) Source # 
Instance details

Defined in Rel8.Internal.Table

type Eval (TTable context a :: Constraint -> Type) = Table context a

data TColumns a (b :: HTable) Source #

Instances

Instances details
type Eval (TColumns a :: HTable -> Type) Source # 
Instance details

Defined in Rel8.Internal.Table

type Eval (TColumns a :: HTable -> Type) = Columns a

data TContext a (b :: Context) Source #

Instances

Instances details
type Eval (TContext a :: Context -> Type) Source # 
Instance details

Defined in Rel8.Internal.Table

type Eval (TContext a :: Context -> Type) = Context a

data TFromExprs a b Source #

Instances

Instances details
type Eval (TFromExprs a :: Type -> Type) Source # 
Instance details

Defined in Rel8.Internal.Table

type Eval (TFromExprs a :: Type -> Type) = FromExprs a

data TTranspose (a :: Context) b c Source #

Instances

Instances details
type Eval (TTranspose context a :: Type -> Type) Source # 
Instance details

Defined in Rel8.Internal.Table

type Eval (TTranspose context a :: Type -> Type) = Transpose context a

data TSerialize a b c Source #

Instances

Instances details
type Eval (TSerialize expr a :: Constraint -> Type) Source # 
Instance details

Defined in Rel8.Internal.Table

type Eval (TSerialize expr a :: Constraint -> Type) = (Table (Context expr) expr, a ~ FromExprs expr)