-
Notifications
You must be signed in to change notification settings - Fork 167
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 passing parameters to SQL query #208
Comments
Hi @1Dragoon , thanks for brining up this issue! We don't support prepared statements for now. I think the difficulty here is that we need to require the input parameters' type implement the For windows integrated authentication, you can add the |
Sorry for not following up for a long time, this isn't really for a performance concern so much as it is a security concern. Basically the use case here is being able to easily delineate between user defined SQL code and developer defined SQL code to i.e. mitigate SQL injection. |
Hi 👋, Thanks @wangxiaoying for this lib, its performance really shines <3 This feature would be very useful. I guess what's needed is something similar to |
For postgresql at least we can emulate it client side import psycopg2
import connectorx as cx
DSN = 'postgresql://username:password@host:port/dbname'
conn = None
def read_sql(sql, params=None):
global conn
if params:
if conn is None:
conn = psycopg2.connect(DSN)
sql = conn.cursor().mogrify(sql, params).decode('utf-8')
return cx.read_sql(DSN, sql) |
FYI it's now
For psycopg3 |
Any update on this issue? I'm experimenting with connectorx and need to pass some params without injections. Is there any other ways we can use? |
Is it possible to send prepared statements to MSSQL? I'm able to do this with tiberius directly, but I don't see a way to do it with connectorx.
Also I don't see a way to use integrated authentication in windows environments, which can also be done with the bare tiberius crate, is that also possible?EDIT: figured out how to get integrated auth, just don't specify username/password in the urlJust using Rust BTW, not python.
The text was updated successfully, but these errors were encountered: