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

Squeal.PostgreSQL.Expression.Inline

Contents

Description

inline expressions

Synopsis

Inline

class Inline x where Source #

The Inline class allows embedding a Haskell value directly as an Expression using inline.

>>> printSQL (inline 'a')
(E'a' :: char(1))
>>> printSQL (inline (1 :: Double))
(1.0 :: float8)
>>> printSQL (inline (Json ([1, 2] :: [Double])))
('[1.0,2.0]' :: json)
>>> printSQL (inline (Enumerated GT))
'GT'

Methods

inline :: x -> Expr (null (PG x)) Source #

Instances

Instances details
Inline Bool Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Inline

Methods

inline :: forall (null :: PGType -> NullType). Bool -> Expr (null (PG Bool)) Source #

Inline Char Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Inline

Methods

inline :: forall (null :: PGType -> NullType). Char -> Expr (null (PG Char)) Source #

Inline Double Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Inline

Methods

inline :: forall (null :: PGType -> NullType). Double -> Expr (null (PG Double)) Source #

Inline Float Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Inline

Methods

inline :: forall (null :: PGType -> NullType). Float -> Expr (null (PG Float)) Source #

Inline Int16 Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Inline

Methods

inline :: forall (null :: PGType -> NullType). Int16 -> Expr (null (PG Int16)) Source #

Inline Int32 Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Inline

Methods

inline :: forall (null :: PGType -> NullType). Int32 -> Expr (null (PG Int32)) Source #

Inline Int64 Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Inline

Methods

inline :: forall (null :: PGType -> NullType). Int64 -> Expr (null (PG Int64)) Source #

Inline String Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Inline

Methods

inline :: forall (null :: PGType -> NullType). String -> Expr (null (PG String)) Source #

Inline Scientific Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Inline

Methods

inline :: forall (null :: PGType -> NullType). Scientific -> Expr (null (PG Scientific)) Source #

Inline UTCTime Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Inline

Methods

inline :: forall (null :: PGType -> NullType). UTCTime -> Expr (null (PG UTCTime)) Source #

Inline Text Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Inline

Methods

inline :: forall (null :: PGType -> NullType). Text -> Expr (null (PG Text)) Source #

Inline Text Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Inline

Methods

inline :: forall (null :: PGType -> NullType). Text -> Expr (null (PG Text)) Source #

Inline UUID Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Inline

Methods

inline :: forall (null :: PGType -> NullType). UUID -> Expr (null (PG UUID)) Source #

Inline Day Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Inline

Methods

inline :: forall (null :: PGType -> NullType). Day -> Expr (null (PG Day)) Source #

Inline DiffTime Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Inline

Methods

inline :: forall (null :: PGType -> NullType). DiffTime -> Expr (null (PG DiffTime)) Source #

Inline TimeOfDay Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Inline

Methods

inline :: forall (null :: PGType -> NullType). TimeOfDay -> Expr (null (PG TimeOfDay)) Source #

Inline LocalTime Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Inline

Methods

inline :: forall (null :: PGType -> NullType). LocalTime -> Expr (null (PG LocalTime)) Source #

Inline Oid Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Inline

Methods

inline :: forall (null :: PGType -> NullType). Oid -> Expr (null (PG Oid)) Source #

Inline Money Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Inline

Methods

inline :: forall (null :: PGType -> NullType). Money -> Expr (null (PG Money)) Source #

(KnownNat n, 1 <= n) => Inline (FixChar n) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Inline

Methods

inline :: forall (null :: PGType -> NullType). FixChar n -> Expr (null (PG (FixChar n))) Source #

(KnownNat n, 1 <= n) => Inline (VarChar n) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Inline

Methods

inline :: forall (null :: PGType -> NullType). VarChar n -> Expr (null (PG (VarChar n))) Source #

InlineParam x (NullPG x) => Inline (VarArray [x]) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Inline

Methods

inline :: forall (null :: PGType -> NullType). VarArray [x] -> Expr (null (PG (VarArray [x]))) Source #

InlineParam x (NullPG x) => Inline (VarArray (Vector x)) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Inline

Methods

inline :: forall (null :: PGType -> NullType). VarArray (Vector x) -> Expr (null (PG (VarArray (Vector x)))) Source #

(IsEnumType x, HasDatatypeInfo x) => Inline (Enumerated x) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Inline

Methods

inline :: forall (null :: PGType -> NullType). Enumerated x -> Expr (null (PG (Enumerated x))) Source #

(IsRecord x xs, AllZip InlineField xs (RowPG x)) => Inline (Composite x) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Inline

Methods

inline :: forall (null :: PGType -> NullType). Composite x -> Expr (null (PG (Composite x))) Source #

ToJSON x => Inline (Jsonb x) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Inline

Methods

inline :: forall (null :: PGType -> NullType). Jsonb x -> Expr (null (PG (Jsonb x))) Source #

ToJSON x => Inline (Json x) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Inline

Methods

inline :: forall (null :: PGType -> NullType). Json x -> Expr (null (PG (Json x))) Source #

Inline (Range Int32) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Inline

Methods

inline :: forall (null :: PGType -> NullType). Range Int32 -> Expr (null (PG (Range Int32))) Source #

Inline (Range Int64) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Inline

Methods

inline :: forall (null :: PGType -> NullType). Range Int64 -> Expr (null (PG (Range Int64))) Source #

Inline (Range Scientific) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Inline

Methods

inline :: forall (null :: PGType -> NullType). Range Scientific -> Expr (null (PG (Range Scientific))) Source #

Inline (Range UTCTime) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Inline

Methods

inline :: forall (null :: PGType -> NullType). Range UTCTime -> Expr (null (PG (Range UTCTime))) Source #

Inline (Range Day) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Inline

Methods

inline :: forall (null :: PGType -> NullType). Range Day -> Expr (null (PG (Range Day))) Source #

Inline (Range LocalTime) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Inline

Methods

inline :: forall (null :: PGType -> NullType). Range LocalTime -> Expr (null (PG (Range LocalTime))) Source #

Inline (TimeOfDay, TimeZone) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Inline

Methods

inline :: forall (null :: PGType -> NullType). (TimeOfDay, TimeZone) -> Expr (null (PG (TimeOfDay, TimeZone))) Source #

Inline x => Inline (Const x tag) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Inline

Methods

inline :: forall (null :: PGType -> NullType). Const x tag -> Expr (null (PG (Const x tag))) Source #

Inline x => Inline (K x tag) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Inline

Methods

inline :: forall (null :: PGType -> NullType). K x tag -> Expr (null (PG (K x tag))) Source #

Inline x => Inline (Constant x tag) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Inline

Methods

inline :: forall (null :: PGType -> NullType). Constant x tag -> Expr (null (PG (Constant x tag))) Source #

class InlineParam x ty where Source #

Lifts Inline to NullTypes.

Methods

inlineParam :: x -> Expr ty Source #

Instances

Instances details
(Inline x, pg ~ PG x) => InlineParam x ('NotNull pg) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Inline

Methods

inlineParam :: x -> Expr ('NotNull pg) Source #

(Inline x, pg ~ PG x) => InlineParam (Maybe x) ('Null pg) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Inline

Methods

inlineParam :: Maybe x -> Expr ('Null pg) Source #

class InlineField (field :: (Symbol, Type)) (fieldpg :: (Symbol, NullType)) where Source #

Lifts Inline to fields.

Methods

inlineField :: P field -> Aliased (Expression grp lat with db params from) fieldpg Source #

Instances

Instances details
(KnownSymbol alias, InlineParam x ty) => InlineField (alias ::: x) (alias ::: ty) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Inline

Methods

inlineField :: forall (grp :: Grouping) (lat :: FromType) (with :: FromType) (db :: SchemasType) (params :: [NullType]) (from :: FromType). P (alias ::: x) -> Aliased (Expression grp lat with db params from) (alias ::: ty) Source #

inlineFields Source #

Arguments

:: (IsRecord hask fields, AllZip InlineField fields row) 
=> hask

record

-> NP (Aliased (Expression 'Ungrouped '[] with db params '[])) row 

Inline a Haskell record as a row of expressions.

class InlineColumn (field :: (Symbol, Type)) (column :: (Symbol, ColumnType)) where Source #

Lifts Inline to a column entry

Methods

inlineColumn :: P field -> Aliased (Optional (Expression grp lat with db params from)) column Source #

Haskell record field as a inline column

Instances

Instances details
(KnownSymbol col, InlineParam x ty) => InlineColumn (col ::: Optional I ('Def :=> x)) (col ::: ('Def :=> ty)) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Inline

Methods

inlineColumn :: forall (grp :: Grouping) (lat :: FromType) (with :: FromType) (db :: SchemasType) (params :: [NullType]) (from :: FromType). P (col ::: Optional I ('Def :=> x)) -> Aliased (Optional (Expression grp lat with db params from)) (col ::: ('Def :=> ty)) Source #

(KnownSymbol col, InlineParam x ty) => InlineColumn (col ::: x) (col ::: ('NoDef :=> ty)) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Inline

Methods

inlineColumn :: forall (grp :: Grouping) (lat :: FromType) (with :: FromType) (db :: SchemasType) (params :: [NullType]) (from :: FromType). P (col ::: x) -> Aliased (Optional (Expression grp lat with db params from)) (col ::: ('NoDef :=> ty)) Source #

inlineColumns Source #

Arguments

:: (IsRecord hask xs, AllZip InlineColumn xs columns) 
=> hask

record

-> NP (Aliased (Optional (Expression 'Ungrouped '[] with db params '[]))) columns 

Inline a Haskell record as a list of columns.