-
Notifications
You must be signed in to change notification settings - Fork 91
-
Having a function to escape identities allows creating more dynamic queries while reducing the risk of SQL Injection. psycopg has that: https://www.psycopg.org/psycopg3/docs/api/sql.html#psycopg.sql.Identifier.
Would it be enough to expose SQLIdentifier?
Workaround:
def identity_expression(value): return str(FunctionExpression("", ConstantExpression(value).alias("")))[1:-1]
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment