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

Allow escaping of colon : in SQL #13

Closed
csummers opened this issue Nov 24, 2015 · 0 comments
Closed

Allow escaping of colon : in SQL #13

csummers opened this issue Nov 24, 2015 · 0 comments
Milestone

Comments

@csummers
Copy link
Member

Since HugSQL uses named parameters starting with a colon :, it is considered as special HugSQL syntax. We specifically work around a common use case in Postgresql SQL for explicit type casts starting with double colons ::. However, there are more uses of the colon : in Postgresql and possibly other DBs. For instance, Postgresql array slicing syntax uses colons.

Instead of working around every possible use of colons across many flavors of SQL, HugSQL should support the escaping of the colon : with a backslash \.

\: will be interpreted as a : in SQL output
\\ will be interpreted as a \ in SQL output

@csummers csummers added this to the 0.4.0 milestone Nov 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant