SQL, parameter encoder, and row decoder for a statement that returns rows. We assume that sql
has the same number of placeholders of the form $1
, $2
, etc., as the number of slots encoded
by encoder
, that sql
selects the same number of columns are the number of slots decoded by
decoder
, and that the parameter and column types specified by encoder
and decoder
are
consistent with the schema. The check
methods on Session provide a means to
verify this assumption.
You can construct a Query
directly, although it is more typical to use the sql
interpolator.
sql"SELECT name, age FROM person WHERE age > $int2".query(varchar ~ int2) // Query[Short, String ~ Short]
Attributes
- decoder
A decoder for selected columns.
- encoder
An encoder for all parameters
$1
,$2
, etc., insql
.- origin
The
Origin
where the sql was defined, if any.- sql
A SQL statement returning no rows.
- See also:
StringContextOps for information on the
sql
interpolator.Session for information on executing a
Query
.- Companion:
- object
- Source:
- Query.scala
- Graph
- Supertypes