honeysql

Nazral 2023-06-14T20:17:58.399029Z

Hi! Is there a way to specify a create table foo (...) strict (for https://www.sqlite.org/stricttables.html) with honeysql helpers ?

p-himik 2023-06-14T20:26:31.217449Z

(sql/format {:create-table [:t
                            {:columns [:foo :bar :baz]}
                            [:strict]]})
=> ["CREATE TABLE t (foo, bar, baz) STRICT"]

Nazral 2023-06-14T20:27:34.170149Z

right, thank you 👍 so no helper for this case

Nazral 2023-06-14T20:27:46.771419Z

(like with-columns or such)

seancorfield 2023-06-14T21:12:20.621169Z

The syntax that can be supported there is pretty random and it's database specific so it's not worth trying to design a helper for it. DDL in general is mostly too unstructured for helpers to improve things. (sql/format (update table-ddl :create-table conj [:strict])) 🙂

👍 1
Nazral 2023-06-14T21:49:48.934129Z

thanks for the help