[jOOQ/jOOQ#1985] Add EXASOL support (WIP)

This commit is contained in:
Lukas Eder 2021-03-09 13:23:20 +01:00
parent c634cb5ece
commit ac4458a86e
60 changed files with 63 additions and 433 deletions

View File

@ -507,11 +507,8 @@ class GenerationUtil {
}
}
case H2: {
case H2:
return name(H2DataType.OTHER.getTypeName());
}
case HSQLDB: {

View File

@ -2705,10 +2705,8 @@ public abstract class AbstractDatabase implements Database {
case H2:
return "ARRAY".equals(dataType);
case HSQLDB:
// TODO: Is there any more robust way to recognise these?
// For instance, there could be a UDT that is called this way
return dataType.endsWith(" ARRAY");

View File

@ -1145,8 +1145,6 @@ public enum SQLDialect {
case MARIADB:
case MYSQL: return "MySQL";
case POSTGRES: return "PostgreSQL";
@ -1215,8 +1213,6 @@ public enum SQLDialect {
case MYSQL: return "org.hibernate.dialect.MySQL5Dialect";

View File

@ -148,8 +148,6 @@ final class BlockImpl extends AbstractRowCountQuery implements Block {
break;
}
case POSTGRES: {
bodyAsString(ctx, K_DO, c -> accept0(c));
break;
@ -227,8 +225,6 @@ final class BlockImpl extends AbstractRowCountQuery implements Block {
case HSQLDB:
case MARIADB:
default: {
@ -527,6 +523,7 @@ final class BlockImpl extends AbstractRowCountQuery implements Block {
ctx.visit(K_END);
switch (ctx.family()) {
case H2:
case FIREBIRD:
break;
@ -539,9 +536,6 @@ final class BlockImpl extends AbstractRowCountQuery implements Block {
default:
ctx.sql(';');
}

View File

@ -165,7 +165,6 @@ implements
case MARIADB:
case MYSQL: {
if (table != null)

View File

@ -81,9 +81,6 @@ final class Concat extends AbstractField<String> {
switch (ctx.family()) {
case MARIADB:
case MYSQL:
ctx.visit(function("concat", SQLDataType.VARCHAR, cast));

View File

@ -66,20 +66,17 @@ final class ConditionAsField extends AbstractField<Boolean> {
// Some databases don't accept predicates where column expressions
// are expected.
case CUBRID:
case FIREBIRD:
// [#10179] Avoid 3VL when not necessary
if (condition instanceof AbstractCondition && !((AbstractCondition) condition).isNullable())
ctx.visit(DSL.when(condition, inline(true))
@ -91,23 +88,7 @@ final class ConditionAsField extends AbstractField<Boolean> {
.when(not(condition), inline(false)));
break;
// These databases can inline predicates in column expression contexts
case DERBY:
case H2:
case HSQLDB:
case MARIADB:
case MYSQL:
case POSTGRES:
case SQLITE:
// The default, for new dialects
// Other dialects can inline predicates in column expression contexts
default:
ctx.sql('(').visit(condition).sql(')');
break;

View File

@ -303,9 +303,6 @@ implements
case MYSQL:
default:
if (enforced)
ctx.sql(' ').visit(K_ENFORCED);

View File

@ -230,8 +230,6 @@ final class CreateViewImpl<R extends Record> extends AbstractRowCountQuery imple
switch (ctx.family()) {
case FIREBIRD:
ctx.sql(' ').visit(K_ALTER);
break;

View File

@ -99,9 +99,6 @@ extends
case POSTGRES:
default:
ctx.visit(N_CURRENT_DATABASE).sql("()");
break;

View File

@ -114,8 +114,6 @@ extends
case MARIADB:
case MYSQL:
ctx.visit(K_DATABASE).sql("()");
@ -124,12 +122,11 @@ extends
case HSQLDB:
case POSTGRES:
ctx.visit(K_CURRENT_SCHEMA);
break;
default:
ctx.visit(K_CURRENT_SCHEMA).sql("()");
break;

View File

@ -115,6 +115,7 @@ extends
case SQLITE:
ctx.visit(DSL.inline(""));
break;
default:
ctx.visit(N_CURRENT_USER).sql("()");
break;

View File

@ -122,8 +122,6 @@ extends
switch (ctx.family()) {
case CUBRID:
case MARIADB:
case MYSQL: {
@ -346,7 +344,6 @@ extends
case FIREBIRD:
default: {
ctx.visit(N_DATEADD).sql('(').visit(standardKeyword()).sql(", ").visit(interval).sql(", ").visit(date).sql(')');
break;

View File

@ -96,8 +96,6 @@ final class DateDiff<T> extends AbstractField<Integer> {
switch (ctx.family()) {
case MARIADB:
case MYSQL:
switch (p) {
@ -169,9 +167,6 @@ final class DateDiff<T> extends AbstractField<Integer> {
case FIREBIRD:
case H2:
case HSQLDB:
@ -222,8 +217,6 @@ final class DateDiff<T> extends AbstractField<Integer> {
case CUBRID:
case POSTGRES:
switch (p) {

View File

@ -88,8 +88,6 @@ final class DateOrTime<T> extends AbstractField<T> {
switch (ctx.family()) {
case MYSQL:
case MARIADB:
ctx.visit(keyword(getDataType())).sql('(').visit(field).sql(')');
@ -103,6 +101,7 @@ final class DateOrTime<T> extends AbstractField<T> {
ctx.visit(K_TIME).sql('(').visit(field).sql(')');
else
ctx.visit(N_STRFTIME).sql("('%Y-%m-%d %H:%M:%f', ").visit(field).sql(')');
break;
}

View File

@ -646,8 +646,6 @@ public class DefaultBinding<T, U> implements Binding<T, U> {
// These dialects can hardly detect the type of a bound constant.
case DERBY:
case FIREBIRD:
@ -670,8 +668,6 @@ public class DefaultBinding<T, U> implements Binding<T, U> {
case POSTGRES: {
return true;
}
@ -687,8 +683,6 @@ public class DefaultBinding<T, U> implements Binding<T, U> {
case H2:
case HSQLDB:
case POSTGRES:
@ -701,8 +695,6 @@ public class DefaultBinding<T, U> implements Binding<T, U> {
switch (ctx.family()) {
case POSTGRES:
return true;
}
@ -1145,8 +1137,6 @@ public class DefaultBinding<T, U> implements Binding<T, U> {
switch (ctx.family()) {
case POSTGRES:
// Postgres needs explicit casting for enum (array) types
@ -1166,8 +1156,6 @@ public class DefaultBinding<T, U> implements Binding<T, U> {
switch (ctx.family()) {
case POSTGRES: {
ctx.statement().setString(ctx.index(), toPGArrayString(value));
break;
@ -1206,8 +1194,6 @@ public class DefaultBinding<T, U> implements Binding<T, U> {
switch (ctx.family()) {
case POSTGRES:
return pgGetArray(ctx, ctx.resultSet(), dataType, ctx.index());
@ -1654,14 +1640,11 @@ public class DefaultBinding<T, U> implements Binding<T, U> {
// Some dialects have trouble binding binary data as BLOB
// Same logic in DefaultBytesBinding
case POSTGRES:
return Types.BINARY;
default:
@ -1990,14 +1973,11 @@ public class DefaultBinding<T, U> implements Binding<T, U> {
// Some dialects have trouble binding binary data as BLOB
// Same logic in DefaultBlobBinding
case POSTGRES:
return Types.BINARY;
default:
@ -2877,11 +2857,9 @@ public class DefaultBinding<T, U> implements Binding<T, U> {
switch (family) {
// [#5895] HSQLDB derives the specific data type from the literal
case HSQLDB:
ctx.render().visit(K_TIMESTAMP).sql(" '").sql(escape(format(value, family), ctx.render())).sql('\'');
break;
@ -3458,8 +3436,6 @@ public class DefaultBinding<T, U> implements Binding<T, U> {
switch (ctx.family()) {
case POSTGRES:
return pgNewRecord(dataType.getType(), null, ctx.resultSet().getObject(ctx.index()));
@ -3473,8 +3449,6 @@ public class DefaultBinding<T, U> implements Binding<T, U> {
switch (ctx.family()) {
case POSTGRES:
return pgNewRecord(dataType.getType(), null, ctx.statement().getObject(ctx.index()));
@ -3716,16 +3690,9 @@ public class DefaultBinding<T, U> implements Binding<T, U> {
final int sqltype(Statement statement, Configuration configuration) {
switch (configuration.family()) {
case H2:
return -10; // OracleTypes.CURSOR;
case POSTGRES:
default:
return Types.OTHER;
}
@ -4196,9 +4163,6 @@ public class DefaultBinding<T, U> implements Binding<T, U> {
case H2:
case POSTGRES: {
ctx.statement().setObject(ctx.index(), value);
@ -4236,9 +4200,6 @@ public class DefaultBinding<T, U> implements Binding<T, U> {
case H2:
case POSTGRES:
return Convert.convert(ctx.resultSet().getObject(ctx.index()), UUID.class);
@ -4267,9 +4228,6 @@ public class DefaultBinding<T, U> implements Binding<T, U> {
case H2:
case POSTGRES:
return (UUID) ctx.statement().getObject(ctx.index());
@ -4299,9 +4257,6 @@ public class DefaultBinding<T, U> implements Binding<T, U> {
switch (configuration.family()) {
case POSTGRES:
return Types.OTHER;

View File

@ -4030,9 +4030,6 @@ public class DefaultDSLContext extends AbstractScope implements DSLContext, Seri
case CUBRID:
case MARIADB:
case MYSQL:
@ -4043,9 +4040,6 @@ public class DefaultDSLContext extends AbstractScope implements DSLContext, Seri
case POSTGRES:
return fetchValue(field("lastval()", BigInteger.class));

View File

@ -164,8 +164,6 @@ public class DefaultTransactionProvider implements TransactionProvider {
switch (configuration.family()) {
case CUBRID:
return UNSUPPORTED_SAVEPOINT;
default:

View File

@ -122,9 +122,9 @@ final class ExplainQuery {
case H2:
// HSQLDB's EXPLAIN PLAN FOR output doesn't contain any useful additional information
case HSQLDB: {
case HSQLDB:
break;
}
case MARIADB:
case MYSQL: {
// MySQL doesn't expose any cost (yet).

View File

@ -414,8 +414,6 @@ final class Expression<T> extends AbstractTransformable<T> {
switch (family) {
case CUBRID:
case MARIADB:
case MYSQL: {
@ -704,8 +702,6 @@ final class Expression<T> extends AbstractTransformable<T> {
}
case HSQLDB: {
if (operator == ADD)
ctx.visit(lhs.add(DSL.field("({0}) day", rhsAsNumber())));
@ -735,8 +731,6 @@ final class Expression<T> extends AbstractTransformable<T> {
case CUBRID:
case MARIADB:
case MYSQL: {
@ -803,9 +797,7 @@ final class Expression<T> extends AbstractTransformable<T> {
case H2:
// These dialects can add / subtract days using +/- operators
default:
ctx.visit(new DefaultExpression<>(lhs, operator, rhs));
break;

View File

@ -62,41 +62,21 @@ final class FieldCondition extends AbstractCondition {
public void accept(Context<?> ctx) {
switch (ctx.family()) {
// [#2485] These don't work nicely, yet
// [#2485] Some of these don't work nicely, yet
case CUBRID:
case FIREBIRD:
ctx.visit(field.eq(inline(true, field.getDataType())));
break;
// Native support
case DERBY:
case H2:
case HSQLDB:
case MARIADB:
case MYSQL:
case POSTGRES:
case SQLITE:
default:
ctx.visit(Tools.hasDefaultConverter(field) ? field : field.eq(inline(true, field.getDataType())));
break;

View File

@ -73,8 +73,6 @@ final class FieldFunction<T> extends AbstractField<Integer> {
switch (ctx.family()) {
case MARIADB:
case MYSQL:
if (arguments.size() > 1)

View File

@ -153,8 +153,6 @@ final class ForLock extends AbstractQueryPart {
case DERBY: {
forLockOfTables.toSQLFields(ctx);
break;

View File

@ -95,8 +95,6 @@ final class FunctionTable<R extends Record> extends AbstractTable<R> {
// with defaulted parameters.
case POSTGRES: {
ctx.visit(function);
break;

View File

@ -84,8 +84,6 @@ final class Greatest<T> extends AbstractField<T> {
case DERBY: {
Field<T> first = (Field<T>) args[0];
Field<T> other = (Field<T>) args[1];

View File

@ -75,8 +75,6 @@ final class Identifiers {
case MARIADB:
case MYSQL:
QUOTES.put(family, new char[][][] {
@ -102,25 +100,6 @@ final class Identifiers {
// Most dialects implement the SQL standard, using double quotes
case CUBRID:
case DERBY:
case FIREBIRD:
case H2:
case HSQLDB:
case IGNITE:
case POSTGRES:
case SQLITE:
default:
QUOTES.put(family, new char[][][] {
{ { '"' } },

View File

@ -72,8 +72,6 @@ final class Iif<T> extends AbstractField<T> {
switch (ctx.family()) {
case MARIADB:
case MYSQL:
ctx.visit(N_IF).sql('(').visit(condition).sql(", ").visit(ifTrue).sql(", ").visit(ifFalse).sql(')');

View File

@ -156,8 +156,6 @@ final class InCondition<T> extends AbstractCondition {
case FIREBIRD: {
ctx.sqlIndentStart('(');

View File

@ -307,9 +307,6 @@ final class InsertQueryImpl<R extends Record> extends AbstractStoreQuery<R> impl
switch (ctx.family()) {
case POSTGRES:
case SQLITE: {
toSQLInsert(ctx);
@ -404,13 +401,6 @@ final class InsertQueryImpl<R extends Record> extends AbstractStoreQuery<R> impl
}
// MySQL has a nice syntax for this
case CUBRID:
case MARIADB:
case MYSQL:
default: {
// [#2508] In H2, this syntax is supported in MySQL MODE (we're assuming users will
@ -463,8 +453,6 @@ final class InsertQueryImpl<R extends Record> extends AbstractStoreQuery<R> impl
case MYSQL:
case MARIADB: {
toSQLInsert(ctx);
@ -483,8 +471,6 @@ final class InsertQueryImpl<R extends Record> extends AbstractStoreQuery<R> impl
case POSTGRES:
case SQLITE: {
toSQLInsert(ctx);
@ -567,8 +553,6 @@ final class InsertQueryImpl<R extends Record> extends AbstractStoreQuery<R> impl
@ -688,7 +672,6 @@ final class InsertQueryImpl<R extends Record> extends AbstractStoreQuery<R> impl
case DERBY:
case MARIADB:
case MYSQL:

View File

@ -139,9 +139,6 @@ implements
switch (ctx.family()) {
case POSTGRES:
if (onNull == JSONOnNull.ABSENT_ON_NULL) {
Row1[] rows = new Row1[fields.size()];

View File

@ -128,7 +128,6 @@ final class JSONEntryImpl<T> extends AbstractQueryPart implements JSONEntry<T>,
case MARIADB:
case MYSQL:
case POSTGRES:

View File

@ -130,8 +130,6 @@ final class JSONExists extends AbstractCondition implements JSONExistsOnStep {
public final void accept(Context<?> ctx) {
switch (ctx.family()) {
case MYSQL:
ctx.visit(N_JSON_CONTAINS_PATH).sql('(').visit(json).sql(", 'one', ").visit(path).sql(')');
break;

View File

@ -137,9 +137,6 @@ implements
switch (ctx.family()) {
case POSTGRES:
if (onNull == JSONOnNull.ABSENT_ON_NULL)
ctx.visit(unquotedName(getDataType().getType() == JSONB.class ? "jsonb_strip_nulls" : "json_strip_nulls")).sql('(');

View File

@ -99,7 +99,6 @@ implements JSONObjectAggNullStep<J> {
case POSTGRES:
acceptPostgres(ctx);
break;

View File

@ -177,15 +177,11 @@ implements
public final void accept(Context<?> ctx) {
switch (ctx.family()) {
case MYSQL:
ctx.visit(N_JSON_EXTRACT).sql('(').visit(json).sql(", ").visit(path).sql(')');
break;
case POSTGRES:
ctx.visit(N_JSONB_PATH_QUERY_FIRST).sql('(').visit(castIfNeeded(json, JSONB)).sql(", ").visit(path).sql("::jsonpath)");
break;

View File

@ -119,9 +119,6 @@ extends
case SQLITE:
ctx.visit(N_LTRIM).sql('(').visit(string).sql(", ").visit(characters).sql(')');
break;

View File

@ -83,8 +83,6 @@ final class Least<T> extends AbstractField<T> {
case DERBY: {
Field<T> first = (Field<T>) args[0];
Field<T> other = (Field<T>) args[1];

View File

@ -290,8 +290,6 @@ final class Limit extends AbstractQueryPart {
case MYSQL:
case SQLITE: {
acceptDefaultLimitMandatory(ctx, castMode);
@ -307,20 +305,6 @@ final class Limit extends AbstractQueryPart {
case HSQLDB:
// No break
// A default implementation is necessary for hashCode() and toString()
default: {
acceptDefault(ctx, castMode);
break;

View File

@ -154,6 +154,7 @@ extends
case DERBY:

View File

@ -1320,8 +1320,6 @@ implements
case MARIADB:
case MYSQL:
toSQLMySQLOnDuplicateKeyUpdate(ctx);
@ -1329,8 +1327,6 @@ implements
case POSTGRES:
toPostgresInsertOnConflict(ctx);
break;

View File

@ -360,8 +360,6 @@ final class MetaImpl extends AbstractMeta {
// [#3977] [#11255] PostgreSQL returns other object types, too
case POSTGRES:
types = new String[] { "FOREIGN TABLE", "MATERIALIZED VIEW", "SYSTEM_TABLE", "SYSTEM_VIEW", "TABLE", "VIEW" };
break;
@ -378,7 +376,6 @@ final class MetaImpl extends AbstractMeta {
case SQLITE:
types = new String[] { "TABLE", "VIEW" };
break;
/* [/pro] */
default:
types = null;

View File

@ -65,39 +65,20 @@ final class NotField extends AbstractField<Boolean> {
public final void accept(Context<?> ctx) {
switch (ctx.family()) {
// [#2485] These don't work nicely, yet
// [#2485] Some of these don't work nicely, yet
case CUBRID:
case FIREBIRD:
ctx.visit(DSL.field(not(condition(field))));
break;
// Native support
case DERBY:
case H2:
case HSQLDB:
case MARIADB:
case MYSQL:
case POSTGRES:
case SQLITE:
default:
ctx.visit(K_NOT)
.sql('(')

View File

@ -73,8 +73,6 @@ final class NullStatement extends AbstractStatement {
default:
ctx.visit(K_NULL).sql(';');
break;

View File

@ -79,7 +79,6 @@ final class Nvl<T> extends AbstractField<T> {
case H2:
case HSQLDB:
ctx.visit(N_NVL).sql('(').visit(arg1).sql(", ").visit(arg2).sql(')');
@ -87,8 +86,6 @@ final class Nvl<T> extends AbstractField<T> {
case DERBY:
case POSTGRES:
ctx.visit(K_COALESCE).sql('(').visit(arg1).sql(", ").visit(arg2).sql(')');
@ -97,8 +94,6 @@ final class Nvl<T> extends AbstractField<T> {
case MARIADB:
case MYSQL:
case SQLITE:

View File

@ -77,7 +77,6 @@ final class Nvl2<T> extends AbstractField<T> {
case H2:
case HSQLDB:
ctx.visit(N_NVL2).sql('(').visit(arg1).sql(", ").visit(arg2).sql(", ").visit(arg3).sql(')');

View File

@ -122,11 +122,8 @@ final class QuantifiedSelectImpl<R extends Record> extends AbstractQueryPart imp
// [#869] Postgres supports this syntax natively
case POSTGRES: {
case POSTGRES:
return array;
}
// [#869] H2 and HSQLDB can emulate this syntax by unnesting
// the array in a subselect

View File

@ -119,9 +119,6 @@ extends
case SQLITE:
ctx.visit(N_RTRIM).sql('(').visit(string).sql(", ").visit(characters).sql(')');
break;

View File

@ -74,13 +74,11 @@ final class RegexpLike extends AbstractCondition {
case CUBRID:
case H2:
case MARIADB:
case MYSQL:
case SQLITE: {
case SQLITE:
ctx.visit(search)
.sql(' ')
.visit(K_REGEXP)
@ -88,28 +86,19 @@ final class RegexpLike extends AbstractCondition {
.visit(pattern);
break;
}
// [#620] HSQLDB has its own syntax
case HSQLDB: {
case HSQLDB:
ctx.visit(keyword("regexp_matches")).sql('(').visit(search).sql(", ").visit(pattern).sql(')');
break;
}
// [#620] Postgres has its own syntax
case POSTGRES: {
case POSTGRES:
ctx.sql('(').visit(search).sql(" ~ ").visit(pattern).sql(')');
break;
}
@ -121,15 +110,6 @@ final class RegexpLike extends AbstractCondition {
// Render the SQL standard for those databases that do not support
// regular expressions
case DERBY:
case FIREBIRD:
default: {
ctx.sql('(')
.visit(search)

View File

@ -73,8 +73,6 @@ final class RegexpReplace extends AbstractField<String> {
case POSTGRES:
ctx.visit(N_REGEXP_REPLACE).sql('(').visit(field).sql(", ").visit(pattern).sql(", ").visit(replacement);
@ -97,13 +95,6 @@ final class RegexpReplace extends AbstractField<String> {
case MYSQL:
// [#10151] TODO: Emulate REGEXP_REPLACE_FIRST for these three
case H2:
case HSQLDB:

View File

@ -65,8 +65,6 @@ final class Rollup extends AbstractField<Object> {
public final void accept(Context<?> ctx) {
switch (ctx.family()) {
case CUBRID:
case MARIADB:
case MYSQL:

View File

@ -77,11 +77,6 @@ final class RowIdField extends AbstractField<RowId> {
case SQLITE:
default:
ctx.visit(getQualifiedName());
break;

View File

@ -3644,8 +3644,6 @@ final class SelectQueryImpl<R extends Record> extends AbstractResultQuery<R> imp
default:
result.add(DSL.field("({select} 0)").asc());
break;

View File

@ -241,22 +241,18 @@ public class SequenceImpl<T extends Number> extends AbstractTypedNamed<T> implem
case POSTGRES: {
case POSTGRES:
ctx.visit(method.keyword).sql('(');
ctx.sql('\'').stringLiteral(true).visit(sequence).stringLiteral(false).sql('\'');
ctx.sql(')');
break;
}
case DERBY:
case FIREBIRD:
case H2:
case HSQLDB:
case MARIADB: {
case MARIADB:
if (method == SequenceMethod.NEXTVAL)
ctx.visit(K_NEXT_VALUE_FOR).sql(' ').visit(sequence);
else if (family == H2)
@ -285,9 +281,8 @@ public class SequenceImpl<T extends Number> extends AbstractTypedNamed<T> implem
throw new SQLDialectNotSupportedException("The sequence's current value functionality is not supported for the " + family + " dialect.");
}
break;
}
case CUBRID: {
case CUBRID:
ctx.visit(sequence).sql('.');
if (method == SequenceMethod.NEXTVAL)
@ -296,13 +291,11 @@ public class SequenceImpl<T extends Number> extends AbstractTypedNamed<T> implem
ctx.visit(DSL.keyword("current_value"));
break;
}
// Default is needed for hashCode() and toString()
default: {
default:
ctx.visit(sequence).sql('.').visit(method.keyword);
break;
}
}
}

View File

@ -105,7 +105,6 @@ extends
case MARIADB:
case MYSQL:
ctx.visit(K_USE).sql(' ').visit(schema);
@ -114,8 +113,6 @@ extends
case POSTGRES:
ctx.visit(K_SET).sql(' ').visit(K_SEARCH_PATH).sql(" = ").visit(schema);
break;

View File

@ -114,8 +114,6 @@ extends
// [#430] These databases use SQL standard syntax
case FIREBIRD: {
if (length == null)
ctx.visit(N_SUBSTRING).sql('(').visit(string).sql(' ').visit(K_FROM).sql(' ').visit(startingPosition).sql(')');

View File

@ -4391,28 +4391,23 @@ final class Tools {
case FIREBIRD: {
case FIREBIRD:
ctx.visit(K_EXECUTE_BLOCK).formatSeparator()
.visit(K_AS).formatSeparator()
.visit(K_BEGIN).formatIndentStart().formatSeparator();
break;
}
case MARIADB: {
case MARIADB:
ctx.visit(K_BEGIN).sql(' ').visit(K_NOT).sql(' ').visit(K_ATOMIC).formatIndentStart().formatSeparator();
break;
}
case POSTGRES: {
case POSTGRES:
if (increment(ctx.data(), DATA_BLOCK_NESTING))
ctx.visit(K_DO).sql(" $$").formatSeparator();
ctx.visit(K_BEGIN).formatIndentStart().formatSeparator();
break;
}
}
}
@ -4432,13 +4427,13 @@ final class Tools {
case FIREBIRD:
case MARIADB: {
case MARIADB:
ctx.formatIndentEnd().formatSeparator()
.visit(K_END);
break;
}
case POSTGRES: {
case POSTGRES:
ctx.formatIndentEnd().formatSeparator()
.visit(K_END);
@ -4446,7 +4441,6 @@ final class Tools {
ctx.sql(" $$");
break;
}
}
}
@ -4472,11 +4466,9 @@ final class Tools {
case FIREBIRD: {
case FIREBIRD:
ctx.visit(K_EXECUTE_STATEMENT).sql(" '").stringLiteral(true).formatIndentStart().formatSeparator();
break;
}
}
}
@ -4841,8 +4833,6 @@ final class Tools {
}
case POSTGRES: {
begin(ctx, c -> {
String sqlstate;
@ -4953,8 +4943,6 @@ final class Tools {
case CUBRID: ctx.sql(' ').visit(K_AUTO_INCREMENT); break;
case HSQLDB: ctx.sql(' ').visit(K_GENERATED_BY_DEFAULT_AS_IDENTITY).sql('(').visit(K_START_WITH).sql(" 1)"); break;
case SQLITE: ctx.sql(' ').visit(K_PRIMARY_KEY).sql(' ').visit(K_AUTOINCREMENT); break;
case POSTGRES:
@ -4963,15 +4951,12 @@ final class Tools {
case POSTGRES:
ctx.sql(' ').visit(K_GENERATED_BY_DEFAULT_AS_IDENTITY); break;
}
break;
case DERBY:
case FIREBIRD: ctx.sql(' ').visit(K_GENERATED_BY_DEFAULT_AS_IDENTITY); break;
}
@ -4988,8 +4973,6 @@ final class Tools {
// [#5062] H2's (and others') AUTO_INCREMENT flag is syntactically located *after* NULL flags.
switch (ctx.family()) {
case H2: ctx.sql(' ').visit(K_GENERATED_BY_DEFAULT_AS_IDENTITY); break;
@ -5045,9 +5028,6 @@ final class Tools {
switch (ctx.family()) {
case H2:
case MARIADB:
case MYSQL: {
@ -5066,8 +5046,6 @@ final class Tools {
// [#7597] In PostgreSQL, the enum type reference should be used
case POSTGRES: {
// [#7597] but only if the EnumType.getSchema() value is present

View File

@ -119,8 +119,6 @@ extends
else {
switch (ctx.family()) {
case SQLITE:
ctx.visit(N_TRIM).sql('(').visit(string).sql(", ").visit(characters).sql(')');
break;

View File

@ -94,8 +94,6 @@ extends
switch (ctx.family()) {
case DERBY: {
Field<?> power;
@ -115,8 +113,6 @@ extends
case H2:
case MARIADB:
case MYSQL:
@ -127,8 +123,6 @@ extends
// DOUBLE PRECISION ones
case POSTGRES:
ctx.visit(castIfNeeded(
DSL.function("trunc", NUMERIC,
@ -155,13 +149,6 @@ extends
case CUBRID:
case HSQLDB:
default:
ctx.visit(N_TRUNC).sql('(').visit(value).sql(", ").visit(decimals).sql(')');
break;

View File

@ -129,9 +129,6 @@ final class TruncDate<T> extends AbstractField<T> {
case POSTGRES: {
switch (part) {
case YEAR: keyword = "year"; break;

View File

@ -131,18 +131,10 @@ final class UDTConstant<R extends UDTRecord<R>> extends AbstractParam<R> {
switch (ctx.family()) {
case POSTGRES:
ctx.visit(K_ROW);
break;
// Assume default behaviour if dialect is not available
default: {
ctx.visit(value.getUDT());
break;
@ -166,17 +158,9 @@ final class UDTConstant<R extends UDTRecord<R>> extends AbstractParam<R> {
switch (ctx.family()) {
case POSTGRES:
return "ROW";
// Assume default behaviour if dialect is not available
default:
return Tools.getMappedUDTName(ctx.configuration(), value);
}