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

Escape colon in SQL properly #2777

Closed
wants to merge 2 commits into from

Conversation

mistercrunch
Copy link
Member

No description provided.

@@ -97,6 +97,8 @@ def process_template(self, sql, **kwargs):
>>> process_template(sql)
"SELECT '2017-01-01T00:00:00'"
"""
# Escaping colon
sql = sql.replace(':', '\:')
Copy link
Contributor

@ascott ascott May 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if a user escapes the colon themselves? would '\:' then equal '\\:'? should we add a test for this case?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like the escaping is only required for some database engines as well. The specs being loose and the sqlalchemy dialects being of varying quality it makes this really hard on our end...

@mistercrunch
Copy link
Member Author

Superseeded by #3186

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

Successfully merging this pull request may close these issues.

2 participants