Closed lucasvieirasilva closed 1 year ago
This PR adds support for interpolated variables from the connection config.
Example:
{ "sqltools.queryParams.enableReplace": true, "sqltools.connections": [ { "name": "SQLite", "driver": "SQLite", "database": "./docker/sqlite/test_db.db", "connectionTimeout": 15, "variables": { "env": "dev" } } ] }
Query:
SELECT * FROM table_$[env];
You can also use Jinja format by adding the sqltools.queryParams.regex property with this value \\{\\{(.*)\\}\\}
sqltools.queryParams.regex
\\{\\{(.*)\\}\\}
SELECT * FROM table_{{ env }};
Using pre-defined variables from the connection config to avoid prompting the variable value every time the user runs the query.
Thank you for your contribution! Before submitting this PR, please make sure:
Thanks for this contribution. I have suggested a minor change to a description in two places. Then I think it will be ready to merge.
@gjsjohnmurray Thanks for the review, I've applied your suggestions
This PR adds support for interpolated variables from the connection config.
Example:
Query:
You can also use Jinja format by adding the
sqltools.queryParams.regex
property with this value\\{\\{(.*)\\}\\}
Query:
Benefits
Using pre-defined variables from the connection config to avoid prompting the variable value every time the user runs the query.
Related Issues
744
Thank you for your contribution! Before submitting this PR, please make sure: