/**
 * @wrnexus/db — the data layer core: TS models (source of truth for DDL,
 * validation, and result typing), the `Driver` interface, and the `Db` client.
 *
 * Adapters are imported from subpaths, e.g. `@wrnexus/db/sqlite`. Migrations and
 * the sqlc-style query generator build on this core in later phases.
 */

export { v, table, Column } from "./schema.ts";
export type { Model, Columns, ColumnDef, BaseType } from "./schema.ts";
export { createDb } from "./driver.ts";
export type { Db, Driver, Row, ExecResult, TxHandle } from "./driver.ts";
export { setDb, getDb, hasDb, registerDb, databaseNames, closeDatabases } from "./client.ts";
export { createTableSql } from "./sql.ts";
export type { Dialect } from "./sql.ts";
export {
  parseMigration,
  loadMigrations,
  appliedMigrations,
  migrate,
  rollback,
  status,
  scaffoldMigration,
} from "./migrate.ts";
export type { Migration } from "./migrate.ts";
export { parseQueries, generateQueriesFile } from "./generate.ts";
export type { QueryDef, QueryKind, ModelRef } from "./generate.ts";
export { paginate, loadRelated } from "./query.ts";
export type { Paginated, PageOptions, RelationOptions } from "./query.ts";
