[jOOQ/jOOQ#10404] Add SQLDialect.ASE_12_5, ASE_15_5, ASE_15_7, ASE_16_0 dialects
This commit is contained in:
parent
fddd51b3fd
commit
5bf67a30c8
@ -610,6 +610,38 @@ public enum SQLDialect {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -67,10 +67,10 @@ final class DefaultInterpreterConnectionProvider implements ConnectionProvider {
|
||||
@NotNull
|
||||
@Override
|
||||
public Connection acquire() throws DataAccessException {
|
||||
SQLDialect dialect = defaultIfNull(configuration.settings().getInterpreterDialect(), DEFAULT);
|
||||
SQLDialect family = defaultIfNull(configuration.settings().getInterpreterDialect(), DEFAULT).family();
|
||||
|
||||
try {
|
||||
switch (dialect) {
|
||||
switch (family) {
|
||||
case DERBY:
|
||||
return DriverManager.getConnection("jdbc:derby:memory:db;create=true");
|
||||
|
||||
@ -86,7 +86,7 @@ final class DefaultInterpreterConnectionProvider implements ConnectionProvider {
|
||||
return DriverManager.getConnection("jdbc:sqlite::memory:");
|
||||
|
||||
default:
|
||||
throw new DataAccessException("Unsupported interpretation dialect: " + dialect);
|
||||
throw new DataAccessException("Unsupported interpretation dialect family: " + family);
|
||||
}
|
||||
}
|
||||
catch (SQLException e) {
|
||||
|
||||
@ -268,6 +268,10 @@ final class Limit extends AbstractQueryPart {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1100,6 +1100,10 @@ final class SelectQueryImpl<R extends Record> extends AbstractResultQuery<R> imp
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -75,7 +75,7 @@ final class SourceMetaProvider implements MetaProvider {
|
||||
}
|
||||
|
||||
SQLDialect dialect = configuration.settings().getInterpreterDialect();
|
||||
switch (defaultIfNull(dialect, DEFAULT)) {
|
||||
switch (defaultIfNull(dialect, DEFAULT).family()) {
|
||||
case DEFAULT:
|
||||
return new InterpreterMetaProvider(configuration, sources).provide();
|
||||
|
||||
|
||||
@ -37,13 +37,23 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.SQLITE;
|
||||
// ...
|
||||
// ...
|
||||
import static org.jooq.impl.Keywords.K_BOTH;
|
||||
import static org.jooq.impl.Keywords.K_FROM;
|
||||
import static org.jooq.impl.Names.N_TRIM;
|
||||
import static org.jooq.impl.SQLDataType.VARCHAR;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import org.jooq.Context;
|
||||
import org.jooq.Field;
|
||||
// ...
|
||||
import org.jooq.SQLDialect;
|
||||
|
||||
/**
|
||||
* @author Lukas Eder
|
||||
@ -53,7 +63,12 @@ final class Trim extends AbstractField<String> {
|
||||
/**
|
||||
* Generated UID
|
||||
*/
|
||||
private static final long serialVersionUID = -7273879239726265322L;
|
||||
private static final long serialVersionUID = -7273879239726265322L;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private final Field<String> argument;
|
||||
private final Field<String> characters;
|
||||
@ -72,48 +87,20 @@ final class Trim extends AbstractField<String> {
|
||||
@Override
|
||||
public final void accept(Context<?> ctx) {
|
||||
if (characters == null) {
|
||||
switch (ctx.dialect()) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
default:
|
||||
ctx.visit(N_TRIM).sql('(').visit(argument).sql(')');
|
||||
break;
|
||||
}
|
||||
ctx.visit(N_TRIM).sql('(').visit(argument).sql(')');
|
||||
}
|
||||
else {
|
||||
switch (ctx.dialect()) {
|
||||
else if (ctx.family() == SQLITE)
|
||||
ctx.visit(N_TRIM).sql('(').visit(argument).sql(", ").visit(characters).sql(')');
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
case SQLITE:
|
||||
ctx.visit(N_TRIM).sql('(').visit(argument).sql(", ").visit(characters).sql(')');
|
||||
break;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
default:
|
||||
ctx.visit(N_TRIM).sql('(').visit(K_BOTH).sql(' ').visit(characters).sql(' ').visit(K_FROM).sql(' ').visit(argument).sql(')');
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
ctx.visit(N_TRIM).sql('(').visit(K_BOTH).sql(' ').visit(characters).sql(' ').visit(K_FROM).sql(' ').visit(argument).sql(')');
|
||||
}
|
||||
}
|
||||
|
||||
@ -175,7 +175,7 @@ public class JDBCUtils {
|
||||
if (majorVersion == 0)
|
||||
return dialect;
|
||||
|
||||
switch (dialect) {
|
||||
switch (dialect.family()) {
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user