import { Relations } from "drizzle-orm"; import { PgEnum } from "drizzle-orm/pg-core"; import { CollectionConfig } from "@rebasepro/types"; import { PostgresCollectionRegistry } from "./PostgresCollectionRegistry"; /** * Everything a registry is built from: the collections, and the drizzle schema * they are backed by. In BaaS mode all of it is introspected from the live * database; when collections are declared it comes from the config and the generated schema. */ export interface RegistrySchema { collections?: CollectionConfig[]; tables?: Record; enums?: Record>; relations?: Record; } /** * Build the collection registry for a driver. * * The order matters and is the reason this is one function rather than a run of * statements in the bootstrapper. Keys are resolved from the drizzle schema, so * anything that inspects them has to run *after* the tables are registered — * and `warnOnKeysTheAdminCannotResolve` fails open if it does not, because a * collection whose table it cannot look up is one it has nothing to say about. * Warned too early, it would skip every collection and report nothing, which * reads exactly like having nothing to report. */ export declare function buildCollectionRegistry(schema: RegistrySchema): PostgresCollectionRegistry;