This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # aleph (16)
- # bangalore-clj (4)
- # beginners (19)
- # boot (27)
- # cider (81)
- # clara (2)
- # cljs-dev (343)
- # cljsrn (97)
- # clojure (224)
- # clojure-hk (1)
- # clojure-italy (25)
- # clojure-russia (5)
- # clojure-serbia (2)
- # clojure-spec (7)
- # clojure-uk (27)
- # clojurescript (97)
- # cursive (8)
- # datomic (48)
- # docker (1)
- # emacs (15)
- # hoplon (39)
- # jobs (4)
- # lumo (13)
- # off-topic (2)
- # om (66)
- # onyx (7)
- # parinfer (5)
- # pedestal (2)
- # play-clj (10)
- # protorepl (2)
- # quil (1)
- # re-frame (38)
- # reagent (33)
- # spacemacs (1)
- # specter (4)
- # sql (19)
- # test-check (31)
- # unrepl (4)
- # untangled (3)
@seancorfield Right, I see. So I'll stick to the standard.
This leaves me with a few not-so-important questions, like:
* if the author copies the code base and rewrites it, why wouldn't he submit to the original one?
* if there are really some goodies in
clojure.jdbc (better performance? less code duplication? sub-transaction support? ...? - according to the author: http://funcool.github.io/clojure.jdbc/latest/#why-another-jdbc-wrapper ), why not take parts of that code and add it to yours (and acknowledge the author of
It's just awkward to me to have 2 libs, doing the same, without being substentially different. The author of
clojure.jdbc claims it's completely different:
> Is this a fork of java.jdbc? No. It is an alternative implementation.
is not really true, is it?
@kurt-o-sys Because the Clojure Contrib libraries are managed under a Contributor’s Agreement and the EPL license. The
clojure.jdbc author’s work would need to be submitted as patches and they’d have to agree to the CA and the legal aspects of it.
Here’s the thread where this all blew up on the mailing list https://groups.google.com/forum/#!msg/clojure/Louc1PRdb_s/eGDvnW4XUxkJ
(took me a while to track it down — he talks about why he wouldn’t contribute to
clojure.java.jdbc (after lifting a bunch of its code!) and why he wouldn’t contribute to the community documentation either)
@kurt-o-sys It's "cheating" but you can do
(create-table-ddl "IF NOT EXISTS tablename" [[...]])
Maybe it would be a nice enhancement to the create/drop functions to have a conditional option somehow...?
I'm going to add a
:conditional? option to both
drop-table-ddl that will insert the
IF NOT EXISTS or
IF EXISTS clause that works on some DBs. it can be boolean or a string (in which case it will insert the specified string -- which is how the
:explain? option works on
other small question: if I want to add several tables in 1 transaction, I see a few functions:
with-db-transaction. Which one to use? (Both seem to run 1 transaction, if I'm not mistaken)
Because it might not be "if not exists" in all dialects (hence, it can be a string) and also it means both
drop-table-ddl can be "conditional", even tho' the condition is the opposite between them (`drop table if exists foo`,
create table if not exists foo).
db-do-commands is for DDL -- see the community docs http://clojure-doc.org/articles/ecosystem/java_jdbc/home.html --
with-db-transaction is for wrapping calls in a transaction (so you might use them together). Note that some DBs don't let you wrap DDL in a transaction: it's always auto-committed in some.