-
Notifications
You must be signed in to change notification settings - Fork 89
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
SQL mapper auto-quoting mechanism #244
Comments
I wrote a "little" preg_replace for cortex to test some auto quotation. What do you think?!
|
Wow that's impressive! You've just reached the Master Of Regex level 😆 I've tried all the edge cases that were described in the initial conversation, and they all seem to be covered. Can you explain a little bit what's the rationale behind it? I got a little bit confused by the comments. |
Haha, yeah thanks for the flowers, but actually it's a simple thing: we want to match all fields, so it's basically a word ( |
This is a followup of this conversation.
The SQL mapper tries to automatically quote the keys that are located in the
ORDER BY
clause. In most cases, this mechanism is working well, but there are some special cases where it doesn't work (mainly when a function is part of the order clause).In order to fix that, we now check if the order clause is not already quoted before enabling auto-quoting.
Anyway, having to manually quote expressions as they get more complex is a pity, when the mapper is supposed to abstract away SQL engines syntax differences.
I created this issue, so we can think of a way to sort this out in the next major release.
The ideal way to handle this would be to improve the auto-quoting mechanism so that it can handle all possible cases, but I doubt this is possible, as discussed in the conversation above.
Another way to handle this would be to have a F3-specific quoting character, that would allow to manually quote order clauses (and why not filters), without having to resort to engine-specific quoting characters.
The text was updated successfully, but these errors were encountered: