[jOOQ/jOOQ#12022] Add code generator support for MySQL's invisible columns

This commit is contained in:
Lukas Eder 2022-09-21 17:34:09 +02:00
parent ec0608399e
commit 09bf6265e8
2 changed files with 102 additions and 0 deletions

View File

@ -42,6 +42,7 @@ import static java.util.Arrays.asList;
// ...
import static org.jooq.impl.DSL.coalesce;
import static org.jooq.impl.DSL.name;
import static org.jooq.impl.DSL.noCondition;
import static org.jooq.meta.mysql.information_schema.Tables.COLUMNS;
import java.sql.SQLException;
@ -109,6 +110,9 @@ public class MySQLTableDefinition extends AbstractTableDefinition {
// [#5213] Duplicate schema value to work around MySQL issue https://bugs.mysql.com/bug.php?id=86022
.where(COLUMNS.TABLE_SCHEMA.in(getSchema().getName(), getSchema().getName()))
.and(COLUMNS.TABLE_NAME.equal(getName()))
.and(getDatabase().getIncludeInvisibleColumns()
? noCondition()
: COLUMNS.EXTRA.notLike("%INVISIBLE%"))
.orderBy(COLUMNS.ORDINAL_POSITION)
) {

View File

@ -1296,6 +1296,104 @@ final class Tools {