[jOOQ/jOOQ#19300] MetaImpl doesn't provide table comments for BigQuery

This commit is contained in:
Lukas Eder 2025-10-31 09:05:02 +01:00
parent bb7fdf573b
commit 639859836f
2 changed files with 4 additions and 2 deletions

View File

@ -604,6 +604,7 @@ final class MetaImpl extends AbstractMeta {
case MYSQL:
case MARIADB: {

View File

@ -285,7 +285,7 @@ final class MetaSQL {
M_SOURCES.put(CLICKHOUSE, "select system.tables.database catalog, system.tables.database, system.tables.table, system.tables.create_table_query from system.tables where (system.tables.database in (?) and system.tables.engine = 'View')");
M_SOURCES.put(CLICKHOUSE, "select system.tables.database as catalog, system.tables.database, system.tables.table, system.tables.create_table_query from system.tables where (system.tables.database in (?) and system.tables.engine = 'View')");
M_SOURCES.put(DERBY, "select cast(null as varchar(32672)) as catalog, SYS.SYSSCHEMAS.SCHEMANAME, SYS.SYSTABLES.TABLENAME, SYS.SYSVIEWS.VIEWDEFINITION from SYS.SYSTABLES join SYS.SYSSCHEMAS on SYS.SYSTABLES.SCHEMAID = SYS.SYSSCHEMAS.SCHEMAID left outer join SYS.SYSVIEWS on SYS.SYSTABLES.TABLEID = SYS.SYSVIEWS.TABLEID where cast(SYS.SYSSCHEMAS.SCHEMANAME as varchar(32672)) in (cast(? as varchar(32672))) order by SYS.SYSSCHEMAS.SCHEMANAME, SYS.SYSTABLES.TABLENAME");
M_SOURCES.put(DUCKDB, "select duckdb_views.database_name, duckdb_views.schema_name, duckdb_views.view_name, duckdb_views.sql from duckdb_views() where duckdb_views.schema_name in (cast(? as varchar))");
M_SOURCES.put(FIREBIRD, "select null catalog, null schema, trim(RDB$RELATIONS.RDB$RELATION_NAME), case when lower(RDB$RELATIONS.RDB$VIEW_SOURCE) like 'create%' then trim(RDB$RELATIONS.RDB$VIEW_SOURCE) else case when upper(substring(trim(RDB$RELATIONS.RDB$VIEW_SOURCE) from 1 for 1)) = substring(trim(RDB$RELATIONS.RDB$VIEW_SOURCE) from 1 for 1) then ((('CREATE VIEW \"' || trim(RDB$RELATIONS.RDB$RELATION_NAME)) || '\" AS ') || RDB$RELATIONS.RDB$VIEW_SOURCE) else ((('create view \"' || trim(RDB$RELATIONS.RDB$RELATION_NAME)) || '\" as ') || RDB$RELATIONS.RDB$VIEW_SOURCE) end end view_source from RDB$RELATIONS order by trim(RDB$RELATIONS.RDB$RELATION_NAME)");
@ -378,7 +378,7 @@ final class MetaSQL {
M_COMMENTS.put(CLICKHOUSE, "select c.catalog, c.database, c.table, c.name, c.comment from (select system.tables.database catalog, system.tables.database, system.tables.name table, null name, system.tables.comment comment from system.tables where system.tables.comment <> '' union all select system.columns.database catalog, system.columns.database, system.columns.table, system.columns.name, system.columns.comment from system.columns where system.columns.comment <> '') c where c.database in (?) order by 1, 2, 3, 4");
M_COMMENTS.put(CLICKHOUSE, "select c.catalog, c.database, c.table, c.name, c.comment from (select system.tables.database as catalog, system.tables.database, system.tables.name as table, null as name, system.tables.comment as comment from system.tables where system.tables.comment <> '' union all select system.columns.database as catalog, system.columns.database, system.columns.table, system.columns.name, system.columns.comment from system.columns where system.columns.comment <> '') c where c.database in (?) order by 1, 2, 3, 4");
M_COMMENTS.put(DUCKDB, "select duckdb_tables.database_name, duckdb_tables.schema_name, duckdb_tables.table_name, duckdb_tables.column_name, duckdb_tables.comment from (select duckdb_tables.database_name, duckdb_tables.schema_name, duckdb_tables.table_name, null column_name, duckdb_tables.comment from duckdb_tables() union all select duckdb_views.database_name, duckdb_views.schema_name, duckdb_views.view_name, null column_name, duckdb_views.comment from duckdb_views() union all select duckdb_columns.database_name, duckdb_columns.schema_name, duckdb_columns.table_name, duckdb_columns.column_name, duckdb_columns.comment from duckdb_columns()) duckdb_tables where duckdb_tables.schema_name in (cast(? as varchar))");
M_COMMENTS.put(FIREBIRD, "select c.catalog, c.schema, c.RDB$RELATION_NAME, c.RDB$FIELD_NAME, c.RDB$DESCRIPTION from (select null catalog, null schema, trim(RDB$RELATIONS.RDB$RELATION_NAME) RDB$RELATION_NAME, null RDB$FIELD_NAME, trim(RDB$RELATIONS.RDB$DESCRIPTION) RDB$DESCRIPTION from RDB$RELATIONS where RDB$RELATIONS.RDB$DESCRIPTION is not null union all select null, null, RDB$RELATION_FIELDS.RDB$RELATION_NAME, RDB$RELATION_FIELDS.RDB$FIELD_NAME, RDB$RELATION_FIELDS.RDB$DESCRIPTION from RDB$RELATION_FIELDS where RDB$RELATION_FIELDS.RDB$DESCRIPTION is not null) c order by 1, 2, 3");
M_COMMENTS.put(H2, "select c.TABLE_CATALOG, c.TABLE_SCHEMA, c.TABLE_NAME, c.COLUMN_NAME, c.REMARKS from (select INFORMATION_SCHEMA.TABLES.TABLE_CATALOG, INFORMATION_SCHEMA.TABLES.TABLE_SCHEMA, INFORMATION_SCHEMA.TABLES.TABLE_NAME, null COLUMN_NAME, INFORMATION_SCHEMA.TABLES.REMARKS from INFORMATION_SCHEMA.TABLES where INFORMATION_SCHEMA.TABLES.REMARKS is not null union all select INFORMATION_SCHEMA.COLUMNS.TABLE_CATALOG, INFORMATION_SCHEMA.COLUMNS.TABLE_SCHEMA, INFORMATION_SCHEMA.COLUMNS.TABLE_NAME, INFORMATION_SCHEMA.COLUMNS.COLUMN_NAME, INFORMATION_SCHEMA.COLUMNS.REMARKS from INFORMATION_SCHEMA.COLUMNS where INFORMATION_SCHEMA.COLUMNS.REMARKS is not null) c where c.TABLE_SCHEMA in (cast(? as varchar)) order by 1, 2, 3, 4");
@ -432,6 +432,7 @@ final class MetaSQL {
M_GENERATORS.put(MARIADB, "select null as table_catalog, information_schema.COLUMNS.TABLE_SCHEMA, information_schema.COLUMNS.TABLE_NAME, information_schema.COLUMNS.COLUMN_NAME, information_schema.COLUMNS.GENERATION_EXPRESSION, case when information_schema.COLUMNS.EXTRA in ('VIRTUAL', 'VIRTUAL GENERATED') then 'VIRTUAL' when information_schema.COLUMNS.EXTRA in ('PERSISTENT', 'STORED GENERATED') then 'STORED' end as generationOption from information_schema.COLUMNS where (information_schema.COLUMNS.TABLE_SCHEMA in (?) and information_schema.COLUMNS.EXTRA in ('VIRTUAL', 'VIRTUAL GENERATED', 'PERSISTENT', 'STORED GENERATED')) order by information_schema.COLUMNS.ORDINAL_POSITION");