forked from sosedoff/pgweb
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Description
When embedding pgweb in iframes, users need to pass tenant-specific parameters (like gsr_client, gsr_inst) that should be automatically substituted into SQL queries without prompting the user.
Current Behavior
- Queries with
@parameterplaceholders always prompt users for input - No way to pre-populate parameters from URL query strings
- Makes iframe embedding less seamless for tenant-aware applications
Desired Behavior
- Extract URL parameters matching patterns like
gsr_*,tenant_*,user_*from query string - Automatically substitute
@parameterplaceholders with URL values - Only prompt users if no matching URL parameters are available (backward compatibility)
- Secure parameter handling with SQL injection protection
Use Case
// React iframe with tenant parameters
<iframe
src={`/sql/embed/?gsr_client=${clientId}&gsr_inst=${instanceId}`}
title="Database Interface"
/>Queries like:
SELECT * FROM intf_automation.hubs
WHERE gsr_client = @gsr_client AND gsr_inst = @gsr_instShould automatically substitute without user prompts.
Metadata
Metadata
Assignees
Labels
No labels