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

Support for prepared statements #62

Open
cristoirmac opened this issue Jul 21, 2017 · 1 comment
Open

Support for prepared statements #62

cristoirmac opened this issue Jul 21, 2017 · 1 comment

Comments

@cristoirmac
Copy link

I think prepared statements could help our performance, especially by eliminating the parse/optimizer step since we execute thousands of queries of the same structure but different values.

Server-side prepared statements are useful for:

  • Optimizing queries. HP Vertica only needs to parse the statement once.
  • Preventing SQL injection attacks. A SQL injection attack occurs when user input is either incorrectly filtered for string literal escape characters embedded in SQL statements or user input is not strongly typed and thereby unexpectedly run. Since a prepared statement is parsed separately from the input data, there is no chance the data can be accidentally executed by the database.
  • Binding direct variables to return columns. By pointing to data structures, the code doesn't have to perform extra transformations.

https://my.vertica.com/docs/7.1.x/HTML/Content/Authoring/ConnectingToHPVertica/ClientDriverMisc/UsingPreparedStatements.htm

@wvanbergen
Copy link
Owner

I am happy to merge support for prepared statements, but I am not working on this library myself anymore.

FWIW, if preventing SQL injection is what you are after: it's also possible to do parameterization of queries client-side, without implementing prepared statements which is a lot more work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants