orville-postgresql-1.0.0.0: A Haskell library for PostgreSQL
CopyrightFlipstone Technology Partners 2023
LicenseMIT
StabilityStable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Orville.PostgreSQL.Expr.Update

Description

Since: 1.0.0.0

Synopsis

Documentation

data UpdateExpr Source #

Type to represent a SQL UPDATE statement. E.G.

UPDATE foo
SET id = 1
WHERE id <> 1

UpdateExpr provides a SqlExpression instance. See unsafeSqlExpression for how to construct a value with your own custom SQL.

Since: 1.0.0.0

Instances

Instances details
SqlExpression UpdateExpr Source # 
Instance details

Defined in Orville.PostgreSQL.Expr.Update

updateExpr Source #

Arguments

:: Qualified TableName

The name of the table to be updated.

-> SetClauseList

The updates to be made to the table.

-> Maybe WhereClause

An optional where clause to limit the rows updated.

-> Maybe ReturningExpr

An optional returning clause to return data from the updated rows.

-> UpdateExpr 

Constructs an UpdateExpr with the given options.

Since: 1.0.0.0

data SetClauseList Source #

Type to represent the list of updates to be made in an UPDATE statement. E.G.

foo = 1,
bar = 2

SetClauseList provides a SqlExpression instance. See unsafeSqlExpression for how to construct a value with your own custom SQL.

Since: 1.0.0.0

setClauseList :: NonEmpty SetClause -> SetClauseList Source #

Constructs a SetClauseList with the specified set clauses.

Since: 1.0.0.0

data SetClause Source #

Type to represent a single update to be made in an UPDATE statement. E.G.

foo = 1

SetClause provides a SqlExpression instance. See unsafeSqlExpression for how to construct a value with your own custom SQL.

Since: 1.0.0.0

Instances

Instances details
SqlExpression SetClause Source # 
Instance details

Defined in Orville.PostgreSQL.Expr.Update

setColumn :: ColumnName -> SqlValue -> SetClause Source #

Constructs a SetClause that will set the specified column to the specified value.

Since: 1.0.0.0