UNPKG

bknd

Version:

Lightweight Firebase/Supabase alternative built to run anywhere — incl. Next.js, React Router, Astro, Cloudflare, Bun, Node, AWS Lambda & more.

24 lines (23 loc) 1.19 kB
import { type DatabaseMetadata, type DatabaseMetadataOptions, type Kysely, type KyselyPlugin, type RawBuilder, type TableMetadata, type DatabaseIntrospector, type SchemaMetadata } from "kysely"; import type { IndexMetadata } from "../../data/connection/Connection"; export type TableSpec = TableMetadata & { indices: IndexMetadata[]; }; export type SchemaSpec = TableSpec[]; export type BaseIntrospectorConfig = { excludeTables?: string[]; plugins?: KyselyPlugin[]; }; export declare abstract class BaseIntrospector implements DatabaseIntrospector { protected readonly db: Kysely<any>; readonly _excludeTables: string[]; readonly _plugins: KyselyPlugin[]; constructor(db: Kysely<any>, config?: BaseIntrospectorConfig); abstract getSchemaSpec(): Promise<SchemaSpec>; abstract getSchemas(): Promise<SchemaMetadata[]>; protected getExcludedTableNames(): string[]; protected executeWithPlugins<T>(query: RawBuilder<any>): Promise<T>; getMetadata(options?: DatabaseMetadataOptions): Promise<DatabaseMetadata>; getIndices(tbl_name?: string): Promise<IndexMetadata[]>; getTables(options?: DatabaseMetadataOptions): Promise<TableMetadata[]>; }