Discussion:
Add API to check if a table exists
Robert Mikes
2018-11-11 17:24:59 UTC
Permalink
*Use case: *we have a bootstrap code that creates/updates the database
structure upon startup. Similarly to liquibase, I need to check if a table
exists, CREATE it if not and ALTER it if it already exists, in order to
apply later changes.

*Feature request:* add API to check if a table exists.

See:
https://stackoverflow.com/questions/24741761/how-to-check-if-a-table-exists-in-jooq
--
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Lukas Eder
2018-11-12 08:56:35 UTC
Permalink
Hi Robert,

Thank you very much for your message. That's a very interesting idea. Most
SQL dialects already support an CREATE <object> [ IF NOT EXISTS ] or an
ALTER <object> [ IF EXISTS ] clause, and jOOQ can emulate it for many SQL
dialects by generating an anonymous block that catches exceptions. But if
we could have an extra statement / predicate that allows for a client to
run this check independently of the actual DDL statement, that would be
even more powerful. It would also be useful to jOOQ's internals.

I've created a feature request for this:
https://github.com/jOOQ/jOOQ/issues/8038

Thanks again,
Lukas
Post by Robert Mikes
*Use case: *we have a bootstrap code that creates/updates the database
structure upon startup. Similarly to liquibase, I need to check if a table
exists, CREATE it if not and ALTER it if it already exists, in order to
apply later changes.
*Feature request:* add API to check if a table exists.
https://stackoverflow.com/questions/24741761/how-to-check-if-a-table-exists-in-jooq
--
You received this message because you are subscribed to the Google Groups
"jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...