> Is it reasonable to ask that JOOQ *createTableIfNotExists()* knows which
> underlying SQL implementations that supports it natively and does a "SELECT
> 1 FROM ..." automatically for those that don't ??
Sure, this is very desirable. And the feature is actually emulated in those
databases that do not support it, *if* they support anonymous procedural
blocks. E.g. in Oracle, the emulation runs something along the lines of:
execute immediate '
create table "t"(
"i" number null,
"n" decimal(3, 1) null,
"s" varchar2(5) not null
when others then
if sqlerrm like 'ORA-00955%' then null;
There might just be dialects where we either didn't do it yet, or where we
didn't figure out how it could be done. What dialect(s) are you interested
in, and do you have a pointer on how it could be done?
We could certainly also run two queries from the client instead of just
one. The problem with that is (so far) that we have to update our execution
model and all the SPIs like ExecuteListener to take into account the
possibility of a single execute() call by the client running several
queries. Also, what will Query.getSQL() produce? A ";" separated statement
batch? This will take some time to design properly.
A much better solution would be to emulate anonymous blocks where they're
not available by creating temporary stored procedures. This would be
feature request https://github.com/jOOQ/jOOQ/issues/6474.
There are other similar issues, such as knowing which SQL types are
It seems that I was chasing another problem in the MySQL case, and adding
additional debugging support to figure out what was going on there, and
down the rabbit hole of this issue and lost track of the problem that
So, Postgresql case works fine. For MySQL, my VARCHAR fields becomes
CHAR(1) fields and the only code that differs is that Schema is not used in
MySQL case. I will try to create a testcase showing this a bit later.
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to [hidden email].