ClickHaskell-0.1.0: ClickHouse driver
Safe HaskellSafe-Inferred
LanguageHaskell2010

ClickHaskell.Columns

Synopsis

Columns

appendColumn :: KnownColumn (Column name chType) => Column name chType -> Columns columns -> Columns (Column name chType ': columns) Source #

Columns extraction helper

class HasColumns hasColumns Source #

Associated Types

type GetColumns hasColumns :: [Type] Source #

Instances

Instances details
HasColumns (Columns columns) Source # 
Instance details

Defined in ClickHaskell.Columns

Associated Types

type GetColumns (Columns columns) :: [Type] Source #

HasColumns (Table name columns) Source # 
Instance details

Defined in ClickHaskell

Associated Types

type GetColumns (Table name columns) :: [Type] Source #

HasColumns (View name columns parameters) Source # 
Instance details

Defined in ClickHaskell

Associated Types

type GetColumns (View name columns parameters) :: [Type] Source #

Take column by name from list of columns

type family TakeColumn (name :: Symbol) (columns :: [Type]) :: (Type, [Type]) where ... Source #

Equations

TakeColumn name columns = GoTakeColumn name columns '[] 

type family GoTakeColumn name (columns :: [Type]) (acc :: [Type]) :: (Type, [Type]) where ... Source #

Equations

GoTakeColumn name (Column name chType ': columns) acc = '(Column name chType, acc ++ columns) 
GoTakeColumn name (Column name1 chType ': columns) acc = GoTakeColumn name columns (Column name1 chType ': acc) 
GoTakeColumn name '[] acc = TypeError ((('Text "There is no column \"" :<>: 'Text name) :<>: 'Text "\" in table") :$$: 'Text "You can't use this field") 

type family (list1 :: [Type]) ++ (list2 :: [Type]) :: [Type] where ... Source #

Equations

'[] ++ list = list 
(head ': tail) ++ list = tail ++ (head ': list) 

To columns generic convertion

type GenericWritable record columns = (Generic record, GWritable columns (Rep record)) Source #

class (HasColumns (Columns (GetColumns columns)), Serializable (Columns (GetColumns columns)), DeserializableColumns (Columns (GetColumns columns))) => WritableInto columns record where Source #

Minimal complete definition

Nothing

class GWritable (columns :: [Type]) f where Source #

Instances

Instances details
GWritable columns (left1 :*: (left2 :*: right)) => GWritable columns ((left1 :*: left2) :*: right) Source # 
Instance details

Defined in ClickHaskell.Columns

(GWritable '[Column name chType] (S1 ('MetaSel ('Just name) a b f) rec), GWritable restColumns right, '(Column name chType, restColumns) ~ TakeColumn name columns) => GWritable columns (S1 ('MetaSel ('Just name) a b f) rec :*: right) Source # 
Instance details

Defined in ClickHaskell.Columns

GWritable columns f => GWritable columns (D1 c (C1 c2 f)) Source # 
Instance details

Defined in ClickHaskell.Columns

(KnownColumn (Column name chType), ToChType chType inputType, Serializable (Column name chType), '(Column name chType, restColumns) ~ TakeColumn name columns) => GWritable columns (S1 ('MetaSel ('Just name) a b f) (Rec0 inputType)) Source # 
Instance details

Defined in ClickHaskell.Columns

From columns generic convertion

Reading

type GenericReadable record hasColumns = (Generic record, GReadable (GetColumns hasColumns) (Rep record)) Source #

class (HasColumns hasColumns, DeserializableColumns (Columns (GetColumns hasColumns))) => ReadableFrom hasColumns record where Source #

Minimal complete definition

Nothing

Methods

deserializeColumns :: ProtocolRevision -> UVarInt -> Get [record] Source #

default deserializeColumns :: GenericReadable record hasColumns => ProtocolRevision -> UVarInt -> Get [record] Source #

readingColumns :: Builder Source #

default readingColumns :: GenericReadable record hasColumns => Builder Source #

class GReadable (columns :: [Type]) f where Source #

Instances

Instances details
GReadable columns (left :*: (right1 :*: right2)) => GReadable columns ((left :*: right1) :*: right2) Source # 
Instance details

Defined in ClickHaskell.Columns

Methods

gFromColumns :: ProtocolRevision -> UVarInt -> Get [((left :*: right1) :*: right2) p] Source #

gReadingColumns :: Builder Source #

GReadable columns f => GReadable columns (D1 c (C1 c2 f)) Source # 
Instance details

Defined in ClickHaskell.Columns

(KnownColumn (Column name chType), DeserializableColumn (Column name chType), FromChType chType inputType, '(Column name chType, restColumns) ~ TakeColumn name columns) => GReadable columns (S1 ('MetaSel ('Just name) a b f) (Rec0 inputType)) Source # 
Instance details

Defined in ClickHaskell.Columns

Methods

gFromColumns :: ProtocolRevision -> UVarInt -> Get [S1 ('MetaSel ('Just name) a b f) (Rec0 inputType) p] Source #

gReadingColumns :: Builder Source #

(KnownColumn (Column name chType), GReadable '[Column name chType] (S1 sel rec), GReadable restColumns right) => GReadable (Column name chType ': restColumns) (S1 sel rec :*: right) Source # 
Instance details

Defined in ClickHaskell.Columns