honeysql

Discussion of https://github.com/seancorfield/honeysql :slightly_smiling_face:
avi 2020-06-09T21:55:19.058800Z

👋 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!

seancorfield 2020-06-09T22:02:57.059700Z

@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.

seancorfield 2020-06-09T22:04:40.060800Z

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...

seancorfield 2020-06-09T22:07:04.063Z

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...

2020-06-09T23:07:41.063900Z

@aviflax if you're using postgres, https://github.com/nilenso/honeysql-postgres has them.

avi 2020-06-09T23:10:59.064400Z

Thanks! I’m using SQLite tho.