Module

SqlSquared

Package
purescript-sql-squared
Repository
slamdata/purescript-sql-squared

#Sql Source

type Sql = Mu (SqlF EJsonF)

#SqlQuery Source

#print Source

#encodeJson Source

#encodeJsonQuery Source

#encodeJsonModule Source

#arbitrarySqlOfSize Source

#arbitrarySqlQueryOfSize Source

#arbitrarySqlModuleOfSize Source

Re-exports from SqlSquared.Constructors

#when Source

when :: forall t. t -> (t -> Case t)

#vari Source

vari :: forall f t. Corecursive t (SqlF f) => String -> t

#unop Source

unop :: forall f t. Corecursive t (SqlF f) => UnaryOperator -> t -> t

#then_ Source

then_ :: forall t. t -> (t -> Case t) -> Case t

#switch Source

switch :: forall f t. Corecursive t (SqlF f) => List (Case t) -> Maybe t -> t

#string Source

string :: forall t. Corecursive t (SqlF EJsonF) => String -> t

#splice Source

splice :: forall f t. Corecursive t (SqlF f) => Maybe t -> t

#set Source

set :: forall g f t. Corecursive t (SqlF g) => Foldable f => f t -> t

#select Source

select :: forall f t. Corecursive t (SqlF EJsonF) => Foldable f => Boolean -> f (Projection t) -> Maybe (Relation t) -> Maybe t -> Maybe (GroupBy t) -> Maybe (OrderBy t) -> t

#projection Source

projection :: forall t. t -> Projection t

#pars Source

pars :: forall f t. Corecursive t (SqlF f) => t -> t

#num Source

num :: forall t. Corecursive t (SqlF EJsonF) => Number -> t

#null Source

null :: forall t. Corecursive t (SqlF EJsonF) => t

#match Source

match :: forall f t. Corecursive t (SqlF f) => t -> List (Case t) -> Maybe t -> t

#map_ Source

map_ :: forall t. Corecursive t (SqlF EJsonF) => Ord t => Map t t -> t

#let_ Source

let_ :: forall f t. Corecursive t (SqlF f) => String -> t -> t -> t

#invokeFunction Source

invokeFunction :: forall f t. Corecursive t (SqlF f) => String -> List t -> t

#int Source

int :: forall t. Corecursive t (SqlF EJsonF) => Int -> t

#ident Source

ident :: forall f t. Corecursive t (SqlF f) => String -> t

#hugeNum Source

hugeNum :: forall t. Corecursive t (SqlF EJsonF) => HugeNum -> t

#having Source

having :: forall t. t -> GroupBy t -> GroupBy t

#groupBy Source

groupBy :: forall f t. Foldable f => f t -> GroupBy t

#buildSelect Source

buildSelect :: forall f t. Corecursive t (SqlF f) => (SelectR t -> SelectR t) -> t

#bool Source

bool :: forall t. Corecursive t (SqlF EJsonF) => Boolean -> t

#binop Source

binop :: forall f t. Corecursive t (SqlF f) => BinaryOperator -> t -> t -> t

#as Source

as :: forall t. String -> Projection t -> Projection t

#array Source

array :: forall f t. Corecursive t (SqlF EJsonF) => Foldable f => f t -> t

Re-exports from SqlSquared.Lenses

#_tablePath Source

_tablePath :: forall r a. Lens' { tablePath :: a | r } a

#_right Source

_right :: forall r a. Lens' { right :: a | r } a

#_rhs Source

_rhs :: forall r a. Lens' { rhs :: a | r } a

#_relations Source

_relations :: forall r a. Lens' { relations :: a | r } a

#_projections Source

_projections :: forall r a. Lens' { projections :: a | r } a

#_orderBy Source

_orderBy :: forall r a. Lens' { orderBy :: a | r } a

#_op Source

_op :: forall r a. Lens' { op :: a | r } a

#_name Source

_name :: forall r a. Lens' { name :: a | r } a

#_lhs Source

_lhs :: forall r a. Lens' { lhs :: a | r } a

#_left Source

_left :: forall r a. Lens' { left :: a | r } a

#_keys Source

_keys :: forall r a. Lens' { keys :: a | r } a

#_joinType Source

_joinType :: forall r a. Lens' { joinType :: a | r } a

#_isDistinct Source

_isDistinct :: forall r a. Lens' { isDistinct :: a | r } a

#_in Source

_in :: forall r a. Lens' { in_ :: a | r } a

#_ident Source

_ident :: forall r a. Lens' { ident :: a | r } a

#_having Source

_having :: forall r a. Lens' { having :: a | r } a

#_groupBy Source

_groupBy :: forall r a. Lens' { groupBy :: a | r } a

#_filter Source

_filter :: forall r a. Lens' { filter :: a | r } a

#_expr Source

_expr :: forall r a. Lens' { expr :: a | r } a

#_else Source

_else :: forall r a. Lens' { else_ :: a | r } a

#_cond Source

_cond :: forall r a. Lens' { cond :: a | r } a

#_clause Source

_clause :: forall r a. Lens' { clause :: a | r } a

#_cases Source

_cases :: forall r a. Lens' { cases :: a | r } a

#_bindTo Source

_bindTo :: forall r a. Lens' { bindTo :: a | r } a

#_args Source

_args :: forall r a. Lens' { args :: a | r } a

#_aliasName Source

_aliasName :: forall r a. Lens' { aliasName :: a | r } a

#_alias Source

_alias :: forall r a. Lens' { alias :: a | r } a

#_VariRelation Source

#_Vari Source

_Vari :: forall f t. Recursive t (SqlF f) => Corecursive t (SqlF f) => Prism' t String

#_Unop Source

_Unop :: forall f t. Recursive t (SqlF f) => Corecursive t (SqlF f) => Prism' t (UnopR t)

#_TableRelation Source

#_Switch Source

_Switch :: forall f t. Recursive t (SqlF f) => Corecursive t (SqlF f) => Prism' t (SwitchR t)

#_StringLiteral Source

#_Splice Source

_Splice :: forall f t. Recursive t (SqlF f) => Corecursive t (SqlF f) => Prism' t (Maybe t)

#_SetLiteral Source

_SetLiteral :: forall f t. Recursive t (SqlF f) => Corecursive t (SqlF f) => Prism' t (List t)

#_Select Source

_Select :: forall f t. Recursive t (SqlF f) => Corecursive t (SqlF f) => Prism' t (SelectR t)

#_Projection Source

_Projection :: forall a. Iso' (Projection a) { alias :: Maybe String, expr :: a }

#_Parens Source

_Parens :: forall f t. Recursive t (SqlF f) => Corecursive t (SqlF f) => Prism' t t

#_OrderBy Source

_OrderBy :: forall a. Iso' (OrderBy a) (NonEmpty List (OrderType × a))

#_NullLiteral Source

#_Match Source

_Match :: forall f t. Recursive t (SqlF f) => Corecursive t (SqlF f) => Prism' t (MatchR t)

#_MapLiteral Source

_MapLiteral :: forall t. Recursive t (SqlF EJsonF) => Corecursive t (SqlF EJsonF) => Prism' t (Array (t × t))

#_Literal Source

_Literal :: forall f t. Recursive t (SqlF f) => Corecursive t (SqlF f) => Prism' t (f t)

#_Let Source

_Let :: forall f t. Recursive t (SqlF f) => Corecursive t (SqlF f) => Prism' t (LetR t)

#_JoinRelation Source

_JoinRelation :: forall a. Prism' (Relation a) (JoinRelR a)

#_InvokeFunction Source

_InvokeFunction :: forall f t. Recursive t (SqlF f) => Corecursive t (SqlF f) => Prism' t (InvokeFunctionR t)

#_IntLiteral Source

#_Ident Source

_Ident :: forall f t. Recursive t (SqlF f) => Corecursive t (SqlF f) => Prism' t String

#_GroupBy Source

_GroupBy :: forall a. Iso' (GroupBy a) { having :: Maybe a, keys :: List a }

#_ExprRelation Source

_ExprRelation :: forall a. Prism' (Relation a) (ExprRelR a)

#_DecimalLiteral Source

#_Case Source

_Case :: forall a. Iso' (Case a) { cond :: a, expr :: a }

#_BoolLiteral Source

#_Binop Source

_Binop :: forall f t. Recursive t (SqlF f) => Corecursive t (SqlF f) => Prism' t (BinopR t)

#_ArrayLiteral Source

Re-exports from SqlSquared.Parser

#PositionedToken Source

type PositionedToken = { position :: Position, token :: Token }

#printToken Source

#prettyParse Source

prettyParse :: forall a. (String -> Either ParseError a) -> String -> Either String a

#parse Source

Re-exports from SqlSquared.Signature

#VariRelR Source

type VariRelR = { alias :: Maybe String, vari :: String }

#UnopR Source

type UnopR a = { expr :: a, op :: UnaryOperator }

#TableRelR Source

#SwitchR Source

type SwitchR a = { cases :: List (Case a), else_ :: Maybe a }

#SqlF Source

data SqlF literal a

Constructors

Instances

#SelectR Source

type SelectR a = { filter :: Maybe a, groupBy :: Maybe (GroupBy a), isDistinct :: Boolean, orderBy :: Maybe (OrderBy a), projections :: List (Projection a), relations :: Maybe (Relation a) }

#Projection Source

newtype Projection a

Constructors

Instances

#MatchR Source

type MatchR a = { cases :: List (Case a), else_ :: Maybe a, expr :: a }

#LetR Source

type LetR a = { bindTo :: a, ident :: String, in_ :: a }

#JoinRelR Source

type JoinRelR a = { clause :: a, joinType :: JoinType, left :: Relation a, right :: Relation a }

#InvokeFunctionR Source

type InvokeFunctionR a = { args :: List a, name :: String }

#GroupBy Source

newtype GroupBy a

Constructors

Instances

#FunctionDeclR Source

type FunctionDeclR a = { args :: List String, body :: a, ident :: String }

#ExprRelR Source

type ExprRelR a = { aliasName :: String, expr :: a }

#Case Source

newtype Case a

Constructors

  • Case { cond :: a, expr :: a }

Instances

#BinopR Source

type BinopR a = { lhs :: a, op :: BinaryOperator, rhs :: a }

#printSqlF Source

printSqlF :: forall l. Algebra l String -> Algebra (SqlF l) String

#genSql Source

genSql :: forall t. Int -> GenSql t

#encodeJsonSqlF Source

encodeJsonSqlF :: forall l. Algebra l Json -> Algebra (SqlF l) Json

#arbitrarySqlF Source

#(⋙) Source

Operator alias for SqlSquared.Utils.composeFlipped (right-associative / precedence 9)

#(∘) Source

Operator alias for Control.Semigroupoid.compose (right-associative / precedence 9)

#(×) Source

Operator alias for Data.Tuple.Tuple (right-associative / precedence 1)

#type (×) Source

Operator alias for Data.Tuple.Tuple (right-associative / precedence 4)