feat: Prefer count header, procedures outside exposed schemas; 0.2.0

This commit is contained in:
2026-11-02 01:50:34 +01:00
parent 31f97fd392
commit 8735abfe79
18 changed files with 73 additions and 38 deletions
+2 -1
View File
@@ -43,7 +43,8 @@ export function createREST<C = unknown>(options: RestOptions<C>): Rest<C> {
const db = options.db;
let loading: Promise<Api> | null = null;
const load = () => (loading ??= db.introspect({ schemas: options.expose.schemas ?? [], tables: options.expose.tables ?? [] })
const functions = Object.values(options.procedures ?? {}).map((p) => p.function).filter((f) => f.includes('.'));
const load = () => (loading ??= db.introspect({ schemas: options.expose.schemas ?? [], tables: options.expose.tables ?? [], functions })
.then((catalog: Catalog) => ({
resources: buildResources(catalog, options as RestOptions<unknown>),
procedures: buildProcedures(catalog, options.procedures ?? {}),