Table

zio.blocks.sql.Table
See theTable companion object
final case class Table[A](name: String, codec: DbCodec[A], columnsMeta: IndexedSeq[ColumnMeta])

Metadata binding a Scala type A to a specific database table.

Value parameters

codec

The DbCodec used to read and write rows of type A.

columnsMeta

Per-column metadata (name, SQL type, nullability) derived from the schema. Used by createTable to emit DDL.

name

The SQL table name used in generated queries.

Attributes

Companion
object
Source
Table.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def columns: IndexedSeq[String]

Column names in codec order (delegates to codec.columns).

Column names in codec order (delegates to codec.columns).

Attributes

Source
Table.scala
def createTable(dialect: SqlDialect): Frag

Generates a CREATE TABLE IF NOT EXISTS fragment using the column types resolved by dialect.

Generates a CREATE TABLE IF NOT EXISTS fragment using the column types resolved by dialect.

Attributes

Source
Table.scala

Generates a DROP TABLE IF EXISTS fragment for this table.

Generates a DROP TABLE IF EXISTS fragment for this table.

Attributes

Source
Table.scala

Inherited methods

def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
Source
Product.scala
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product
Source
Product.scala