Closed john-shaffer closed 3 years ago
@john-shaffer Looks good so far.
A few notes:
script/generate_circleci.clj
so you'd have to add your config to the script instead of to the generated config.Thanks! I did generate the yaml by running the script, but I missed the [:workflows :ci :jobs]
part.
@john-shaffer Cool! Looks promising so far! You could try to download the pod from the artifact and test it.
@john-shaffer FYI, I tested the mysql pod on macOS.
(require '[babashka.pods :as pods])
(pods/load-pod "/Users/borkdude/Downloads/pod-babashka-mysql")
(require '[pod.babashka.mysql :as mysql])
(def conn {:dbtype "mysql"
:user "root"
:password "mypassword"})
(mysql/execute! conn ["drop database if exists mine;"])
(mysql/execute! conn ["create database if not exists mine;"])
(def db (assoc conn :dbname "mine"))
(mysql/execute! db ["create table mytable ( foobar int );"])
(mysql/execute! db ["insert into mytable (foobar) values (3);"])
(mysql/execute! db ["select * from mytable"])
against a docker container started with:
$ docker run --rm --name=test-mysql -p 3306:3306 -i --env="MYSQL_ROOT_PASSWORD=mypassword" mysql
It returns:
[{:mytable/foobar 3}]
Seems to work :)
Also tried:
(mysql/execute! db ["create table mytable ( foo JSON );"])
(mysql/execute! db ["insert into mytable (foo) values ('{\"a\": 1}');"])
(mysql/execute! db ["select foo->'$.a' as a from mytable"])
which returns [{:a "1"}]
.
Great! What is the download URL?
Known problems are: MySQL returns java.time.LocalDateTime (try select now()
), which causes an exception, and I saw similar issues with JSON (using the JSON tests copied from the postgres tests).
@john-shaffer You can download when going to the CircleCI builds under artifacts:
Okay, I guess I need a throwaway GitHub account then. I don't see a way to disallow private repo access, and there's no reason for me to give that to CircleCI. Will do when I have free time
@john-shaffer huh, ok, that's weird. I can give you the link: do you use linux or macOS?
Linux
@john-shaffer I'm just going ahead and merge this. We can fix and add more features incrementally.
@john-shaffer Due to the GPL license we probably can't distribute the mysql pod through the pod-registry.
Thanks! Why does the GPL license prevent pod-registry distribution?
Maybe I am misunderstanding the license, but I think GPL prohibits you from redistributing a derived work if it is itself not GPL?
I think you're right about the GPL, but it appears that Oracle has a Univeral FOSS Exception that should cover this case.
Source:
Without limiting the foregoing grant of rights under the GPLv2 and additional permission as to separately licensed software, this Connector is also subject to the Universal FOSS Exception, version 1.0, a copy of which is reproduced below and can also be found along with its FAQ at http://oss.oracle.com/ licenses/universal-foss-exception.
https://downloads.mysql.com/docs/licenses/connector-j-8.0-gpl-en.pdf
@john-shaffer I would like to believe so, but it seems the FOSS Exception talks about using interfaces/headers and not about distribution their entire "product"?
(iii) If only Interfaces and no other code is copied between the Software and the Other FOSS in either direction, the use and/or distribution of the Software with the Other FOSS shall not be deemed to require that the Other FOSS be licensed under the license of the Software, other than as to any Interfaces of the Software copied into the Other FOSS. This includes, by way of example and without limitation, statically or dynamically linking the Software together with Other FOSS after enabling interoperability using the Interfaces of one or both, and distributing the resulting combination under different licenses for the respective portions thereof.
Do they mean that "static linking" this library, as in, a pod, is permitted and does not require the pod to be GPL?
@john-shaffer Had a conversation with a developer who has a background as a lawyer:
Well, I want to distribute a binary (the source of which is open source) which contains the mysql driver. This driver is GPL licensed, but Oracle has some FOSS Exception: https://oss.oracle.com/licenses/universal-foss-exception/ I don't know if I'm allowed to distribute that binary. Yesterday, 11:44 PM babashka/babashka-sql-pods github.com This is the project: Yesterday, 11:54 PM Yup The Oracle exception allows you to use GPL2 MySQL drivers with non-GPL but OSI approved licenses. If the whole thing is GPL you are good. https://mysql.com/about/legal/licensing/foss-exception/ 12:06 AM But my project isn't GPL :) 12:08 AM Ah, Eclipse is OSI approved so you’re good https://opensource.org/licenses/EPL-1.0 Eclipse is also listed on Oracle’s FAQ about the exception 12:11 AM So I am even allowed to distribute my binary? 12:12 AM Oracle wants to keep MySQL GPL but make it compatible with non-GPL OSI licenses, that’s why they make an exception, it is a permissive exception, not a restrictive one Yes, you can, provided you comply with the Eclipse license
@john-shaffer So I think we're good and I will add the mysql pod to the releases and pod registry tomorrow.
Added to releases and pod registry. Thanks for contributing!
A first draft of MySQL support (#8) based on https://github.com/john-shaffer/mysql-native-image
WIP because it's completely untested in actual use, and because JSON is not implemented.