hasura / hasura/graphql-engine
Support providing SQL query parameters to `run_sql`
- Dominant language
- TypeScript
- Stars
- 32.1k
- Forks
- 3k
- PR merge metrics
- PR metrics pending
Description
### Is your proposal related to a problem?
I'd like to make use of Hasura's connection pooling to execute arbitrary administrative SQL. The [`run_sql` endpoint](https://hasura.io/docs/latest/api-reference/schema-api/run-sql/#schema-run-sql) seems well suited for this, except it doesn't seem to support SQL query parameters.
### Describe the solution you'd like
I'd like the `run_sql` arguments to accept an JSON object containing query parameters.
### Describe alternatives you've considered
An alternative at the moment would be attempting to construct the SQL string manually by escaping / sanitizing query parameters myself. However my reading on the subject indicates that this is dangerous, error prone, and not something that should generally be done.
Contributor guide
Research direction
Start with the linked run_sql API reference and trace how the endpoint currently accepts and executes its arguments. Define the JSON query-parameter shape and verify that parameterized SQL works through the endpoint without requiring manual SQL construction.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- sql
- Domain
- api, databases
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100