Fork me on GitHub
#honeysql
<
2023-06-14
>
Nazral20:06:58

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

p-himik20:06:31

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

Nazral20:06:34

right, thank you 👍 so no helper for this case

Nazral20:06:46

(like with-columns or such)

seancorfield21:06:20

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])) 🙂

👍 2
Nazral21:06:48

thanks for the help