IntCodec

com.augustnagro.magnum.DbCodec$.IntCodec$
object IntCodec extends DbCodec[Int]

Attributes

Graph
Supertypes
trait DbCodec[Int]
class Object
trait Matchable
class Any
Self type
IntCodec.type

Members list

Value members

Concrete methods

def queryRepr: String

Syntax used when querying the db. For example,

Syntax used when querying the db. For example,

DbCodec[Int].queryRepr == "?"

DbCodec[(String, Boolean)].queryRepr = "(?, ?)"

case class User(id: Long, name: String) derives DbCodec DbCodec[User].queryRepr = "? ?"

Attributes

def readSingle(rs: ResultSet, pos: Int): Int

Read an E from the ResultSet starting at position pos and ending after reading cols number of columns. Make sure the ResultSet is in a valid state (ie, ResultSet::next has been called).

Read an E from the ResultSet starting at position pos and ending after reading cols number of columns. Make sure the ResultSet is in a valid state (ie, ResultSet::next has been called).

Attributes

def writeSingle(i: Int, ps: PreparedStatement, pos: Int): Unit

Write the entity to the PreparedStatement starting at position pos

Write the entity to the PreparedStatement starting at position pos

Attributes

Inherited methods

def biMap[E2](to: Int => E2, from: E2 => Int): DbCodec[E2]

Attributes

Inherited from:
DbCodec
def read(resultSet: ResultSet): Vector[E]

Build every row in the ResultSet into a sequence of E. The ResultSet should be in its initial position before calling (ie, ResultSet::next not called).

Build every row in the ResultSet into a sequence of E. The ResultSet should be in its initial position before calling (ie, ResultSet::next not called).

Attributes

Inherited from:
DbCodec
def readSingle(resultSet: ResultSet): E

Build an E from the ResultSet starting at position 1 and ending after reading cols number of columns. Make sure the ResultSet is in a valid state (ie, ResultSet::next has been called).

Build an E from the ResultSet starting at position 1 and ending after reading cols number of columns. Make sure the ResultSet is in a valid state (ie, ResultSet::next has been called).

Attributes

Inherited from:
DbCodec
def write(entities: Iterable[Int], ps: PreparedStatement): Unit

Writes multiple entities to the preparedStatement via PreparedStatement::addBatch

Writes multiple entities to the preparedStatement via PreparedStatement::addBatch

Attributes

Inherited from:
DbCodec
def writeSingle(entity: Int, ps: PreparedStatement): Unit

Write the entity to the resultSet starting at position 1

Write the entity to the resultSet starting at position 1

Attributes

Inherited from:
DbCodec

Concrete fields

val cols: IArray[Int]

The java.sql.Types constant for every "?" in queryRepr. For mapping database-specific types, Types.JAVA_OBJECT is recommended.

The java.sql.Types constant for every "?" in queryRepr. For mapping database-specific types, Types.JAVA_OBJECT is recommended.

Attributes