Allow escaping of colon : in SQL
csummers opened this issue · 0 comments
csummers commented
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