Skip to content

Commit

Permalink
[#11323] Add HSQLDB procedural language support
Browse files Browse the repository at this point in the history
This includes:

- [#8230] Add support for RAISE or SIGNAL in the procedural API
- [#6956] Add support HSQLDB CREATE TRIGGER
  • Loading branch information
lukaseder committed Jan 27, 2021
1 parent 5579328 commit 2b0bdf7
Show file tree
Hide file tree
Showing 13 changed files with 278 additions and 10 deletions.
4 changes: 2 additions & 2 deletions jOOQ/src/main/java/org/jooq/DSLContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ public interface DSLContext extends Scope {
* @see DSL#begin(Statement...)
*/
@NotNull
@Support({ FIREBIRD, H2, MARIADB, MYSQL, POSTGRES })
@Support({ FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
Block begin(Statement... statements);

/**
Expand All @@ -883,7 +883,7 @@ public interface DSLContext extends Scope {
* @see DSL#begin(Collection)
*/
@NotNull
@Support({ FIREBIRD, H2, MARIADB, MYSQL, POSTGRES })
@Support({ FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
Block begin(Collection<? extends Statement> statements);


Expand Down
1 change: 1 addition & 0 deletions jOOQ/src/main/java/org/jooq/IfElseStep.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,6 @@






1 change: 1 addition & 0 deletions jOOQ/src/main/java/org/jooq/IfThenStep.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,6 @@






88 changes: 88 additions & 0 deletions jOOQ/src/main/java/org/jooq/SignalSetStep.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Other licenses:
* -----------------------------------------------------------------------------
* Commercial licenses for this work are available. These replace the above
* ASL 2.0 and offer limited warranties, support, maintenance, and commercial
* database integrations.
*
* For more information, please visit: http://www.jooq.org/licenses
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package org.jooq;


















































1 change: 1 addition & 0 deletions jOOQ/src/main/java/org/jooq/Variable.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,5 +115,6 @@






3 changes: 3 additions & 0 deletions jOOQ/src/main/java/org/jooq/impl/BlockImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
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;
// ...
Expand Down Expand Up @@ -472,6 +473,8 @@ private static final void begin(Context<?> ctx) {

if (ctx.family() == MARIADB && toplevel(ctx.data(), DATA_BLOCK_NESTING))
ctx.sql(' ').visit(K_NOT).sql(' ').visit(K_ATOMIC);
else if (ctx.family() == HSQLDB && toplevel(ctx.data(), DATA_BLOCK_NESTING))
ctx.sql(' ').visit(K_ATOMIC);

ctx.formatIndentStart();
}
Expand Down
39 changes: 34 additions & 5 deletions jOOQ/src/main/java/org/jooq/impl/DSL.java
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@
import org.jooq.SelectSelectStep;
import org.jooq.SelectWhereStep;
import org.jooq.Sequence;
// ...
import org.jooq.Statement;
import org.jooq.Stringly;
import org.jooq.Support;
Expand Down Expand Up @@ -11231,7 +11232,7 @@ public static Queries queries(Collection<? extends Query> queries) {
* @see DSLContext#begin(Statement...)
*/
@NotNull
@Support({ FIREBIRD, H2, MARIADB, MYSQL, POSTGRES })
@Support({ FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
public static Block begin(Statement... statements) {
return begin(Arrays.asList(statements));
}
Expand All @@ -11242,7 +11243,7 @@ public static Block begin(Statement... statements) {
* @see DSLContext#begin(Collection)
*/
@NotNull
@Support({ FIREBIRD, H2, MARIADB, MYSQL, POSTGRES })
@Support({ FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
public static Block begin(Collection<? extends Statement> statements) {
return DSL.using(new DefaultConfiguration()).begin(statements);
}
Expand Down Expand Up @@ -17498,7 +17499,7 @@ public static AggregateFunction<BigDecimal> regrSlope(Field<? extends Number> y,
}

/**
* The <code>REGR_S_X_X</code> function.
* The <code>REGR_SXX</code> function.
*/
@NotNull
@Support({ POSTGRES })
Expand All @@ -17507,7 +17508,7 @@ public static AggregateFunction<BigDecimal> regrSXX(Field<? extends Number> y, F
}

/**
* The <code>REGR_S_X_Y</code> function.
* The <code>REGR_SXY</code> function.
*/
@NotNull
@Support({ POSTGRES })
Expand All @@ -17516,7 +17517,7 @@ public static AggregateFunction<BigDecimal> regrSXY(Field<? extends Number> y, F
}

/**
* The <code>REGR_S_Y_Y</code> function.
* The <code>REGR_SYY</code> function.
*/
@NotNull
@Support({ POSTGRES })
Expand Down Expand Up @@ -17562,6 +17563,34 @@ public static AggregateFunction<BigDecimal> varSamp(Field<? extends Number> fiel































/**
* Get the rpad(field, length, character) function.
*
Expand Down
1 change: 1 addition & 0 deletions jOOQ/src/main/java/org/jooq/impl/Keywords.java
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ final class Keywords {
static final Keyword K_MATERIALIZED = keyword("materialized");
static final Keyword K_MAXVALUE = keyword("maxvalue");
static final Keyword K_MERGE_INTO = keyword("merge into");
static final Keyword K_MESSAGE_TEXT = keyword("message_text");
static final Keyword K_MILLISECOND = keyword("millisecond");
static final Keyword K_MINUS = keyword("minus");
static final Keyword K_MINUTE = keyword("minute");
Expand Down
2 changes: 2 additions & 0 deletions jOOQ/src/main/java/org/jooq/impl/ParserImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -5013,6 +5013,8 @@ private final DDLQuery parseDropTable(boolean temporary) {








Expand Down
2 changes: 1 addition & 1 deletion jOOQ/src/main/java/org/jooq/impl/RegrSxx.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@


/**
* The <code>REGR S X X</code> statement.
* The <code>REGR SXX</code> statement.
*/
@SuppressWarnings({ "rawtypes", "unused" })
final class RegrSxx
Expand Down
2 changes: 1 addition & 1 deletion jOOQ/src/main/java/org/jooq/impl/RegrSxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@


/**
* The <code>REGR S X Y</code> statement.
* The <code>REGR SXY</code> statement.
*/
@SuppressWarnings({ "rawtypes", "unused" })
final class RegrSxy
Expand Down
2 changes: 1 addition & 1 deletion jOOQ/src/main/java/org/jooq/impl/RegrSyy.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@


/**
* The <code>REGR S Y Y</code> statement.
* The <code>REGR SYY</code> statement.
*/
@SuppressWarnings({ "rawtypes", "unused" })
final class RegrSyy
Expand Down

0 comments on commit 2b0bdf7

Please sign in to comment.