👋 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!
@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.
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...
http://clojure.github.io/java.jdbc/#clojure.java.jdbc/create-table-ddl
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...
@aviflax if you're using postgres, https://github.com/nilenso/honeysql-postgres has them.
Thanks! I’m using SQLite tho.