C
A model for constructing write-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.
Value parameters
- 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
Members list
Type members
Types
Attributes
- Source
- Where.scala
Value members
Concrete methods
Attributes
- Definition Classes
- Source
- Where.scala
Inherited methods
Attributes
- Inherited from:
- Where
- Source
- Where.scala
Attributes
- Inherited from:
- Where
- Source
- Where.scala
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
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
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
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
A method for setting the LIMIT condition in a UPDATE/DELETE statement.
A method for setting the LIMIT condition in a UPDATE/DELETE statement.
TableQuery[City]
.delete
.limit(10)
Value parameters
- length
-
The number of rows to return.
Attributes
- Inherited from:
- CommandProvider
- Source
- Limit.scala
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
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
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
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
Attributes
- Inherited from:
- Product
Attributes
- Inherited from:
- Product
A method to execute an insert operation against the MySQL server.
A method to execute an insert operation against the MySQL server.
TableQuery[User]
.insertInto(user => user.name *: user.age)
.values(("Alice", 20))
.returning[Long]
Type parameters
- T
-
The type of the primary key
Attributes
- Returns
-
The primary key value
- Inherited from:
- Command
- Source
- Command.scala
A method to execute an update operation against the MySQL server.
A method to execute an update operation against the MySQL server.
TableQuery[User]
.update(user => user.id *: user.name *: user.age)((1L, "Alice", 20))
.where(_.id === 1L)
.update
Attributes
- Returns
-
The number of rows updated
- Inherited from:
- Command
- Source
- Command.scala
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
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
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
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
Attributes
- Inherited from:
- Where
- Source
- Where.scala
Attributes
- Inherited from:
- Where
- Source
- Where.scala