-
Notifications
You must be signed in to change notification settings - Fork 348
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
oracle support #1295
oracle support #1295
Conversation
Heh, don't get exited yet. This is only build stuff. |
well... build stuff is the hardest part of this :) |
f9d6910
to
8c998c0
Compare
Okay, I'm switching over to use
So all in all, we have two choices:
I have chosen to do the latter as it solves multiple problems. If Oracle ever decides to actually allow non-logged users to downoad their 'official image' I'll gladly switch back. Alternatively, if docker-hub somehow starts allowing for logins to use api-keys we can go that route too. For now, I will continue developing the tests on to of this existing build. |
879982b
to
bf3123f
Compare
3650ec2
to
6565124
Compare
Here's an update for anyone interested. We translate case class Holder(value:Option[String])
query[Holder].map(h => h.value || "suffix") Will become: select h.value || suffix from Holder h With all the databases we have seen so far, the Even outside of Oracle however, this behavior is still broken. Say we have a statement like this: case class Holder(value:Option[String])
run(query[Holder].map(h =>
h.value.map(v => if(v == "something") "foo" else "bar")).getOrElse("baz"))
) This will turn into the following SQL: SELECT CASE WHEN
CASE WHEN h.value = 'something' THEN 'foo' ELSE 'bar' END IS NOT NULL THEN
CASE WHEN h.value = 'something' THEN 'foo' ELSE 'bar' END
ELSE 'baz'
END FROM Holder h Note, how in this case, when |
Also, I need to note that the run(query[Holder].map { holder =>
holder.value.exists(v => (v+"foo" == "foo"))
}) Which will become this: SELECT (holder.value || 'foo') = 'foo' FROM Holder holder Since Oracle's concatonation operator |
In fact, run(query[Holder].map { holder =>
holder.value.forall(v => (v+"notfoo" == "foo"))
}) Which becomes: SELECT holder.value IS NULL OR (holder.value || 'notfoo') = 'foo' FROM Holder holder Now when |
The run(query[Holder].map { holder =>
if (holder.value.contains("")) "foo" else "bar"
}) Turns into this: SELECT CASE WHEN holder.value = '' THEN 'foo' ELSE 'bar' END FROM Holder holder Now this will correctly yeild If |
4b5687f
to
c4563a1
Compare
Now since #1302 is merged, this work can continue. |
It looks like Oracle are being their usual selves, and started issuing takedown DMCA notices for unofficial containers on docker-hub, despite the fact that "allowed for development purposes" is clearly stated in their license agreement (it's like they don't actually want developers to be able to support their DB in their products!). The Slick people have already been affected by this issue slick/slick#1993 (the original issue here: wnameless/docker-oracle-xe-11g#118). Currently I am using the medgetablelevvel/oracle-12c-base image which is based on sath89/oracle-12c which has also been taken down. I expect medgetablelevvel/oracle-12c-base image will be taken down very soon as well.
The way I see it, if we want to use the official Oracle image, we can go one of two ways:
Flavio, Quill maintainers, and anyone else. Please let me know your thoughts. I know @ghisvail and @jilen commented on #34. We need some discussion here on the best way to move forward. @fwbrasil |
I think it's reasonable to use the official message if we disable the oracle tests for PRs and add instructions on CONTIBUTING.md on how to run the tests locally. We can even change the PR template to add a note about it. We might end up merging something that breaks oracle but it should be fine. We'd just need to revert the PR. |
Okay. I'm fine with that. It seems like someone from Oracle is looking into this DMCA issue (wnameless/docker-oracle-xe-11g#118 (comment)) so I'll wait for him to reply before making major structural changes to this build as it is still working for now. If needed I can also make the change in a future PR. |
d18e522
to
d4ff847
Compare
Okay. This is ready for review. |
1194f49
to
8ed4202
Compare
build.sbt
Outdated
"org.xerial" % "sqlite-jdbc" % "3.25.2" % Test, | ||
"com.microsoft.sqlserver" % "mssql-jdbc" % "7.1.1.jre8-preview" % Test | ||
) | ||
resolvers ++= includeIfOracle( // read ojdbc7 jar in case it is deployed |
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.
it seems that quill-jdbc-monix
has the same code. Would it be possible to reuse?
besides the code duplication on |
Awesome! I'll resolve the conflicts and merge. |
1cdf583
to
c5adb22
Compare
Fixes #34
Checklist
README.md
if applicable[WIP]
to the pull request title if it's work in progresssbt scalariformFormat test:scalariformFormat
to make sure that the source files are formatted@getquill/maintainers