Chat2DB Edition
Chat2DB Community
User Problem
When running the same SQL query repeatedly with different values in the WHERE clause, I currently have to edit the SQL each time to change the value.
For example, changing:
to:
every time I want to query a different record becomes tedious, especially for longer or more complex queries.
Concrete Use Case
It would be useful to define a parameter directly in the SQL:
SELECT
report_name,
report_type
FROM fineract_default.stretchy_report
WHERE id = :id;
When the query is executed, Chat2DB could detect :id and prompt the user to provide its value:
The same query could then be executed again with a different value without modifying the SQL.
This could also support multiple parameters:
SELECT *
FROM some_table
WHERE client_id = :client_id
AND status = :status;
with Chat2DB prompting for both values when the query is run.
Product Area
SQL editor
Proposed Outcome
Add support for interactive SQL query parameters in the SQL editor.
When a query contains parameters, Chat2DB should:
- Detect the parameters in the query.
- Prompt the user for their values when the query is executed.
- Bind the supplied values to the query.
- Execute the query without requiring the SQL itself to be modified.
Named parameters such as :id would be particularly useful, although support for other parameter syntaxes could also be considered depending on the database/driver.
Alternatives Considered
No response
Contribution
I can help test the change
Submission Checklist
Chat2DB Edition
Chat2DB Community
User Problem
When running the same SQL query repeatedly with different values in the
WHEREclause, I currently have to edit the SQL each time to change the value.For example, changing:
to:
every time I want to query a different record becomes tedious, especially for longer or more complex queries.
Concrete Use Case
It would be useful to define a parameter directly in the SQL:
When the query is executed, Chat2DB could detect
:idand prompt the user to provide its value:The same query could then be executed again with a different value without modifying the SQL.
This could also support multiple parameters:
with Chat2DB prompting for both values when the query is run.
Product Area
SQL editor
Proposed Outcome
Add support for interactive SQL query parameters in the SQL editor.
When a query contains parameters, Chat2DB should:
Named parameters such as
:idwould be particularly useful, although support for other parameter syntaxes could also be considered depending on the database/driver.Alternatives Considered
No response
Contribution
I can help test the change
Submission Checklist