trait Statement extends AnyRef
Represents 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.
- Grouped
- Alphabetic
- By Inheritance
- Statement
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
abstract
def
bind(args: (String, Any)*): ExecutableStatement
Binds value to each parameter by name.
Binds value to 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:
- MissingParamValException when some parameter value was not provided
- NoSuitableConverterFoundException when some parameter value's type is not convertible to a database type
-
abstract
def
bindByIdx(args: Any*): ExecutableStatement
Binds value to each parameter by index.
Binds value to 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:
- MissingParamValException when some parameter value was not provided
- NoSuitableConverterFoundException when some parameter value's type is not convertible to a database type
-
abstract
def
noArgs: ExecutableStatement
Creates an executable version of the statement object without providing any arguments.
Creates an executable version of the statement object without providing any arguments.
Example:
val insert = conn.statement("insert into table(p1, p2) values ('str', 10)") insert.map(_.noArgs).foreach(_.execute())
-
abstract
def
streamArgs(argsPublisher: Publisher[_ <: Map[String, Any]]): Future[Unit]
Streams statement named arguments to a database.
Streams statement named arguments to a database.
This method can be used to repeatedly execute this statement with published arguments by leveraging Reactive Streams specification's
Publisher
with a back-pressure. Each published element is a map containing all arguments required by this statement.Resulting future can fail with:
- MissingParamValException when some parameter value was not provided
- NoSuitableConverterFoundException when some parameter value's type is not convertible to a database type
-
abstract
def
streamArgsByIdx(argsPublisher: Publisher[_ <: ImmutIndexedSeq[Any]]): Future[Unit]
Streams statement arguments to a database.
Streams statement arguments to a database.
This method can be used to repeatedly execute this statement with published arguments by leveraging Reactive Streams specification's
Publisher
with a back-pressure. Each published element is an indexed sequence containing all arguments required by this statement.Resulting future can fail with:
- MissingParamValException when some parameter value was not provided
- NoSuitableConverterFoundException when some parameter value's type is not convertible to a database type
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
- def +(other: String): String
- def ->[B](y: B): (Statement, B)
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate() @throws( ... )
- def ensuring(cond: (Statement) ⇒ Boolean, msg: ⇒ Any): Statement
- def ensuring(cond: (Statement) ⇒ Boolean): Statement
- def ensuring(cond: Boolean, msg: ⇒ Any): Statement
- def ensuring(cond: Boolean): Statement
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def formatted(fmtstr: String): String
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
- def →[B](y: B): (Statement, B)
TODO