Dump

zio.blocks.sql.Dump
object Dump

Compile-time SQL dump emission.

When the JVM system property zib.sql.dumpDir is set, inline macro entry points dumpTable and dumpQuery emit .sql files to that directory at compile time. When the property is absent the calls expand to () with zero runtime cost. Files are named -.sql (owner derived from the enclosing symbol or query/table name), written as UTF-8 with a trailing newline, and skipped when the existing content is byte-identical (content-hash skip).

Attributes

Source
Dump.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Dump.type

Members list

Value members

Concrete methods

inline def dumpQuery[A](inline query: SqlQuery[A]): Unit

Compile-time dump of a query-IR SqlQuery's SELECT statement.

Compile-time dump of a query-IR SqlQuery's SELECT statement.

When -Dzib.sql.dumpDir is set, emits -.sql for each dialect at the call site (owner derived from the enclosing symbol/val name). No-op otherwise.

'''Inline-value requirement:''' the query argument must be an inline-constructible tree (e.g. inline val/def or a direct SqlQuery.from(...).innerJoin(...).filter(...) chain). A preconstructed non-inline val cannot expose its join/filter tree and will trigger report.warning("Dump requires inline query value; preconstructed value will emit no file; use inline val/def or Dump.dumpTable") and emit no file (skips emit) instead of an incomplete source-only fallback.

Attributes

Source
Dump.scala
def dumpQueryIrImpl[A](query: Expr[SqlQuery[A]])(using evidence$1: Type[A], Quotes): Expr[Unit]

Attributes

Source
Dump.scala
inline def dumpTable[A](inline table: Table[A])(using schema: Schema[A]): Unit

Compile-time dump of a Table's CREATE TABLE DDL.

Compile-time dump of a Table's CREATE TABLE DDL.

When -Dzib.sql.dumpDir is set, emits <table>-.sql for PostgreSQL and SQLite at the macro-expansion site (owner derived from the table's type name). No-op when the property is absent.

Attributes

Source
Dump.scala
def dumpTableImpl[A](table: Expr[Table[A]])(using evidence$1: Type[A], Quotes): Expr[Unit]

Attributes

Source
Dump.scala