Q

ldbc.statement.Where.Q
case class Q[A, B](table: A, columns: Column[B], statement: String, params: List[Dynamic], isFirst: Boolean) extends Where[A], Query[A, B], QueryProvider[A, B]

A model for constructing read-only query WHERE statements in MySQL.

Type parameters

A

The type of Table. in the case of Join, it is a Tuple of type Table.

B

Scala types to be converted by Decoder

Value parameters

columns

Union-type column list

isFirst

If True, this condition is added first, so the specified join condition is ignored and a WHERE statement is started.

params

A list of Traits that generate values from Parameter, allowing PreparedStatement to be set to a value by index only.

statement

SQL statement string

table

Trait for generating SQL table information.

Attributes

Source
Where.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait QueryProvider[A, B]
trait Query[A, B]
trait SQL
trait Where[A]
class Object
trait Matchable
class Any
Show all

Members list

Type members

Types

override type Self = Q[A, B]

Attributes

Source
Where.scala

Value members

Concrete methods

override def ++(sql: SQL): SQL

Attributes

Definition Classes
SQL
Source
Where.scala
def groupBy[C](func: A => Column[C]): GroupBy[A, B]

A method for setting the GROUP BY condition in a SELECT statement.

A method for setting the GROUP BY condition in a SELECT statement.

Type parameters

C

Scala types to be converted by Decoder

Value parameters

func

Function to construct an expression using the columns that Table has.

Attributes

Source
Where.scala

Inherited methods

def &&(func: A => Expression, bool: Boolean): Self

Attributes

Inherited from:
Where
Source
Where.scala
def &&(func: A => Expression): Self

Attributes

Inherited from:
Where
Source
Where.scala
def and(func: A => Expression, bool: Boolean): Self

Function to set additional conditions on WHERE statement.

Function to set additional conditions on WHERE statement.

 TableQuery[City]
   .select(_.name)
   .where(_.population > 1000000)
   .and(_.name == "Tokyo", false)
 // SELECT name FROM city WHERE population > ?

Value parameters

bool

Determine whether to add to the conditions. If false, the AND condition is not added to the query.

func

Function to construct an expression using the columns that Table has.

Attributes

Inherited from:
Where
Source
Where.scala
def and(func: A => Expression): Self

Function to set additional conditions on WHERE statement.

Function to set additional conditions on WHERE statement.

 TableQuery[City]
   .select(_.name)
   .where(_.population > 1000000)
   .and(_.name == "Tokyo")
 // SELECT name FROM city WHERE population > ? AND name = ?

Value parameters

func

Function to construct an expression using the columns that Table has.

Attributes

Inherited from:
Where
Source
Where.scala
def andOpt[B](opt: Option[B])(func: (A, B) => Expression): Self

Function to set additional conditions on WHERE statement.

Function to set additional conditions on WHERE statement.

 TableQuery[City]
   .select(_.name)
   .where(_.population > 1000000)
   .andOpt(Some("Tokyo"))((city, value) => city.name == value)
 // SELECT name FROM city WHERE population > ? AND name = ?

Value parameters

func

Function to construct an expression using the columns that Table has.

Attributes

Inherited from:
Where
Source
Where.scala
def andOpt(func: A => Option[Expression]): Self

Function to set additional conditions on WHERE statement.

Function to set additional conditions on WHERE statement.

 val opt: Option[String] = ???
 TableQuery[City]
   .select(_.name)
   .where(_.population > 1000000)
   .andOpt((city => opt.map(value => city.name === value))
 // SELECT name FROM city WHERE population > ? AND name = ?

Value parameters

func

Function to construct an expression using the columns that Table has.

Attributes

Inherited from:
Where
Source
Where.scala
def limit(length: Long): (Encoder[Long]) ?=> Q[A, B]

A method for setting the LIMIT condition in a SELECT statement.

A method for setting the LIMIT condition in a SELECT statement.

 TableQuery[City]
   .select(_.population)
   .limit(10)

Value parameters

length

The number of rows to return.

Attributes

Inherited from:
QueryProvider
Source
Limit.scala
def or(func: A => Expression, bool: Boolean): Self

Function to set additional conditions on WHERE statement.

Function to set additional conditions on WHERE statement.

 TableQuery[City]
   .select(_.name)
   .where(_.population > 1000000)
   .or(_.name == "Tokyo", false)
 // SELECT name FROM city WHERE population > ?

Value parameters

bool

Determine whether to add to the conditions. If false, the OR condition is not added to the query.

func

Function to construct an expression using the columns that Table has.

Attributes

Inherited from:
Where
Source
Where.scala
def or(func: A => Expression): Self

Function to set additional conditions on WHERE statement.

Function to set additional conditions on WHERE statement.

 TableQuery[City]
   .select(_.name)
   .where(_.population > 1000000)
   .or(_.name == "Tokyo")
 // SELECT name FROM city WHERE population > ? OR name = ?

Value parameters

func

Function to construct an expression using the columns that Table has.

Attributes

Inherited from:
Where
Source
Where.scala
def orOpt[B](opt: Option[B])(func: (A, B) => Expression): Self

Function to set additional conditions on WHERE statement.

Function to set additional conditions on WHERE statement.

 TableQuery[City]
   .select(_.name)
   .where(_.population > 1000000)
   .orOpt(Some("Tokyo"))((city, value) => city.name == value)
 // SELECT name FROM city WHERE population > ? OR name = ?

Value parameters

func

Function to construct an expression using the columns that Table has.

Attributes

Inherited from:
Where
Source
Where.scala
def orOpt(func: A => Option[Expression]): Self

Function to set additional conditions on WHERE statement.

Function to set additional conditions on WHERE statement.

 val opt: Option[String] = ???
 TableQuery[City]
   .select(_.name)
   .where(_.population > 1000000)
   .orOpt((city => opt.map(value => city.name === value))
 // SELECT name FROM city WHERE population > ? OR name = ?

Value parameters

func

Function to construct an expression using the columns that Table has.

Attributes

Inherited from:
Where
Source
Where.scala
def orderBy[C](func: A => Order[C]): OrderBy[A, B]

A method for setting the ORDER BY condition in a statement.

A method for setting the ORDER BY condition in a statement.

TableQuery[City]
  .select(_.population)
  .orderBy(_.population.desc)

Value parameters

func

Function to construct an expression using the columns that Table has.

Attributes

Inherited from:
Provider (hidden)
Source
OrderBy.scala

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product
def query: Query[B]

A method to convert a query to a ldbc.dsl.Query.

A method to convert a query to a ldbc.dsl.Query.

 TableQuery[User].select(v => v.name *: v.age).query

Attributes

Returns

A ldbc.dsl.Query instance

Inherited from:
Query
Source
Query.scala
def queryTo[P <: Product](using m1: ProductOf[P], m2: ProductOf[B], check: m1.MirroredElemTypes =:= m2.MirroredElemTypes, decoder: Decoder[P]): Query[P]

A method to convert a query to a ldbc.dsl.Query.

A method to convert a query to a ldbc.dsl.Query.

 TableQuery[User].selectAll.queryTo[User]

Attributes

Returns

A ldbc.dsl.Query instance

Inherited from:
Query
Source
Query.scala
def xor(func: A => Expression, bool: Boolean): Self

Function to set additional conditions on WHERE statement.

Function to set additional conditions on WHERE statement.

 TableQuery[City]
   .select(_.name)
   .where(_.population > 1000000)
   .xor(_.name == "Tokyo", false)
 // SELECT name FROM city WHERE population > ?

Value parameters

bool

Determine whether to add to the conditions. If false, the XOR condition is not added to the query.

func

Function to construct an expression using the columns that Table has.

Attributes

Inherited from:
Where
Source
Where.scala
def xor(func: A => Expression): Self

Function to set additional conditions on WHERE statement.

Function to set additional conditions on WHERE statement.

 TableQuery[City]
   .select(_.name)
   .where(_.population > 1000000)
   .xor(_.name == "Tokyo")
 // SELECT name FROM city WHERE population > ? XOR name = ?

Value parameters

func

Function to construct an expression using the columns that Table has.

Attributes

Inherited from:
Where
Source
Where.scala
def xorOpt[B](opt: Option[B])(func: (A, B) => Expression): Self

Function to set additional conditions on WHERE statement.

Function to set additional conditions on WHERE statement.

 TableQuery[City]
   .select(_.name)
   .where(_.population > 1000000)
   .xorOpt(Some("Tokyo"))((city, value) => city.name == value)
 // SELECT name FROM city WHERE population > ? XOR name = ?

Value parameters

func

Function to construct an expression using the columns that Table has.

Attributes

Inherited from:
Where
Source
Where.scala
def xorOpt(func: A => Option[Expression]): Self

Function to set additional conditions on WHERE statement.

Function to set additional conditions on WHERE statement.

 val opt: Option[String] = ???
 TableQuery[City]
   .select(_.name)
   .where(_.population > 1000000)
   .xorOpt((city => opt.map(value => city.name === value))
 // SELECT name FROM city WHERE population > ? XOR name = ?

Value parameters

func

Function to construct an expression using the columns that Table has.

Attributes

Inherited from:
Where
Source
Where.scala
def ||(func: A => Expression, bool: Boolean): Self

Attributes

Inherited from:
Where
Source
Where.scala
def ||(func: A => Expression): Self

Attributes

Inherited from:
Where
Source
Where.scala