diff --git a/jOOQ-meta-extensions/src/main/java/org/jooq/meta/extensions/ddl/DDLDatabase.java b/jOOQ-meta-extensions/src/main/java/org/jooq/meta/extensions/ddl/DDLDatabase.java
index cf93d4012b..791b9d725c 100644
--- a/jOOQ-meta-extensions/src/main/java/org/jooq/meta/extensions/ddl/DDLDatabase.java
+++ b/jOOQ-meta-extensions/src/main/java/org/jooq/meta/extensions/ddl/DDLDatabase.java
@@ -37,6 +37,7 @@
*/
package org.jooq.meta.extensions.ddl;
+// ...
import static org.jooq.conf.SettingsTools.renderLocale;
import static org.jooq.impl.DSL.name;
import static org.jooq.tools.StringUtils.isBlank;
@@ -55,6 +56,7 @@ import org.jooq.Name;
import org.jooq.Name.Quoted;
import org.jooq.Queries;
import org.jooq.Query;
+// ...
import org.jooq.ResultQuery;
import org.jooq.Source;
import org.jooq.VisitContext;
@@ -171,6 +173,12 @@ public class DDLDatabase extends AbstractInterpretingDatabase {
Scanner s = new Scanner(r = source.reader()).useDelimiter("\\A");
Queries queries = ctx.parser().parse(s.hasNext() ? s.next() : "");
+
+
+
+
+
+
for (Query query : queries) {
repeat:
diff --git a/jOOQ/src/main/java/org/jooq/AlterTableStep.java b/jOOQ/src/main/java/org/jooq/AlterTableStep.java
index 5686af6836..653abdfd01 100644
--- a/jOOQ/src/main/java/org/jooq/AlterTableStep.java
+++ b/jOOQ/src/main/java/org/jooq/AlterTableStep.java
@@ -325,7 +325,7 @@ public interface AlterTableStep {
*/
@NotNull @CheckReturnValue
@Support({ FIREBIRD, H2, IGNITE, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
- AlterTableAddStep add(FieldOrConstraint... fields);
+ AlterTableAddStep add(TableElement... fields);
/**
* Add an ADD clause with multiple columns or constraints to
@@ -333,7 +333,7 @@ public interface AlterTableStep {
*/
@NotNull @CheckReturnValue
@Support({ FIREBIRD, H2, IGNITE, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
- AlterTableAddStep add(Collection extends FieldOrConstraint> fields);
+ AlterTableAddStep add(Collection extends TableElement> fields);
/**
* Add an ADD COLUMN clause to the ALTER TABLE
diff --git a/jOOQ/src/main/java/org/jooq/Constraint.java b/jOOQ/src/main/java/org/jooq/Constraint.java
index cbb2c57bec..d56adb1a25 100644
--- a/jOOQ/src/main/java/org/jooq/Constraint.java
+++ b/jOOQ/src/main/java/org/jooq/Constraint.java
@@ -61,6 +61,10 @@ import org.jooq.impl.DSL;
*
* @author Lukas Eder
*/
-public /* non-sealed */ interface Constraint extends FieldOrConstraint {
+public /* non-sealed */ interface Constraint
+extends
+ FieldOrConstraint,
+ TableElement
+{
}
diff --git a/jOOQ/src/main/java/org/jooq/CreateTableAsStep.java b/jOOQ/src/main/java/org/jooq/CreateTableAsStep.java
index e9d1838078..94b5d4f7f9 100644
--- a/jOOQ/src/main/java/org/jooq/CreateTableAsStep.java
+++ b/jOOQ/src/main/java/org/jooq/CreateTableAsStep.java
@@ -37,37 +37,14 @@
*/
package org.jooq;
-// ...
-// ...
-// ...
-// ...
-// ...
-import static org.jooq.SQLDialect.CUBRID;
-// ...
-import static org.jooq.SQLDialect.DERBY;
-// ...
-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.YUGABYTEDB;
+import static org.jooq.SQLDialect.*;
-import org.jetbrains.annotations.NotNull;
+import java.util.*;
+
+import org.jetbrains.annotations.*;
/**
- * A {@link Query} that can create tables.
+ * A step in the construction of the CREATE TABLE statement.
*
*
XYZ*Step types directly from client code@@ -86,15 +63,14 @@ import org.jetbrains.annotations.NotNull; *
AS clause to the CREATE TABLE statement.
+ * Add the AS clause to the CREATE TABLE statement.
*/
- @NotNull @CheckReturnValue
@Support({ CUBRID, DERBY, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE, YUGABYTEDB })
- CreateTableWithDataStep as(Select extends R> select);
+ @NotNull @CheckReturnValue
+ CreateTableWithDataStep as(Select> select);
}
diff --git a/jOOQ/src/main/java/org/jooq/CreateTableColumnStep.java b/jOOQ/src/main/java/org/jooq/CreateTableColumnStep.java
deleted file mode 100644
index 8d720c7cbe..0000000000
--- a/jOOQ/src/main/java/org/jooq/CreateTableColumnStep.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * 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;
-
-import org.jetbrains.annotations.*;
-
-
-import java.util.Collection;
-
-/**
- * A {@link Query} that can create tables.
- * - *
XYZ*Step types directly from client code
- * It is usually not recommended to reference any XYZ*Step types
- * directly from client code, or assign them to local variables. When writing
- * dynamic SQL, creating a statement's components dynamically, and passing them
- * to the DSL API statically is usually a better choice. See the manual's
- * section about dynamic SQL for details: https://www.jooq.org/doc/latest/manual/sql-building/dynamic-sql.
- *
- * Drawbacks of referencing the XYZ*Step types directly:
- *
CREATE TABLE
- * statement.
- *
- * This is the same as calling {@link #column(Field, DataType)} with
- * {@link Field#getDataType()} as the argument data type.
- */
- @NotNull @CheckReturnValue
- @Support
- CreateTableColumnStep column(Field> field);
-
- /**
- * Add a column to the column list of the
- * This is the same as calling {@link #column(Field, DataType)} for each
- * column, with {@link Field#getDataType()} as the argument data type.
- */
- @NotNull @CheckReturnValue
- @Support
- CreateTableColumnStep columns(Field>... fields);
-
- /**
- * Add several columns to the column list of the
- * This is the same as calling {@link #column(Field, DataType)} for each
- * column. Lacking an explicit data type, this makes sense only for a
- *
- * This is the same as calling {@link #column(Field, DataType)} for each
- * column. Lacking an explicit data type, this makes sense only for a
- *
- * This is the same as calling {@link #column(Field, DataType)} for each
- * column, with {@link Field#getDataType()} as the argument data type.
- */
- @NotNull @CheckReturnValue
- @Support
- CreateTableColumnStep columns(Collection extends Field>> fields);
-}
diff --git a/jOOQ/src/main/java/org/jooq/CreateTableCommentStep.java b/jOOQ/src/main/java/org/jooq/CreateTableCommentStep.java
index b6ba7a4694..f3d7043707 100644
--- a/jOOQ/src/main/java/org/jooq/CreateTableCommentStep.java
+++ b/jOOQ/src/main/java/org/jooq/CreateTableCommentStep.java
@@ -37,13 +37,14 @@
*/
package org.jooq;
-import org.jetbrains.annotations.*;
-
-
import static org.jooq.SQLDialect.*;
+import java.util.*;
+
+import org.jetbrains.annotations.*;
+
/**
- * A {@link Query} that can create tables.
+ * A step in the construction of the
*
@@ -62,23 +63,21 @@ import static org.jooq.SQLDialect.*;
*
- *
- * It is usually not recommended to reference any
- * Drawbacks of referencing the
- * This does the same as adding {@link DSL#primaryKey(String...)} via
- * {@link #constraint(Constraint)} explicitly.
- */
- @NotNull @CheckReturnValue
- @Support
- CreateTableConstraintStep primaryKey(String... fields);
-
- /**
- * Convenience method to add an unnamed (system named)
- *
- * This does the same as adding {@link DSL#primaryKey(Name...)} via
- * {@link #constraint(Constraint)} explicitly.
- */
- @NotNull @CheckReturnValue
- @Support
- CreateTableConstraintStep primaryKey(Name... fields);
-
- /**
- * Convenience method to add an unnamed (system named)
- *
- * This does the same as adding {@link DSL#primaryKey(Field...)} via
- * {@link #constraint(Constraint)} explicitly.
- */
- @NotNull @CheckReturnValue
- @Support
- CreateTableConstraintStep primaryKey(Field>... fields);
-
- /**
- * Convenience method to add an unnamed (system named)
- *
- * This does the same as adding {@link DSL#primaryKey(Field...)} via
- * {@link #constraint(Constraint)} explicitly.
- */
- @NotNull @CheckReturnValue
- @Support
- CreateTableConstraintStep primaryKey(Collection extends Field>> fields);
-
- /**
- * Convenience method to add an unnamed (system named)
- * This does the same as adding {@link DSL#unique(String...)} via
- * {@link #constraint(Constraint)} explicitly.
- */
- @NotNull @CheckReturnValue
- @Support
- CreateTableConstraintStep unique(String... fields);
-
- /**
- * Convenience method to add an unnamed (system named)
- * This does the same as adding {@link DSL#unique(Name...)} via
- * {@link #constraint(Constraint)} explicitly.
- */
- @NotNull @CheckReturnValue
- @Support
- CreateTableConstraintStep unique(Name... fields);
-
- /**
- * Convenience method to add an unnamed (system named)
- * This does the same as adding {@link DSL#unique(Field...)} via
- * {@link #constraint(Constraint)} explicitly.
- */
- @NotNull @CheckReturnValue
- @Support
- CreateTableConstraintStep unique(Field>... fields);
-
- /**
- * Convenience method to add an unnamed (system named)
- * This does the same as adding {@link DSL#unique(Field...)} via
- * {@link #constraint(Constraint)} explicitly.
- */
- @NotNull @CheckReturnValue
- @Support
- CreateTableConstraintStep unique(Collection extends Field>> fields);
-
- /**
- * Convenience method to add an unnamed (system named)
- * This does the same as adding {@link DSL#check(Condition)} via
- * {@link #constraint(Constraint)} explicitly.
- */
- @NotNull @CheckReturnValue
- @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE, YUGABYTEDB })
- CreateTableConstraintStep check(Condition condition);
-}
diff --git a/jOOQ/src/main/java/org/jooq/CreateTableElementListStep.java b/jOOQ/src/main/java/org/jooq/CreateTableElementListStep.java
new file mode 100644
index 0000000000..42ea316ba2
--- /dev/null
+++ b/jOOQ/src/main/java/org/jooq/CreateTableElementListStep.java
@@ -0,0 +1,244 @@
+/*
+ * 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;
+
+import static org.jooq.SQLDialect.*;
+
+import java.util.*;
+
+import org.jetbrains.annotations.*;
+
+/**
+ * A step in the construction of the
+ *
+ * It is usually not recommended to reference any
+ * Drawbacks of referencing the
+ * @deprecated - [#11329] - 3.15.0 - This type will be removed in the future. Do not reference it directly
*
*
@@ -58,11 +65,8 @@ package org.jooq;
*
- *
- * It is usually not recommended to reference any
- * Drawbacks of referencing the
*
@@ -67,44 +63,28 @@ import org.jooq.impl.DSL;
*
- * This clause will only be rendered when used with a
- *
- * This clause will only be rendered when used with a
- *
- * This clause will only be rendered when used with a
- *
*
@@ -62,156 +63,47 @@ import org.jooq.impl.DSL;
*
- * Storage clauses will always be appended to the end of everything
- * else that jOOQ renders, including possibly other storage clauses, such as
- * {@link CreateTableOnCommitStep#onCommitDeleteRows()} or similar clauses.
- * If custom storage clauses should be mixed with jOOQ-provided storage
- * clauses, it is recommended not to use the jOOQ API and use the custom
- * clause API for all storage clauses instead.
- *
- * Storage clauses will be separated from previous elements by a separator
- * (whitespace or newline) to ensure syntactic integrity.
- *
- * Example usage:
- *
- *
- * NOTE: When inserting plain SQL into jOOQ objects, you must
- * guarantee syntax integrity. You may also create the possibility of
- * malicious SQL injection. Be sure to properly use bind variables and/or
- * escape literals when concatenated into SQL clauses! One way to escape
- * literals is to use {@link DSL#name(String...)} and similar methods
+ * Add the
- * Storage clauses will always be appended to the end of everything
- * else that jOOQ renders, including possibly other storage clauses, such as
- * {@link CreateTableOnCommitStep#onCommitDeleteRows()} or similar clauses.
- * If custom storage clauses should be mixed with jOOQ-provided storage
- * clauses, it is recommended not to use the jOOQ API and use the custom
- * clause API for all storage clauses instead.
- *
- * Storage clauses will be separated from previous elements by a separator
- * (whitespace or newline) to ensure syntactic integrity.
- *
- * Example usage:
- *
- *
- * NOTE: When inserting plain SQL into jOOQ objects, you must
- * guarantee syntax integrity. You may also create the possibility of
- * malicious SQL injection. Be sure to properly use bind variables and/or
- * escape literals when concatenated into SQL clauses! One way to escape
- * literals is to use {@link DSL#name(String...)} and similar methods
+ * Add the
- * Storage clauses will always be appended to the end of everything
- * else that jOOQ renders, including possibly other storage clauses, such as
- * {@link CreateTableOnCommitStep#onCommitDeleteRows()} or similar clauses.
- * If custom storage clauses should be mixed with jOOQ-provided storage
- * clauses, it is recommended not to use the jOOQ API and use the custom
- * clause API for all storage clauses instead.
- *
- * Storage clauses will be separated from previous elements by a separator
- * (whitespace or newline) to ensure syntactic integrity.
- *
- * Example usage:
- *
- *
- * NOTE: When inserting plain SQL into jOOQ objects, you must
- * guarantee syntax integrity. You may also create the possibility of
- * malicious SQL injection. Be sure to properly use bind variables and/or
- * escape literals when concatenated into SQL clauses! One way to escape
- * literals is to use {@link DSL#name(String...)} and similar methods
+ * Add the
- * Storage clauses will always be appended to the end of everything
- * else that jOOQ renders, including possibly other storage clauses, such as
- * {@link CreateTableOnCommitStep#onCommitDeleteRows()} or similar clauses.
- * If custom storage clauses should be mixed with jOOQ-provided storage
- * clauses, it is recommended not to use the jOOQ API and use the custom
- * clause API for all storage clauses instead.
- *
- * Storage clauses will be separated from previous elements by a separator
- * (whitespace or newline) to ensure syntactic integrity.
- *
- * Example usage:
- *
- *
- * NOTE: When inserting plain SQL into jOOQ objects, you must
- * guarantee syntax integrity. You may also create the possibility of
- * malicious SQL injection. Be sure to properly use bind variables and/or
- * escape literals when concatenated into SQL clauses! One way to escape
- * literals is to use {@link DSL#name(String...)} and similar methods
+ * Add the
*
@@ -86,22 +63,21 @@ import org.jetbrains.annotations.NotNull;
*
+ * This is useful for DDL statements.
+ *
+ * Instances of this type cannot be created directly, only of its subtypes.
+ *
+ * @author Lukas Eder
+ */
+public /* sealed */ interface TableElement
+extends
+ Named
+/* permits
+ FieldOrConstraint,
+ Field,
+ Constraint,
+ Index */
+{
+
+}
diff --git a/jOOQ/src/main/java/org/jooq/TableOptions.java b/jOOQ/src/main/java/org/jooq/TableOptions.java
index 1497739db9..c7aae521f1 100644
--- a/jOOQ/src/main/java/org/jooq/TableOptions.java
+++ b/jOOQ/src/main/java/org/jooq/TableOptions.java
@@ -40,9 +40,14 @@ package org.jooq;
// ...
// ...
import static org.jooq.SQLDialect.POSTGRES;
+import static org.jooq.TableOptions.OnCommit.DELETE_ROWS;
+import static org.jooq.TableOptions.OnCommit.DROP;
+import static org.jooq.TableOptions.OnCommit.PRESERVE_ROWS;
import java.io.Serializable;
+import org.jooq.impl.QOM.TableCommitAction;
+
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -141,6 +146,22 @@ public final class TableOptions implements Serializable {
return new TableOptions(onCommit);
}
+ /**
+ * Create a new {@link TableOptions} object for a {@link TableType#TEMPORARY}.
+ */
+ @NotNull
+ public static final TableOptions temporaryTable(TableCommitAction onCommit) {
+ if (onCommit == null)
+ return new TableOptions((OnCommit) null);
+
+ switch (onCommit) {
+ case DELETE_ROWS: return temporaryTable(DELETE_ROWS);
+ case PRESERVE_ROWS: return temporaryTable(PRESERVE_ROWS);
+ case DROP: return temporaryTable(DROP);
+ default: throw new IllegalArgumentException("TableCommitAction not supported: " + onCommit);
+ }
+ }
+
/**
* Create a new {@link TableOptions} object for a {@link TableType#VIEW} of
* unknown content.
diff --git a/jOOQ/src/main/java/org/jooq/impl/AbstractNamed.java b/jOOQ/src/main/java/org/jooq/impl/AbstractNamed.java
index b125218a5e..2c9c0638b1 100644
--- a/jOOQ/src/main/java/org/jooq/impl/AbstractNamed.java
+++ b/jOOQ/src/main/java/org/jooq/impl/AbstractNamed.java
@@ -39,7 +39,6 @@
package org.jooq.impl;
import static org.jooq.impl.AbstractName.NO_NAME;
-import static org.jooq.impl.Tools.findAny;
import java.util.ArrayList;
import java.util.List;
diff --git a/jOOQ/src/main/java/org/jooq/impl/AlterTableImpl.java b/jOOQ/src/main/java/org/jooq/impl/AlterTableImpl.java
index 509017eda5..3b15472212 100644
--- a/jOOQ/src/main/java/org/jooq/impl/AlterTableImpl.java
+++ b/jOOQ/src/main/java/org/jooq/impl/AlterTableImpl.java
@@ -199,6 +199,7 @@ import org.jooq.Record1;
import org.jooq.SQLDialect;
import org.jooq.Select;
import org.jooq.Table;
+import org.jooq.TableElement;
// ...
import org.jooq.impl.QOM.Cascade;
import org.jooq.impl.QOM.UNotYetImplemented;
@@ -223,18 +224,18 @@ implements
UNotYetImplemented
{
- private static final Clause[] CLAUSES = { ALTER_TABLE };
- private static final Set
+ * Unlike statement construction methods in the {@link DSLContext} API, this
+ * creates an unattached, and thus not directly renderable or executable
+ * statement. It can be used as a subquery or nested in procedural logic.
+ *
+ * @see DSLContext#createTable(String)
+ */
+ @NotNull @CheckReturnValue
+ @Support
+ public static org.jooq.CreateTableElementListStep createTable(@Stringly.Name String table) {
+ return dsl().createTable(table);
+ }
+
+ /**
+ * The
+ * Unlike statement construction methods in the {@link DSLContext} API, this
+ * creates an unattached, and thus not directly renderable or executable
+ * statement. It can be used as a subquery or nested in procedural logic.
+ *
+ * @see DSLContext#createTable(Name)
+ */
+ @NotNull @CheckReturnValue
+ @Support
+ public static org.jooq.CreateTableElementListStep createTable(Name table) {
+ return dsl().createTable(table);
+ }
+
+ /**
+ * The
+ * Unlike statement construction methods in the {@link DSLContext} API, this
+ * creates an unattached, and thus not directly renderable or executable
+ * statement. It can be used as a subquery or nested in procedural logic.
+ *
+ * @see DSLContext#createTable(Table)
+ */
+ @NotNull @CheckReturnValue
+ @Support
+ public static org.jooq.CreateTableElementListStep createTable(Table> table) {
+ return dsl().createTable(table);
+ }
+
+ /**
+ * The
+ * Unlike statement construction methods in the {@link DSLContext} API, this
+ * creates an unattached, and thus not directly renderable or executable
+ * statement. It can be used as a subquery or nested in procedural logic.
+ *
+ * @see DSLContext#createTableIfNotExists(String)
+ */
+ @NotNull @CheckReturnValue
+ @Support({ FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES, SQLITE, YUGABYTEDB })
+ public static org.jooq.CreateTableElementListStep createTableIfNotExists(@Stringly.Name String table) {
+ return dsl().createTableIfNotExists(table);
+ }
+
+ /**
+ * The
+ * Unlike statement construction methods in the {@link DSLContext} API, this
+ * creates an unattached, and thus not directly renderable or executable
+ * statement. It can be used as a subquery or nested in procedural logic.
+ *
+ * @see DSLContext#createTableIfNotExists(Name)
+ */
+ @NotNull @CheckReturnValue
+ @Support({ FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES, SQLITE, YUGABYTEDB })
+ public static org.jooq.CreateTableElementListStep createTableIfNotExists(Name table) {
+ return dsl().createTableIfNotExists(table);
+ }
+
+ /**
+ * The
+ * Unlike statement construction methods in the {@link DSLContext} API, this
+ * creates an unattached, and thus not directly renderable or executable
+ * statement. It can be used as a subquery or nested in procedural logic.
+ *
+ * @see DSLContext#createTableIfNotExists(Table)
+ */
+ @NotNull @CheckReturnValue
+ @Support({ FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES, SQLITE, YUGABYTEDB })
+ public static org.jooq.CreateTableElementListStep createTableIfNotExists(Table> table) {
+ return dsl().createTableIfNotExists(table);
+ }
+
+ /**
+ * The
+ * Unlike statement construction methods in the {@link DSLContext} API, this
+ * creates an unattached, and thus not directly renderable or executable
+ * statement. It can be used as a subquery or nested in procedural logic.
+ *
+ * @see DSLContext#createTemporaryTable(String)
+ */
+ @NotNull @CheckReturnValue
+ @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
+ public static org.jooq.CreateTableElementListStep createTemporaryTable(@Stringly.Name String table) {
+ return dsl().createTemporaryTable(table);
+ }
+
+ /**
+ * The
+ * Unlike statement construction methods in the {@link DSLContext} API, this
+ * creates an unattached, and thus not directly renderable or executable
+ * statement. It can be used as a subquery or nested in procedural logic.
+ *
+ * @see DSLContext#createTemporaryTable(Name)
+ */
+ @NotNull @CheckReturnValue
+ @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
+ public static org.jooq.CreateTableElementListStep createTemporaryTable(Name table) {
+ return dsl().createTemporaryTable(table);
+ }
+
+ /**
+ * The
+ * Unlike statement construction methods in the {@link DSLContext} API, this
+ * creates an unattached, and thus not directly renderable or executable
+ * statement. It can be used as a subquery or nested in procedural logic.
+ *
+ * @see DSLContext#createTemporaryTable(Table)
+ */
+ @NotNull @CheckReturnValue
+ @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
+ public static org.jooq.CreateTableElementListStep createTemporaryTable(Table> table) {
+ return dsl().createTemporaryTable(table);
+ }
+
+ /**
+ * The
+ * Unlike statement construction methods in the {@link DSLContext} API, this
+ * creates an unattached, and thus not directly renderable or executable
+ * statement. It can be used as a subquery or nested in procedural logic.
+ *
+ * @see DSLContext#createTemporaryTableIfNotExists(String)
+ */
+ @NotNull @CheckReturnValue
+ @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
+ public static org.jooq.CreateTableElementListStep createTemporaryTableIfNotExists(@Stringly.Name String table) {
+ return dsl().createTemporaryTableIfNotExists(table);
+ }
+
+ /**
+ * The
+ * Unlike statement construction methods in the {@link DSLContext} API, this
+ * creates an unattached, and thus not directly renderable or executable
+ * statement. It can be used as a subquery or nested in procedural logic.
+ *
+ * @see DSLContext#createTemporaryTableIfNotExists(Name)
+ */
+ @NotNull @CheckReturnValue
+ @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
+ public static org.jooq.CreateTableElementListStep createTemporaryTableIfNotExists(Name table) {
+ return dsl().createTemporaryTableIfNotExists(table);
+ }
+
+ /**
+ * The
+ * Unlike statement construction methods in the {@link DSLContext} API, this
+ * creates an unattached, and thus not directly renderable or executable
+ * statement. It can be used as a subquery or nested in procedural logic.
+ *
+ * @see DSLContext#createTemporaryTableIfNotExists(Table)
+ */
+ @NotNull @CheckReturnValue
+ @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
+ public static org.jooq.CreateTableElementListStep createTemporaryTableIfNotExists(Table> table) {
+ return dsl().createTemporaryTableIfNotExists(table);
+ }
+
+ /**
+ * The
+ * Unlike statement construction methods in the {@link DSLContext} API, this
+ * creates an unattached, and thus not directly renderable or executable
+ * statement. It can be used as a subquery or nested in procedural logic.
+ *
+ * @see DSLContext#createGlobalTemporaryTable(String)
+ */
+ @NotNull @CheckReturnValue
+ @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
+ public static org.jooq.CreateTableElementListStep createGlobalTemporaryTable(@Stringly.Name String table) {
+ return dsl().createGlobalTemporaryTable(table);
+ }
+
+ /**
+ * The
+ * Unlike statement construction methods in the {@link DSLContext} API, this
+ * creates an unattached, and thus not directly renderable or executable
+ * statement. It can be used as a subquery or nested in procedural logic.
+ *
+ * @see DSLContext#createGlobalTemporaryTable(Name)
+ */
+ @NotNull @CheckReturnValue
+ @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
+ public static org.jooq.CreateTableElementListStep createGlobalTemporaryTable(Name table) {
+ return dsl().createGlobalTemporaryTable(table);
+ }
+
+ /**
+ * The
+ * Unlike statement construction methods in the {@link DSLContext} API, this
+ * creates an unattached, and thus not directly renderable or executable
+ * statement. It can be used as a subquery or nested in procedural logic.
+ *
+ * @see DSLContext#createGlobalTemporaryTable(Table)
+ */
+ @NotNull @CheckReturnValue
+ @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
+ public static org.jooq.CreateTableElementListStep createGlobalTemporaryTable(Table> table) {
+ return dsl().createGlobalTemporaryTable(table);
+ }
+
+ /**
+ * The
+ * Unlike statement construction methods in the {@link DSLContext} API, this
+ * creates an unattached, and thus not directly renderable or executable
+ * statement. It can be used as a subquery or nested in procedural logic.
+ *
+ * @see DSLContext#createGlobalTemporaryTableIfNotExists(String)
+ */
+ @NotNull @CheckReturnValue
+ @Support({ FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES, SQLITE, YUGABYTEDB })
+ public static org.jooq.CreateTableElementListStep createGlobalTemporaryTableIfNotExists(@Stringly.Name String table) {
+ return dsl().createGlobalTemporaryTableIfNotExists(table);
+ }
+
+ /**
+ * The
+ * Unlike statement construction methods in the {@link DSLContext} API, this
+ * creates an unattached, and thus not directly renderable or executable
+ * statement. It can be used as a subquery or nested in procedural logic.
+ *
+ * @see DSLContext#createGlobalTemporaryTableIfNotExists(Name)
+ */
+ @NotNull @CheckReturnValue
+ @Support({ FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES, SQLITE, YUGABYTEDB })
+ public static org.jooq.CreateTableElementListStep createGlobalTemporaryTableIfNotExists(Name table) {
+ return dsl().createGlobalTemporaryTableIfNotExists(table);
+ }
+
+ /**
+ * The
+ * Unlike statement construction methods in the {@link DSLContext} API, this
+ * creates an unattached, and thus not directly renderable or executable
+ * statement. It can be used as a subquery or nested in procedural logic.
+ *
+ * @see DSLContext#createGlobalTemporaryTableIfNotExists(Table)
+ */
+ @NotNull @CheckReturnValue
+ @Support({ FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES, SQLITE, YUGABYTEDB })
+ public static org.jooq.CreateTableElementListStep createGlobalTemporaryTableIfNotExists(Table> table) {
+ return dsl().createGlobalTemporaryTableIfNotExists(table);
+ }
+
+
+
+
+
@@ -9950,171 +10223,6 @@ public class DSL {
-
- /**
- * Create a new DSL
+ * Specify whether a table created from a subquery should include the subquery's data.
+ */
+ public enum WithOrWithoutData {
+ WITH_DATA(keyword("with data")),
+ WITH_NO_DATA(keyword("with no data")),
+ ;
+
+ final Keyword keyword;
+
+ private WithOrWithoutData(Keyword keyword) {
+ this.keyword = keyword;
+ }
+ }
+
+ /**
+ * The
+ * Specify the action to be taken on temporary tables when committing.
+ */
+ public enum TableCommitAction {
+ DELETE_ROWS(keyword("delete rows")),
+ PRESERVE_ROWS(keyword("preserve rows")),
+ DROP(keyword("drop")),
+ ;
+
+ final Keyword keyword;
+
+ private TableCommitAction(Keyword keyword) {
+ this.keyword = keyword;
+ }
+ }
+
CREATE TABLE statement.
- */
- @NotNull @CheckReturnValue
- @Support
- CREATE TABLE statement.
- */
- @NotNull @CheckReturnValue
- @Support
- CreateTableColumnStep column(Name field, DataType> type);
-
- /**
- * Add a column to the column list of the CREATE TABLE statement.
- */
- @NotNull @CheckReturnValue
- @Support
- CreateTableColumnStep column(String field, DataType> type);
-
- /**
- * Add several columns to the column list of the CREATE TABLE
- * statement.
- * CREATE TABLE
- * statement.
- * CREATE TABLE AS SELECT... statement.
- */
- @NotNull @CheckReturnValue
- @Support
- CreateTableColumnStep columns(Name... fields);
-
- /**
- * Add several columns to the column list of the CREATE TABLE
- * statement.
- * CREATE TABLE AS SELECT... statement.
- */
- @NotNull @CheckReturnValue
- @Support
- CreateTableColumnStep columns(String... fields);
-
- /**
- * Add several columns to the column list of the CREATE TABLE
- * statement.
- * CREATE TABLE statement.
* Referencing
* XYZ*Step types directly from client codeCOMMENT clause to the CREATE TABLE statement.
*/
- @NotNull @CheckReturnValue
@Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
- CreateTableStorageStep comment(String comment);
+ @NotNull @CheckReturnValue
+ CreateTableStorageStep comment(@Stringly.Comment String comment);
/**
- * Add a comment to the table.
+ * Add the COMMENT clause to the CREATE TABLE statement.
*/
- @NotNull @CheckReturnValue
@Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
+ @NotNull @CheckReturnValue
CreateTableStorageStep comment(Comment comment);
-
}
diff --git a/jOOQ/src/main/java/org/jooq/CreateTableConstraintStep.java b/jOOQ/src/main/java/org/jooq/CreateTableConstraintStep.java
deleted file mode 100644
index 50951ac4ae..0000000000
--- a/jOOQ/src/main/java/org/jooq/CreateTableConstraintStep.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
- * 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;
-
-import org.jooq.impl.DSL;
-
-import org.jetbrains.annotations.*;
-
-// ...
-// ...
-// ...
-// ...
-import static org.jooq.SQLDialect.CUBRID;
-// ...
-import static org.jooq.SQLDialect.DERBY;
-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.YUGABYTEDB;
-
-import java.util.Collection;
-
-/**
- * A {@link Query} that can create tables.
- * Referencing
- * XYZ*Step types directly from client codeXYZ*Step types
- * directly from client code, or assign them to local variables. When writing
- * dynamic SQL, creating a statement's components dynamically, and passing them
- * to the DSL API statically is usually a better choice. See the manual's
- * section about dynamic SQL for details: https://www.jooq.org/doc/latest/manual/sql-building/dynamic-sql.
- * XYZ*Step types directly:
- *
- *
- *
- * @author Lukas Eder
- */
-public interface CreateTableConstraintStep extends CreateTableIndexStep {
-
- /**
- * Add a constraint to the table.
- */
- @NotNull @CheckReturnValue
- @Support
- CreateTableConstraintStep constraint(Constraint constraint);
-
- /**
- * Add constraints to the table.
- */
- @NotNull @CheckReturnValue
- @Support
- CreateTableConstraintStep constraints(Constraint... constraints);
-
- /**
- * Add constraints to the table.
- */
- @NotNull @CheckReturnValue
- @Support
- CreateTableConstraintStep constraints(Collection extends Constraint> constraints);
-
- /**
- * Convenience method to add an unnamed (system named)
- * PRIMARY KEY constraint to the table.
- * PRIMARY KEY constraint to the table.
- * PRIMARY KEY constraint to the table.
- * PRIMARY KEY constraint to the table.
- * UNIQUE
- * constraint to the table.
- * UNIQUE
- * constraint to the table.
- * UNIQUE
- * constraint to the table.
- * UNIQUE
- * constraint to the table.
- * CHECK
- * constraint to the table.
- * CREATE TABLE statement.
+ * Referencing
+ * XYZ*Step types directly from client codeXYZ*Step types
+ * directly from client code, or assign them to local variables. When writing
+ * dynamic SQL, creating a statement's components dynamically, and passing them
+ * to the DSL API statically is usually a better choice. See the manual's
+ * section about dynamic SQL for details: https://www.jooq.org/doc/latest/manual/sql-building/dynamic-sql.
+ * XYZ*Step types directly:
+ *
+ *
+ */
+@SuppressWarnings({ "unused" })
+public interface CreateTableElementListStep extends CreateTableAsStep {
+
+ /**
+ * Add the TABLE ELEMENTS clause to the CREATE TABLE statement.
+ */
+ @Support
+ @NotNull @CheckReturnValue
+ CreateTableElementListStep tableElements(TableElement... tableElements);
+
+ /**
+ * Add the TABLE ELEMENTS clause to the CREATE TABLE statement.
+ */
+ @Support
+ @NotNull @CheckReturnValue
+ CreateTableElementListStep tableElements(Collection extends TableElement> tableElements);
+
+ /**
+ * Add the COLUMNS clause to the CREATE TABLE statement.
+ */
+ @Support
+ @NotNull @CheckReturnValue
+ CreateTableElementListStep columns(String... columns);
+
+ /**
+ * Add the COLUMNS clause to the CREATE TABLE statement.
+ */
+ @Support
+ @NotNull @CheckReturnValue
+ CreateTableElementListStep columns(Name... columns);
+
+ /**
+ * Add the COLUMNS clause to the CREATE TABLE statement.
+ */
+ @Support
+ @NotNull @CheckReturnValue
+ CreateTableElementListStep columns(Field>... columns);
+
+ /**
+ * Add the COLUMNS clause to the CREATE TABLE statement.
+ */
+ @Support
+ @NotNull @CheckReturnValue
+ CreateTableElementListStep columns(Collection extends Field>> columns);
+
+ /**
+ * Add the COLUMN clause to the CREATE TABLE statement.
+ */
+ @Support
+ @NotNull @CheckReturnValue
+ CreateTableElementListStep column(Field> column);
+
+ /**
+ * Add the COLUMN clause to the CREATE TABLE statement.
+ */
+ @Support
+ @NotNull @CheckReturnValue
+ CreateTableElementListStep column(@Stringly.Name String field, DataType> type);
+
+ /**
+ * Add the COLUMN clause to the CREATE TABLE statement.
+ */
+ @Support
+ @NotNull @CheckReturnValue
+ CreateTableElementListStep column(Name field, DataType> type);
+
+ /**
+ * Add the COLUMN clause to the CREATE TABLE statement.
+ */
+ @Support
+ @NotNull @CheckReturnValue
+ CreateTableElementListStep column(Field> field, DataType> type);
+
+ /**
+ * Add the CONSTRAINTS clause to the CREATE TABLE statement.
+ */
+ @Support
+ @NotNull @CheckReturnValue
+ CreateTableElementListStep constraints(Constraint... constraints);
+
+ /**
+ * Add the CONSTRAINTS clause to the CREATE TABLE statement.
+ */
+ @Support
+ @NotNull @CheckReturnValue
+ CreateTableElementListStep constraints(Collection extends Constraint> constraints);
+
+ /**
+ * Add the CONSTRAINT clause to the CREATE TABLE statement.
+ */
+ @Support
+ @NotNull @CheckReturnValue
+ CreateTableElementListStep constraint(Constraint constraint);
+
+ /**
+ * Add the PRIMARY KEY clause to the CREATE TABLE statement.
+ */
+ @Support
+ @NotNull @CheckReturnValue
+ CreateTableElementListStep primaryKey(String... fields);
+
+ /**
+ * Add the PRIMARY KEY clause to the CREATE TABLE statement.
+ */
+ @Support
+ @NotNull @CheckReturnValue
+ CreateTableElementListStep primaryKey(Name... fields);
+
+ /**
+ * Add the PRIMARY KEY clause to the CREATE TABLE statement.
+ */
+ @Support
+ @NotNull @CheckReturnValue
+ CreateTableElementListStep primaryKey(Field>... fields);
+
+ /**
+ * Add the PRIMARY KEY clause to the CREATE TABLE statement.
+ */
+ @Support
+ @NotNull @CheckReturnValue
+ CreateTableElementListStep primaryKey(Collection extends Field>> fields);
+
+ /**
+ * Add the UNIQUE clause to the CREATE TABLE statement.
+ */
+ @Support
+ @NotNull @CheckReturnValue
+ CreateTableElementListStep unique(String... fields);
+
+ /**
+ * Add the UNIQUE clause to the CREATE TABLE statement.
+ */
+ @Support
+ @NotNull @CheckReturnValue
+ CreateTableElementListStep unique(Name... fields);
+
+ /**
+ * Add the UNIQUE clause to the CREATE TABLE statement.
+ */
+ @Support
+ @NotNull @CheckReturnValue
+ CreateTableElementListStep unique(Field>... fields);
+
+ /**
+ * Add the UNIQUE clause to the CREATE TABLE statement.
+ */
+ @Support
+ @NotNull @CheckReturnValue
+ CreateTableElementListStep unique(Collection extends Field>> fields);
+
+ /**
+ * Add the CHECK clause to the CREATE TABLE statement.
+ */
+ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE, YUGABYTEDB })
+ @NotNull @CheckReturnValue
+ CreateTableElementListStep check(Condition condition);
+
+ /**
+ * Add the INDEXES clause to the CREATE TABLE statement.
+ */
+ @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
+ @NotNull @CheckReturnValue
+ CreateTableElementListStep indexes(Index... indexes);
+
+ /**
+ * Add the INDEXES clause to the CREATE TABLE statement.
+ */
+ @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
+ @NotNull @CheckReturnValue
+ CreateTableElementListStep indexes(Collection extends Index> indexes);
+
+ /**
+ * Add the INDEX clause to the CREATE TABLE statement.
+ */
+ @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
+ @NotNull @CheckReturnValue
+ CreateTableElementListStep index(Index index);
+}
diff --git a/jOOQ/src/main/java/org/jooq/CreateTableFinalStep.java b/jOOQ/src/main/java/org/jooq/CreateTableFinalStep.java
index e16b1586d9..a5c3d05da5 100644
--- a/jOOQ/src/main/java/org/jooq/CreateTableFinalStep.java
+++ b/jOOQ/src/main/java/org/jooq/CreateTableFinalStep.java
@@ -37,9 +37,16 @@
*/
package org.jooq;
+import static org.jooq.SQLDialect.*;
+
+import java.util.*;
+
+import org.jetbrains.annotations.*;
/**
- * A {@link Query} that can create tables.
+ * A step in the construction of the CREATE TABLE statement.
+ * Referencing
* XYZ*Step types directly from client codeReferencing
- * XYZ*Step types directly from client codeXYZ*Step types
- * directly from client code, or assign them to local variables. When writing
- * dynamic SQL, creating a statement's components dynamically, and passing them
- * to the DSL API statically is usually a better choice. See the manual's
- * section about dynamic SQL for details: https://www.jooq.org/doc/latest/manual/sql-building/dynamic-sql.
- * XYZ*Step types directly:
- *
- *
- *
- * @author Lukas Eder
- */
-public interface CreateTableIndexStep extends CreateTableOnCommitStep {
-
- /**
- * Add an index to the table.
- */
- @NotNull @CheckReturnValue
- @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
- CreateTableIndexStep index(Index index);
-
- /**
- * Add indexes to the table.
- */
- @NotNull @CheckReturnValue
- @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
- CreateTableIndexStep indexes(Index... indexes);
-
- /**
- * Add indexes to the table.
- */
- @NotNull @CheckReturnValue
- @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
- CreateTableIndexStep indexes(Collection extends Index> indexes);
-}
diff --git a/jOOQ/src/main/java/org/jooq/CreateTableOnCommitStep.java b/jOOQ/src/main/java/org/jooq/CreateTableOnCommitStep.java
index b45c16b434..21f41ea64d 100644
--- a/jOOQ/src/main/java/org/jooq/CreateTableOnCommitStep.java
+++ b/jOOQ/src/main/java/org/jooq/CreateTableOnCommitStep.java
@@ -37,18 +37,14 @@
*/
package org.jooq;
+import static org.jooq.SQLDialect.*;
+
+import java.util.*;
+
import org.jetbrains.annotations.*;
-
-// ...
-// ...
-import static org.jooq.SQLDialect.POSTGRES;
-import static org.jooq.SQLDialect.YUGABYTEDB;
-
-import org.jooq.impl.DSL;
-
/**
- * A {@link Query} that can create tables.
+ * A step in the construction of the CREATE TABLE statement.
* Referencing
* XYZ*Step types directly from client codeON COMMIT DELETE ROWS clause.
- * GLOBAL TEMPORARY TABLE
- *
- * @see DSL#createGlobalTemporaryTable(Table)
+ * Add the ON COMMIT DELETE ROWS clause to the CREATE TABLE statement.
*/
- @NotNull @CheckReturnValue
@Support({ POSTGRES, YUGABYTEDB })
+ @NotNull @CheckReturnValue
CreateTableCommentStep onCommitDeleteRows();
/**
- * Add an ON COMMIT PRESERVE ROWS clause.
- * GLOBAL TEMPORARY TABLE
- *
- * @see DSL#createGlobalTemporaryTable(Table)
+ * Add the ON COMMIT PRESERVE ROWS clause to the CREATE TABLE statement.
*/
- @NotNull @CheckReturnValue
@Support({ POSTGRES, YUGABYTEDB })
+ @NotNull @CheckReturnValue
CreateTableCommentStep onCommitPreserveRows();
/**
- * Add an ON COMMIT DROP clause.
- * GLOBAL TEMPORARY TABLE
- *
- * @see DSL#createGlobalTemporaryTable(Table)
+ * Add the ON COMMIT DROP clause to the CREATE TABLE statement.
*/
- @NotNull @CheckReturnValue
@Support({ POSTGRES, YUGABYTEDB })
+ @NotNull @CheckReturnValue
CreateTableCommentStep onCommitDrop();
}
diff --git a/jOOQ/src/main/java/org/jooq/CreateTableStorageStep.java b/jOOQ/src/main/java/org/jooq/CreateTableStorageStep.java
index 537d05b684..eae8547805 100644
--- a/jOOQ/src/main/java/org/jooq/CreateTableStorageStep.java
+++ b/jOOQ/src/main/java/org/jooq/CreateTableStorageStep.java
@@ -37,13 +37,14 @@
*/
package org.jooq;
+import static org.jooq.SQLDialect.*;
+
+import java.util.*;
+
import org.jetbrains.annotations.*;
-
-import org.jooq.impl.DSL;
-
/**
- * A {@link Query} that can create tables.
+ * A step in the construction of the CREATE TABLE statement.
* Referencing
* XYZ*Step types directly from client codeCREATE TABLE statement.
- *
- *
- * DSL.using(configuration)
- * .createTable("t")
- * .column(field("i", SQLDataType.INTEGER))
- * .storage("TABLESPACE my_tablespace")
- * .execute();
- * STORAGE clause to the CREATE TABLE statement.
*
- * @param sql The SQL
+ * @see SQL
*/
- @NotNull @CheckReturnValue
@Support
@PlainSQL
- CreateTableFinalStep storage(SQL sql);
+ @NotNull @CheckReturnValue
+ CreateTableFinalStep storage(SQL storage);
/**
- * Add vendor-specific storage clauses to the CREATE TABLE statement.
- *
- *
- * DSL.using(configuration)
- * .createTable("t")
- * .column(field("i", SQLDataType.INTEGER))
- * .storage("TABLESPACE my_tablespace")
- * .execute();
- * STORAGE clause to the CREATE TABLE statement.
*
- * @param sql The SQL
+ * @see SQL
*/
- @NotNull @CheckReturnValue
@Support
@PlainSQL
- CreateTableFinalStep storage(String sql);
+ @NotNull @CheckReturnValue
+ CreateTableFinalStep storage(@Stringly.SQL String storage, QueryPart... parts);
/**
- * Add vendor-specific storage clauses to the CREATE TABLE statement.
- *
- *
- * DSL.using(configuration)
- * .createTable("t")
- * .column(field("i", SQLDataType.INTEGER))
- * .storage("TABLESPACE my_tablespace")
- * .execute();
- * STORAGE clause to the CREATE TABLE statement.
*
- * @param sql The SQL
- * @param bindings The bindings
+ * @see SQL
*/
- @NotNull @CheckReturnValue
@Support
@PlainSQL
- CreateTableFinalStep storage(String sql, Object... bindings);
+ @NotNull @CheckReturnValue
+ CreateTableFinalStep storage(@Stringly.SQL String storage, Object... bindings);
/**
- * Add vendor-specific storage clauses to the CREATE TABLE
- * statement.
- *
- *
- * DSL.using(configuration)
- * .createTable("t")
- * .column(field("i", SQLDataType.INTEGER))
- * .storage("TABLESPACE my_tablespace")
- * .execute();
- * STORAGE clause to the CREATE TABLE statement.
*
- * @param sql The SQL
- * @param parts The {@link QueryPart} objects that are rendered at the
- * {numbered placeholder} locations
+ * @see SQL
*/
- @NotNull @CheckReturnValue
@Support
@PlainSQL
- CreateTableFinalStep storage(String sql, QueryPart... parts);
+ @NotNull @CheckReturnValue
+ CreateTableFinalStep storage(@Stringly.SQL String storage);
}
diff --git a/jOOQ/src/main/java/org/jooq/CreateTableWithDataStep.java b/jOOQ/src/main/java/org/jooq/CreateTableWithDataStep.java
index 4a8c303cec..c746ef7220 100644
--- a/jOOQ/src/main/java/org/jooq/CreateTableWithDataStep.java
+++ b/jOOQ/src/main/java/org/jooq/CreateTableWithDataStep.java
@@ -37,37 +37,14 @@
*/
package org.jooq;
-// ...
-// ...
-// ...
-// ...
-// ...
-import static org.jooq.SQLDialect.CUBRID;
-// ...
-import static org.jooq.SQLDialect.DERBY;
-// ...
-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.YUGABYTEDB;
+import static org.jooq.SQLDialect.*;
-import org.jetbrains.annotations.NotNull;
+import java.util.*;
+
+import org.jetbrains.annotations.*;
/**
- * A {@link Query} that can create tables.
+ * A step in the construction of the CREATE TABLE statement.
* Referencing
* XYZ*Step types directly from client codeWITH DATA clause.
+ * Add the WITH DATA clause to the CREATE TABLE statement.
*/
- @NotNull @CheckReturnValue
@Support({ CUBRID, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE, YUGABYTEDB })
- CreateTableCommentStep withData();
+ @NotNull @CheckReturnValue
+ CreateTableOnCommitStep withData();
/**
- * Add a WITH DATA clause.
+ * Add the WITH NO DATA clause to the CREATE TABLE statement.
*/
- @NotNull @CheckReturnValue
@Support({ CUBRID, DERBY, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE, YUGABYTEDB })
- CreateTableCommentStep withNoData();
+ @NotNull @CheckReturnValue
+ CreateTableOnCommitStep withNoData();
}
diff --git a/jOOQ/src/main/java/org/jooq/DSLContext.java b/jOOQ/src/main/java/org/jooq/DSLContext.java
index f6e516c8e6..a21289373e 100644
--- a/jOOQ/src/main/java/org/jooq/DSLContext.java
+++ b/jOOQ/src/main/java/org/jooq/DSLContext.java
@@ -9992,6 +9992,172 @@ public interface DSLContext extends Scope {
+ /**
+ * The CREATE TABLE statement.
+ *
+ * @see DSL#createTable(String)
+ */
+ @NotNull @CheckReturnValue
+ @Support
+ CreateTableElementListStep createTable(@Stringly.Name String table);
+
+ /**
+ * The CREATE TABLE statement.
+ *
+ * @see DSL#createTable(Name)
+ */
+ @NotNull @CheckReturnValue
+ @Support
+ CreateTableElementListStep createTable(Name table);
+
+ /**
+ * The CREATE TABLE statement.
+ *
+ * @see DSL#createTable(Table)
+ */
+ @NotNull @CheckReturnValue
+ @Support
+ CreateTableElementListStep createTable(Table> table);
+
+ /**
+ * The CREATE TABLE IF NOT EXISTS statement.
+ *
+ * @see DSL#createTableIfNotExists(String)
+ */
+ @NotNull @CheckReturnValue
+ @Support({ FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES, SQLITE, YUGABYTEDB })
+ CreateTableElementListStep createTableIfNotExists(@Stringly.Name String table);
+
+ /**
+ * The CREATE TABLE IF NOT EXISTS statement.
+ *
+ * @see DSL#createTableIfNotExists(Name)
+ */
+ @NotNull @CheckReturnValue
+ @Support({ FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES, SQLITE, YUGABYTEDB })
+ CreateTableElementListStep createTableIfNotExists(Name table);
+
+ /**
+ * The CREATE TABLE IF NOT EXISTS statement.
+ *
+ * @see DSL#createTableIfNotExists(Table)
+ */
+ @NotNull @CheckReturnValue
+ @Support({ FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES, SQLITE, YUGABYTEDB })
+ CreateTableElementListStep createTableIfNotExists(Table> table);
+
+ /**
+ * The CREATE TEMPORARY TABLE statement.
+ *
+ * @see DSL#createTemporaryTable(String)
+ */
+ @NotNull @CheckReturnValue
+ @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
+ CreateTableElementListStep createTemporaryTable(@Stringly.Name String table);
+
+ /**
+ * The CREATE TEMPORARY TABLE statement.
+ *
+ * @see DSL#createTemporaryTable(Name)
+ */
+ @NotNull @CheckReturnValue
+ @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
+ CreateTableElementListStep createTemporaryTable(Name table);
+
+ /**
+ * The CREATE TEMPORARY TABLE statement.
+ *
+ * @see DSL#createTemporaryTable(Table)
+ */
+ @NotNull @CheckReturnValue
+ @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
+ CreateTableElementListStep createTemporaryTable(Table> table);
+
+ /**
+ * The CREATE TEMPORARY TABLE IF NOT EXISTS statement.
+ *
+ * @see DSL#createTemporaryTableIfNotExists(String)
+ */
+ @NotNull @CheckReturnValue
+ @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
+ CreateTableElementListStep createTemporaryTableIfNotExists(@Stringly.Name String table);
+
+ /**
+ * The CREATE TEMPORARY TABLE IF NOT EXISTS statement.
+ *
+ * @see DSL#createTemporaryTableIfNotExists(Name)
+ */
+ @NotNull @CheckReturnValue
+ @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
+ CreateTableElementListStep createTemporaryTableIfNotExists(Name table);
+
+ /**
+ * The CREATE TEMPORARY TABLE IF NOT EXISTS statement.
+ *
+ * @see DSL#createTemporaryTableIfNotExists(Table)
+ */
+ @NotNull @CheckReturnValue
+ @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
+ CreateTableElementListStep createTemporaryTableIfNotExists(Table> table);
+
+ /**
+ * The CREATE GLOBAL TEMPORARY TABLE statement.
+ *
+ * @see DSL#createGlobalTemporaryTable(String)
+ */
+ @NotNull @CheckReturnValue
+ @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
+ CreateTableElementListStep createGlobalTemporaryTable(@Stringly.Name String table);
+
+ /**
+ * The CREATE GLOBAL TEMPORARY TABLE statement.
+ *
+ * @see DSL#createGlobalTemporaryTable(Name)
+ */
+ @NotNull @CheckReturnValue
+ @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
+ CreateTableElementListStep createGlobalTemporaryTable(Name table);
+
+ /**
+ * The CREATE GLOBAL TEMPORARY TABLE statement.
+ *
+ * @see DSL#createGlobalTemporaryTable(Table)
+ */
+ @NotNull @CheckReturnValue
+ @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
+ CreateTableElementListStep createGlobalTemporaryTable(Table> table);
+
+ /**
+ * The CREATE GLOBAL TEMPORARY TABLE IF NOT EXISTS statement.
+ *
+ * @see DSL#createGlobalTemporaryTableIfNotExists(String)
+ */
+ @NotNull @CheckReturnValue
+ @Support({ FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES, SQLITE, YUGABYTEDB })
+ CreateTableElementListStep createGlobalTemporaryTableIfNotExists(@Stringly.Name String table);
+
+ /**
+ * The CREATE GLOBAL TEMPORARY TABLE IF NOT EXISTS statement.
+ *
+ * @see DSL#createGlobalTemporaryTableIfNotExists(Name)
+ */
+ @NotNull @CheckReturnValue
+ @Support({ FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES, SQLITE, YUGABYTEDB })
+ CreateTableElementListStep createGlobalTemporaryTableIfNotExists(Name table);
+
+ /**
+ * The CREATE GLOBAL TEMPORARY TABLE IF NOT EXISTS statement.
+ *
+ * @see DSL#createGlobalTemporaryTableIfNotExists(Table)
+ */
+ @NotNull @CheckReturnValue
+ @Support({ FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES, SQLITE, YUGABYTEDB })
+ CreateTableElementListStep createGlobalTemporaryTableIfNotExists(Table> table);
+
+
+
+
+
@@ -10960,141 +11126,6 @@ public interface DSLContext extends Scope {
-
- /**
- * Create a new DSL CREATE TABLE statement.
- *
- * @see DSL#createTable(String)
- */
- @NotNull @CheckReturnValue
- @Support
- CreateTableColumnStep createTable(String table);
-
- /**
- * Create a new DSL CREATE TABLE statement.
- *
- * @see DSL#createTable(Name)
- */
- @NotNull @CheckReturnValue
- @Support
- CreateTableColumnStep createTable(Name table);
-
- /**
- * Create a new DSL CREATE TABLE statement.
- *
- * @see DSL#createTable(Table)
- */
- @NotNull @CheckReturnValue
- @Support
- CreateTableColumnStep createTable(Table> table);
-
- /**
- * Create a new DSL CREATE TABLE statement.
- *
- * @see DSL#createTableIfNotExists(String)
- */
- @NotNull @CheckReturnValue
- @Support({ FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES, SQLITE, YUGABYTEDB })
- CreateTableColumnStep createTableIfNotExists(String table);
-
- /**
- * Create a new DSL CREATE TABLE statement.
- *
- * @see DSL#createTableIfNotExists(Name)
- */
- @NotNull @CheckReturnValue
- @Support({ FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES, SQLITE, YUGABYTEDB })
- CreateTableColumnStep createTableIfNotExists(Name table);
-
- /**
- * Create a new DSL CREATE TABLE statement.
- *
- * @see DSL#createTableIfNotExists(Table)
- */
- @NotNull @CheckReturnValue
- @Support({ FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES, SQLITE, YUGABYTEDB })
- CreateTableColumnStep createTableIfNotExists(Table> table);
-
- /**
- * Create a new DSL CREATE TEMPORARY TABLE statement.
- *
- * @see DSL#createTemporaryTable(String)
- */
- @NotNull @CheckReturnValue
- @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
- CreateTableColumnStep createTemporaryTable(String table);
-
- /**
- * Create a new DSL CREATE TEMPORARY TABLE statement.
- *
- * @see DSL#createTemporaryTable(Name)
- */
- @NotNull @CheckReturnValue
- @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
- CreateTableColumnStep createTemporaryTable(Name table);
-
- /**
- * Create a new DSL CREATE TEMPORARY TABLE statement.
- *
- * @see DSL#createTemporaryTable(Table)
- */
- @NotNull @CheckReturnValue
- @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
- CreateTableColumnStep createTemporaryTable(Table> table);
-
- /**
- * Create a new DSL CREATE TEMPORARY TABLE IF NOT EXISTS statement.
- *
- * @see DSL#createTemporaryTableIfNotExists(String)
- */
- @NotNull @CheckReturnValue
- @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
- CreateTableColumnStep createTemporaryTableIfNotExists(String table);
-
- /**
- * Create a new DSL CREATE TEMPORARY TABLE IF NOT EXISTS statement.
- *
- * @see DSL#createTemporaryTableIfNotExists(Name)
- */
- @NotNull @CheckReturnValue
- @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
- CreateTableColumnStep createTemporaryTableIfNotExists(Name table);
-
- /**
- * Create a new DSL CREATE TEMPORARY TABLE IF NOT EXISTS statement.
- *
- * @see DSL#createTemporaryTableIfNotExists(Table)
- */
- @NotNull @CheckReturnValue
- @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
- CreateTableColumnStep createTemporaryTableIfNotExists(Table> table);
-
- /**
- * Create a new DSL CREATE GLOBAL TEMPORARY TABLE statement.
- *
- * @see DSL#createGlobalTemporaryTable(String)
- */
- @NotNull @CheckReturnValue
- @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
- CreateTableColumnStep createGlobalTemporaryTable(String table);
-
- /**
- * Create a new DSL CREATE GLOBAL TEMPORARY TABLE statement.
- *
- * @see DSL#createGlobalTemporaryTable(Name)
- */
- @NotNull @CheckReturnValue
- @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
- CreateTableColumnStep createGlobalTemporaryTable(Name table);
-
- /**
- * Create a new DSL CREATE GLOBAL TEMPORARY TABLE statement.
- *
- * @see DSL#createGlobalTemporaryTable(Table)
- */
- @NotNull @CheckReturnValue
- @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
- CreateTableColumnStep createGlobalTemporaryTable(Table> table);
/**
* Create a new DSL CREATE VIEW statement.
diff --git a/jOOQ/src/main/java/org/jooq/Field.java b/jOOQ/src/main/java/org/jooq/Field.java
index b6cbabc102..4f3a901122 100644
--- a/jOOQ/src/main/java/org/jooq/Field.java
+++ b/jOOQ/src/main/java/org/jooq/Field.java
@@ -150,7 +150,8 @@ extends
GroupField,
OrderFieldCREATE TABLE statement.
*/
+@SuppressWarnings({ "hiding", "rawtypes", "unused" })
final class CreateTableImpl
extends
AbstractDDLQuery
implements
+ QOM.CreateTable,
+ CreateTableElementListStep,
+ CreateTableAsStep,
CreateTableWithDataStep,
- CreateTableColumnStep,
- UNotYetImplemented
-
+ CreateTableOnCommitStep,
+ CreateTableCommentStep,
+ CreateTableStorageStep,
+ CreateTableFinalStep
{
+
+ final Table> table;
+ final boolean temporary;
+ final boolean ifNotExists;
+ QueryPartListView extends TableElement> tableElements;
+ Select> select;
+ WithOrWithoutData withData;
+ TableCommitAction onCommit;
+ Comment comment;
+ SQL storage;
+
+ CreateTableImpl(
+ Configuration configuration,
+ Table> table,
+ boolean temporary,
+ boolean ifNotExists
+ ) {
+ this(
+ configuration,
+ table,
+ temporary,
+ ifNotExists,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null
+ );
+ }
+
+ CreateTableImpl(
+ Configuration configuration,
+ Table> table,
+ boolean temporary,
+ boolean ifNotExists,
+ Collection extends TableElement> tableElements,
+ Select> select,
+ WithOrWithoutData withData,
+ TableCommitAction onCommit,
+ Comment comment,
+ SQL storage
+ ) {
+ super(configuration);
+
+ this.table = table;
+ this.temporary = temporary;
+ this.ifNotExists = ifNotExists;
+ this.tableElements = new QueryPartList<>(tableElements);
+ this.select = select;
+ this.withData = withData;
+ this.onCommit = onCommit;
+ this.comment = comment;
+ this.storage = storage;
+ }
+
+ // -------------------------------------------------------------------------
+ // XXX: DSL API
+ // -------------------------------------------------------------------------
+
+ @Override
+ public final CreateTableImpl tableElements(TableElement... tableElements) {
+ return tableElements(Arrays.asList(tableElements));
+ }
+
+ @Override
+ public final CreateTableImpl tableElements(Collection extends TableElement> tableElements) {
+ if (this.tableElements == null)
+ this.tableElements = new QueryPartList<>(tableElements);
+ else
+ this.tableElements.addAll((Collection) tableElements);
+
+ return this;
+ }
+
+ @Override
+ public final CreateTableImpl columns(String... columns) {
+ return columns(Tools.fieldsByName(columns));
+ }
+
+ @Override
+ public final CreateTableImpl columns(Name... columns) {
+ return columns(Tools.fieldsByName(columns));
+ }
+
+ @Override
+ public final CreateTableImpl columns(Field>... columns) {
+ return columns(Arrays.asList(columns));
+ }
+
+ @Override
+ public final CreateTableImpl columns(Collection extends Field>> columns) {
+ return tableElements(new QueryPartList<>(columns));
+ }
+
+ @Override
+ public final CreateTableImpl column(Field> column) {
+ return tableElements(column);
+ }
+
+ @Override
+ public final CreateTableImpl column(String field, DataType> type) {
+ return column(DSL.name(field), type);
+ }
+
+ @Override
+ public final CreateTableImpl column(Name field, DataType> type) {
+ return tableElements(DSL.field(field, type));
+ }
+
+ @Override
+ public final CreateTableImpl column(Field> field, DataType> type) {
+ return tableElements(DSL.field(field.getQualifiedName(), type));
+ }
+
+ @Override
+ public final CreateTableImpl constraints(Constraint... constraints) {
+ return constraints(Arrays.asList(constraints));
+ }
+
+ @Override
+ public final CreateTableImpl constraints(Collection extends Constraint> constraints) {
+ return tableElements(new QueryPartList<>(constraints));
+ }
+
+ @Override
+ public final CreateTableImpl constraint(Constraint constraint) {
+ return tableElements(constraint);
+ }
+
+ @Override
+ public final CreateTableImpl primaryKey(String... fields) {
+ return primaryKey(Tools.fieldsByName(fields));
+ }
+
+ @Override
+ public final CreateTableImpl primaryKey(Name... fields) {
+ return primaryKey(Tools.fieldsByName(fields));
+ }
+
+ @Override
+ public final CreateTableImpl primaryKey(Field>... fields) {
+ return primaryKey(Arrays.asList(fields));
+ }
+
+ @Override
+ public final CreateTableImpl primaryKey(Collection extends Field>> fields) {
+ return tableElements(DSL.primaryKey(new QueryPartList<>(fields)));
+ }
+
+ @Override
+ public final CreateTableImpl unique(String... fields) {
+ return unique(Tools.fieldsByName(fields));
+ }
+
+ @Override
+ public final CreateTableImpl unique(Name... fields) {
+ return unique(Tools.fieldsByName(fields));
+ }
+
+ @Override
+ public final CreateTableImpl unique(Field>... fields) {
+ return unique(Arrays.asList(fields));
+ }
+
+ @Override
+ public final CreateTableImpl unique(Collection extends Field>> fields) {
+ return tableElements(DSL.unique(new QueryPartList<>(fields)));
+ }
+
+ @Override
+ public final CreateTableImpl check(Condition condition) {
+ return tableElements(DSL.check(condition));
+ }
+
+ @Override
+ public final CreateTableImpl indexes(Index... indexes) {
+ return indexes(Arrays.asList(indexes));
+ }
+
+ @Override
+ public final CreateTableImpl indexes(Collection extends Index> indexes) {
+ return tableElements(new QueryPartList<>(indexes));
+ }
+
+ @Override
+ public final CreateTableImpl index(Index index) {
+ return tableElements(index);
+ }
+
+ @Override
+ public final CreateTableImpl as(Select> select) {
+ this.select = select;
+ return this;
+ }
+
+ @Override
+ public final CreateTableImpl withData() {
+ this.withData = WithOrWithoutData.WITH_DATA;
+ return this;
+ }
+
+ @Override
+ public final CreateTableImpl withNoData() {
+ this.withData = WithOrWithoutData.WITH_NO_DATA;
+ return this;
+ }
+
+ @Override
+ public final CreateTableImpl onCommitDeleteRows() {
+ this.onCommit = TableCommitAction.DELETE_ROWS;
+ return this;
+ }
+
+ @Override
+ public final CreateTableImpl onCommitPreserveRows() {
+ this.onCommit = TableCommitAction.PRESERVE_ROWS;
+ return this;
+ }
+
+ @Override
+ public final CreateTableImpl onCommitDrop() {
+ this.onCommit = TableCommitAction.DROP;
+ return this;
+ }
+
+ @Override
+ public final CreateTableImpl comment(String comment) {
+ return comment(DSL.comment(comment));
+ }
+
+ @Override
+ public final CreateTableImpl comment(Comment comment) {
+ this.comment = comment;
+ return this;
+ }
+
+ @Override
+ public final CreateTableImpl storage(SQL storage) {
+ this.storage = storage;
+ return this;
+ }
+
+ @Override
+ public final CreateTableImpl storage(String storage, QueryPart... parts) {
+ return storage(DSL.sql(storage, parts));
+ }
+
+ @Override
+ public final CreateTableImpl storage(String storage, Object... bindings) {
+ return storage(DSL.sql(storage, bindings));
+ }
+
+ @Override
+ public final CreateTableImpl storage(String storage) {
+ return storage(DSL.sql(storage));
+ }
+
+ // -------------------------------------------------------------------------
+ // XXX: QueryPart API
+ // -------------------------------------------------------------------------
+
+
+
private static final SetCREATE TABLE statement.
+ * CREATE TABLE statement.
+ * CREATE TABLE statement.
+ * CREATE TABLE IF NOT EXISTS statement.
+ * CREATE TABLE IF NOT EXISTS statement.
+ * CREATE TABLE IF NOT EXISTS statement.
+ * CREATE TEMPORARY TABLE statement.
+ * CREATE TEMPORARY TABLE statement.
+ * CREATE TEMPORARY TABLE statement.
+ * CREATE TEMPORARY TABLE IF NOT EXISTS statement.
+ * CREATE TEMPORARY TABLE IF NOT EXISTS statement.
+ * CREATE TEMPORARY TABLE IF NOT EXISTS statement.
+ * CREATE GLOBAL TEMPORARY TABLE statement.
+ * CREATE GLOBAL TEMPORARY TABLE statement.
+ * CREATE GLOBAL TEMPORARY TABLE statement.
+ * CREATE GLOBAL TEMPORARY TABLE IF NOT EXISTS statement.
+ * CREATE GLOBAL TEMPORARY TABLE IF NOT EXISTS statement.
+ * CREATE GLOBAL TEMPORARY TABLE IF NOT EXISTS statement.
+ * CREATE TABLE statement.
- *
- * @see DSLContext#createTable(String)
- */
- @NotNull
- @Support
- public static CreateTableColumnStep createTable(String table) {
- return dsl().createTable(table);
- }
-
- /**
- * Create a new DSL CREATE TABLE statement.
- *
- * @see DSLContext#createTable(Name)
- */
- @NotNull
- @Support
- public static CreateTableColumnStep createTable(Name table) {
- return dsl().createTable(table);
- }
-
- /**
- * Create a new DSL CREATE TABLE statement.
- *
- * @see DSLContext#createTable(Table)
- */
- @NotNull
- @Support
- public static CreateTableColumnStep createTable(Table> table) {
- return dsl().createTable(table);
- }
-
- /**
- * Create a new DSL CREATE TABLE statement.
- *
- * @see DSLContext#createTableIfNotExists(String)
- */
- @NotNull
- @Support({ FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES, SQLITE, YUGABYTEDB })
- public static CreateTableColumnStep createTableIfNotExists(String table) {
- return dsl().createTableIfNotExists(table);
- }
-
- /**
- * Create a new DSL CREATE TABLE statement.
- *
- * @see DSLContext#createTableIfNotExists(Name)
- */
- @NotNull
- @Support({ FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES, SQLITE, YUGABYTEDB })
- public static CreateTableColumnStep createTableIfNotExists(Name table) {
- return dsl().createTableIfNotExists(table);
- }
-
- /**
- * Create a new DSL CREATE TABLE statement.
- *
- * @see DSLContext#createTableIfNotExists(Table)
- */
- @NotNull
- @Support({ FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES, SQLITE, YUGABYTEDB })
- public static CreateTableColumnStep createTableIfNotExists(Table> table) {
- return dsl().createTableIfNotExists(table);
- }
-
- /**
- * Create a new DSL CREATE TEMPORARY TABLE statement.
- *
- * @see DSLContext#createTemporaryTable(String)
- */
- @NotNull
- @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
- public static CreateTableColumnStep createTemporaryTable(String table) {
- return dsl().createTemporaryTable(table);
- }
-
- /**
- * Create a new DSL CREATE TEMPORARY TABLE statement.
- *
- * @see DSLContext#createTemporaryTable(Name)
- */
- @NotNull
- @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
- public static CreateTableColumnStep createTemporaryTable(Name table) {
- return dsl().createTemporaryTable(table);
- }
-
- /**
- * Create a new DSL CREATE TEMPORARY TABLE statement.
- *
- * @see DSLContext#createTemporaryTable(Table)
- */
- @NotNull
- @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
- public static CreateTableColumnStep createTemporaryTable(Table> table) {
- return dsl().createTemporaryTable(table);
- }
-
- /**
- * Create a new DSL CREATE TEMPORARY TABLE statement.
- *
- * @see DSLContext#createTemporaryTableIfNotExists(String)
- */
- @NotNull
- @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
- public static CreateTableColumnStep createTemporaryTableIfNotExists(String table) {
- return dsl().createTemporaryTableIfNotExists(table);
- }
-
- /**
- * Create a new DSL CREATE TEMPORARY TABLE statement.
- *
- * @see DSLContext#createTemporaryTableIfNotExists(Name)
- */
- @NotNull
- @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
- public static CreateTableColumnStep createTemporaryTableIfNotExists(Name table) {
- return dsl().createTemporaryTableIfNotExists(table);
- }
-
- /**
- * Create a new DSL CREATE TEMPORARY TABLE statement.
- *
- * @see DSLContext#createTemporaryTableIfNotExists(Table)
- */
- @NotNull
- @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
- public static CreateTableColumnStep createTemporaryTableIfNotExists(Table> table) {
- return dsl().createTemporaryTableIfNotExists(table);
- }
-
- /**
- * Create a new DSL CREATE GLOBAL TEMPORARY TABLE statement.
- *
- * @see DSLContext#createGlobalTemporaryTable(String)
- */
- @NotNull
- @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
- public static CreateTableColumnStep createGlobalTemporaryTable(String table) {
- return dsl().createGlobalTemporaryTable(table);
- }
-
- /**
- * Create a new DSL CREATE GLOBAL TEMPORARY TABLE statement.
- *
- * @see DSLContext#createGlobalTemporaryTable(Name)
- */
- @NotNull
- @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
- public static CreateTableColumnStep createGlobalTemporaryTable(Name table) {
- return dsl().createGlobalTemporaryTable(table);
- }
-
- /**
- * Create a new DSL CREATE GLOBAL TEMPORARY TABLE statement.
- *
- * @see DSLContext#createGlobalTemporaryTable(Table)
- */
- @NotNull
- @Support({ FIREBIRD, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
- public static CreateTableColumnStep createGlobalTemporaryTable(Table> table) {
- return dsl().createGlobalTemporaryTable(table);
- }
/**
* Create a new DSL CREATE VIEW statement.
diff --git a/jOOQ/src/main/java/org/jooq/impl/DefaultDSLContext.java b/jOOQ/src/main/java/org/jooq/impl/DefaultDSLContext.java
index e4dce9fb60..0eefd360d0 100644
--- a/jOOQ/src/main/java/org/jooq/impl/DefaultDSLContext.java
+++ b/jOOQ/src/main/java/org/jooq/impl/DefaultDSLContext.java
@@ -110,7 +110,6 @@ import org.jooq.ConnectionProvider;
import org.jooq.ConnectionRunnable;
import org.jooq.ContextTransactionalCallable;
import org.jooq.ContextTransactionalRunnable;
-import org.jooq.CreateTableColumnStep;
import org.jooq.CreateTypeStep;
import org.jooq.CreateViewAsStep;
import org.jooq.Cursor;
@@ -3270,6 +3269,100 @@ public class DefaultDSLContext extends AbstractScope implements DSLContext, Seri
+ @Override
+ public org.jooq.CreateTableElementListStep createTable(@Stringly.Name String table) {
+ return new CreateTableImpl(configuration(), DSL.table(DSL.name(table)), false, false);
+ }
+
+ @Override
+ public org.jooq.CreateTableElementListStep createTable(Name table) {
+ return new CreateTableImpl(configuration(), DSL.table(table), false, false);
+ }
+
+ @Override
+ public org.jooq.CreateTableElementListStep createTable(Table> table) {
+ return new CreateTableImpl(configuration(), table, false, false);
+ }
+
+ @Override
+ public org.jooq.CreateTableElementListStep createTableIfNotExists(@Stringly.Name String table) {
+ return new CreateTableImpl(configuration(), DSL.table(DSL.name(table)), false, true);
+ }
+
+ @Override
+ public org.jooq.CreateTableElementListStep createTableIfNotExists(Name table) {
+ return new CreateTableImpl(configuration(), DSL.table(table), false, true);
+ }
+
+ @Override
+ public org.jooq.CreateTableElementListStep createTableIfNotExists(Table> table) {
+ return new CreateTableImpl(configuration(), table, false, true);
+ }
+
+ @Override
+ public org.jooq.CreateTableElementListStep createTemporaryTable(@Stringly.Name String table) {
+ return new CreateTableImpl(configuration(), DSL.table(DSL.name(table)), true, false);
+ }
+
+ @Override
+ public org.jooq.CreateTableElementListStep createTemporaryTable(Name table) {
+ return new CreateTableImpl(configuration(), DSL.table(table), true, false);
+ }
+
+ @Override
+ public org.jooq.CreateTableElementListStep createTemporaryTable(Table> table) {
+ return new CreateTableImpl(configuration(), table, true, false);
+ }
+
+ @Override
+ public org.jooq.CreateTableElementListStep createTemporaryTableIfNotExists(@Stringly.Name String table) {
+ return new CreateTableImpl(configuration(), DSL.table(DSL.name(table)), true, true);
+ }
+
+ @Override
+ public org.jooq.CreateTableElementListStep createTemporaryTableIfNotExists(Name table) {
+ return new CreateTableImpl(configuration(), DSL.table(table), true, true);
+ }
+
+ @Override
+ public org.jooq.CreateTableElementListStep createTemporaryTableIfNotExists(Table> table) {
+ return new CreateTableImpl(configuration(), table, true, true);
+ }
+
+ @Override
+ public org.jooq.CreateTableElementListStep createGlobalTemporaryTable(@Stringly.Name String table) {
+ return new CreateTableImpl(configuration(), DSL.table(DSL.name(table)), true, false);
+ }
+
+ @Override
+ public org.jooq.CreateTableElementListStep createGlobalTemporaryTable(Name table) {
+ return new CreateTableImpl(configuration(), DSL.table(table), true, false);
+ }
+
+ @Override
+ public org.jooq.CreateTableElementListStep createGlobalTemporaryTable(Table> table) {
+ return new CreateTableImpl(configuration(), table, true, false);
+ }
+
+ @Override
+ public org.jooq.CreateTableElementListStep createGlobalTemporaryTableIfNotExists(@Stringly.Name String table) {
+ return new CreateTableImpl(configuration(), DSL.table(DSL.name(table)), true, true);
+ }
+
+ @Override
+ public org.jooq.CreateTableElementListStep createGlobalTemporaryTableIfNotExists(Name table) {
+ return new CreateTableImpl(configuration(), DSL.table(table), true, true);
+ }
+
+ @Override
+ public org.jooq.CreateTableElementListStep createGlobalTemporaryTableIfNotExists(Table> table) {
+ return new CreateTableImpl(configuration(), table, true, true);
+ }
+
+
+
+
+
@@ -4029,81 +4122,6 @@ public class DefaultDSLContext extends AbstractScope implements DSLContext, Seri
return new CreateViewImpl<>(configuration(), view, fieldNameFunction, true, false);
}
- @Override
- public CreateTableColumnStep createTable(String table) {
- return createTable(name(table));
- }
-
- @Override
- public CreateTableColumnStep createTable(Name table) {
- return createTable(table(table));
- }
-
- @Override
- public CreateTableColumnStep createTable(Table> table) {
- return new CreateTableImpl(configuration(), table, false, false);
- }
-
- @Override
- public CreateTableColumnStep createTableIfNotExists(String table) {
- return createTableIfNotExists(name(table));
- }
-
- @Override
- public CreateTableColumnStep createTableIfNotExists(Name table) {
- return createTableIfNotExists(table(table));
- }
-
- @Override
- public CreateTableColumnStep createTableIfNotExists(Table> table) {
- return new CreateTableImpl(configuration(), table, false, true);
- }
-
- @Override
- public CreateTableColumnStep createTemporaryTable(String table) {
- return createTemporaryTable(name(table));
- }
-
- @Override
- public CreateTableColumnStep createTemporaryTable(Name table) {
- return createTemporaryTable(table(table));
- }
-
- @Override
- public CreateTableColumnStep createTemporaryTable(Table> table) {
- return new CreateTableImpl(configuration(), table, true, false);
- }
-
- @Override
- public CreateTableColumnStep createTemporaryTableIfNotExists(String table) {
- return createTemporaryTableIfNotExists(name(table));
- }
-
- @Override
- public CreateTableColumnStep createTemporaryTableIfNotExists(Name table) {
- return createTemporaryTableIfNotExists(table(table));
- }
-
- @Override
- public CreateTableColumnStep createTemporaryTableIfNotExists(Table> table) {
- return new CreateTableImpl(configuration(), table, true, true);
- }
-
- @Override
- public CreateTableColumnStep createGlobalTemporaryTable(String table) {
- return createGlobalTemporaryTable(name(table));
- }
-
- @Override
- public CreateTableColumnStep createGlobalTemporaryTable(Name table) {
- return createGlobalTemporaryTable(table(table));
- }
-
- @Override
- public CreateTableColumnStep createGlobalTemporaryTable(Table> table) {
- return new CreateTableImpl(configuration(), table, true, false);
- }
-
@Override
public CreateTypeStep createType(String type) {
return createType(name(type));
diff --git a/jOOQ/src/main/java/org/jooq/impl/Internal.java b/jOOQ/src/main/java/org/jooq/impl/Internal.java
index 4c9e8800cc..0cbd078a97 100644
--- a/jOOQ/src/main/java/org/jooq/impl/Internal.java
+++ b/jOOQ/src/main/java/org/jooq/impl/Internal.java
@@ -44,8 +44,10 @@ import java.lang.reflect.Array;
import java.util.function.Consumer;
import java.util.function.Supplier;
+import org.jooq.Attachable;
import org.jooq.Binding;
import org.jooq.Check;
+import org.jooq.Configuration;
import org.jooq.Converter;
import org.jooq.DataType;
import org.jooq.Domain;
@@ -494,4 +496,12 @@ public final class Internal {
public static final void requireCommercial(SupplierCREATE TABLE statement.
+ */
+ public /*sealed*/ interface CreateTable
+ extends
+ DDLQuery
+ //permits
+ // CreateTableImpl
+ {
+ @NotNull Table> $table();
+ boolean $temporary();
+ boolean $ifNotExists();
+ @NotNull UnmodifiableList extends TableElement> $tableElements();
+ @Nullable Select> $select();
+ @Nullable WithOrWithoutData $withData();
+ @Nullable TableCommitAction $onCommit();
+ @Nullable Comment $comment();
+ @Nullable SQL $storage();
+ @NotNull CreateTable $table(Table> table);
+ @NotNull CreateTable $temporary(boolean temporary);
+ @NotNull CreateTable $ifNotExists(boolean ifNotExists);
+ @NotNull CreateTable $tableElements(Collection extends TableElement> tableElements);
+ @NotNull CreateTable $select(Select> select);
+ @NotNull CreateTable $withData(WithOrWithoutData withData);
+ @NotNull CreateTable $onCommit(TableCommitAction onCommit);
+ @NotNull CreateTable $comment(Comment comment);
+ @NotNull CreateTable $storage(SQL storage);
+ }
+
+
+
@@ -5721,6 +5754,41 @@ public final class QOM {
}
}
+ /**
+ * The WithOrWithoutData type.
+ * TableCommitAction type.
+ *