[jOOQ/jOOQ#11248] Make jOOQ-meta queries available to MetaSQL
This commit is contained in:
parent
e90a6c41e7
commit
f6cff58e8b
@ -49,9 +49,11 @@ import static org.jooq.SQLDialect.CUBRID;
|
||||
import static org.jooq.SQLDialect.FIREBIRD;
|
||||
import static org.jooq.SQLDialect.SQLITE;
|
||||
// ...
|
||||
import static org.jooq.impl.DSL.case_;
|
||||
import static org.jooq.impl.DSL.count;
|
||||
import static org.jooq.impl.DSL.falseCondition;
|
||||
import static org.jooq.impl.DSL.field;
|
||||
import static org.jooq.impl.DSL.inline;
|
||||
import static org.jooq.impl.DSL.noCondition;
|
||||
import static org.jooq.impl.DSL.one;
|
||||
import static org.jooq.impl.DSL.partitionBy;
|
||||
@ -59,6 +61,7 @@ import static org.jooq.impl.DSL.rowNumber;
|
||||
import static org.jooq.impl.DSL.table;
|
||||
import static org.jooq.impl.DSL.when;
|
||||
import static org.jooq.meta.AbstractTypedElementDefinition.customType;
|
||||
import static org.jooq.meta.hsqldb.information_schema.Tables.TRIGGERS;
|
||||
import static org.jooq.tools.StringUtils.defaultIfBlank;
|
||||
import static org.jooq.tools.StringUtils.defaultIfEmpty;
|
||||
import static org.jooq.tools.StringUtils.defaultIfNull;
|
||||
@ -77,6 +80,7 @@ import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
@ -110,11 +114,15 @@ import org.jooq.Parser;
|
||||
// ...
|
||||
import org.jooq.Query;
|
||||
import org.jooq.Record;
|
||||
import org.jooq.Record14;
|
||||
import org.jooq.SQLDialect;
|
||||
import org.jooq.Schema;
|
||||
import org.jooq.Select;
|
||||
import org.jooq.Table;
|
||||
import org.jooq.TableField;
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
import org.jooq.TableOptions.TableType;
|
||||
import org.jooq.conf.ParseWithMetaLookups;
|
||||
import org.jooq.conf.RenderQuotedNames;
|
||||
@ -124,6 +132,7 @@ import org.jooq.impl.DSL;
|
||||
import org.jooq.impl.ParserException;
|
||||
import org.jooq.impl.QOM;
|
||||
import org.jooq.impl.SQLDataType;
|
||||
import org.jooq.meta.hsqldb.information_schema.tables.Triggers;
|
||||
import org.jooq.meta.jaxb.CatalogMappingType;
|
||||
import org.jooq.meta.jaxb.CommentType;
|
||||
import org.jooq.meta.jaxb.CustomType;
|
||||
@ -808,7 +817,7 @@ public abstract class AbstractDatabase implements Database {
|
||||
@Override
|
||||
public final SchemaDefinition getSchema(String inputName) {
|
||||
for (SchemaDefinition schema : getSchemata())
|
||||
if (schema.getName().equals(inputName))
|
||||
if (schema.getName().equals(defaultIfNull(inputName, "")))
|
||||
return schema;
|
||||
|
||||
return null;
|
||||
@ -1585,35 +1594,33 @@ public abstract class AbstractDatabase implements Database {
|
||||
log.warn("DEPRECATED", "The <types/> element in <forcedType/> is deprecated. Use <includeTypes/> instead: " + type);
|
||||
}
|
||||
|
||||
if (StringUtils.isBlank(type.getUserType())) {
|
||||
if (type.getVisibilityModifier() == null
|
||||
&& StringUtils.isBlank(type.getGenerator())
|
||||
&& StringUtils.isBlank(type.getName())
|
||||
&& !TRUE.equals(type.isAuditInsertTimestamp())
|
||||
&& !TRUE.equals(type.isAuditInsertUser())
|
||||
&& !TRUE.equals(type.isAuditUpdateTimestamp())
|
||||
&& !TRUE.equals(type.isAuditUpdateUser())) {
|
||||
log.warn("Bad configuration for <forcedType/>. Any of <name/>, <userType/>, <generator/>, <auditInsertTimestamp/>, <auditInsertUser/>, <auditUpdateTimestamp/>, <auditUpdateUser/>, or <visibilityModifier/> is required: " + type);
|
||||
|
||||
it2.remove();
|
||||
continue;
|
||||
}
|
||||
else if (!commercial()) {
|
||||
log.warn("<generator/>, <auditInsertTimestamp/>, <auditInsertUser/>, <auditUpdateTimestamp/>, <auditUpdateUser/>, and <visibilityModifier/> are commercial only features. Please upgrade to the jOOQ Professional Edition or jOOQ Enterprise Edition: " + type);
|
||||
boolean commercialFlags =
|
||||
type.getVisibilityModifier() != null
|
||||
|| !StringUtils.isBlank(type.getGenerator())
|
||||
|| TRUE.equals(type.isAuditInsertTimestamp())
|
||||
|| TRUE.equals(type.isAuditInsertUser())
|
||||
|| TRUE.equals(type.isAuditUpdateTimestamp())
|
||||
|| TRUE.equals(type.isAuditUpdateUser());
|
||||
|
||||
it2.remove();
|
||||
continue;
|
||||
}
|
||||
if (StringUtils.isBlank(type.getUserType())
|
||||
&& StringUtils.isBlank(type.getName())
|
||||
&& !commercialFlags) {
|
||||
log.warn("Bad configuration for <forcedType/>. Any of <name/>, <userType/>, <generator/>, <auditInsertTimestamp/>, <auditInsertUser/>, <auditUpdateTimestamp/>, <auditUpdateUser/>, or <visibilityModifier/> is required: " + type);
|
||||
|
||||
it2.remove();
|
||||
continue;
|
||||
}
|
||||
else if (commercialFlags && !commercial()) {
|
||||
log.warn("<generator/>, <auditInsertTimestamp/>, <auditInsertUser/>, <auditUpdateTimestamp/>, <auditUpdateUser/>, and <visibilityModifier/> are commercial only features. Please upgrade to the jOOQ Professional Edition or jOOQ Enterprise Edition: " + type);
|
||||
|
||||
it2.remove();
|
||||
continue;
|
||||
}
|
||||
|
||||
if (StringUtils.isBlank(type.getBinding())
|
||||
&& StringUtils.isBlank(type.getConverter())
|
||||
&& StringUtils.isBlank(type.getGenerator())
|
||||
&& !TRUE.equals(type.isAuditInsertTimestamp())
|
||||
&& !TRUE.equals(type.isAuditInsertUser())
|
||||
&& !TRUE.equals(type.isAuditUpdateTimestamp())
|
||||
&& !TRUE.equals(type.isAuditUpdateUser())
|
||||
&& type.getVisibilityModifier() == null
|
||||
&& !commercialFlags
|
||||
&& !Boolean.TRUE.equals(type.isAutoConverter())
|
||||
&& !Boolean.TRUE.equals(type.isEnumConverter())
|
||||
&& !Boolean.TRUE.equals(type.isXmlConverter())
|
||||
@ -3976,6 +3983,72 @@ public abstract class AbstractDatabase implements Database {
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Retrieve ALL indexes from the database
|
||||
*/
|
||||
@ -4052,17 +4125,6 @@ public abstract class AbstractDatabase implements Database {
|
||||
*/
|
||||
protected abstract List<DomainDefinition> getDomains0() throws SQLException;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Retrieve ALL XML schema collections from the database. This will be
|
||||
* filtered in {@link #getXMLSchemaCollections()}
|
||||
|
||||
@ -42,10 +42,13 @@ import java.util.List;
|
||||
|
||||
import org.jooq.Meta;
|
||||
import org.jooq.Record12;
|
||||
import org.jooq.Record14;
|
||||
import org.jooq.Record4;
|
||||
import org.jooq.Record5;
|
||||
import org.jooq.Record6;
|
||||
import org.jooq.ResultQuery;
|
||||
// ...
|
||||
// ...
|
||||
|
||||
import org.jetbrains.annotations.ApiStatus.Internal;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@ -180,4 +183,36 @@ public interface ResultQueryDatabase extends Database {
|
||||
@Internal
|
||||
@Nullable
|
||||
ResultQuery<Record5<String, String, String, String, String>> comments(List<String> schemas);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -76,6 +76,7 @@ import org.jooq.DSLContext;
|
||||
import org.jooq.Field;
|
||||
import org.jooq.Record;
|
||||
import org.jooq.Record12;
|
||||
import org.jooq.Record14;
|
||||
import org.jooq.Record4;
|
||||
import org.jooq.Record5;
|
||||
import org.jooq.Record6;
|
||||
@ -114,6 +115,8 @@ import org.jooq.meta.UDTDefinition;
|
||||
import org.jooq.meta.XMLSchemaCollectionDefinition;
|
||||
import org.jooq.meta.derby.sys.tables.Systriggers;
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* @author Lukas Eder
|
||||
*/
|
||||
@ -507,45 +510,6 @@ public class DerbyDatabase extends AbstractDatabase implements ResultQueryDataba
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -64,12 +64,15 @@ import java.util.List;
|
||||
import org.jooq.DSLContext;
|
||||
import org.jooq.Record;
|
||||
import org.jooq.Record12;
|
||||
import org.jooq.Record14;
|
||||
import org.jooq.Record4;
|
||||
import org.jooq.Record5;
|
||||
import org.jooq.Record6;
|
||||
import org.jooq.ResultQuery;
|
||||
import org.jooq.SQLDialect;
|
||||
import org.jooq.TableOptions.TableType;
|
||||
// ...
|
||||
// ...
|
||||
import org.jooq.impl.DSL;
|
||||
import org.jooq.meta.AbstractDatabase;
|
||||
import org.jooq.meta.ArrayDefinition;
|
||||
@ -220,6 +223,15 @@ public class DuckDBDatabase extends AbstractDatabase implements ResultQueryDatab
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public ResultQuery<Record12<String, String, String, String, Integer, Integer, Long, Long, BigDecimal, BigDecimal, Boolean, Long>> sequences(List<String> schemas) {
|
||||
return create()
|
||||
|
||||
@ -37,9 +37,9 @@
|
||||
*/
|
||||
package org.jooq.meta.firebird;
|
||||
|
||||
import static java.lang.Boolean.TRUE;
|
||||
import static java.util.Arrays.asList;
|
||||
import static java.util.stream.Collectors.mapping;
|
||||
import static java.util.stream.Collectors.toList;
|
||||
import static org.jooq.SQLDialect.FIREBIRD;
|
||||
import static org.jooq.impl.DSL.any;
|
||||
import static org.jooq.impl.DSL.bitGet;
|
||||
@ -83,16 +83,17 @@ import java.math.BigDecimal;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.jooq.DSLContext;
|
||||
import org.jooq.Field;
|
||||
import org.jooq.Record;
|
||||
import org.jooq.Record12;
|
||||
import org.jooq.Record14;
|
||||
import org.jooq.Record4;
|
||||
import org.jooq.Record5;
|
||||
import org.jooq.Record6;
|
||||
@ -104,7 +105,6 @@ import org.jooq.Table;
|
||||
import org.jooq.TableOptions.TableType;
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
import org.jooq.impl.DSL;
|
||||
import org.jooq.meta.AbstractDatabase;
|
||||
import org.jooq.meta.AbstractIndexDefinition;
|
||||
@ -117,7 +117,6 @@ import org.jooq.meta.DefaultDomainDefinition;
|
||||
import org.jooq.meta.DefaultIndexColumnDefinition;
|
||||
import org.jooq.meta.DefaultRelations;
|
||||
import org.jooq.meta.DefaultSequenceDefinition;
|
||||
// ...
|
||||
import org.jooq.meta.DomainDefinition;
|
||||
import org.jooq.meta.EnumDefinition;
|
||||
import org.jooq.meta.IndexColumnDefinition;
|
||||
@ -128,7 +127,6 @@ import org.jooq.meta.RoutineDefinition;
|
||||
import org.jooq.meta.SchemaDefinition;
|
||||
import org.jooq.meta.SequenceDefinition;
|
||||
import org.jooq.meta.TableDefinition;
|
||||
// ...
|
||||
import org.jooq.meta.UDTDefinition;
|
||||
import org.jooq.meta.XMLSchemaCollectionDefinition;
|
||||
import org.jooq.meta.firebird.rdb.tables.Rdb$checkConstraints;
|
||||
@ -675,37 +673,6 @@ public class FirebirdDatabase extends AbstractDatabase implements ResultQueryDat
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -98,6 +98,7 @@ import org.jooq.Field;
|
||||
import org.jooq.Name;
|
||||
import org.jooq.Record;
|
||||
import org.jooq.Record12;
|
||||
import org.jooq.Record14;
|
||||
import org.jooq.Record4;
|
||||
import org.jooq.Record5;
|
||||
import org.jooq.Record6;
|
||||
@ -108,6 +109,8 @@ import org.jooq.Select;
|
||||
import org.jooq.SortOrder;
|
||||
import org.jooq.Table;
|
||||
import org.jooq.TableField;
|
||||
// ...
|
||||
// ...
|
||||
import org.jooq.TableOptions.TableType;
|
||||
import org.jooq.impl.DSL;
|
||||
import org.jooq.meta.AbstractDatabase;
|
||||
@ -729,6 +732,15 @@ public class H2Database extends AbstractDatabase implements ResultQueryDatabase
|
||||
SEQUENCES.SEQUENCE_NAME);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected List<SequenceDefinition> getSequences0() throws SQLException {
|
||||
List<SequenceDefinition> result = new ArrayList<>();
|
||||
@ -1213,16 +1225,6 @@ public class H2Database extends AbstractDatabase implements ResultQueryDatabase
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected List<XMLSchemaCollectionDefinition> getXMLSchemaCollections0() throws SQLException {
|
||||
List<XMLSchemaCollectionDefinition> result = new ArrayList<>();
|
||||
|
||||
@ -41,14 +41,17 @@ package org.jooq.meta.hsqldb;
|
||||
import static org.jooq.Records.mapping;
|
||||
import static org.jooq.impl.DSL.case_;
|
||||
import static org.jooq.impl.DSL.coalesce;
|
||||
import static org.jooq.impl.DSL.count;
|
||||
import static org.jooq.impl.DSL.decode;
|
||||
import static org.jooq.impl.DSL.falseCondition;
|
||||
import static org.jooq.impl.DSL.field;
|
||||
import static org.jooq.impl.DSL.inline;
|
||||
import static org.jooq.impl.DSL.lower;
|
||||
import static org.jooq.impl.DSL.max;
|
||||
import static org.jooq.impl.DSL.name;
|
||||
import static org.jooq.impl.DSL.noCondition;
|
||||
import static org.jooq.impl.DSL.nvl;
|
||||
import static org.jooq.impl.DSL.replace;
|
||||
import static org.jooq.impl.DSL.select;
|
||||
import static org.jooq.impl.DSL.trim;
|
||||
import static org.jooq.impl.DSL.when;
|
||||
@ -79,17 +82,16 @@ import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import org.jooq.DSLContext;
|
||||
import org.jooq.Field;
|
||||
import org.jooq.Name;
|
||||
import org.jooq.Record;
|
||||
import org.jooq.Record12;
|
||||
import org.jooq.Record14;
|
||||
import org.jooq.Record4;
|
||||
import org.jooq.Record5;
|
||||
import org.jooq.Record6;
|
||||
@ -656,31 +658,6 @@ public class HSQLDBDatabase extends AbstractDatabase implements ResultQueryDatab
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -48,10 +48,12 @@ import static org.jooq.SQLDialect.MYSQL;
|
||||
// ...
|
||||
import static org.jooq.impl.DSL.case_;
|
||||
import static org.jooq.impl.DSL.cast;
|
||||
import static org.jooq.impl.DSL.count;
|
||||
import static org.jooq.impl.DSL.field;
|
||||
import static org.jooq.impl.DSL.inline;
|
||||
import static org.jooq.impl.DSL.length;
|
||||
import static org.jooq.impl.DSL.lower;
|
||||
import static org.jooq.impl.DSL.max;
|
||||
import static org.jooq.impl.DSL.name;
|
||||
import static org.jooq.impl.DSL.noCondition;
|
||||
import static org.jooq.impl.DSL.regexpReplaceAll;
|
||||
@ -93,6 +95,7 @@ import org.jooq.DSLContext;
|
||||
import org.jooq.Field;
|
||||
import org.jooq.Record;
|
||||
import org.jooq.Record12;
|
||||
import org.jooq.Record14;
|
||||
import org.jooq.Record4;
|
||||
import org.jooq.Record5;
|
||||
import org.jooq.Record6;
|
||||
@ -136,6 +139,8 @@ import org.jooq.meta.mysql.information_schema.tables.Triggers;
|
||||
import org.jooq.meta.mysql.mysql.enums.ProcType;
|
||||
import org.jooq.tools.csv.CSVReader;
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* @author Lukas Eder
|
||||
*/
|
||||
@ -659,31 +664,6 @@ public class MySQLDatabase extends AbstractDatabase implements ResultQueryDataba
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -130,6 +130,7 @@ import org.jooq.Name;
|
||||
import org.jooq.Record;
|
||||
import org.jooq.Record1;
|
||||
import org.jooq.Record12;
|
||||
import org.jooq.Record14;
|
||||
import org.jooq.Record4;
|
||||
import org.jooq.Record5;
|
||||
import org.jooq.Record6;
|
||||
@ -189,6 +190,8 @@ import org.jooq.meta.postgres.pg_catalog.tables.PgInherits;
|
||||
import org.jooq.meta.postgres.pg_catalog.tables.PgType;
|
||||
import org.jooq.tools.JooqLogger;
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* Postgres uses the ANSI default INFORMATION_SCHEMA, but unfortunately ships
|
||||
* with a non-capitalised version of it: <code>information_schema</code>. Hence
|
||||
@ -963,37 +966,6 @@ public class PostgresDatabase extends AbstractDatabase implements ResultQueryDat
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -73,6 +73,7 @@ import org.jooq.Query;
|
||||
import org.jooq.Record;
|
||||
import org.jooq.Record1;
|
||||
import org.jooq.Record12;
|
||||
import org.jooq.Record14;
|
||||
import org.jooq.Record4;
|
||||
import org.jooq.Record5;
|
||||
import org.jooq.Record6;
|
||||
@ -117,6 +118,8 @@ import org.jooq.meta.sqlite.sqlite_master.SQLiteMaster;
|
||||
import org.jooq.tools.JooqLogger;
|
||||
import org.jooq.tools.StringUtils;
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* SQLite implementation of {@link AbstractDatabase}
|
||||
*
|
||||
@ -587,6 +590,11 @@ public class SQLiteDatabase extends AbstractDatabase implements ResultQueryDatab
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -55,11 +55,14 @@ import java.util.List;
|
||||
import org.jooq.DSLContext;
|
||||
import org.jooq.Record;
|
||||
import org.jooq.Record12;
|
||||
import org.jooq.Record14;
|
||||
import org.jooq.Record4;
|
||||
import org.jooq.Record5;
|
||||
import org.jooq.Record6;
|
||||
import org.jooq.ResultQuery;
|
||||
import org.jooq.SQLDialect;
|
||||
// ...
|
||||
// ...
|
||||
import org.jooq.TableOptions.TableType;
|
||||
import org.jooq.impl.DSL;
|
||||
import org.jooq.meta.AbstractDatabase;
|
||||
@ -155,7 +158,7 @@ public class TrinoDatabase extends AbstractDatabase implements ResultQueryDataba
|
||||
}
|
||||
|
||||
@Override
|
||||
public final ResultQuery<Record4<String, String, String, String>> sources(List<String> schemas) {
|
||||
public ResultQuery<Record4<String, String, String, String>> sources(List<String> schemas) {
|
||||
return create()
|
||||
.select(
|
||||
inline("").as(VIEWS.TABLE_CATALOG),
|
||||
|
||||
@ -1,9 +1,94 @@
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.SQLDialect.*;
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.DERBY;
|
||||
import static org.jooq.SQLDialect.DUCKDB;
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.FIREBIRD;
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.H2;
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.HSQLDB;
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.MARIADB;
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.MYSQL;
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.POSTGRES;
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.SQLITE;
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.TRINO;
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.YUGABYTEDB;
|
||||
// ...
|
||||
|
||||
import java.util.EnumMap;
|
||||
|
||||
// ...
|
||||
import org.jooq.SQLDialect;
|
||||
|
||||
// The queries generated by MetaGeneration from the various jOOQ-meta ResultQueryDatabase types.
|
||||
@ -15,6 +100,10 @@ final class MetaSQL {
|
||||
private static final EnumMap<SQLDialect, String> M_SOURCES = new EnumMap<>(SQLDialect.class);
|
||||
private static final EnumMap<SQLDialect, String> M_COMMENTS = new EnumMap<>(SQLDialect.class);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
static final String M_UNIQUE_KEYS(SQLDialect dialect) {
|
||||
String result = M_UNIQUE_KEYS.get(dialect);
|
||||
return result != null ? result : M_UNIQUE_KEYS.get(dialect.family());
|
||||
@ -45,6 +134,16 @@ final class MetaSQL {
|
||||
return result != null ? result : M_COMMENTS.get(dialect.family());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
static {
|
||||
|
||||
M_UNIQUE_KEYS.put(DUCKDB, "select duckdb_constraints.database_name, duckdb_constraints.schema_name, duckdb_constraints.table_name, ((((((duckdb_constraints.database_name || '__') || duckdb_constraints.schema_name) || '__') || duckdb_constraints.table_name) || '__') || duckdb_constraints.constraint_text) constraint_text, unnest(duckdb_constraints.constraint_column_names) constraint_column_names, unnest(duckdb_constraints.constraint_column_indexes) constraint_column_indexes from duckdb_constraints() where (duckdb_constraints.constraint_type = 'UNIQUE' and duckdb_constraints.schema_name in (cast(? as varchar)))");
|
||||
@ -363,6 +462,72 @@ final class MetaSQL {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user