Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: SQL Endpoint with Parameters #228

Open
aersam opened this issue Nov 21, 2022 · 1 comment
Open

Feature Request: SQL Endpoint with Parameters #228

aersam opened this issue Nov 21, 2022 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@aersam
Copy link

aersam commented Nov 21, 2022

Hi there

This project really looks promising! I have one thing I think should be changed: the SQL Endpoint does not seem to support parameters - at least it's not documented. That encourages users to create their SQL by using string concatenation which is not good from a security perspective (SQL injection). I propose to either use JSON Body:

{
"sql": "SELECT * FROM table where name = $name",
"parameters": {"$name": "something that is properly escaped\" drop table table"}
}

Or make use of headers:

POST URLTOTABLE
X-SQL-Parameter-Name: something that is properly escaped" drop table table

SELECT * FROM table where name = $name

What do you think?

@houqp
Copy link
Member

houqp commented Jan 22, 2023

that sounds good to me, feel free to send us a PR, we can do the parameter sanitization on the server side.

@houqp houqp added enhancement New feature or request help wanted Extra attention is needed labels Jan 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants