Fork me on GitHub

@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: ), why not take parts of that code and add it to yours (and acknowledge the author of clojure.jdbc)? 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.


Andrey Antukh hasn’t signed a CA.


right. too bad, I suppose...


Here’s the thread where this all blew up on the mailing list!msg/clojure/Louc1PRdb_s/eGDvnW4XUxkJ


(took me a while to track it down — he talks about why he wouldn’t contribute to (after lifting a bunch of its code!) and why he wouldn’t contribute to the community documentation either)


You’ll see why I have zero sympathy or patience for that library 🙂


reading it 🙂


quick question: there's no 'create table if not exists'-function, is there?


iirc that’s not officially sql/ddl but most dbs have a syntax for it


ok. So I'll just check it.


@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 create-table-ddl and 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 query).


would be awesome... :conditional?. Or why not :if-not-exists?


other small question: if I want to add several tables in 1 transaction, I see a few functions: db-do-commands and 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 create-table-ddl and 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 -- 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.