DbApi

scalasql.core.DbApi
See theDbApi companion object
trait DbApi extends AutoCloseable

An interface to the SQL database allowing you to run queries.

Attributes

Companion
object
Graph
Supertypes
trait AutoCloseable
class Object
trait Matchable
class Any
Known subtypes
trait Txn
class Impl

Members list

Value members

Abstract methods

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

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

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

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

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

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

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

def updateGetGeneratedKeysRaw[R](sql: String, variables: Seq[Any], fetchSize: Int, queryTimeoutSeconds: Int)(implicit qr: Row[_, R], fileName: FileName, lineNum: Line): IndexedSeq[R]
def updateGetGeneratedKeysSql[R](sql: SqlStr, fetchSize: Int, queryTimeoutSeconds: Int)(implicit qr: Row[_, R], fileName: FileName, lineNum: Line): IndexedSeq[R]
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

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 and Abstract methods

def close(): Unit

Attributes

Inherited from:
AutoCloseable