ClickHaskell-0.0.0.1: ClickHouse driver
Safe HaskellSafe-Inferred
LanguageHaskell2010

ClickHaskell.Tables

Synopsis

Specs

data Table (name :: Symbol) (columns :: [Type]) Source #

Instances

Instances details
HasColumns (Table name columns :: Type) Source # 
Instance details

Defined in ClickHaskell.Tables

Associated Types

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

type GetColumns (Table name columns :: Type) Source # 
Instance details

Defined in ClickHaskell.Tables

type GetColumns (Table name columns :: Type) = columns

data View (name :: Symbol) (columns :: [Type]) (parameters :: [Type]) Source #

Instances

Instances details
HasColumns (View name columns params :: Type) Source # 
Instance details

Defined in ClickHaskell.Tables

Associated Types

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

type GetColumns (View name columns params :: Type) Source # 
Instance details

Defined in ClickHaskell.Tables

type GetColumns (View name columns params :: Type) = columns

parameter :: forall name chType parameters userType. (InterpretableParameters parameters, ToChType chType userType, KnownSymbol name, ToQueryPart chType) => userType -> ParametersInterpreter parameters -> WithPassedParameter (Parameter name chType) parameters Source #

data Parameter (name :: Symbol) (chType :: Type) Source #

parameters :: forall (params :: [Type]). (ParametersInterpreter '[] -> ParametersInterpreter params) -> Builder Source #

>>> parameters (parameter @"a3" @ChString ("a3Val" :: ByteString) . parameter @"a2" @ChString ("a2Val" :: ByteString))
"(a2='a2Val', a3='a3Val')"

newtype ParametersInterpreter (parameters :: [Type]) Source #

class InterpretableParameters (ps :: [Type]) where Source #

Associated Types

type WithPassedParameter p ps = withPassedParameter | withPassedParameter -> ps p Source #

Methods

interpretParameter :: forall name chType. (KnownSymbol name, ToQueryPart chType) => chType -> ParametersInterpreter ps -> WithPassedParameter (Parameter name chType) ps Source #

Instances

Instances details
InterpretableParameters ('[] :: [Type]) Source # 
Instance details

Defined in ClickHaskell.Tables

Associated Types

type WithPassedParameter p '[] = (withPassedParameter :: Type) Source #

Methods

interpretParameter :: forall (name :: Symbol) chType. (KnownSymbol name, ToQueryPart chType) => chType -> ParametersInterpreter '[] -> WithPassedParameter (Parameter name chType) '[] Source #

InterpretableParameters (x ': xs) Source # 
Instance details

Defined in ClickHaskell.Tables

Associated Types

type WithPassedParameter p (x ': xs) = (withPassedParameter :: Type) Source #

Methods

interpretParameter :: forall (name :: Symbol) chType. (KnownSymbol name, ToQueryPart chType) => chType -> ParametersInterpreter (x ': xs) -> WithPassedParameter (Parameter name chType) (x ': xs) Source #

type family CheckParameters (tableFunctionParams :: [Type]) (passedParams :: [Type]) :: Constraint where ... Source #

Equations

CheckParameters tfs ps = (CheckDuplicates ps, GoCheckParameters tfs ps '[] True) 

Columns

HasColumns helper class

class HasColumns (hasColumns :: k) Source #

Associated Types

type GetColumns hasColumns :: [Type] Source #

Instances

Instances details
HasColumns (Table name columns :: Type) Source # 
Instance details

Defined in ClickHaskell.Tables

Associated Types

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

HasColumns (View name columns params :: Type) Source # 
Instance details

Defined in ClickHaskell.Tables

Associated Types

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

HasColumns (columns :: [Type]) Source # 
Instance details

Defined in ClickHaskell.Tables

Associated Types

type GetColumns columns :: [Type] Source #

Take column from list of columns

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

Equations

TakeColumn name columns = GoTakeColumn name columns '[] 

Column

data Column (name :: Symbol) (columnType :: Type) Source #

Column declaration

Examples:

type MyColumn = Column "myColumn" ChString
type MyColumn = Column "myColumn" ChString -> Alias
type MyColumn = Column "myColumn" ChString -> Default

Instances

Instances details
(IsChType columnType, KnownSymbol name, KnownSymbol (ToChTypeName columnType)) => CompiledColumn (Column name columnType :: Type) Source # 
Instance details

Defined in ClickHaskell.Tables

Associated Types

type GetColumnName (Column name columnType) :: Symbol Source #

type GetColumnType (Column name columnType) Source #

type WritableColumn (Column name columnType) :: Maybe ErrorMessage Source #

type WriteOptionalColumn (Column name columnType) :: Bool Source #

CompiledColumn (Column name columnType) => CompiledColumn (Column name columnType -> Alias :: Type) Source # 
Instance details

Defined in ClickHaskell.Tables

Associated Types

type GetColumnName (Column name columnType -> Alias) :: Symbol Source #

type GetColumnType (Column name columnType -> Alias) Source #

type WritableColumn (Column name columnType -> Alias) :: Maybe ErrorMessage Source #

type WriteOptionalColumn (Column name columnType -> Alias) :: Bool Source #

CompiledColumn (Column name columnType) => CompiledColumn (Column name columnType -> Default :: Type) Source # 
Instance details

Defined in ClickHaskell.Tables

Associated Types

type GetColumnName (Column name columnType -> Default) :: Symbol Source #

type GetColumnType (Column name columnType -> Default) Source #

type WritableColumn (Column name columnType -> Default) :: Maybe ErrorMessage Source #

type WriteOptionalColumn (Column name columnType -> Default) :: Bool Source #

type GetColumnName (Column name columnType :: Type) Source # 
Instance details

Defined in ClickHaskell.Tables

type GetColumnName (Column name columnType :: Type) = name
type GetColumnName (Column name columnType -> Alias :: Type) Source # 
Instance details

Defined in ClickHaskell.Tables

type GetColumnName (Column name columnType -> Alias :: Type) = GetColumnName (Column name columnType)
type GetColumnName (Column name columnType -> Default :: Type) Source # 
Instance details

Defined in ClickHaskell.Tables

type GetColumnName (Column name columnType -> Default :: Type) = GetColumnName (Column name columnType)
type GetColumnType (Column name columnType :: Type) Source # 
Instance details

Defined in ClickHaskell.Tables

type GetColumnType (Column name columnType :: Type) = columnType
type GetColumnType (Column name columnType -> Alias :: Type) Source # 
Instance details

Defined in ClickHaskell.Tables

type GetColumnType (Column name columnType -> Alias :: Type) = GetColumnType (Column name columnType)
type GetColumnType (Column name columnType -> Default :: Type) Source # 
Instance details

Defined in ClickHaskell.Tables

type GetColumnType (Column name columnType -> Default :: Type) = GetColumnType (Column name columnType)
type WritableColumn (Column name columnType :: Type) Source # 
Instance details

Defined in ClickHaskell.Tables

type WritableColumn (Column name columnType :: Type) = 'Nothing :: Maybe ErrorMessage
type WritableColumn (Column name columnType -> Alias :: Type) Source # 
Instance details

Defined in ClickHaskell.Tables

type WritableColumn (Column name columnType -> Alias :: Type) = 'Just ((('Text "You are trying insert into Alias column \"" ':<>: 'Text name) ':<>: 'Text "\"") ':$$: 'Text "You can't do this. Read about Alias columns")
type WritableColumn (Column name columnType -> Default :: Type) Source # 
Instance details

Defined in ClickHaskell.Tables

type WritableColumn (Column name columnType -> Default :: Type) = 'Nothing :: Maybe ErrorMessage
type WriteOptionalColumn (Column name columnType :: Type) Source # 
Instance details

Defined in ClickHaskell.Tables

type WriteOptionalColumn (Column name columnType :: Type) = IsWriteOptional columnType
type WriteOptionalColumn (Column name columnType -> Alias :: Type) Source # 
Instance details

Defined in ClickHaskell.Tables

type WriteOptionalColumn (Column name columnType -> Alias :: Type) = 'False
type WriteOptionalColumn (Column name columnType -> Default :: Type) Source # 
Instance details

Defined in ClickHaskell.Tables

type WriteOptionalColumn (Column name columnType -> Default :: Type) = 'True

Column subtypes

data Alias Source #

Column that refers to another column.

Can be only readed.

Example:

type MyColumn = Column "myColumn" ChString -> Alias

Instances

Instances details
CompiledColumn (Column name columnType) => CompiledColumn (Column name columnType -> Alias :: Type) Source # 
Instance details

Defined in ClickHaskell.Tables

Associated Types

type GetColumnName (Column name columnType -> Alias) :: Symbol Source #

type GetColumnType (Column name columnType -> Alias) Source #

type WritableColumn (Column name columnType -> Alias) :: Maybe ErrorMessage Source #

type WriteOptionalColumn (Column name columnType -> Alias) :: Bool Source #

type GetColumnName (Column name columnType -> Alias :: Type) Source # 
Instance details

Defined in ClickHaskell.Tables

type GetColumnName (Column name columnType -> Alias :: Type) = GetColumnName (Column name columnType)
type GetColumnType (Column name columnType -> Alias :: Type) Source # 
Instance details

Defined in ClickHaskell.Tables

type GetColumnType (Column name columnType -> Alias :: Type) = GetColumnType (Column name columnType)
type WritableColumn (Column name columnType -> Alias :: Type) Source # 
Instance details

Defined in ClickHaskell.Tables

type WritableColumn (Column name columnType -> Alias :: Type) = 'Just ((('Text "You are trying insert into Alias column \"" ':<>: 'Text name) ':<>: 'Text "\"") ':$$: 'Text "You can't do this. Read about Alias columns")
type WriteOptionalColumn (Column name columnType -> Alias :: Type) Source # 
Instance details

Defined in ClickHaskell.Tables

type WriteOptionalColumn (Column name columnType -> Alias :: Type) = 'False

data Default Source #

Column which value could be evaluated when it's not mentioned.

Not required for writing.

Example:

type MyColumn = Column "myColumn" ChString -> Default

Instances

Instances details
CompiledColumn (Column name columnType) => CompiledColumn (Column name columnType -> Default :: Type) Source # 
Instance details

Defined in ClickHaskell.Tables

Associated Types

type GetColumnName (Column name columnType -> Default) :: Symbol Source #

type GetColumnType (Column name columnType -> Default) Source #

type WritableColumn (Column name columnType -> Default) :: Maybe ErrorMessage Source #

type WriteOptionalColumn (Column name columnType -> Default) :: Bool Source #

type GetColumnName (Column name columnType -> Default :: Type) Source # 
Instance details

Defined in ClickHaskell.Tables

type GetColumnName (Column name columnType -> Default :: Type) = GetColumnName (Column name columnType)
type GetColumnType (Column name columnType -> Default :: Type) Source # 
Instance details

Defined in ClickHaskell.Tables

type GetColumnType (Column name columnType -> Default :: Type) = GetColumnType (Column name columnType)
type WritableColumn (Column name columnType -> Default :: Type) Source # 
Instance details

Defined in ClickHaskell.Tables

type WritableColumn (Column name columnType -> Default :: Type) = 'Nothing :: Maybe ErrorMessage
type WriteOptionalColumn (Column name columnType -> Default :: Type) Source # 
Instance details

Defined in ClickHaskell.Tables

type WriteOptionalColumn (Column name columnType -> Default :: Type) = 'True

Compilers

class IsChType (GetColumnType columnDescription) => CompiledColumn columnDescription where Source #

Associated Types

type GetColumnName columnDescription :: Symbol Source #

type GetColumnType columnDescription :: Type Source #

type WritableColumn columnDescription :: Maybe ErrorMessage Source #

type WriteOptionalColumn columnDescription :: Bool Source #

Instances

Instances details
(IsChType columnType, KnownSymbol name, KnownSymbol (ToChTypeName columnType)) => CompiledColumn (Column name columnType :: Type) Source # 
Instance details

Defined in ClickHaskell.Tables

Associated Types

type GetColumnName (Column name columnType) :: Symbol Source #

type GetColumnType (Column name columnType) Source #

type WritableColumn (Column name columnType) :: Maybe ErrorMessage Source #

type WriteOptionalColumn (Column name columnType) :: Bool Source #

CompiledColumn (Column name columnType) => CompiledColumn (Column name columnType -> Alias :: Type) Source # 
Instance details

Defined in ClickHaskell.Tables

Associated Types

type GetColumnName (Column name columnType -> Alias) :: Symbol Source #

type GetColumnType (Column name columnType -> Alias) Source #

type WritableColumn (Column name columnType -> Alias) :: Maybe ErrorMessage Source #

type WriteOptionalColumn (Column name columnType -> Alias) :: Bool Source #

CompiledColumn (Column name columnType) => CompiledColumn (Column name columnType -> Default :: Type) Source # 
Instance details

Defined in ClickHaskell.Tables

Associated Types

type GetColumnName (Column name columnType -> Default) :: Symbol Source #

type GetColumnType (Column name columnType -> Default) Source #

type WritableColumn (Column name columnType -> Default) :: Maybe ErrorMessage Source #

type WriteOptionalColumn (Column name columnType -> Default) :: Bool Source #