Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data Table (name :: Symbol) (columns :: [Type])
- data View (name :: Symbol) (columns :: [Type]) (parameters :: [Type])
- parameter :: forall name chType parameters userType. (InterpretableParameters parameters, ToChType chType userType, KnownSymbol name, ToQueryPart chType) => userType -> ParametersInterpreter parameters -> WithPassedParameter (Parameter name chType) parameters
- data Parameter (name :: Symbol) (chType :: Type)
- parameters :: forall (params :: [Type]). (ParametersInterpreter '[] -> ParametersInterpreter params) -> Builder
- newtype ParametersInterpreter (parameters :: [Type]) = MkParametersInterpreter {}
- class InterpretableParameters (ps :: [Type]) where
- type WithPassedParameter p ps = withPassedParameter | withPassedParameter -> ps p
- interpretParameter :: forall name chType. (KnownSymbol name, ToQueryPart chType) => chType -> ParametersInterpreter ps -> WithPassedParameter (Parameter name chType) ps
- type family CheckParameters (tableFunctionParams :: [Type]) (passedParams :: [Type]) :: Constraint where ...
- class HasColumns (hasColumns :: k) where
- type GetColumns hasColumns :: [Type]
- type family TakeColumn (name :: Symbol) (columns :: [Type]) :: (Type, [Type]) where ...
- data Column (name :: Symbol) (columnType :: Type)
- data Alias
- data Default
- class IsChType (GetColumnType columnDescription) => CompiledColumn columnDescription where
- type GetColumnName columnDescription :: Symbol
- type GetColumnType columnDescription :: Type
- type WritableColumn columnDescription :: Maybe ErrorMessage
- type WriteOptionalColumn columnDescription :: Bool
- renderColumnName :: Builder
- renderColumnType :: Builder
Specs
data Table (name :: Symbol) (columns :: [Type]) Source #
Instances
HasColumns (Table name columns :: Type) Source # | |
Defined in ClickHaskell.Tables type GetColumns (Table name columns) :: [Type] Source # | |
type GetColumns (Table name columns :: Type) Source # | |
Defined in ClickHaskell.Tables |
data View (name :: Symbol) (columns :: [Type]) (parameters :: [Type]) Source #
Instances
HasColumns (View name columns params :: Type) Source # | |
Defined in ClickHaskell.Tables type GetColumns (View name columns params) :: [Type] Source # | |
type GetColumns (View name columns params :: Type) Source # | |
Defined in ClickHaskell.Tables |
parameter :: forall name chType parameters userType. (InterpretableParameters parameters, ToChType chType userType, KnownSymbol name, ToQueryPart chType) => userType -> ParametersInterpreter parameters -> WithPassedParameter (Parameter name chType) parameters 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 #
type WithPassedParameter p ps = withPassedParameter | withPassedParameter -> ps p Source #
interpretParameter :: forall name chType. (KnownSymbol name, ToQueryPart chType) => chType -> ParametersInterpreter ps -> WithPassedParameter (Parameter name chType) ps Source #
Instances
InterpretableParameters ('[] :: [Type]) Source # | |
Defined in ClickHaskell.Tables type WithPassedParameter p '[] = (withPassedParameter :: Type) Source # interpretParameter :: forall (name :: Symbol) chType. (KnownSymbol name, ToQueryPart chType) => chType -> ParametersInterpreter '[] -> WithPassedParameter (Parameter name chType) '[] Source # | |
InterpretableParameters (x ': xs) Source # | |
Defined in ClickHaskell.Tables type WithPassedParameter p (x ': xs) = (withPassedParameter :: Type) Source # 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 #
CheckParameters tfs ps = (CheckDuplicates ps, GoCheckParameters tfs ps '[] True) |
Columns
HasColumns helper class
class HasColumns (hasColumns :: k) Source #
type GetColumns hasColumns :: [Type] Source #
Instances
HasColumns (Table name columns :: Type) Source # | |
Defined in ClickHaskell.Tables type GetColumns (Table name columns) :: [Type] Source # | |
HasColumns (View name columns params :: Type) Source # | |
Defined in ClickHaskell.Tables type GetColumns (View name columns params) :: [Type] Source # | |
HasColumns (columns :: [Type]) Source # | |
Defined in ClickHaskell.Tables type GetColumns columns :: [Type] Source # |
Take column from list of columns
type family TakeColumn (name :: Symbol) (columns :: [Type]) :: (Type, [Type]) where ... Source #
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
Column subtypes
Column that refers to another column.
Can be only readed.
Example:
type MyColumn = Column "myColumn" ChString -> Alias
Instances
Column which value could be evaluated when it's not mentioned.
Not required for writing.
Example:
type MyColumn = Column "myColumn" ChString -> Default
Instances
Compilers
class IsChType (GetColumnType columnDescription) => CompiledColumn columnDescription where Source #
type GetColumnName columnDescription :: Symbol Source #
type GetColumnType columnDescription :: Type Source #
type WritableColumn columnDescription :: Maybe ErrorMessage Source #
type WriteOptionalColumn columnDescription :: Bool Source #