Insert

ldbc.statement.Insert
See theInsert companion object
sealed trait Insert[A] extends Command

Trait for building Statements to be added.

Type parameters

A

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

Attributes

Companion
object
Source
Insert.scala
Graph
Supertypes
trait Command
trait SQL
class Object
trait Matchable
class Any
Known subtypes
class Impl[A]
class Values[A]

Members list

Value members

Abstract methods

def onDuplicateKeyUpdate[B](func: A => Column[B]): DuplicateKeyUpdate[A]

Methods for constructing INSERT ... ON DUPLICATE KEY UPDATE statements.

Methods for constructing INSERT ... ON DUPLICATE KEY UPDATE statements.

 TableQuery[City]
   .insert((1L, "Tokyo"))
   .onDuplicateKeyUpdate(_.name)

Attributes

Source
Insert.scala
def onDuplicateKeyUpdate[B](func: A => Column[B], value: B): DuplicateKeyUpdate[A]

Methods for constructing INSERT ... ON DUPLICATE KEY UPDATE statements.

Methods for constructing INSERT ... ON DUPLICATE KEY UPDATE statements.

 TableQuery[City]
   .insert((1L, "Tokyo"))
   .onDuplicateKeyUpdate(_.name, "Osaka")

Attributes

Source
Insert.scala
def table: A

A model for generating queries from Table information.

A model for generating queries from Table information.

Attributes

Source
Insert.scala

Inherited methods

def returning[T <: String | Int | Long](using decoder: Decoder[T]): DBIO[T]

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
def update: DBIO[Int]

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

Inherited and Abstract methods

def ++(sql: SQL): SQL

Attributes

Inherited from:
SQL
Source
SQL.scala

statement has '?' that the statement has.

statement has '?' that the statement has.

Attributes

Inherited from:
SQL
Source
SQL.scala

an SQL statement that may contain one or more '?' IN parameter placeholders

an SQL statement that may contain one or more '?' IN parameter placeholders

Attributes

Inherited from:
SQL
Source
SQL.scala