Re: RenderQuotedNames.ALWAYS not rendering quotes for SQLite

2024-03-22 Thread Lukas Eder
On Fri, Mar 22, 2024 at 12:16 PM Marcel Overdijk wrote: > Thanks for detailed feedback Luka, I really appreciate it. > > I think https://github.com/jOOQ/jOOQ/issues/16498 makes sense, > but also MariaDB supports the { d '*str*' } expression (as expected as > it is a fork), so even in my case

Re: RenderQuotedNames.ALWAYS not rendering quotes for SQLite

2024-03-22 Thread Marcel Overdijk
Thanks for detailed feedback Luka, I really appreciate it. I think https://github.com/jOOQ/jOOQ/issues/16498 makes sense, but also MariaDB supports the { d '*str*' } expression (as expected as it is a fork), so even in my case that should be no problem. Note I'm generating the .sql file dumps

Re: RenderQuotedNames.ALWAYS not rendering quotes for SQLite

2024-03-22 Thread Lukas Eder
Marcel, Yes I know it’s a challenge to try to create “ANSI SQL” files. > I've just thought of a problem you will inevitably run into with your approach: jOOQ does not give you any guarantee of "ANSI SQL." If you pick any dialect (e.g. PostgreSQL), it will generate a "reasonable" SQL query or

Re: RenderQuotedNames.ALWAYS not rendering quotes for SQLite

2024-03-22 Thread Marcel Overdijk
Hi Lukas, I did some further investigation about what insert is generated for each db. [ ] insert into "country" ("id", "code", "name", "population", "percentage", "date", "continent_id") values ('netherlands', 'NL', 'Netherlands', 17947684, 0.2, date '2023-12-31', 'europe') [CUBRID

Re: RenderQuotedNames.ALWAYS not rendering quotes for SQLite

2024-03-21 Thread Marcel Overdijk
Yes I know it’s a challenge to try to create “ANSI SQL” files.Maybe a bit of background I have to share I have a project which contains semi-static data which is updated ~2 times a month.The data is provided to users in various formats like csv, json and smile.Another variant is a SQLite database

Re: RenderQuotedNames.ALWAYS not rendering quotes for SQLite

2024-03-21 Thread Lukas Eder
Thanks for your message. The logic to prevent quoting in SQLite is very old. I don't recall the exact reason, but I believe that SQLite's parser had a lot of trouble with quoted identifiers in some contexts - so the solution was to simply avoid quoting, except for identifiers that conflict with

Re: RenderQuotedNames.ALWAYS not rendering quotes for SQLite

2024-03-21 Thread Marcel Overdijk
Note I also tried with SQLDialect.POSTGRES and then I get the double quotes. But then date values are rendered like: INSERT INTO "TABLE_A" ("DATE") VALUES ( DATE '2024-03-21') which I think is not mandatory for PostgreSQL, but is not supported e.g. with SQLite... On Thursday, March 21,

RenderQuotedNames.ALWAYS not rendering quotes for SQLite

2024-03-21 Thread Marcel Overdijk
// Create context. Settings settings = new Settings() .withRenderQuotedNames(RenderQuotedNames.ALWAYS); DSLContext ctx = DSL.using(SQLDialect.SQLITE, settings); // Insert statement. Continent continent = new Continent();