rel8-internal
Safe HaskellNone
LanguageHaskell2010

Rel8.Internal.Table.Null

Synopsis

Documentation

newtype NullTable (context :: Context) a Source #

NullTable t is the table t, but where all the columns in t have the possibility of being null. This is very similar to MaybeTable, except that it does not use an extra tag field, so it cannot distinguish between Nothing and Just Nothing if nested. In other words, if all of the columns of the t passed to NullTable are already nullable, then NullTable has no effect.

Constructors

NullTable (Nullify context a) 

Instances

Instances details
(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 #

context ~ Expr => AltTable (NullTable context) Source # 
Instance details

Defined in Rel8.Internal.Table.Null

Methods

(<|>:) :: Table Expr a => NullTable context a -> NullTable context a -> NullTable context a Source #

context ~ Expr => AlternativeTable (NullTable context) Source # 
Instance details

Defined in Rel8.Internal.Table.Null

Methods

emptyTable :: Table Expr a => NullTable context a Source #

Projectable (NullTable context) Source # 
Instance details

Defined in Rel8.Internal.Table.Null

Methods

project :: Projecting a b => Projection a b -> NullTable context a -> NullTable context b Source #

(EqTable a, context ~ Expr) => EqTable (NullTable context a) Source # 
Instance details

Defined in Rel8.Internal.Table.Null

Methods

eqTable :: Columns (NullTable context a) (Dict (Sql DBEq)) Source #

(OrdTable a, context ~ Expr) => OrdTable (NullTable context a) Source # 
Instance details

Defined in Rel8.Internal.Table.Null

Methods

ordTable :: Columns (NullTable context a) (Dict (Sql DBOrd)) Source #

(ToExprs exprs a, context ~ Expr) => ToExprs (NullTable context exprs) (Maybe a) Source # 
Instance details

Defined in Rel8.Internal.Table.Null

type Transpose to (NullTable context a) Source # 
Instance details

Defined in Rel8.Internal.Table.Null

type Transpose to (NullTable context a) = NullTable to (Transpose to a)
type Columns (NullTable context a) Source # 
Instance details

Defined in Rel8.Internal.Table.Null

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

Defined in Rel8.Internal.Table.Null

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

Defined in Rel8.Internal.Table.Null

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

nullableTable :: (Table Expr a, Table Expr b) => b -> (a -> b) -> NullTable Expr a -> b Source #

Like nullable.

nullTable :: Table Expr a => NullTable Expr a Source #

The null table. Like null.

nullifyTable :: a -> NullTable Expr a Source #

Lift any table into NullTable. Like nullify.

unsafeUnnullifyTable :: NullTable Expr a -> a Source #

Assume that a NullTable is non-null. Like unsafeUnnullify.

isNullTable :: Table Expr a => NullTable Expr a -> Expr Bool Source #

Check if any of the non-nullable fields of a are null under the NullTable. Returns false if a has no non-nullable fields.

nameNullTable :: a -> NullTable Name a Source #

Construct a NullTable in the Name context. This can be useful if you have a NullTable that you are storing in a table and need to construct a TableSchema.

toNullTable :: Table Expr a => MaybeTable Expr a -> NullTable Expr a Source #

Convert a MaybeTable to a NullTable. Note that if the underlying a has no non-nullable fields, this is a lossy conversion.