Module
Yoga.ScyllaDB.Schema
- Package
- purescript-yoga-scylladb
- Repository
- rowtype-yoga/purescript-yoga-scylladb
#Table Source
data Table :: Symbol -> Row Type -> Typedata Table name columns
Constructors
Instances
(IsSymbol name, RowToList cols rl, RenderColumnsRL rl, PartitionKeysRL rl, ClusteringKeysRL rl) => CreateTableDDL (Table name cols)(IsSymbol name, RowToList cols rl, InsertColumnsRL rl) => InsertSQLFor (Table name cols)(IsSymbol name) => SelectAllSQLFor (Table name cols)(IsSymbol name, RowToList whereRow whereRL, WhereClauseRL whereRL) => SelectWhereSQLFor (Table name cols) whereRow(IsSymbol name, RowToList setRow setRL, RowToList whereRow whereRL, SetClauseRL setRL, WhereClauseRL whereRL) => UpdateSQLFor (Table name cols) setRow whereRow(IsSymbol name, RowToList whereRow whereRL, WhereClauseRL whereRL) => DeleteSQLFor (Table name cols) whereRow
#PartitionKey Source
data PartitionKey aInstances
(ExtractType a typ) => ExtractType (PartitionKey a) typ(RenderConstraint a) => RenderConstraint (PartitionKey a)IsPartitionKey (PartitionKey a)IsKeyColumn (PartitionKey a)
#ClusteringKey Source
data ClusteringKey aInstances
(ExtractType a typ) => ExtractType (ClusteringKey a) typ(RenderConstraint a) => RenderConstraint (ClusteringKey a)IsClusteringKey (ClusteringKey a)IsKeyColumn (ClusteringKey a)
#Static Source
data Static aInstances
(ExtractType a typ) => ExtractType (Static a) typ(RenderConstraint a) => RenderConstraint (Static a)(IsPartitionKey a) => IsPartitionKey (Static a)(IsClusteringKey a) => IsClusteringKey (Static a)
#IsNullable Source
class IsNullable :: forall k. k -> Constraintclass IsNullable a where
Members
isNullable :: Proxy a -> Boolean
Instances
IsNullable (Maybe a)IsNullable a
#ExtractType Source
class ExtractType wrapped typ | wrapped -> typInstances
(ExtractType a typ) => ExtractType (PartitionKey a) typ(ExtractType a typ) => ExtractType (ClusteringKey a) typ(ExtractType a typ) => ExtractType (Static a) typExtractType a a
#CQLTypeName Source
class CQLTypeName :: forall k. k -> Constraintclass CQLTypeName a where
Members
cqlTypeName :: Proxy a -> String
Instances
#RenderConstraint Source
class RenderConstraint :: forall k. k -> Constraintclass RenderConstraint a where
Members
renderConstraint :: Proxy a -> String
Instances
(RenderConstraint a) => RenderConstraint (PartitionKey a)(RenderConstraint a) => RenderConstraint (ClusteringKey a)(RenderConstraint a) => RenderConstraint (Static a)RenderConstraint a
#IsPartitionKey Source
class IsPartitionKey :: forall k. k -> Constraintclass IsPartitionKey a where
Members
isPartitionKey :: Proxy a -> Boolean
Instances
IsPartitionKey (PartitionKey a)(IsPartitionKey a) => IsPartitionKey (Static a)IsPartitionKey a
#IsClusteringKey Source
class IsClusteringKey :: forall k. k -> Constraintclass IsClusteringKey a where
Members
isClusteringKey :: Proxy a -> Boolean
Instances
IsClusteringKey (ClusteringKey a)(IsClusteringKey a) => IsClusteringKey (Static a)IsClusteringKey a
#IsKeyColumn Source
class IsKeyColumn :: forall k. k -> Constraintclass IsKeyColumn a where
Members
isKeyColumn :: Proxy a -> Boolean
Instances
#RenderColumnsRL Source
class RenderColumnsRL :: RowList Type -> Constraintclass RenderColumnsRL rl where
Members
renderColumnsRL :: Proxy rl -> Array String
Instances
RenderColumnsRL Nil(IsSymbol name, ExtractType entry typ, CQLTypeName typ, RenderConstraint entry, RenderColumnsRL tail) => RenderColumnsRL (Cons name entry tail)
#PartitionKeysRL Source
class PartitionKeysRL :: RowList Type -> Constraintclass PartitionKeysRL rl where
Members
partitionKeysRL :: Proxy rl -> Array String
Instances
PartitionKeysRL Nil(IsSymbol name, IsPartitionKey entry, PartitionKeysRL tail) => PartitionKeysRL (Cons name entry tail)
#ClusteringKeysRL Source
class ClusteringKeysRL :: RowList Type -> Constraintclass ClusteringKeysRL rl where
Members
clusteringKeysRL :: Proxy rl -> Array String
Instances
ClusteringKeysRL Nil(IsSymbol name, IsClusteringKey entry, ClusteringKeysRL tail) => ClusteringKeysRL (Cons name entry tail)
#CreateTableDDL Source
class CreateTableDDL :: forall k. k -> Constraintclass CreateTableDDL a where
Members
Instances
(IsSymbol name, RowToList cols rl, RenderColumnsRL rl, PartitionKeysRL rl, ClusteringKeysRL rl) => CreateTableDDL (Table name cols)
#InsertColumnsRL Source
class InsertColumnsRL :: RowList Type -> Constraintclass InsertColumnsRL rl where
Members
insertColumnsRL :: Proxy rl -> Array String
Instances
InsertColumnsRL Nil(IsSymbol name, InsertColumnsRL tail) => InsertColumnsRL (Cons name entry tail)
#InsertSQLFor Source
class InsertSQLFor :: forall k. k -> Constraintclass InsertSQLFor a where
Members
Instances
(IsSymbol name, RowToList cols rl, InsertColumnsRL rl) => InsertSQLFor (Table name cols)
#SelectAllSQLFor Source
class SelectAllSQLFor :: forall k. k -> Constraintclass SelectAllSQLFor a where
Members
Instances
(IsSymbol name) => SelectAllSQLFor (Table name cols)
#WhereClauseRL Source
class WhereClauseRL :: RowList Type -> Constraintclass WhereClauseRL rl where
Members
whereClauseRL :: Proxy rl -> Array String
Instances
WhereClauseRL Nil(IsSymbol name, WhereClauseRL tail) => WhereClauseRL (Cons name typ tail)
#SelectWhereSQLFor Source
class SelectWhereSQLFor :: forall k1 k2. k1 -> k2 -> Constraintclass SelectWhereSQLFor a whereRow where
Members
Instances
(IsSymbol name, RowToList whereRow whereRL, WhereClauseRL whereRL) => SelectWhereSQLFor (Table name cols) whereRow
#ColumnCountRL Source
class ColumnCountRL :: RowList Type -> Constraintclass ColumnCountRL rl where
Members
columnCountRL :: Proxy rl -> Int
Instances
ColumnCountRL Nil(ColumnCountRL tail) => ColumnCountRL (Cons name typ tail)
#SetClauseRL Source
class SetClauseRL :: RowList Type -> Constraintclass SetClauseRL rl where
Members
setClauseRL :: Proxy rl -> Array String
Instances
SetClauseRL Nil(IsSymbol name, SetClauseRL tail) => SetClauseRL (Cons name typ tail)
#UpdateSQLFor Source
class UpdateSQLFor :: forall k1 k2 k3. k1 -> k2 -> k3 -> Constraintclass UpdateSQLFor table setRow whereRow where
Members
Instances
(IsSymbol name, RowToList setRow setRL, RowToList whereRow whereRL, SetClauseRL setRL, WhereClauseRL whereRL) => UpdateSQLFor (Table name cols) setRow whereRow
#DeleteSQLFor Source
class DeleteSQLFor :: forall k1 k2. k1 -> k2 -> Constraintclass DeleteSQLFor table whereRow where
Members
Instances
(IsSymbol name, RowToList whereRow whereRL, WhereClauseRL whereRL) => DeleteSQLFor (Table name cols) whereRow
#StripColumnsRL Source
class StripColumnsRL :: RowList Type -> RowList Type -> Constraintclass StripColumnsRL rl out | rl -> out
Instances
StripColumnsRL Nil Nil(ExtractType entry typ, StripColumnsRL tail out') => StripColumnsRL (Cons name entry tail) (Cons name typ out')
#StripColumns Source
class StripColumns :: Row Type -> Row Type -> Constraintclass StripColumns cols result | cols -> result
Instances
(RowToList cols rl, StripColumnsRL rl outRL, ListToRow outRL result) => StripColumns cols result
#NonKeyColumnsRL Source
class NonKeyColumnsRL :: RowList Type -> Constraintclass NonKeyColumnsRL rl where
Members
nonKeyColumnsRL :: Proxy rl -> Array String
Instances
NonKeyColumnsRL Nil(IsSymbol name, IsKeyColumn entry, NonKeyColumnsRL tail) => NonKeyColumnsRL (Cons name entry tail)
#SingleTable Source
class SingleTable :: Row (Row Type) -> Symbol -> Row Type -> Constraintclass SingleTable tables name cols | tables -> name cols
Instances
(RowToList tables (Cons name cols Nil), IsSymbol name) => SingleTable tables name cols
#HasAnyDML Source
class HasAnyDML :: Row Type -> Constraintclass HasAnyDML stage
Instances
(RowToList stage rl, HasAnyDMLRL rl) => HasAnyDML stage
#HasAnyDMLRL Source
class HasAnyDMLRL :: RowList Type -> Constraintclass HasAnyDMLRL rl
Instances
HasAnyDMLRL (Cons "select" Unit rest)HasAnyDMLRL (Cons "set" Unit rest)HasAnyDMLRL (Cons "delete" Unit rest)(HasAnyDMLRL rest) => HasAnyDMLRL (Cons label typ rest)(Fail (Text "WHERE requires a preceding SELECT, UPDATE (set), or DELETE")) => HasAnyDMLRL Nil
#RecordValuesRL Source
class RecordValuesRL :: RowList Type -> Row Type -> Constraintclass RecordValuesRL rl row where
Members
recordValuesRL :: Proxy rl -> Record row -> Array Foreign
Instances
RecordValuesRL Nil row(IsSymbol name, Cons name typ rest row, ToCQLValue typ, RecordValuesRL tail row) => RecordValuesRL (Cons name typ tail) row
#ColumnNamesRL Source
class ColumnNamesRL :: RowList Type -> Constraintclass ColumnNamesRL rl where
Members
columnNamesRL :: Proxy rl -> Array String
Instances
ColumnNamesRL Nil(IsSymbol name, ColumnNamesRL tail) => ColumnNamesRL (Cons name typ tail)
#ValidateSetColumnsRL Source
class ValidateSetColumnsRL :: RowList Type -> Row Type -> Constraintclass ValidateSetColumnsRL rl cols
Instances
ValidateSetColumnsRL Nil cols(IsSymbol name, Cons name colType rest cols, ValidateSetColumnsRL tail cols) => ValidateSetColumnsRL (Cons name typ tail) cols
#selectAll Source
selectAll :: forall tables name cols result r p stage stage'. SingleTable tables name cols => StripColumns cols result => Lacks "select" stage => Lacks "insert" stage => Lacks "set" stage => Lacks "delete" stage => Lacks "where" stage => Lacks "orderBy" stage => Lacks "limit" stage => Cons "select" Unit stage stage' => Q tables r p stage -> Q tables result p stage'#BuilderSetClauseRL Source
class BuilderSetClauseRL :: RowList Type -> Constraintclass BuilderSetClauseRL rl where
Members
builderSetClauseRL :: Proxy rl -> Array String
Instances
BuilderSetClauseRL Nil(IsSymbol name, BuilderSetClauseRL tail) => BuilderSetClauseRL (Cons name typ tail)
#insert Source
insert :: forall tables name cols userRow userRowRL stage stage'. SingleTable tables name cols => RowToList userRow userRowRL => ColumnNamesRL userRowRL => RecordValuesRL userRowRL userRow => IsSymbol name => Lacks "select" stage => Lacks "insert" stage => Lacks "set" stage => Lacks "delete" stage => Cons "insert" Unit stage stage' => Record userRow -> Q tables () () stage -> Q tables () () stage'#set Source
set :: forall tables name cols setRow setRL stage stage'. SingleTable tables name cols => RowToList setRow setRL => IsSymbol name => ValidateSetColumnsRL setRL cols => BuilderSetClauseRL setRL => RecordValuesRL setRL setRow => Lacks "select" stage => Lacks "insert" stage => Lacks "set" stage => Lacks "delete" stage => Cons "set" Unit stage stage' => Record setRow -> Q tables () () stage -> Q tables () () stage'#ParseWhere Source
class ParseWhere :: Symbol -> Row (Row Type) -> Row Type -> Constraintclass ParseWhere sym tables params | sym tables -> params
Instances
(Cons h t sym, ParseWhereGo h t tables Nil outRL, ListToRow outRL params) => ParseWhere sym tables params
#ParseWhereGo Source
class ParseWhereGo :: Symbol -> Symbol -> Row (Row Type) -> RowList Type -> RowList Type -> Constraintclass ParseWhereGo head tail tables paramsIn paramsOut | head tail tables paramsIn -> paramsOut
Instances
(CollectParamName rest "" paramName restAfter, SingleTable tables tableName cols, RowToList cols colsRL, ResolveParamType paramName colsRL typ, EndOrContinue restAfter tables (Cons paramName typ paramsIn) paramsOut) => ParseWhereGo "$" rest tables paramsIn paramsOutParseWhereGo h "" tables paramsIn paramsIn(Cons h2 t2 rest, ParseWhereGo h2 t2 tables paramsIn paramsOut) => ParseWhereGo h rest tables paramsIn paramsOut
#CollectParamName Source
class CollectParamName :: Symbol -> Symbol -> Symbol -> Symbol -> Constraintclass CollectParamName input acc name rest | input acc -> name rest
Instances
CollectParamName "" acc acc ""(Cons h t input, CollectParamNameChar h t acc name rest) => CollectParamName input acc name rest
#CollectParamNameChar Source
class CollectParamNameChar :: Symbol -> Symbol -> Symbol -> Symbol -> Symbol -> Constraintclass CollectParamNameChar char tail acc name rest | char tail acc -> name rest
Instances
(Cons " " tail rest) => CollectParamNameChar " " tail acc acc rest(Cons ")" tail rest) => CollectParamNameChar ")" tail acc acc rest(Cons "," tail rest) => CollectParamNameChar "," tail acc acc rest(Append acc char acc', CollectParamName tail acc' name rest) => CollectParamNameChar char tail acc name rest
#EndOrContinue Source
class EndOrContinue :: Symbol -> Row (Row Type) -> RowList Type -> RowList Type -> Constraintclass EndOrContinue rest tables paramsIn paramsOut | rest tables paramsIn -> paramsOut
Instances
EndOrContinue "" tables paramsIn paramsIn(Cons h t rest, ParseWhereGo h t tables paramsIn paramsOut) => EndOrContinue rest tables paramsIn paramsOut
#ResolveParamType Source
class ResolveParamType :: Symbol -> RowList Type -> Type -> Constraintclass ResolveParamType name rl typ | name rl -> typ
Instances
(Fail (Text "Column not found in table")) => ResolveParamType name Nil typ(ExtractType entry typ) => ResolveParamType name (Cons name entry tail) typ(ResolveParamType name tail typ) => ResolveParamType name (Cons other entry tail) typ
#where_ Source
where_ :: forall @whr tables result params p stage stage'. IsSymbol whr => ParseWhere whr tables params => HasAnyDML stage => Lacks "where" stage => Lacks "insert" stage => Lacks "orderBy" stage => Lacks "limit" stage => Cons "where" Unit stage stage' => Q tables result p stage -> Q tables result params stage'#ParseLimitOffset Source
class ParseLimitOffset :: Symbol -> Row Type -> Row Type -> Constraintclass ParseLimitOffset sym paramsIn paramsOut | sym paramsIn -> paramsOut
Instances
(Cons h t sym, ParseLimitOffsetChar h t paramsIn paramsOut) => ParseLimitOffset sym paramsIn paramsOut
#ParseLimitOffsetChar Source
class ParseLimitOffsetChar :: Symbol -> Symbol -> Row Type -> Row Type -> Constraintclass ParseLimitOffsetChar head tail paramsIn paramsOut | head tail paramsIn -> paramsOut
Instances
(Append "" tail paramName, Cons paramName Int paramsIn paramsOut) => ParseLimitOffsetChar "$" tail paramsIn paramsOutParseLimitOffsetChar h tail paramsIn paramsIn
#ParseSelect Source
class ParseSelect :: Symbol -> Row (Row Type) -> Row Type -> Constraintclass ParseSelect sym tables result | sym tables -> result
Instances
ParseSelect "" tables ()(Cons h t sym, ParseSelectGo h t "" tables Nil outRL, ListToRow outRL result) => ParseSelect sym tables result
#ParseSelectGo Source
class ParseSelectGo :: Symbol -> Symbol -> Symbol -> Row (Row Type) -> RowList Type -> RowList Type -> Constraintclass ParseSelectGo head tail acc tables resultIn resultOut | head tail acc tables resultIn -> resultOut
Instances
(SingleTable tables tableName cols, RowToList cols colsRL, ResolveParamType acc colsRL typ, Cons h2 t2 rest, SkipSpaces h2 t2 h3 t3, ParseSelectGo h3 t3 "" tables (Cons acc typ resultIn) resultOut) => ParseSelectGo "," rest acc tables resultIn resultOut(Cons h2 t2 rest, ParseSelectGo h2 t2 acc tables resultIn resultOut) => ParseSelectGo " " rest acc tables resultIn resultOut(Append acc h acc', SingleTable tables tableName cols, RowToList cols colsRL, ResolveParamType acc' colsRL typ) => ParseSelectGo h "" acc tables resultIn (Cons acc' typ resultIn)(Append acc h acc', Cons h2 t2 rest, ParseSelectGo h2 t2 acc' tables resultIn resultOut) => ParseSelectGo h rest acc tables resultIn resultOut
#SkipSpaces Source
class SkipSpaces :: Symbol -> Symbol -> Symbol -> Symbol -> Constraintclass SkipSpaces head tail outHead outTail | head tail -> outHead outTail
Instances
(Cons h2 t2 rest, SkipSpaces h2 t2 outHead outTail) => SkipSpaces " " rest outHead outTailSkipSpaces h t h t
#select Source
select :: forall @sel tables result r p stage stage'. IsSymbol sel => ParseSelect sel tables result => Lacks "select" stage => Lacks "insert" stage => Lacks "set" stage => Lacks "delete" stage => Lacks "where" stage => Lacks "orderBy" stage => Lacks "limit" stage => Cons "select" Unit stage stage' => Q tables r p stage -> Q tables result p stage'#ParamsToArray Source
class ParamsToArray :: RowList Type -> Row Type -> Constraintclass ParamsToArray rl row where
Members
Instances
ParamsToArray Nil row(IsSymbol name, Cons name typ rest row, Lacks name rest, ParamsToArray tail row) => ParamsToArray (Cons name typ tail) row
#decodeRows Source
decodeRows :: forall a. ReadForeign a => Array Foreign -> Either String (Array a)#runQueryOne Source
runQueryOne :: forall tables result params paramsRL stage. RowToList params paramsRL => ParamsToArray paramsRL params => ReadForeign (Record result) => Client -> Record params -> Q tables result params stage -> Aff (Maybe (Record result))#runExecute Source
runExecute :: forall tables params paramsRL stage. RowToList params paramsRL => ParamsToArray paramsRL params => Client -> Record params -> Q tables () params stage -> Aff Unit