query-builder
query-builder copied to clipboard
Escaping quotes in PostgreSQL
Currently escape method replaces single quotes with pre-double-slashed-single-quotes (' becomes \\'). This wouldn't work in PostgreSQL, it doesn't like slashes in strings.
The possible solution is to allow to define the escape character to a developer. Again, Tren currently allows it.
I've made updates, you can test. (for example) Can you report if there's a problem?
You're escaping slashes in PostgreSQL queries - this is overhead due to wrapping in quotes ('value') automatically escapes everything rather than single quotes :nerd_face: For example, 'foo \bar' is a valid string and 'foo'bar' is not. Maybe add a sort of @escapeable_regex thing? For PostgreSQL it would be /'/.
You're right. I'm working on to this. I'll release update coming soon.