Query

io.eezo.db.Query
See theQuery companion object
final case class Query[T](table: Table[T], pred: Expr[T] = ..., ord: List[Order[T]] = ..., lim: Option[Int] = ..., off: Option[Int] = ...)

A query, as a pure description. DESIGN §9.3.

It holds no capability, so it can be built anywhere, passed around, composed conditionally and unit-tested without a database. Only the terminals require DB, and they are strict — there is no cursor here to outlive the scope that produced it.

Attributes

Companion
object
Source
Query.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def count()(using db: DB): Long

Attributes

Source
Query.scala
def countSql: (String, List[Bind])

Attributes

Source
Query.scala
def first()(using db: DB): Option[T]

Attributes

Source
Query.scala
def limit(n: Int): Query[T]

Attributes

Source
Query.scala
def list()(using db: DB): List[T]

Attributes

Source
Query.scala
def offset(n: Int): Query[T]

Attributes

Source
Query.scala
def orderBy(f: ColsOf[T] => Order[T]): Query[T]

Attributes

Source
Query.scala
def selectSql: (String, List[Bind])

The statement and its binds, without running anything. Golden-testable, and what a log line or an explain would want.

The statement and its binds, without running anything. Golden-testable, and what a log line or an explain would want.

Attributes

Source
Query.scala
def where(f: ColsOf[T] => Expr[T]): Query[T]

Attributes

Source
Query.scala

Inherited methods

def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
Source
Product.scala
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product
Source
Product.scala