Fork me on GitHub
#honeysql
<
2022-11-05
>
hifumi12303:11:49

Is there some dialect available for H2 database when building HoneySQL statements? I'm asking because I currently have to employ a workaround when referencing tables in DDLs. e.g. [[:constraint :some-constraint] [:references :table/column]] will produce CONSTRAINT some_constraint REFERENCES table.column, but H2 requires the reference to be schema.table(column), even if you are in the same schema as the table you're referencing, leading me to using workarounds like [[:constraint :some-constraint] [:references [:public.table :column]]]

seancorfield03:11:43

I'm not sure why you consider that to be a workaround?

hifumi12303:11:41

hm... I guess I consider it a workaround because HoneySQL documentation seems to suggest :table/column is the "natural" way to reference table.column , rather than doing what I am currently doing. As long as this seems OK in your eyes then I'm willing to accept it 🙂

seancorfield03:11:28

If you need to specify the schema where would HoneySQL get that from, unless you tell it somehow? [:schema.table :column] seems like a good notation for that.

seancorfield03:11:12

(and, as I keep saying over and over, DDL is so horribly DB-specific and non-regular that supporting it "fully" is... a pipe dream at best)

hifumi12303:11:22

Makes sense. Thanks for the quick response btw. I was just making sure I'm using HoneySQL as intended, and I'm fine with things as they currently are

seancorfield03:11:18

"as intended" implies HoneySQL is opinionated 🙂 I think, when it comes to DDL, whatever works is acceptable.