Module

SqlSquared

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

#Sql Source

type Sql = Mu (SqlF EJsonF)

#SqlQuery Source

#print Source

#genSql Source

genSql :: forall m. MonadGen m => MonadRec m => m Sql

#genSqlQuery Source

genSqlQuery :: forall m. MonadGen m => MonadRec m => m SqlQuery

#genSqlModule Source

genSqlModule :: forall m. MonadGen m => MonadRec m => m SqlModule

Re-exports from SqlSquared.Constructors

#when Source

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

#var Source

var :: forall f t. Corecursive t (SqlF f) => Ident -> 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) => SwitchR t -> 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 f) => SelectR 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

#parens Source

parens :: 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) => MatchR t -> 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) => Ident -> t -> t -> t

#let' Source

let' :: forall f t. Corecursive t (SqlF f) => LetR t -> t

#invokeFunction' Source

invokeFunction' :: forall f t. Corecursive t (SqlF f) => InvokeFunctionR t -> t

#invokeFunction Source

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

#int Source

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

#ident' Source

ident' :: forall f t. Corecursive t (SqlF f) => Ident -> 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. Ident -> Projection t -> Projection 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

#_VarRelation Source

#_Var Source

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

#_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 Ident, 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

#_Identifier Source

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

#_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 }

#prettyParse Source

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

#parse Source

Re-exports from SqlSquared.Signature

#VarRelR Source

type VarRelR = { alias :: Maybe Ident, var :: Ident }

#UnopR Source

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

#TableRelR Source

type TableRelR = { alias :: Maybe Ident, path :: Either AnyDir AnyFile }

#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

#OrderType Source

data OrderType

Constructors

Instances

#MatchR Source

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

#LetR Source

type LetR a = { bindTo :: a, ident :: Ident, 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 :: Ident }

#GroupBy Source

newtype GroupBy a

Constructors

Instances

#FunctionDeclR Source

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

#ExprRelR Source

type ExprRelR a = { alias :: Ident, 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

#printIdent Source

#genUnaryOperator Source

#genSqlQueryF Source

#genSqlModuleF Source

#genSqlF Source

genSqlF :: forall l m. MonadGen m => MonadRec m => CoalgebraM m l Int -> CoalgebraM m (SqlF l) Int

#genSqlDeclF Source

#genRelation Source

#genProjection Source

#genOrderType Source

genOrderType :: forall m. MonadGen m => m OrderType

#genOrderBy Source

#genJoinType Source

genJoinType :: forall m. MonadGen m => m JoinType

#genGroupBy Source

#genCase Source

genCase :: forall m. MonadGen m => CoalgebraM m Case Int

#genBinaryOperator 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)