KeyedCrudBase

usql.dao.KeyedCrudBase
abstract class KeyedCrudBase[K, T](using keyDataType: DataType[K]) extends CrdBase[T], KeyedCrud[T]

Implementation of KeyedCrd for KeyedTabular data.

Attributes

Graph
Supertypes
trait KeyedCrud[T]
class CrdBase[T]
trait Crd[T]
class Object
trait Matchable
class Any
Show all

Members list

Type members

Types

override type Key = K

Type of the key

Type of the key

Attributes

final type KeyColumnPath = ColumnPath[T, K]

Value members

Abstract methods

Concrete methods

override def deleteByKey(key: K)(using ConnectionProvider): Int

Delete by key.

Delete by key.

Attributes

Definition Classes
override def findByKey(key: K)(using ConnectionProvider): Option[T]

Find one by key.

Find one by key.

Attributes

Definition Classes
def keyOf(value: T): K

Returns the key of a value.

Returns the key of a value.

Attributes

override def update(value: T)(using ConnectionProvider): Int

Update some value.

Update some value.

Attributes

Definition Classes

Inherited methods

def alias(name: String): Alias[T]

Gives access to an aliased view.

Gives access to an aliased view.

Attributes

Inherited from:
CrdBase
def cols: ColumnPath[T, T]

Gives access to the columns

Gives access to the columns

Attributes

Inherited from:
CrdBase
override def countAll()(using ConnectionProvider): Int

Count all instances.

Count all instances.

Attributes

Definition Classes
Inherited from:
CrdBase
override def deleteAll()(using ConnectionProvider): Int

Delete all instances.

Delete all instances.

Attributes

Definition Classes
Inherited from:
CrdBase
def findAgain(value: T)(using ConnectionProvider): Option[T]

Load some value again based upon key.

Load some value again based upon key.

Attributes

Inherited from:
KeyedCrud
override def findAll()(using ConnectionProvider): Seq[T]

Find all instances

Find all instances

Attributes

Definition Classes
Inherited from:
CrdBase
override def insert(values: Seq[T])(using ConnectionProvider): Int

Insert many elements.

Insert many elements.

Attributes

Definition Classes
Inherited from:
CrdBase
def insert(value1: T, value2: T, values: T*)(using ConnectionProvider): Int

Insert many elements

Insert many elements

Attributes

Inherited from:
Crd
override def insert(value: T)(using ConnectionProvider): Int

Insert into database.

Insert into database.

Attributes

Definition Classes
Inherited from:
CrdBase

Concrete fields

The column of the key

The column of the key

Attributes

Inherited fields

lazy protected val selectAll: Sql

Select All Statement, may be reused.

Select All Statement, may be reused.

Attributes

Inherited from:
CrdBase

Inherited and Abstract fields

lazy val tabular: SqlTabular[T]

Define the referenced tabular, usually implemented using summon. We would like to have it as a parameter, but this leads to this error https://github.com/scala/scala3/issues/22704 even when using lazy parameters.

Define the referenced tabular, usually implemented using summon. We would like to have it as a parameter, but this leads to this error https://github.com/scala/scala3/issues/22704 even when using lazy parameters.

Attributes

Inherited from:
CrdBase

Givens

Inherited givens

protected given pf: RowEncoder[T]

Attributes

Inherited from:
CrdBase
protected given rd: RowDecoder[T]

Attributes

Inherited from:
CrdBase