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
+10
View File
@@ -29,3 +29,13 @@ for (const page of PAGES) {
}
});
}
describe('postgres procedures outside the exposed schemas', { skip: !url && 'RESTLOOM_PG_URL is not set' }, () => {
test('a declared function is read even when only tables are exposed', async () => {
await pool.query(fixture);
const rest = createREST({ db: postgres(pool), expose: { tables: ['demo.tags'] }, procedures: { 'assets/{asset}/retire': { function: 'demo.retire_asset' } } });
const res = await rest.handle({ method: 'POST', path: '/assets/3/retire', query: new URLSearchParams(), headers: {}, body: {}, context: undefined });
assert.equal(res.status, 200);
assert.equal(res.body, 3);
});
});