Copyright | Flipstone Technology Partners 2023 |
---|---|
License | MIT |
Stability | Stable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Since: 1.0.0.0
Synopsis
- data InsertExpr
- insertExpr :: Qualified TableName -> Maybe InsertColumnList -> InsertSource -> Maybe ReturningExpr -> InsertExpr
- data InsertColumnList
- insertColumnList :: [ColumnName] -> InsertColumnList
- data InsertSource
- insertSqlValues :: [[SqlValue]] -> InsertSource
- data RowValues
- rowValues :: [SqlValue] -> RowValues
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
SqlExpression InsertExpr Source # | Since: 1.0.0.0 |
Defined in Orville.PostgreSQL.Expr.Insert toRawSql :: InsertExpr -> RawSql Source # unsafeFromRawSql :: RawSql -> InsertExpr Source # |
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
SqlExpression InsertColumnList Source # | Since: 1.0.0.0 |
Defined in Orville.PostgreSQL.Expr.Insert |
insertColumnList :: [ColumnName] -> InsertColumnList Source #
Create an InsertColumnList
for the given ColumnName
s, 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
SqlExpression InsertSource Source # | Since: 1.0.0.0 |
Defined in Orville.PostgreSQL.Expr.Insert toRawSql :: InsertSource -> RawSql Source # |
insertSqlValues :: [[SqlValue]] -> InsertSource Source #
Create an InsertSource
for the given SqlValue
s. This ensures that all input values are used
as parameters and comma-separated in the generated SQL.
Since: 1.0.0.0
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
SqlExpression RowValues Source # | Since: 1.0.0.0 |