trait ExecutableStatement extends AnyRef
Represents an executable statement.
Executable statement is a statement that has all parameters provided and is ready to be executed.
- Alphabetic
- By Inheritance
- ExecutableStatement
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
abstract
def
execute()(implicit timeout: Timeout): Future[Unit]
Executes this statement ignoring any resulting information.
Executes this statement ignoring any resulting information.
After the operation takes longer time than
timeout
, operation will be aborted. Note however, that it may not be feasible to abort the operation immediately.Returned future can fail with:
- UnauthorizedException when client is not authorized to perform the action
- InvalidQueryException when query is rejected by a database engine as invalid
- InactiveTxException when transaction is in progress but is in inactive state
- ConstraintViolationException when operation results in an integrity constraint violation
-
abstract
def
executeForFirstRow()(implicit timeout: Timeout): Future[Option[Row]]
Executes this statement and returns the first row returned by a database engine.
Executes this statement and returns the first row returned by a database engine.
If no rows are found, None will be returned.
After the operation takes longer time than
timeout
, operation will be aborted. Note however, that it may not be feasible to abort the operation immediately.Returned future can fail with:
- UnauthorizedException when client is not authorized to perform the action
- InvalidQueryException when query is rejected by a database engine as invalid
- InactiveTxException when transaction is in progress but is in inactive state
- ConstraintViolationException when operation results in an integrity constraint violation
-
abstract
def
executeForKey[K]()(implicit arg0: ClassTag[K], timeout: Timeout): Future[K]
Executes this statement and returns a single generated key.
Executes this statement and returns a single generated key.
After the operation takes longer time than
timeout
, operation will be aborted. Note however, that it may not be feasible to abort the operation immediately.Returned future can fail with:
- UnauthorizedException when client is not authorized to perform the action
- InvalidQueryException when query is rejected by a database engine as invalid
- InactiveTxException when transaction is in progress but is in inactive state
- ConstraintViolationException when operation results in an integrity constraint violation
- NoKeysReturnedException when no keys were returned by the database engine
- NoSuitableConverterFoundException when no suitable converter was found to transform key value to desired class instance
- K
type of the returned key
-
abstract
def
executeForRowsAffected()(implicit timeout: Timeout): Future[Long]
Executes this statement returning a number of rows that were affected.
Executes this statement returning a number of rows that were affected.
After the operation takes longer time than
timeout
, operation will be aborted. Note however, that it may not be feasible to abort the operation immediately.Returned future can fail with:
- UnauthorizedException when client is not authorized to perform the action
- InvalidQueryException when query is rejected by a database engine as invalid
- InactiveTxException when transaction is in progress but is in inactive state
- ConstraintViolationException when operation results in an integrity constraint violation
-
abstract
def
executeForSet()(implicit timeout: Timeout): Future[ResultSet]
Executes this statement and returns a ResultSet instance.
Executes this statement and returns a ResultSet instance.
After execution all resulting rows will be pulled from a database and buffered in the resulting object. If expected result set is very big this may cause out of memory errors.
After the operation takes longer time than
timeout
, operation will be aborted. Note however, that it may not be feasible to abort the operation immediately.Returned future can fail with:
- UnauthorizedException when client is not authorized to perform the action
- InvalidQueryException when query is rejected by a database engine as invalid
- InactiveTxException when transaction is in progress but is in inactive state
- ConstraintViolationException when operation results in an integrity constraint violation
-
abstract
def
executeForStream()(implicit timeout: Timeout): Future[ResultStream]
Executes this statement and returns a ResultStream instance that can be used to stream rows from the database leveraging Reactive Streams specification's
Publisher
with backpressure.Executes this statement and returns a ResultStream instance that can be used to stream rows from the database leveraging Reactive Streams specification's
Publisher
with backpressure.After the operation takes longer time than
timeout
, operation will be aborted. Note however, that it may not be feasible to abort the operation immediately.Returned future can fail with:
- UnauthorizedException when client is not authorized to perform the action
- InvalidQueryException when query is rejected by a database engine as invalid
- InactiveTxException when transaction is in progress but is in inactive state
- ConstraintViolationException when operation results in an integrity constraint violation
-
abstract
def
executeForValue[A](valExtractor: (Row) ⇒ A)(implicit timeout: Timeout): Future[Option[A]]
Executes this statement and returns a single column value from the first row returned by a database engine.
Executes this statement and returns a single column value from the first row returned by a database engine.
If no rows are found, None will be returned.
If extracted value has SQL
null
value, a Some instance containing anull
value will be returned.This method is not intended to be used for returning values from columns that can have a SQL
null
value. UseexecuteForValueOpt
for such columns.Example:
for { val id = 10 select <- conn.statement(sql"select name from users where id = $id") name <- select.executeForValue(_.str("name")) } yield name
After the operation takes longer time than
timeout
, operation will be aborted. Note however, that it may not be feasible to abort the operation immediately.Returned future can fail with:
- UnauthorizedException when client is not authorized to perform the action
- InvalidQueryException when query is rejected by a database engine as invalid
- InactiveTxException when transaction is in progress but is in inactive state
- ConstraintViolationException when operation results in an integrity constraint violation
- valExtractor
function used to extract value from the returned row
-
abstract
def
executeForValueOpt[A](valExtractor: (Row) ⇒ Option[A])(implicit timeout: Timeout): Future[Option[Option[A]]]
Executes this statement and returns a single column value from the first row returned by a database engine.
Executes this statement and returns a single column value from the first row returned by a database engine.
If no rows are found, None will be returned.
If row was found but extracted value has SQL
null
value, a Some instance will be returned containing a None.Example:
val id = 10 for { select <- conn.select(sql"select name from users where id = $id") name <- parametrized.executeForValueOpt(_.str("name")) } yield name
After the operation takes longer time than
timeout
, operation will be aborted. Note however, that it may not be feasible to abort the operation immediately.Returned future can fail with:
- UnauthorizedException when client is not authorized to perform the action
- InvalidQueryException when query is rejected by a database engine as invalid
- InactiveTxException when transaction is in progress but is in inactive state
- ConstraintViolationException when operation results in an integrity constraint violation
- valExtractor
function used to extract value from the returned row
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
def
+(other: String): String
- Implicit
- This member is added by an implicit conversion from ExecutableStatement to any2stringadd[ExecutableStatement] performed by method any2stringadd in scala.Predef.
- Definition Classes
- any2stringadd
-
def
->[B](y: B): (ExecutableStatement, B)
- Implicit
- This member is added by an implicit conversion from ExecutableStatement to ArrowAssoc[ExecutableStatement] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @inline()
-
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
- @throws( ... )
-
def
ensuring(cond: (ExecutableStatement) ⇒ Boolean, msg: ⇒ Any): ExecutableStatement
- Implicit
- This member is added by an implicit conversion from ExecutableStatement to Ensuring[ExecutableStatement] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: (ExecutableStatement) ⇒ Boolean): ExecutableStatement
- Implicit
- This member is added by an implicit conversion from ExecutableStatement to Ensuring[ExecutableStatement] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: Boolean, msg: ⇒ Any): ExecutableStatement
- Implicit
- This member is added by an implicit conversion from ExecutableStatement to Ensuring[ExecutableStatement] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: Boolean): ExecutableStatement
- Implicit
- This member is added by an implicit conversion from ExecutableStatement to Ensuring[ExecutableStatement] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
formatted(fmtstr: String): String
- Implicit
- This member is added by an implicit conversion from ExecutableStatement to StringFormat[ExecutableStatement] performed by method StringFormat in scala.Predef.
- Definition Classes
- StringFormat
- Annotations
- @inline()
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
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
- @throws( ... )
-
def
→[B](y: B): (ExecutableStatement, B)
- Implicit
- This member is added by an implicit conversion from ExecutableStatement to ArrowAssoc[ExecutableStatement] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
TODO