Dialect

zio.blocks.sql.Dialect
See theDialect companion object
trait Dialect extends SqlMigration

Database-specific SQL generation for migration support structures.

Attributes

Companion
object
Source
Dialect.scala
Graph
Supertypes
trait SqlMigration
class Object
trait Matchable
class Any
Known subtypes
object Postgres
object SQLite

Members list

Value members

Abstract methods

The SqlDialect this generation strategy targets, for mismatch checks against the live connection.

The SqlDialect this generation strategy targets, for mismatch checks against the live connection.

Attributes

Source
Dialect.scala

Concrete methods

def ddl[A](table: Table[A]): Seq[Frag]

Pure DDL for the given table: create and drop fragments.

Pure DDL for the given table: create and drop fragments.

Delegates to existing Table/Ddl builders without opening any connection.

Attributes

Source
Dialect.scala

Inherited and Abstract methods

def createQueueTableDDL(table: String, col: String): String

Idempotent CREATE TABLE IF NOT EXISTS DDL for the dirty-key queue table.

Idempotent CREATE TABLE IF NOT EXISTS DDL for the dirty-key queue table.

Attributes

Inherited from:
SqlMigration
Source
Dialect.scala
def createShadowTableDDL(shadowName: String, sourceTable: String): String

Idempotent shadow-table DDL copying sourceTable structure; unsupported on SQLite (raises UnsupportedOperationException).

Idempotent shadow-table DDL copying sourceTable structure; unsupported on SQLite (raises UnsupportedOperationException).

Attributes

Inherited from:
SqlMigration
Source
Dialect.scala
def createTriggerDDL(queueTable: String, sourceTable: String, sourceIdColumn: String, queueKeyColumn: String): List[String]

Statements installing capture triggers that upsert source-row keys into the queue table. Must be idempotent (safe to re-run on restart).

Statements installing capture triggers that upsert source-row keys into the queue table. Must be idempotent (safe to re-run on restart).

Attributes

Inherited from:
SqlMigration
Source
Dialect.scala
def dequeueSQL(table: String, col: String, batchSize: Int): String

SELECT claiming up to batchSize queue keys, ordered by key; on PostgreSQL the claim locks rows with FOR UPDATE SKIP LOCKED.

SELECT claiming up to batchSize queue keys, ordered by key; on PostgreSQL the claim locks rows with FOR UPDATE SKIP LOCKED.

Attributes

Inherited from:
SqlMigration
Source
Dialect.scala

Inherited and Abstract fields

val supportsSkipLocked: Boolean

Whether dequeueSQL uses FOR UPDATE SKIP LOCKED (PostgreSQL only).

Whether dequeueSQL uses FOR UPDATE SKIP LOCKED (PostgreSQL only).

Attributes

Inherited from:
SqlMigration
Source
Dialect.scala