openvibers/openvibe.codes Commits
Readiness names the store: the db check makes a real round trip (db.ready) and reports postgresql or pglite with the pool, as the other services on PostgreSQL do. npm test 28/28.
Changes
@@@ -22,10 +22,13 @@ function createCodesReadiness({ store, keys, network, outbox, docs, config, valkchecks: [{name: 'db', required: true,++ // A real round trip that names the store (postgresql / pglite), and the tables present.check: async () => {++ const r = await db.ready();++ if (!r.ok) return r.error;const names = new Set((await db.prepare("SELECT table_name AS name FROM information_schema.tables WHERE table_schema = current_schema()").all()).map((r) => r.name));const missing = TABLES.filter((t) => !names.has(t));-- return missing.length ? `missing ${missing.join(', ')}` : true;++ return missing.length ? `missing ${missing.join(', ')} (migrations did not run)` : { ok: true, detail: r.detail };},},{
@@ -22,10 +22,13 @@ function createCodesReadiness({ store, keys, network, outbox, docs, config, valk
@@ -22,10 +22,13 @@ function createCodesReadiness({ store, keys, network, outbox, docs, config, valk
checks: [
checks: [
{
{
name: 'db', required: true,
name: 'db', required: true,
+ // A real round trip that names the store (postgresql / pglite), and the tables present.
check: async () => {
check: async () => {
+ const r = await db.ready();
+ if (!r.ok) return r.error;
const names = new Set((await db.prepare("SELECT table_name AS name FROM information_schema.tables WHERE table_schema = current_schema()").all()).map((r) => r.name));
const names = new Set((await db.prepare("SELECT table_name AS name FROM information_schema.tables WHERE table_schema = current_schema()").all()).map((r) => r.name));
const missing = TABLES.filter((t) => !names.has(t));
const missing = TABLES.filter((t) => !names.has(t));
- return missing.length ? `missing ${missing.join(', ')}` : true;
+ return missing.length ? `missing ${missing.join(', ')} (migrations did not run)` : { ok: true, detail: r.detail };
},
},
},
},
{
{