Feature Request: Prevent or Warn Against Hardcoded Schemas in Query Builder
We’re using Retool to power internal tools for multiple user groups (installers, CSRs, partners), with PostgreSQL environments split by schema (pw_prod, pw_stage, etc.) and controlled via search_path.
However — the Query Builder hardcodes the schema name (e.g., pw_prod.users) into every query. This completely bypasses the search_path mechanism, and breaks all of our efforts to maintain:
• Environment parity (prod vs. stage)
• Schema-level portability
• Code reuse across apps
• Consistent security context
• App portability and reviewability
The Problem
-
Query Builder forcibly hardcodes schema names , e.g., pw_prod.users, with no way to opt out .
-
Even when we configure a search_path in the Retool resource settings, it is not respected inside GUI-built queries.
-
The only way we got it working was to set a default search_path at the database level (per user role) in Postgres — which defeats the purpose of environment-level flexibility in Retool.
-
There is:
• No “Convert to SQL” for Postgres queries
• No preview of generated SQL
• No schema-awareness toggle in the GUI
• No way to detect this misuse across apps
What We Need
At a minimum, we need an option in the Postgres resource settings:
“Enforce use of search_path (disallow hardcoded schemas in Query Builder)”
Also helpful:
• Warning or confirmation when Query Builder auto-inserts schema names
• “Convert to SQL” for all query types
• A way to inspect generated SQL from GUI queries
• Linter/audit tooling to detect and flag schema-qualified table references
Why This Matters
Retool is awesome for quickly building internal tools, but once you’re supporting multi-environment deployments, shared resources, and schema-based access control, these seemingly small limitations cause serious headaches.
We’ve had to enforce SQL-only development, audit apps for schema references, and shift query logic to the DB level — all to work around something that feels like it should be configurable.