Fork me on GitHub
#sql
<
2019-02-27
>
jdt16:02:06

Just checking to see if there's a beefier version of create-table-ddl that people might know about.

seancorfield17:02:53

clojure.java.jdbc is intended to be completely DB agnostic and DDL is notoriously DB-specific so it's very hard to support "useful" stuff generically. There's a honeysql-postgres library that, together with honeysql, should get you a bit closer.

seancorfield17:02:51

(also, it's not really clojure.java.jdbc's purpose to generate SQL, just to run it, so the few affordances it provides for that are as generic as possible, and therefore fairly minimal by design)

jdt17:02:02

Yeah, again I wasn't trying to slight clojure.java.jdbc in this case, I understand the goal.

jdt17:02:33

Just looking for tooling rather than reinvent wheels or take the cruder approach I have for plan B.

hiredman17:02:23

regardless I don't think create-table-ddl gets used all that much, the typical approach is to keep ddl in files used by some some migration library

jdt17:02:46

I'm using honeysql for queries, good point it can probably be used for all my ddl too, assuming I don't fall into honeysql/raw traps.

hiredman17:02:06

something like https://github.com/yogthos/migratus is the approach to ddl that the clojure projects I've worked on has taken