import type { SchemaSnapshot, DiffResult, AllowOptions, AmbiguousCallback, Dialect } from "../types.js"; export interface DiffArgs { expected: SchemaSnapshot; actual: SchemaSnapshot; allow?: AllowOptions; onAmbiguous?: AmbiguousCallback; /** * Table-name patterns to ignore on both sides of the diff. Tables matching * any pattern are excluded from comparison — neither create-table nor * drop-table changes are emitted for them, and they're omitted from index/ * fk passes. Supports exact names and `*` glob wildcards. * * Defaults to [`__drizzle_migrations`] when omitted so the Drizzle migration- * tracking table doesn't surface as a drop. Pass `[]` explicitly to disable * the default. Pass additional patterns to extend. */ ignoreTables?: string[]; /** * Restrict the diff to a set of DB schemas. A table whose schema is not in this * set is excluded from BOTH sides — neither created/altered nor dropped. * * When omitted, the scope is **auto-derived from the schemas the expected * (metadata) side declares**: the model manages only the schemas it actually * mentions, so a table living in a schema the model never declares belongs to * another owner (e.g. a downstream app's schema sharing the same database) and is * left untouched. This makes per-owner drift gates clean without manual config — * a model that declares only `public` ignores a co-located downstream-app schema, * and vice versa. Pass an explicit set to override; pass nothing for the smart default. * * Auto-scoping is skipped when the expected side declares no tables at all * (nothing to manage → prior whole-DB behavior is preserved). */ scopeSchemas?: string[]; /** * Qualified physical names (`schema.name`, schema defaulting to Postgres `public`) * of DB objects declared `@unmanaged` (#208 §7). Excluded from the ACTUAL side of the * diff, so a declared-external table/view is never proposed for drop — silence, not a * policy-gated drop. They are already absent from `expected` (skipped in * buildExpectedSchema Pass 1 / buildProjectionViews), so no create is proposed either. * Net: the tool leaves a declared-external object entirely alone. Compute via * `collectUnmanagedNames`; the format matches `tableIdentity`/`viewIdentity`. */ unmanagedNames?: string[]; /** Dialect; CHECK-constraint evolution on existing tables is emitted for postgres only. */ dialect?: Dialect; /** * #258 — refuse (throw {@link PrimaryKeyChangeError}) when an existing table's live * PRIMARY KEY differs from the metadata identity. There is no primary-key change kind * in the emitter, so such a move would silently degrade into add-column + drop-column * and leave the table with no PK, breaking referencing FKs at apply time. Set by the * migration-generation path (snapshot/plan.ts); left unset by the read-only drift/verify * path so `meta verify` keeps reporting drift rather than throwing. Off by default — * existing callers are byte-identical. */ refusePrimaryKeyChange?: boolean; } /** * Compares an expected schema (from metadata) against an actual schema (from introspection) * and produces the change list to bring actual → expected. Always returns a Promise. * * Per spec §6. * * Accepts either the full DiffArgs object, or positional (expected, actual[, opts]) for * convenience in tests and simple callers. */ export declare function diff(args: DiffArgs): Promise; export declare function diff(expected: SchemaSnapshot, actual: SchemaSnapshot, opts?: Omit): Promise; //# sourceMappingURL=index.d.ts.map