Fork me on GitHub
#honeysql2020-06-09
>
avi21:06:19

👋 hi all, hopefully quick question, about HoneySQL support for create table statements. My impression is that it’s currently either impossible; difficult+tricky+unsupported; and/or undocumented. Can anyone confirm which of those is the case, if any? Thanks!

seancorfield22:06:57

@aviflax create table syntax varies wildly from database to database -- HoneySQL's goal is to support SQL-92 / portable SQL so it doesn't attempt to do any DDL stuff.

seancorfield22:06:40

FWIW, clojure.java.jdbc has some very basic support for creating the DDL for that, but I omitted it from next.jdbc because it really wasn't any better than just bashing strings together...

seancorfield22:06:04

So many column declarations require strings due to spaces or punctuation -- and all it does really is (clojure.string/join " " (map name col-spec)) on each column spec and then (clojure.string/join ", " cols) across the sequence of column descriptions...

avi23:06:59

Thanks! I’m using SQLite tho.