[jOOQ/jOOQ#10660] H2 supports SYSTEM_RANGE
This commit is contained in:
parent
279a447536
commit
74c06bf825
@ -41,10 +41,10 @@ import static org.jooq.impl.DSL.inline;
|
||||
// ...
|
||||
import static org.jooq.impl.DSL.one;
|
||||
import static org.jooq.impl.DSL.select;
|
||||
import static org.jooq.impl.DSL.table;
|
||||
import static org.jooq.impl.DSL.unquotedName;
|
||||
import static org.jooq.impl.DSL.withRecursive;
|
||||
import static org.jooq.impl.Names.N_GENERATE_SERIES;
|
||||
import static org.jooq.impl.Names.N_SYSTEM_RANGE;
|
||||
import static org.jooq.impl.SQLDataType.INTEGER;
|
||||
import static org.jooq.impl.Tools.visitSubquery;
|
||||
|
||||
@ -110,6 +110,15 @@ final class GenerateSeries extends AbstractTable<Record1<Integer>> {
|
||||
break;
|
||||
}
|
||||
|
||||
case H2: {
|
||||
if (step == null)
|
||||
ctx.visit(N_SYSTEM_RANGE).sql('(').visit(from).sql(", ").visit(to).sql(')');
|
||||
else
|
||||
ctx.visit(N_SYSTEM_RANGE).sql('(').visit(from).sql(", ").visit(to).sql(", ").visit(step).sql(')');
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -133,13 +142,12 @@ final class GenerateSeries extends AbstractTable<Record1<Integer>> {
|
||||
|
||||
|
||||
|
||||
case H2:
|
||||
case POSTGRES:
|
||||
default: {
|
||||
if (step == null)
|
||||
ctx.visit(table("{generate_series}({0}, {1})", from, to));
|
||||
ctx.visit(N_GENERATE_SERIES).sql('(').visit(from).sql(", ").visit(to).sql(')');
|
||||
else
|
||||
ctx.visit(table("{generate_series}({0}, {1}, {2})", from, to, step));
|
||||
ctx.visit(N_GENERATE_SERIES).sql('(').visit(from).sql(", ").visit(to).sql(", ").visit(step).sql(')');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -230,6 +230,7 @@ final class Names {
|
||||
static final Name N_SUBSTR = unquotedName("substr");
|
||||
static final Name N_SUBSTRING = unquotedName("substring");
|
||||
static final Name N_SYSDATE = unquotedName("sysdate");
|
||||
static final Name N_SYSTEM_RANGE = unquotedName("system_range");
|
||||
static final Name N_SYSTEM_TIME = unquotedName("system_time");
|
||||
static final Name N_T = unquotedName("t");
|
||||
static final Name N_TANH = unquotedName("tanh");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user