From 78cbb06c573d85411c07950fafc91093763f97c2 Mon Sep 17 00:00:00 2001 From: Roman Wu Date: Mon, 28 Jul 2025 11:43:15 -0400 Subject: [PATCH] Modify the PostgreSQL SQL connector to support querying tables from schemas other than the default public schema. (#4202) * Add PostgreSQL schema support to SQL connector - Add schema configuration option to PostgreSQL connector - Update SQL queries to filter by specified schema - Add schema input field to frontend connection modal (PostgreSQL only) - Default to 'public' schema when no custom schema specified - Add getQualifiedTableName() method for schema.table format * Fix code formatting after linting * Update Postgresql.js * add back removal of ending curly brace * Update Postgresql.js * add back removal of ending curly brace (again?) --------- Co-authored-by: timothycarambat --- .../NewConnectionModal.jsx | 18 ++++++++++++++++++ .../sql-agent/SQLConnectors/Postgresql.js | 6 ++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/Admin/Agents/SQLConnectorSelection/NewConnectionModal.jsx b/frontend/src/pages/Admin/Agents/SQLConnectorSelection/NewConnectionModal.jsx index 9c5327b9..0803ecd1 100644 --- a/frontend/src/pages/Admin/Agents/SQLConnectorSelection/NewConnectionModal.jsx +++ b/frontend/src/pages/Admin/Agents/SQLConnectorSelection/NewConnectionModal.jsx @@ -36,6 +36,7 @@ const DEFAULT_CONFIG = { host: null, port: null, database: null, + schema: null, encrypt: false, }; @@ -269,6 +270,23 @@ export default function NewSQLConnection({ /> + {engine === "postgresql" && ( +
+ + +
+ )} + {engine === "sql-server" && (