-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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 field, table and schema matching #41781
Conversation
:indirect count))) | ||
(is (= 6 | ||
(-> (q "select v.* from venues v join checkins") | ||
:indirect count)))))))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Compelling tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks nice to me!
You've confirmed that our understanding of case and quotes is true for all SQL dialects we care about?
Ehmm... it's a bit shameful, but I've looked at list of supported databases and just asked ChatGPT. It says that most of dialects support SQL Standard - so unquoted names are case insensitive, quoted are case sensitive. |
f52f4d1
to
b1eca30
Compare
|
69dcd55
to
fe9a2b5
Compare
(#'query-analyzer/field-query :f.name "\"TEST\"")))) | ||
(testing "escaping inside quoted fields should be handled properly" | ||
(is (= [:= :f.name "Perv\"e\"rse"] | ||
;; this is "Perv""e""rse" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is indeed perverse :)
Oh nice, the tests are legit broken with the case-matching, I think:
|
fe9a2b5
to
37f69b6
Compare
yeah and it actually had your comment about |
@piranha Did you forget to add a milestone to the issue for this PR? When and where should I add a milestone? |
Uses new Macaw to better match Field objects used in an SQL string.
References #36911