From 538448fff491ed386904d6f8005975ddb0c4f612 Mon Sep 17 00:00:00 2001 From: Simone Date: Sat, 16 Nov 2024 15:42:58 +0100 Subject: [PATCH] Removed the hardcoded "public" schema of a pg database in favour of a simple "scheva" property in the config map --- src/adapters/PostgresAdapter.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/adapters/PostgresAdapter.js b/src/adapters/PostgresAdapter.js index a317998..7a442db 100644 --- a/src/adapters/PostgresAdapter.js +++ b/src/adapters/PostgresAdapter.js @@ -25,11 +25,11 @@ class PostgresAdapter extends DatabaseAdapter { const query = ` SELECT table_name FROM information_schema.tables - WHERE table_schema = 'public' AND table_catalog = $1; + WHERE table_schema = $2 AND table_catalog = $1; `; const client = await this.pool.connect(); try { - const res = await client.query(query, [this.config.database]); + const res = await client.query(query, [this.config.database, this.config.schema]); return res.rows.map((row) => row.table_name); } finally { client.release();