Binds each parameter by name.
Binds each parameter by name.
Example:
val insert = conn.insert("insert into table(p1, p2) values (:p1, :p2)") insert.map(_.bind("p1" -> "str", "p2" -> 10L)).foreach(_.execute())
Throws:
Binds each parameter by index.
Binds each parameter by index.
Parameters are ordered, each value in params
sequence will be bound
to the corresponding parameter.
Example:
val insert = conn.insert("insert into table(p1, p2) values (:p1, :p2)") insert.map(_.bind("str", 10L)).foreach(_.execute())
Throws:
Binds each parameter by index and wraps a result in a Future.
Binds each parameter by index and wraps a result in a Future.
Parameters are ordered, each value in params
sequence will be bound
to the corresponding parameter.
This is not an asynchronous operation, it's only an utility method
that wraps bindByIdx
result with a Future
to allow chaining bind operations with asynchronous operations.
Example:
for { insert <- conn.insert("insert into table(p1, p2) values (:p1, :p2)") bound <- insert.bindByIdxF("str", 10L) _ <- bound.execute() } yield ()
Resulting future can fail with:
Binds each parameter by name and wraps a result in a Future.
Binds each parameter by name and wraps a result in a Future.
This is not an asynchronous operation, it's only an utility method
that wraps bind
result with a Future
to allow chaining bind operations with asynchronous operations.
Example:
for { insert <- conn.insert("insert into table(p1, p2) values (:p1, :p2)") bound <- insert.bindF("p1" -> "str", "p2" -> 10L) _ <- bound.execute() } yield ()
Resulting future can fail with:
Creaes an executable version of the statement object without providing any parameters.
Creaes an executable version of the statement object without providing any parameters.
Example:
val insert = conn.statement("insert into table(p1, p2) values ('str', 10)") insert.map(_.noParams).foreach(_.execute())
Creates an executable version of the statement object without providing any parameters and wraps a result in a future
Creates an executable version of the statement object without providing any parameters and wraps a result in a future
This is not an asynchronous operation, it's only an utility method
that wraps noParams
result with a Future
to allow chaining bind operations with asynchronous operations.
Example:
for { insert <- conn.statement("insert into table(p1, p2) values ('str', 10)") executable <- insert.noParamsF _ <- bound.execute() } yield ()
Streams statement parameters to a database.
Streams statement parameters to a database.
This method can be used to repeatedly execute this statement with
published parameters by leveraging Reactive Streams specification's
Publisher
with a backpressure. Each published element is a map
containing all parameters required by this statement.
Resulting future can fail with:
Represent a SQL statement
Methods of this trait allow to bind argument values to parameters either by name or index. Classes extending this trait can be used as an alternative to
sql
string interpolator - SqlInterpolator.