An SQL definition that produces a value of type A.
The definition can be either:
Attributes
- Companion
- object
- Source
- SQLDefinition.scala
- Graph
-
- Supertypes
- Known subtypes
-
class Column[A]trait WithSQLDefinition[A]
- Self type
Members list
Type members
Value members
Abstract methods
Returns the SQL which evaluates to true if all columns of this SQLDefinition are equal to the given value.
Returns the SQL which evaluates to true if all columns of this SQLDefinition are equal to the given value.
Attributes
- Source
- SQLDefinition.scala
Converts the value into a vector of (columnName, value)
pairs.
Converts the value into a vector of (columnName, value)
pairs.
Attributes
- Source
- SQLDefinition.scala
Vector of columns
Prefixes all column names with prefix.
. If this already had a prefix, the prefix is replaced.
Prefixes all column names with prefix.
. If this already had a prefix, the prefix is replaced.
Attributes
- Source
- SQLDefinition.scala
Attributes
- Source
- SQLDefinition.scala
Attributes
- Source
- SQLDefinition.scala
Concrete methods
Returns Update for batch inserts into the given table.
Attributes
- Source
- SQLDefinition.scala
Full SQL for inserting into the given table.
To allow widening the type of Column and similar ones to SQLDefinition.
To allow widening the type of Column and similar ones to SQLDefinition.
This is useful when working with tuples of SQLDefinitions, because (Column[Int], Column[String])
is not the same thing as (SQLResult[Int], SQLResult[String])
.
Attributes
- Source
- SQLDefinition.scala
Inherited methods
To allow widening the type of Column and similar ones to TypedMultiFragment.
To allow widening the type of Column and similar ones to TypedMultiFragment.
This is useful when working with tuples of TypedMultiFragments, because (Column[Int], Column[String])
is not the same thing as (TypedMultiFragment[Int], TypedMultiFragment[String])
.
Attributes
- Inherited from:
- TypedMultiFragment
- Source
- TypedMultiFragment.scala
Concrete fields
The SQL Fragment containing all of the Column.name joined with ",".
The SQL Fragment containing all of the Column.name joined with ",".
Useful in preparing batch inserts.
Update[Person](
sql"INSERT INTO $personTable (${person.columnsSql}) VALUES (${person.valuesSql})".rawSql
).updateMany(persons)
Attributes
- Source
- SQLDefinition.scala
Prefixes all column names with EXCLUDED
, which is a special SQL table name when resolving insert/update conflicts.
Prefixes all column names with EXCLUDED
, which is a special SQL table name when resolving insert/update conflicts.
Example:
sql"""
${t.Row.insertSqlFor(t)}
ON CONFLICT (${t.userId}, ${t.weaponId}) DO UPDATE SET ${t.kills} = ${t.kills} + ${t.kills.excluded}
"""
Attributes
- Source
- SQLDefinition.scala
Combines columnsSql and valuesSql.
Combines columnsSql and valuesSql.
Useful in preparing batch inserts.
Update[Person](
sql"INSERT INTO $personTable ${person.insertSql}".rawSql
).updateMany(persons)
Attributes
- Source
- SQLDefinition.scala
SQL that lists all of the columns to get this SQL result.
The SQL Fragment containing as many value placeholders (?) as there are columns joined with ",".
The SQL Fragment containing as many value placeholders (?) as there are columns joined with ",".
Useful in preparing batch inserts. See columnsSql.
Attributes
- Source
- SQLDefinition.scala