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

Orville.PostgreSQL.Expr.Insert

Description

Since: 1.0.0.0

Synopsis

Documentation

data InsertExpr Source #

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

INSERT INTO foo (id) VALUES (1),(3),(3)

InsertExpr 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 InsertExpr Source #

Since: 1.0.0.0

Instance details

Defined in Orville.PostgreSQL.Expr.Insert

insertExpr :: Qualified TableName -> Maybe InsertColumnList -> InsertSource -> Maybe ReturningExpr -> InsertExpr Source #

Create an InsertExpr for the given TableName, limited to the specific columns if given. Callers of this likely want to use a function to create the InsertSource to ensure the input values are correctly used as parameters. This function does not include that protection itself.

Since: 1.0.0.0

data InsertColumnList Source #

Type to represent the SQL columns list for an insert statement. E.G.

(foo,bar,baz)

InsertColumnList 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 InsertColumnList Source #

Since: 1.0.0.0

Instance details

Defined in Orville.PostgreSQL.Expr.Insert

insertColumnList :: [ColumnName] -> InsertColumnList Source #

Create an InsertColumnList for the given ColumnNames, making sure the columns are wrapped in parens and commas are used to separate.

Since: 1.0.0.0

data InsertSource Source #

Type to represent the SQL for the source of data for an insert statement. E.G.

VALUES ('Bob',32),('Cindy',33)

InsertSource 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 InsertSource Source #

Since: 1.0.0.0

Instance details

Defined in Orville.PostgreSQL.Expr.Insert

insertSqlValues :: [[SqlValue]] -> InsertSource Source #

Create an InsertSource for the given SqlValues. This ensures that all input values are used as parameters and comma-separated in the generated SQL.

Since: 1.0.0.0

data RowValues Source #

Type to represent a SQL row literal. For example, a single row to insert in a VALUES clause. E.G.

('Cindy',33)

RowValues 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 RowValues Source #

Since: 1.0.0.0

Instance details

Defined in Orville.PostgreSQL.Expr.Insert

rowValues :: [SqlValue] -> RowValues Source #

Create a RowValues for the given SqlValues. This ensures that all input values are used as parameters and comma-separated in the generated SQL.

Since: 1.0.0.0