jOOQ / jOOQ

jOOQ is the best way to write SQL in Java
https://www.jooq.org
Other
6.14k stars 1.21k forks source link

Feedback about translation tool #14899

Open souenzzo opened 1 year ago

souenzzo commented 1 year ago

Hello I'm translating from PostgreSQL to H2 latest

Using com.h2database/h2 "2.1.214", org.postgresql/postgresql "42.2.20" and postgres 14.3 in my local dev setup

This postgres

CREATE TABLE hello (
  world text COLLATE "default" NOT NULL
)

translates to

CREATE TABLE hello (
  world clob COLLATE "default" NOT NULL
)

that does not work:

lukaseder commented 1 year ago

Thanks for your feedback. We don't currently translate collations, assuming vendors who support the syntax will support it the same way, though the collation names may still be vendor specific.

Please note you can always tell jOOQ to ignore certain syntax while parsing using the ignore comment syntax (look for /* [jooq ignore start] */): https://www.jooq.org/doc/latest/manual/sql-building/dsl-context/custom-settings/settings-parser/

  • H2 does support text

While that's true, it's just an (undocumented?) synonym for CLOB, see: https://www.h2database.com/html/datatypes.html

(TEXT isn't listed)