import './assert_dev_env.js';
/**
 * PostgreSQL schema introspection — produces a normalized, JSON-serializable
 * snapshot of a database's structure for cross-impl parity checks.
 *
 * The snapshot covers:
 *
 * - Tables with columns (data type, nullability, default, identity)
 * - Indexes with canonical Postgres-rendered definitions
 * - Constraints (CHECK, FOREIGN KEY, PRIMARY KEY, UNIQUE, EXCLUSION)
 * - Sequences with data type — distinguishes `int4` (SERIAL) from `int8`
 *   (BIGSERIAL)
 *
 * Designed for `pg_catalog` introspection — works against both PostgreSQL
 * and PGlite. The snapshot is fully deterministic: every collection sorts by
 * a stable key and excludes time-varying fields like `applied_at`.
 *
 * Paired with `schema_parity.ts` for comparison + assertion helpers.
 *
 * @module
 */
import { z } from 'zod';
import type { Db } from '../db/db.js';
/**
 * Per-column structural metadata. The Zod schema is the canonical source
 * for the column shape — `SchemaSnapshot` reuses it as the cross-impl
 * `_testing_schema_snapshot` RPC action's wire validator, so the
 * introspection type and the wire contract can't drift apart.
 */
export declare const ColumnSnapshot: z.ZodObject<{
    data_type: z.ZodString;
    udt_name: z.ZodString;
    is_nullable: z.ZodBoolean;
    column_default: z.ZodNullable<z.ZodString>;
    is_identity: z.ZodBoolean;
}, z.core.$strip>;
export type ColumnSnapshot = z.infer<typeof ColumnSnapshot>;
/** Per-table structural metadata. */
export declare const TableSnapshot: z.ZodObject<{
    columns: z.ZodRecord<z.ZodString, z.ZodObject<{
        data_type: z.ZodString;
        udt_name: z.ZodString;
        is_nullable: z.ZodBoolean;
        column_default: z.ZodNullable<z.ZodString>;
        is_identity: z.ZodBoolean;
    }, z.core.$strip>>;
    indexes: z.ZodArray<z.ZodObject<{
        name: z.ZodString;
        definition: z.ZodString;
    }, z.core.$strip>>;
    constraints: z.ZodArray<z.ZodObject<{
        name: z.ZodString;
        type: z.ZodString;
        definition: z.ZodString;
    }, z.core.$strip>>;
}, z.core.$strip>;
export type TableSnapshot = z.infer<typeof TableSnapshot>;
/** Sequence metadata — `data_type` is `bigint` (BIGSERIAL) or `integer` (SERIAL). */
export declare const SequenceSnapshot: z.ZodObject<{
    data_type: z.ZodString;
}, z.core.$strip>;
export type SequenceSnapshot = z.infer<typeof SequenceSnapshot>;
/**
 * Normalized database schema snapshot for parity comparison — the single
 * source of truth for the snapshot shape across the introspection query
 * (`query_schema_snapshot`), the diff comparator (`schema_parity.ts`), and
 * the cross-impl RPC action's wire validator (`testing_reset_actions.ts`).
 *
 * All fields are deterministically ordered on capture so structural equality
 * via `JSON.stringify` or per-key comparison yields stable results.
 */
export declare const SchemaSnapshot: z.ZodObject<{
    tables: z.ZodRecord<z.ZodString, z.ZodObject<{
        columns: z.ZodRecord<z.ZodString, z.ZodObject<{
            data_type: z.ZodString;
            udt_name: z.ZodString;
            is_nullable: z.ZodBoolean;
            column_default: z.ZodNullable<z.ZodString>;
            is_identity: z.ZodBoolean;
        }, z.core.$strip>>;
        indexes: z.ZodArray<z.ZodObject<{
            name: z.ZodString;
            definition: z.ZodString;
        }, z.core.$strip>>;
        constraints: z.ZodArray<z.ZodObject<{
            name: z.ZodString;
            type: z.ZodString;
            definition: z.ZodString;
        }, z.core.$strip>>;
    }, z.core.$strip>>;
    sequences: z.ZodRecord<z.ZodString, z.ZodObject<{
        data_type: z.ZodString;
    }, z.core.$strip>>;
}, z.core.$strip>;
export type SchemaSnapshot = z.infer<typeof SchemaSnapshot>;
/** Filter options for `query_schema_snapshot`. */
export interface QuerySchemaSnapshotOptions {
    /**
     * Schema name to introspect — defaults to `'public'`. Single-schema only;
     * cross-schema introspection isn't a current need.
     */
    readonly schema?: string;
    /**
     * Tables to exclude from the snapshot. The `schema_version` migration
     * tracker is always excluded — it's framework bookkeeping created by the
     * migration runner, identical across impls, and not part of any
     * consumer's domain schema.
     */
    readonly exclude_tables?: ReadonlyArray<string>;
}
/**
 * Introspect a live database into a deterministic `SchemaSnapshot`.
 *
 * Reads `information_schema` and `pg_catalog` to capture tables, columns,
 * indexes, constraints, and sequences.
 *
 * The `schema_version` migration tracker never appears in the `tables`
 * field — it's framework bookkeeping created by the migration runner,
 * identical across consumers, and would only add noise.
 */
export declare const query_schema_snapshot: (db: Db, options?: QuerySchemaSnapshotOptions) => Promise<SchemaSnapshot>;
//# sourceMappingURL=schema_introspect.d.ts.map