-
-
Notifications
You must be signed in to change notification settings - Fork 175
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
Add support for "as-is" function calls for case-sensitive contexts (ClickHouse, BigQuery) #352
Comments
Can you provide a concrete example of a database/JDBC driver combination where this causes a problem, so that I can set up a repro test case? |
sure |
Never heard of it. Looks like I can run it via Docker: https://hub.docker.com/r/yandex/clickhouse-server/ Can you provide a short Clojure script that, starting with an empty default instance of ClickHouse via that Docker container, creates a database, a table, and then does something that breaks specifically because of the uppercasing of the function? That will give me a good testing framework so that I can compare behavior across some other DB/drivers and see if this is specific to ClickHouse and then I can look at providing some option for opting out of the default behavior somehow, in a way that won't break anything for users of any other system (this is not just about uppercasing function calls because the logic around that syntax is there to support other SQL syntax -- and this would also have to potentially affect every other context that HoneySQL currently treats as a function call). You may just be better off using dev=> (sql/format {:select [[[:raw "domain(ref)"]]]})
["SELECT domain(ref)"] |
I have got sql for this
expected
|
Much appreciated @evilsneer -- I'll take a look at this during my next OSS window (which probably won't be for a week or two, just to set expectations). |
I'm still thinking about how best to tackle this since it is non-trivial. |
BigQuery is another use case for this. |
develop now supports function keywords that start with dev=> (sql/format {:select [[[:domain :ref]]]})
["SELECT DOMAIN(ref)"]
dev=> (sql/format {:select [[[:'domain :ref]]]})
["SELECT domain(ref)"] Note: there is no literal symbol equivalent to this (although you could do dev=> (sql/format {:select [[[(symbol "'domain") :ref]]]})
["SELECT domain(ref)"] /cc @shay-rf |
@evilsneer You posted a comment and seem to have deleted it -- was your question answered? |
Yes, i thought about some use cases with swapping sql backends below hsql. But at second thought think it’s not such useful, so differences of hsql representation btw backends is ok i guess |
Hi again! Should it works already? I have
and
I see there is upcoming |
It's available on develop via git deps. It has not yet been released. See https://github.com/seancorfield/honeysql/blob/develop/CHANGELOG.md |
It makes trouble when working with some sql-oriented dbs.
Example:
{:select [[[:domain :ref]]]}
produces
SELECT DOMAIN(ref)
The text was updated successfully, but these errors were encountered: