Txn

scalasql.core.DbApi.Txn
trait Txn extends DbApi

An interface to a SQL database transaction, allowing you to run queries, create savepoints, or roll back the transaction.

Attributes

Graph
Supertypes
trait DbApi
trait AutoCloseable
class Object
trait Matchable
class Any
Known subtypes
class Impl

Members list

Value members

Abstract methods

def rollback(): Unit

Rolls back any active Savepoints and then rolls back this Transaction

Rolls back any active Savepoints and then rolls back this Transaction

Attributes

def savepoint[T](block: Savepoint => T): T

Creates a SQL Savepoint that is active within the given block; automatically releases the savepoint if the block completes successfully and rolls it back if the block terminates with an exception, and allows you to roll back the savepoint manually via the DbApi.Savepoint parameter passed to that block

Creates a SQL Savepoint that is active within the given block; automatically releases the savepoint if the block completes successfully and rolls it back if the block terminates with an exception, and allows you to roll back the savepoint manually via the DbApi.Savepoint parameter passed to that block

Attributes

Inherited and Abstract methods

def close(): Unit

Attributes

Inherited from:
AutoCloseable
def renderSql[Q, R](query: Q, castParams: Boolean)(implicit qr: Queryable[Q, R]): String

Converts the given query Q into a string. Useful for debugging and logging

Converts the given query Q into a string. Useful for debugging and logging

Attributes

Inherited from:
DbApi
def run[Q, R](query: Q, fetchSize: Int, queryTimeoutSeconds: Int)(implicit qr: Queryable[Q, R], fileName: FileName, lineNum: Line): R

Runs the given query Q and returns a value of type R

Runs the given query Q and returns a value of type R

Attributes

Inherited from:
DbApi
def runRaw[R](sql: String, variables: Seq[Any], fetchSize: Int, queryTimeoutSeconds: Int)(implicit qr: Row[_, R], fileName: FileName, lineNum: Line): IndexedSeq[R]

Runs a java.lang.String (and any interpolated variables) and deserializes the result set into a Seq of the given type R

Runs a java.lang.String (and any interpolated variables) and deserializes the result set into a Seq of the given type R

Attributes

Inherited from:
DbApi
def runSql[R](query: SqlStr, fetchSize: Int, queryTimeoutSeconds: Int)(implicit qr: Row[_, R], fileName: FileName, lineNum: Line): IndexedSeq[R]

Runs the given SqlStr of the form sql"..." and returns a value of type R

Runs the given SqlStr of the form sql"..." and returns a value of type R

Attributes

Inherited from:
DbApi
def stream[Q, R](query: Q, fetchSize: Int, queryTimeoutSeconds: Int)(implicit qr: Queryable[Q, Seq[R]], fileName: FileName, lineNum: Line): Generator[R]

Runs the given query Q and returns a Generator of values of type R. allow you to process the results in a streaming fashion without materializing the entire list of results in memory

Runs the given query Q and returns a Generator of values of type R. allow you to process the results in a streaming fashion without materializing the entire list of results in memory

Attributes

Inherited from:
DbApi
def streamRaw[R](sql: String, variables: Seq[Any], fetchSize: Int, queryTimeoutSeconds: Int)(implicit qr: Row[_, R], fileName: FileName, lineNum: Line): Generator[R]

Runs a java.lang.String (and any interpolated variables) and deserializes the result set into a streaming Generator of the given type R

Runs a java.lang.String (and any interpolated variables) and deserializes the result set into a streaming Generator of the given type R

Attributes

Inherited from:
DbApi
def streamSql[R](sql: SqlStr, fetchSize: Int, queryTimeoutSeconds: Int)(implicit qr: Row[_, R], fileName: FileName, lineNum: Line): Generator[R]

A combination of stream and runSql, streamSql allows you to pass in an arbitrary SqlStr of the form sql"..." and streams the results back to you

A combination of stream and runSql, streamSql allows you to pass in an arbitrary SqlStr of the form sql"..." and streams the results back to you

Attributes

Inherited from:
DbApi
def updateGetGeneratedKeysRaw[R](sql: String, variables: Seq[Any], fetchSize: Int, queryTimeoutSeconds: Int)(implicit qr: Row[_, R], fileName: FileName, lineNum: Line): IndexedSeq[R]

Attributes

Inherited from:
DbApi
def updateGetGeneratedKeysSql[R](sql: SqlStr, fetchSize: Int, queryTimeoutSeconds: Int)(implicit qr: Row[_, R], fileName: FileName, lineNum: Line): IndexedSeq[R]

Attributes

Inherited from:
DbApi
def updateRaw(sql: String, variables: Seq[Any], fetchSize: Int, queryTimeoutSeconds: Int)(implicit fileName: FileName, lineNum: Line): Int

Runs an java.lang.String (and any interpolated variables) containing an UPDATE or INSERT query and returns the number of rows affected

Runs an java.lang.String (and any interpolated variables) containing an UPDATE or INSERT query and returns the number of rows affected

Attributes

Inherited from:
DbApi
def updateSql(sql: SqlStr, fetchSize: Int, queryTimeoutSeconds: Int)(implicit fileName: FileName, lineNum: Line): Int

Runs an SqlStr of the form sql"..." containing an UPDATE or INSERT query and returns the number of rows affected

Runs an SqlStr of the form sql"..." containing an UPDATE or INSERT query and returns the number of rows affected

Attributes

Inherited from:
DbApi