squeal-postgresql-0.5.2.0: Squeal PostgreSQL Library

Copyright(c) Eitan Chatav 2017
Maintainereitan@morphism.tech
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Squeal.PostgreSQL.Render

Contents

Description

Rendering helper functions.

Synopsis

Render

class RenderSQL sql where Source #

A class for rendering SQL

Methods

renderSQL :: sql -> ByteString Source #

Instances
RenderSQL TimeUnit Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Time

RenderSQL OnUpdateClause Source #

Render OnUpdateClause.

Instance details

Defined in Squeal.PostgreSQL.Definition

RenderSQL OnDeleteClause Source #

Render OnDeleteClause.

Instance details

Defined in Squeal.PostgreSQL.Definition

RenderSQL DeferrableMode Source #

Render a DeferrableMode.

Instance details

Defined in Squeal.PostgreSQL.Transaction

RenderSQL AccessMode Source #

Render an AccessMode.

Instance details

Defined in Squeal.PostgreSQL.Transaction

RenderSQL IsolationLevel Source #

Render an IsolationLevel.

Instance details

Defined in Squeal.PostgreSQL.Transaction

RenderSQL TransactionMode Source #

Render a TransactionMode.

Instance details

Defined in Squeal.PostgreSQL.Transaction

KnownSymbol alias => RenderSQL (Alias alias) Source #
>>> printSQL (#jimbob :: Alias "jimbob")
"jimbob"
Instance details

Defined in Squeal.PostgreSQL.Alias

Methods

renderSQL :: Alias alias -> ByteString Source #

KnownSymbol label => RenderSQL (PGlabel label) Source # 
Instance details

Defined in Squeal.PostgreSQL.Schema

Methods

renderSQL :: PGlabel label -> ByteString Source #

(KnownSymbol q, KnownSymbol a) => RenderSQL (QualifiedAlias q a) Source # 
Instance details

Defined in Squeal.PostgreSQL.Alias

RenderSQL (TypeExpression schemas ty) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Type

Methods

renderSQL :: TypeExpression schemas ty -> ByteString Source #

RenderSQL (GroupByClause grp from) Source #

Renders a GroupByClause.

Instance details

Defined in Squeal.PostgreSQL.Query

Methods

renderSQL :: GroupByClause grp from -> ByteString Source #

RenderSQL (By from by) Source # 
Instance details

Defined in Squeal.PostgreSQL.Query

Methods

renderSQL :: By from by -> ByteString Source #

RenderSQL (ConflictTarget constraints) Source #

Render a ConflictTarget

Instance details

Defined in Squeal.PostgreSQL.Manipulation

Methods

renderSQL :: ConflictTarget constraints -> ByteString Source #

RenderSQL (ColumnTypeExpression schemas ty) Source # 
Instance details

Defined in Squeal.PostgreSQL.Definition

RenderSQL (Definition schemas0 schemas1) Source # 
Instance details

Defined in Squeal.PostgreSQL.Definition

Methods

renderSQL :: Definition schemas0 schemas1 -> ByteString Source #

All KnownSymbol aliases => RenderSQL (NP Alias aliases) Source # 
Instance details

Defined in Squeal.PostgreSQL.Alias

Methods

renderSQL :: NP Alias aliases -> ByteString Source #

All KnownSymbol labels => RenderSQL (NP PGlabel labels) Source # 
Instance details

Defined in Squeal.PostgreSQL.Schema

Methods

renderSQL :: NP PGlabel labels -> ByteString Source #

SListI tys => RenderSQL (Distinction (NP (Expression outer commons grp schemas params from)) tys) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Aggregate

Methods

renderSQL :: Distinction (NP (Expression outer commons grp schemas params from)) tys -> ByteString Source #

RenderSQL (Distinction (Expression outer commons grp schemas params from) ty) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Aggregate

Methods

renderSQL :: Distinction (Expression outer commons grp schemas params from) ty -> ByteString Source #

(forall (x :: k). RenderSQL (expr x)) => RenderSQL (Optional expr ty) Source # 
Instance details

Defined in Squeal.PostgreSQL.Manipulation

Methods

renderSQL :: Optional expr ty -> ByteString Source #

(forall (t0 :: k) (t1 :: k). RenderSQL (p t0 t1)) => RenderSQL (AlignedList p x0 x1) Source # 
Instance details

Defined in Squeal.PostgreSQL.List

Methods

renderSQL :: AlignedList p x0 x1 -> ByteString Source #

RenderSQL (QueryClause commons schemas params columns) Source # 
Instance details

Defined in Squeal.PostgreSQL.Manipulation

Methods

renderSQL :: QueryClause commons schemas params columns -> ByteString Source #

RenderSQL (Manipulation commons schemas params columns) Source # 
Instance details

Defined in Squeal.PostgreSQL.Manipulation

Methods

renderSQL :: Manipulation commons schemas params columns -> ByteString Source #

RenderSQL (TableConstraintExpression sch tab schemas constraint) Source # 
Instance details

Defined in Squeal.PostgreSQL.Definition

Methods

renderSQL :: TableConstraintExpression sch tab schemas constraint -> ByteString Source #

(forall (c :: FromType) (s :: SchemasType) (p :: [NullityType]) (r :: RowType). RenderSQL (statement c s p r)) => RenderSQL (CommonTableExpression statement schemas params commons0 commons1) Source # 
Instance details

Defined in Squeal.PostgreSQL.Query

Methods

renderSQL :: CommonTableExpression statement schemas params commons0 commons1 -> ByteString Source #

RenderSQL (Query outer commons schemas params row) Source # 
Instance details

Defined in Squeal.PostgreSQL.Query

Methods

renderSQL :: Query outer commons schemas params row -> ByteString Source #

RenderSQL (ConflictAction tab commons schemas params columns) Source # 
Instance details

Defined in Squeal.PostgreSQL.Manipulation

Methods

renderSQL :: ConflictAction tab commons schemas params columns -> ByteString Source #

RenderSQL (ReturningClause commons schemas params from row) Source # 
Instance details

Defined in Squeal.PostgreSQL.Manipulation

Methods

renderSQL :: ReturningClause commons schemas params from row -> ByteString Source #

RenderSQL (SortExpression outer commons grp schemas params from) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Sort

Methods

renderSQL :: SortExpression outer commons grp schemas params from -> ByteString Source #

RenderSQL (WindowDefinition outer commons schemas from grp params) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Window

Methods

renderSQL :: WindowDefinition outer commons schemas from grp params -> ByteString Source #

RenderSQL (HavingClause outer commons grp schemas params from) Source #

Render a HavingClause.

Instance details

Defined in Squeal.PostgreSQL.Query

Methods

renderSQL :: HavingClause outer commons grp schemas params from -> ByteString Source #

RenderSQL (TableExpression outer commons grp schemas params from) Source #

Render a TableExpression

Instance details

Defined in Squeal.PostgreSQL.Query

Methods

renderSQL :: TableExpression outer commons grp schemas params from -> ByteString Source #

SListI (TableToColumns table) => RenderSQL (ConflictClause tab commons schemas params table) Source #

Render a ConflictClause.

Instance details

Defined in Squeal.PostgreSQL.Manipulation

Methods

renderSQL :: ConflictClause tab commons schemas params table -> ByteString Source #

RenderSQL (Expression outer commons grp schemas params from ty) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

renderSQL :: Expression outer commons grp schemas params from ty -> ByteString Source #

RenderSQL (WindowFunction outer commons grp schemas params from ty) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Window

Methods

renderSQL :: WindowFunction outer commons grp schemas params from ty -> ByteString Source #

RenderSQL (Selection outer commons grp schemas params from row) Source # 
Instance details

Defined in Squeal.PostgreSQL.Query

Methods

renderSQL :: Selection outer commons grp schemas params from row -> ByteString Source #

RenderSQL (FromClause outer commons schemas params from) Source # 
Instance details

Defined in Squeal.PostgreSQL.Query

Methods

renderSQL :: FromClause outer commons schemas params from -> ByteString Source #

printSQL :: (RenderSQL sql, MonadIO io) => sql -> io () Source #

Print SQL.

escape :: Char -> String Source #

escape a character to prevent injection

(<+>) :: ByteString -> ByteString -> ByteString infixr 7 Source #

Concatenate two ByteStrings with a space between.

commaSeparated :: [ByteString] -> ByteString Source #

Comma separate a list of ByteStrings.

doubleQuoted :: ByteString -> ByteString Source #

Add double quotes around a ByteString.

singleQuotedText :: Text -> ByteString Source #

Add single quotes around a Text and escape single quotes within it.

singleQuotedUtf8 :: ByteString -> ByteString Source #

Add single quotes around a ByteString and escape single quotes within it.

renderCommaSeparated :: SListI xs => (forall x. expression x -> ByteString) -> NP expression xs -> ByteString Source #

Comma separate the renderings of a heterogeneous list.

renderCommaSeparatedConstraint :: forall c xs expression. (All c xs, SListI xs) => (forall x. c x => expression x -> ByteString) -> NP expression xs -> ByteString Source #

Comma separate the renderings of a heterogeneous list.

renderCommaSeparatedMaybe :: SListI xs => (forall x. expression x -> Maybe ByteString) -> NP expression xs -> ByteString Source #

Comma separate the Maybe renderings of a heterogeneous list, dropping Nothings.

renderNat :: forall n. KnownNat n => ByteString Source #

Render a promoted Nat.

renderSymbol :: forall s. KnownSymbol s => ByteString Source #

Render a promoted Symbol.