Defines a table.
Example:
object Users extends TableDefinition("users") {
val id = Column[Int]("id")
}
Value parameters
- rawName
-
the name in database of the table.
Attributes
- Companion
- object
- Source
- TableDefinition.scala
- Graph
-
- Supertypes
Members list
Value members
Concrete methods
Allows you to give an alias for the table, useful in SQL joins.
Allows you to give an alias for the table, useful in SQL joins.
Example:
val u = tables.Users as "u"
val ic = tables.InventoryCharacters as "ic"
val columns = MatchmakingUserRowData
sql"""
SELECT $columns
FROM $u
INNER JOIN $ic ON ${u(_.id) === ic(_.userId)} AND ${u(_.character) === ic(_.guid)}
LIMIT 1
""".queryOf(columns)
Attributes
- Source
- TableDefinition.scala
Returns a string representation of the object.
Returns a string representation of the object.
The default representation is platform dependent.
Attributes
- Returns
-
a string representation of the object.
- Definition Classes
-
Any
- Source
- TableDefinition.scala
Inherited methods
Generates the SQL for INSERT INTO table (column1, column2, ...) VALUES (value1, value2, ...)
.
Generates the SQL for INSERT INTO table (column1, column2, ...) VALUES (value1, value2, ...)
.
Example:
tables.InventoryCharacters.insertInto(NonEmptyVector.of(
tables.InventoryCharacters.userId --> c.userId,
tables.InventoryCharacters.guid --> c.guid
))
Attributes
- Inherited from:
- TableName
- Source
- TableDefinition.scala
Overload of updateTable for convenience.
Overload of updateTable for convenience.
Attributes
- Inherited from:
- TableName
- Source
- TableDefinition.scala
Generates the SQL for UPDATE table SET column1 = value1, column2 = value2, ...
.
Generates the SQL for UPDATE table SET column1 = value1, column2 = value2, ...
.
Example:
tables.InventoryCharacters.updateTable(NonEmpty.createVector(
tables.InventoryCharacters.handgun1 --> loadouts.sets.set1.weapons.handgun,
tables.InventoryCharacters.handgun2 --> loadouts.sets.set2.weapons.handgun
))
Attributes
- Inherited from:
- TableName
- Source
- TableDefinition.scala