AutoSession

object AutoSession extends AutoSession
Companion
class
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait DBSession
trait AutoCloseable
trait LogSupport
class Object
trait Matchable
class Any

Type members

Inherited types

type Closable = { def close(): Unit; }
Inherited from
LoanPattern
type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Inherited from
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Inherited from
Mirror

Value members

Inherited methods

def batch[C[_]](template: String, paramsList: Seq[Any]*)(implicit f: Factory[Int, C[Int]]): C[Int]

Executes java.sql.PreparedStatement#executeBatch().

Executes java.sql.PreparedStatement#executeBatch().

Value Params
paramsList

list of parameters

template

SQL template

Returns

count list

Inherited from
DBSession
def batchAndReturnGeneratedKey[C[_]](template: String, paramsList: Seq[Any]*)(implicit f: Factory[Long, C[Long]]): C[Long]

Executes java.sql.PreparedStatement#executeBatch() and returns numeric generated keys.

Executes java.sql.PreparedStatement#executeBatch() and returns numeric generated keys.

Value Params
paramsList

list of parameters

template

SQL template

Returns

generated keys

Inherited from
DBSession
def batchAndReturnSpecifiedGeneratedKey[C[_]](template: String, key: String, paramsList: Seq[Any]*)(implicit f: Factory[Long, C[Long]]): C[Long]

Executes java.sql.PreparedStatement#executeBatch() and returns numeric generated keys.

Executes java.sql.PreparedStatement#executeBatch() and returns numeric generated keys.

Value Params
key

generated key name

paramsList

list of parameters

template

SQL template

Returns

generated keys

Inherited from
DBSession
def close(): Unit

Close the connection.

Close the connection.

Inherited from
DBSession
def collection[A, C[_]](template: String, params: Any*)(extract: WrappedResultSet => A)(implicit f: Factory[A, C[A]]): C[A]

Returns query result as any Collection object.

Returns query result as any Collection object.

Type Params
A

return type

C

return collection type

Value Params
extract

extract function

params

parameters

template

SQL template

Returns

result as C[A]

Inherited from
DBSession
def execute(template: String, params: Any*): Boolean

Executes java.sql.PreparedStatement#execute().

Executes java.sql.PreparedStatement#execute().

Value Params
params

parameters

template

SQL template

Returns

flag

Inherited from
DBSession
def executeLargeUpdate(template: String, params: Any*): Long

Executes java.sql.PreparedStatement#executeLargeUpdate().

Executes java.sql.PreparedStatement#executeLargeUpdate().

Value Params
params

parameters

template

SQL template

Returns

result count

Inherited from
DBSession
def executeUpdate(template: String, params: Any*): Int

Executes java.sql.PreparedStatement#executeUpdate().

Executes java.sql.PreparedStatement#executeUpdate().

Value Params
params

parameters

template

SQL template

Returns

result count

Inherited from
DBSession
def executeWithFilters(before: PreparedStatement => Unit, after: PreparedStatement => Unit, template: String, params: Any*): Boolean

Executes java.sql.PreparedStatement#execute().

Executes java.sql.PreparedStatement#execute().

Value Params
after

after filter

before

before filter

params

parameters

template

SQL template

Returns

flag

Inherited from
DBSession
override def fetchSize(fetchSize: Option[Int]): AutoSession
Definition Classes
Inherited from
AutoSession
override def fetchSize(fetchSize: Int): AutoSession
Definition Classes
Inherited from
AutoSession
def fetchSize: Option[Int]

Returns fetchSize for this session.

Returns fetchSize for this session.

Returns

fetch size

Inherited from
DBSession
def first[A](template: String, params: Any*)(extract: WrappedResultSet => A): Option[A]

Returns the first row optionally.

Returns the first row optionally.

Type Params
A

return type

Value Params
extract

extract function

params

parameters

template

SQL template

Returns

result optionally

Inherited from
DBSession
def foldLeft[A](template: String, params: Any*)(z: A)(op: (A, WrappedResultSet) => A): A

folding into one value.

folding into one value.

Value Params
op

function

params

parameters

template

SQL template

z

initial value

Returns

folded value

Inherited from
DBSession
def foreach(template: String, params: Any*)(f: WrappedResultSet => Unit): Unit

Applies side-effect to each row iteratively.

Applies side-effect to each row iteratively.

Value Params
f

function

params

parameters

template

SQL template

Returns

result as list

Inherited from
DBSession
def futureUsing[R <: Closable, A](resource: R)(f: R => Future[A])(implicit ec: ExecutionContext): Future[A]

Guarantees a Closeable resource will be closed after being passed to a block that takes the resource as a parameter and returns a Future.

Guarantees a Closeable resource will be closed after being passed to a block that takes the resource as a parameter and returns a Future.

Inherited from
LoanPattern
def iterable[A](template: String, params: Any*)(extract: WrappedResultSet => A): Iterable[A]

Returns query result as scala.collection.Iterable object.

Returns query result as scala.collection.Iterable object.

Type Params
A

return type

Value Params
extract

extract function

params

parameters

template

SQL template

Returns

result as iterable

Inherited from
DBSession
def largeBatch[C[_]](template: String, paramsList: Seq[Any]*)(implicit f: Factory[Long, C[Long]]): C[Long]

Executes java.sql.PreparedStatement#executeLargeBatch().

Executes java.sql.PreparedStatement#executeLargeBatch().

Value Params
paramsList

list of parameters

template

SQL template

Returns

count list

Inherited from
DBSession
def largeUpdateWithAutoGeneratedKeyNameAndFilters(returnGeneratedKeys: Boolean, generatedKeyName: String, before: PreparedStatement => Unit, after: PreparedStatement => Unit, template: String, params: Any*): Long

Executes java.sql.PreparedStatement#executeLargeUpdate().

Executes java.sql.PreparedStatement#executeLargeUpdate().

Value Params
after

after filter

before

before filter

generatedKeyName

generated key name

params

parameters

returnGeneratedKeys

is generated keys required

template

SQL template

Returns

result count

Inherited from
DBSession
def largeUpdateWithFilters(returnGeneratedKeys: Boolean, before: PreparedStatement => Unit, after: PreparedStatement => Unit, template: String, params: Any*): Long

Executes java.sql.PreparedStatement#executeLargeUpdate().

Executes java.sql.PreparedStatement#executeLargeUpdate().

Value Params
after

after filter

before

before filter

params

parameters

returnGeneratedKeys

is generated keys required

template

SQL template

Returns

result count

Inherited from
DBSession
def largeUpdateWithFilters(before: PreparedStatement => Unit, after: PreparedStatement => Unit, template: String, params: Any*): Long

Executes java.sql.PreparedStatement#executeLargeUpdate().

Executes java.sql.PreparedStatement#executeLargeUpdate().

Value Params
after

after filter

before

before filter

params

parameters

template

SQL template

Returns

result count

Inherited from
DBSession
def list[A](template: String, params: Any*)(extract: WrappedResultSet => A): List[A]

Returns query result as scala.List object.

Returns query result as scala.List object.

Type Params
A

return type

Value Params
extract

extract function

params

parameters

template

SQL template

Returns

result as list

Inherited from
DBSession
def productElementNames: Iterator[String]
Inherited from
Product
def productIterator: Iterator[Any]
Inherited from
Product
override def queryTimeout(seconds: Option[Int]): AutoSession
Definition Classes
Inherited from
AutoSession
override def queryTimeout(seconds: Int): AutoSession
Definition Classes
Inherited from
AutoSession
def queryTimeout: Option[Int]

Returns queryTimeout for this session.

Returns queryTimeout for this session.

Returns

query timeout seconds

Inherited from
DBSession
def single[A](template: String, params: Any*)(extract: WrappedResultSet => A): Option[A]

Returns single result optionally. If the result is not single, scalikejdbc.TooManyRowsException will be thrown.

Returns single result optionally. If the result is not single, scalikejdbc.TooManyRowsException will be thrown.

Type Params
A

return type

Value Params
extract

extract function

params

parameters

template

SQL template

Returns

result optionally

Inherited from
DBSession
override def tags(tags: String*): AutoSession
Definition Classes
Inherited from
AutoSession
def tags: Seq[String]

Returns tags for this session.

Returns tags for this session.

Returns

tags

Inherited from
DBSession
Inherited from
DBSession
def toStatementExecutor(template: String, params: Seq[Any], returnGeneratedKeys: Boolean): StatementExecutor
Inherited from
DBSession
def update(template: String, params: Any*): Int

Executes java.sql.PreparedStatement#executeUpdate().

Executes java.sql.PreparedStatement#executeUpdate().

Value Params
params

parameters

template

SQL template

Returns

result count

Inherited from
DBSession
def updateAndReturnGeneratedKey(template: String, params: Any*): Long

Executes java.sql.PreparedStatement#executeUpdate() and returns the generated key.

Executes java.sql.PreparedStatement#executeUpdate() and returns the generated key.

Value Params
params

parameters

template

SQL template

Returns

generated key as a long value

Inherited from
DBSession
def updateAndReturnSpecifiedGeneratedKey(template: String, params: Any*)(key: Any): Long

Executes java.sql.PreparedStatement#executeUpdate() and returns the generated key.

Executes java.sql.PreparedStatement#executeUpdate() and returns the generated key.

Value Params
key

name

params

parameters

template

SQL template

Returns

generated key as a long value

Inherited from
DBSession
def updateWithAutoGeneratedKeyNameAndFilters(returnGeneratedKeys: Boolean, generatedKeyName: String, before: PreparedStatement => Unit, after: PreparedStatement => Unit, template: String, params: Any*): Int

Executes java.sql.PreparedStatement#executeUpdate().

Executes java.sql.PreparedStatement#executeUpdate().

Value Params
after

after filter

before

before filter

generatedKeyName

generated key name

params

parameters

returnGeneratedKeys

is generated keys required

template

SQL template

Returns

result count

Inherited from
DBSession
def updateWithFilters(returnGeneratedKeys: Boolean, before: PreparedStatement => Unit, after: PreparedStatement => Unit, template: String, params: Any*): Int

Executes java.sql.PreparedStatement#executeUpdate().

Executes java.sql.PreparedStatement#executeUpdate().

Value Params
after

after filter

before

before filter

params

parameters

returnGeneratedKeys

is generated keys required

template

SQL template

Returns

result count

Inherited from
DBSession
def updateWithFilters(before: PreparedStatement => Unit, after: PreparedStatement => Unit, template: String, params: Any*): Int

Executes java.sql.PreparedStatement#executeUpdate().

Executes java.sql.PreparedStatement#executeUpdate().

Value Params
after

after filter

before

before filter

params

parameters

template

SQL template

Returns

result count

Inherited from
DBSession
def using[R <: Closable, A](resource: R)(f: R => A): A
Inherited from
LoanPattern

Inherited fields

lazy val connection: Connection

Connection

Connection

Inherited from
DBSession
val isReadOnly: Boolean
Inherited from
AutoSession
protected val log: Log

Logger

Logger

Inherited from
LogSupport
override val tx: Option[Tx]
Inherited from
AutoSession