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

Squeal.PostgreSQL.Expression.Default

Contents

Description

optional expressions

Synopsis

Default

data Optional (expr :: k -> Type) (ty :: (Optionality, k)) where Source #

Optional is either Default or Setting of a value, parameterized by an appropriate Optionality.

Constructors

Default :: Optional expr ('Def :=> ty)

Use the Default value for a column.

Set :: expr ty -> Optional expr (def :=> ty)

Set a value for a column.

Instances

Instances details
(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 #

(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 #

mapOptional :: (expr x -> expr y) -> Optional expr (def :=> x) -> Optional expr (def :=> y) Source #

Map a function over an Optional expression.

pattern NotDefault :: ty -> Optional I ('Def :=> ty) Source #

NotDefault pattern analagous to Just.