squeal-postgresql-0.9.1.3: Squeal PostgreSQL Library
Copyright(c) Eitan Chatav 2019
Maintainereitan@morphism.tech
Stabilityexperimental
Safe HaskellSafe-Inferred
LanguageHaskell2010

Squeal.PostgreSQL.Render

Contents

Description

render functions

Synopsis

Render

class RenderSQL sql where Source #

A class for rendering SQL

Methods

renderSQL :: sql -> ByteString Source #

Instances

Instances details
RenderSQL OnDeleteClause Source # 
Instance details

Defined in Squeal.PostgreSQL.Definition.Constraint

RenderSQL OnUpdateClause Source # 
Instance details

Defined in Squeal.PostgreSQL.Definition.Constraint

RenderSQL ReferentialAction Source # 
Instance details

Defined in Squeal.PostgreSQL.Definition.Constraint

RenderSQL TimeUnit Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Time

RenderSQL LockStrength Source # 
Instance details

Defined in Squeal.PostgreSQL.Query.Table

RenderSQL Waiting Source # 
Instance details

Defined in Squeal.PostgreSQL.Query.Table

RenderSQL Materialization Source # 
Instance details

Defined in Squeal.PostgreSQL.Query.With

RenderSQL AccessMode Source #

Render an AccessMode.

Instance details

Defined in Squeal.PostgreSQL.Session.Transaction.Unsafe

RenderSQL DeferrableMode Source #

Render a DeferrableMode.

Instance details

Defined in Squeal.PostgreSQL.Session.Transaction.Unsafe

RenderSQL IsolationLevel Source #

Render an IsolationLevel.

Instance details

Defined in Squeal.PostgreSQL.Session.Transaction.Unsafe

RenderSQL TransactionMode Source #

Render a TransactionMode.

Instance details

Defined in Squeal.PostgreSQL.Session.Transaction.Unsafe

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

Defined in Squeal.PostgreSQL.Type.Alias

Methods

renderSQL :: Alias alias -> ByteString Source #

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

Defined in Squeal.PostgreSQL.Type.Schema

Methods

renderSQL :: PGlabel label -> ByteString Source #

RenderSQL [SortExpression grp lat with db params from] Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Sort

Methods

renderSQL :: [SortExpression grp lat with db params from] -> ByteString Source #

RenderSQL (Definition db0 db1) Source # 
Instance details

Defined in Squeal.PostgreSQL.Definition

Methods

renderSQL :: Definition db0 db1 -> ByteString Source #

RenderSQL (IndexMethod ty) Source # 
Instance details

Defined in Squeal.PostgreSQL.Definition.Index

RenderSQL (ColumnTypeExpression db ty) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Type

RenderSQL (TypeExpression db ty) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Type

RenderSQL (By from by) Source # 
Instance details

Defined in Squeal.PostgreSQL.Query.Table

Methods

renderSQL :: By from by -> ByteString Source #

RenderSQL (LockingClause from) Source # 
Instance details

Defined in Squeal.PostgreSQL.Query.Table

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

Defined in Squeal.PostgreSQL.Type.Alias

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

Defined in Squeal.PostgreSQL.Type.Alias

Methods

renderSQL :: NP Alias aliases -> ByteString Source #

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

Defined in Squeal.PostgreSQL.Type.Schema

Methods

renderSQL :: NP PGlabel labels -> ByteString Source #

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

Defined in Squeal.PostgreSQL.Expression.Default

Methods

renderSQL :: Optional expr ty -> ByteString Source #

RenderSQL (ConflictTarget constraints) Source #

Render a ConflictTarget

Instance details

Defined in Squeal.PostgreSQL.Manipulation.Insert

Methods

renderSQL :: ConflictTarget constraints -> ByteString Source #

RenderSQL (Statement db x y) Source # 
Instance details

Defined in Squeal.PostgreSQL.Session.Statement

Methods

renderSQL :: Statement db x y -> ByteString Source #

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

Defined in Squeal.PostgreSQL.Definition.Constraint

Methods

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

RenderSQL (ProcedureDefinition db args) Source # 
Instance details

Defined in Squeal.PostgreSQL.Definition.Procedure

RenderSQL (Manipulation with db params columns) Source # 
Instance details

Defined in Squeal.PostgreSQL.Manipulation

Methods

renderSQL :: Manipulation with db params columns -> ByteString Source #

RenderSQL (QueryClause with db params columns) Source # 
Instance details

Defined in Squeal.PostgreSQL.Manipulation.Insert

Methods

renderSQL :: QueryClause with db params columns -> ByteString Source #

RenderSQL (GroupByClause grp from) Source # 
Instance details

Defined in Squeal.PostgreSQL.Query.Table

Methods

renderSQL :: GroupByClause grp from -> ByteString Source #

RenderSQL (ReturningClause with db params from row) Source # 
Instance details

Defined in Squeal.PostgreSQL.Manipulation

Methods

renderSQL :: ReturningClause with db params from row -> ByteString Source #

RenderSQL (ConflictAction tab with db params table) Source # 
Instance details

Defined in Squeal.PostgreSQL.Manipulation.Insert

Methods

renderSQL :: ConflictAction tab with db params table -> ByteString Source #

SListI (TableToColumns table) => RenderSQL (ConflictClause tab with db params table) Source #

Render a ConflictClause.

Instance details

Defined in Squeal.PostgreSQL.Manipulation.Insert

Methods

renderSQL :: ConflictClause tab with db params table -> ByteString Source #

RenderSQL (Query lat with db params row) Source # 
Instance details

Defined in Squeal.PostgreSQL.Query

Methods

renderSQL :: Query lat with db params row -> ByteString Source #

RenderSQL (FromClause lat with db params from) Source # 
Instance details

Defined in Squeal.PostgreSQL.Query.From

Methods

renderSQL :: FromClause lat with db params from -> ByteString Source #

(forall (c :: FromType) (s :: SchemasType) (p :: [NullType]) (r :: RowType). RenderSQL (statement c s p r)) => RenderSQL (CommonTableExpression statement db params with0 with1) Source # 
Instance details

Defined in Squeal.PostgreSQL.Query.With

Methods

renderSQL :: CommonTableExpression statement db params with0 with1 -> ByteString Source #

RenderSQL (FunctionDefinition db args ret) Source # 
Instance details

Defined in Squeal.PostgreSQL.Definition.Function

SListI xs => RenderSQL (AggregateArg xs lat with db params from) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Aggregate

Methods

renderSQL :: AggregateArg xs lat with db params from -> ByteString Source #

RenderSQL (SortExpression grp lat with db params from) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Sort

Methods

renderSQL :: SortExpression grp lat with db params from -> ByteString Source #

RenderSQL (WindowDefinition grp lat with db params from) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Window

Methods

renderSQL :: WindowDefinition grp lat with db params from -> ByteString Source #

RenderSQL (JoinItem lat with db params left right) Source # 
Instance details

Defined in Squeal.PostgreSQL.Query.From.Join

Methods

renderSQL :: JoinItem lat with db params left right -> ByteString Source #

RenderSQL (HavingClause grp lat with db params from) Source #

Render a HavingClause.

Instance details

Defined in Squeal.PostgreSQL.Query.Table

Methods

renderSQL :: HavingClause grp lat with db params from -> ByteString Source #

RenderSQL (TableExpression grp lat with db params from) Source #

Render a TableExpression

Instance details

Defined in Squeal.PostgreSQL.Query.Table

Methods

renderSQL :: TableExpression grp lat with db params from -> ByteString Source #

RenderSQL (Expression grp lat with db params from ty) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

renderSQL :: Expression grp lat with db params from ty -> ByteString Source #

SListI args => RenderSQL (WindowArg grp args lat with db params from) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Window

Methods

renderSQL :: WindowArg grp args lat with db params from -> ByteString Source #

RenderSQL (WindowFunction grp lat with db params from ty) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Window

Methods

renderSQL :: WindowFunction grp lat with db params from ty -> ByteString Source #

RenderSQL (Selection grp lat with db params from row) Source # 
Instance details

Defined in Squeal.PostgreSQL.Query.Select

Methods

renderSQL :: Selection grp lat with db params from row -> 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.

escapeQuotedString :: String -> ByteString Source #

Escape quote a string.

escapeQuotedText :: Text -> ByteString Source #

Escape quote a string.

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.