diff --git a/jOOQ/src/main/java/org/jooq/InsertOnConflictConditionStep.java b/jOOQ/src/main/java/org/jooq/InsertOnConflictConditionStep.java index 2f18cc091b..287c66fd8c 100644 --- a/jOOQ/src/main/java/org/jooq/InsertOnConflictConditionStep.java +++ b/jOOQ/src/main/java/org/jooq/InsertOnConflictConditionStep.java @@ -39,6 +39,7 @@ package org.jooq; // ... import static org.jooq.SQLDialect.POSTGRES_9_5; +import static org.jooq.SQLDialect.SQLITE; import org.jooq.impl.DSL; @@ -84,14 +85,14 @@ public interface InsertOnConflictConditionStep extends InsertR * Combine the currently assembled conditions with another one using the * {@link Operator#AND} operator and proceed to the next step. */ - @Support({ POSTGRES_9_5 }) + @Support({ POSTGRES_9_5, SQLITE }) InsertOnConflictConditionStep and(Condition condition); /** * Combine the currently assembled conditions with another one using the * {@link Operator#AND} operator and proceed to the next step. */ - @Support({ POSTGRES_9_5 }) + @Support({ POSTGRES_9_5, SQLITE }) InsertOnConflictConditionStep and(Field condition); /** @@ -106,7 +107,7 @@ public interface InsertOnConflictConditionStep extends InsertR * @see DSL#condition(SQL) * @see SQL */ - @Support({ POSTGRES_9_5 }) + @Support({ POSTGRES_9_5, SQLITE }) @PlainSQL InsertOnConflictConditionStep and(SQL sql); @@ -122,7 +123,7 @@ public interface InsertOnConflictConditionStep extends InsertR * @see DSL#condition(String) * @see SQL */ - @Support({ POSTGRES_9_5 }) + @Support({ POSTGRES_9_5, SQLITE }) @PlainSQL InsertOnConflictConditionStep and(String sql); @@ -139,7 +140,7 @@ public interface InsertOnConflictConditionStep extends InsertR * @see DSL#sql(String, Object...) * @see SQL */ - @Support({ POSTGRES_9_5 }) + @Support({ POSTGRES_9_5, SQLITE }) @PlainSQL InsertOnConflictConditionStep and(String sql, Object... bindings); @@ -156,7 +157,7 @@ public interface InsertOnConflictConditionStep extends InsertR * @see DSL#sql(String, QueryPart...) * @see SQL */ - @Support({ POSTGRES_9_5 }) + @Support({ POSTGRES_9_5, SQLITE }) @PlainSQL InsertOnConflictConditionStep and(String sql, QueryPart... parts); @@ -164,42 +165,42 @@ public interface InsertOnConflictConditionStep extends InsertR * Combine the currently assembled conditions with a negated other one using * the {@link Operator#AND} operator and proceed to the next step. */ - @Support({ POSTGRES_9_5 }) + @Support({ POSTGRES_9_5, SQLITE }) InsertOnConflictConditionStep andNot(Condition condition); /** * Combine the currently assembled conditions with a negated other one using * the {@link Operator#AND} operator and proceed to the next step. */ - @Support({ POSTGRES_9_5 }) + @Support({ POSTGRES_9_5, SQLITE }) InsertOnConflictConditionStep andNot(Field condition); /** * Combine the currently assembled conditions with an EXISTS clause using * the {@link Operator#AND} operator and proceed to the next step. */ - @Support({ POSTGRES_9_5 }) + @Support({ POSTGRES_9_5, SQLITE }) InsertOnConflictConditionStep andExists(Select select); /** * Combine the currently assembled conditions with a NOT EXISTS clause using * the {@link Operator#AND} operator and proceed to the next step. */ - @Support({ POSTGRES_9_5 }) + @Support({ POSTGRES_9_5, SQLITE }) InsertOnConflictConditionStep andNotExists(Select select); /** * Combine the currently assembled conditions with another one using the * {@link Operator#OR} operator and proceed to the next step. */ - @Support({ POSTGRES_9_5 }) + @Support({ POSTGRES_9_5, SQLITE }) InsertOnConflictConditionStep or(Condition condition); /** * Combine the currently assembled conditions with another one using the * {@link Operator#OR} operator and proceed to the next step. */ - @Support({ POSTGRES_9_5 }) + @Support({ POSTGRES_9_5, SQLITE }) InsertOnConflictConditionStep or(Field condition); /** @@ -214,7 +215,7 @@ public interface InsertOnConflictConditionStep extends InsertR * @see DSL#condition(SQL) * @see SQL */ - @Support({ POSTGRES_9_5 }) + @Support({ POSTGRES_9_5, SQLITE }) @PlainSQL InsertOnConflictConditionStep or(SQL sql); @@ -230,7 +231,7 @@ public interface InsertOnConflictConditionStep extends InsertR * @see DSL#condition(String) * @see SQL */ - @Support({ POSTGRES_9_5 }) + @Support({ POSTGRES_9_5, SQLITE }) @PlainSQL InsertOnConflictConditionStep or(String sql); @@ -247,7 +248,7 @@ public interface InsertOnConflictConditionStep extends InsertR * @see DSL#sql(String, Object...) * @see SQL */ - @Support({ POSTGRES_9_5 }) + @Support({ POSTGRES_9_5, SQLITE }) @PlainSQL InsertOnConflictConditionStep or(String sql, Object... bindings); @@ -264,7 +265,7 @@ public interface InsertOnConflictConditionStep extends InsertR * @see DSL#sql(String, QueryPart...) * @see SQL */ - @Support({ POSTGRES_9_5 }) + @Support({ POSTGRES_9_5, SQLITE }) @PlainSQL InsertOnConflictConditionStep or(String sql, QueryPart... parts); @@ -272,27 +273,27 @@ public interface InsertOnConflictConditionStep extends InsertR * Combine the currently assembled conditions with a negated other one using * the {@link Operator#OR} operator and proceed to the next step. */ - @Support({ POSTGRES_9_5 }) + @Support({ POSTGRES_9_5, SQLITE }) InsertOnConflictConditionStep orNot(Condition condition); /** * Combine the currently assembled conditions with a negated other one using * the {@link Operator#OR} operator and proceed to the next step. */ - @Support({ POSTGRES_9_5 }) + @Support({ POSTGRES_9_5, SQLITE }) InsertOnConflictConditionStep orNot(Field condition); /** * Combine the currently assembled conditions with an EXISTS clause using * the {@link Operator#OR} operator and proceed to the next step. */ - @Support({ POSTGRES_9_5 }) + @Support({ POSTGRES_9_5, SQLITE }) InsertOnConflictConditionStep orExists(Select select); /** * Combine the currently assembled conditions with a NOT EXISTS clause using * the {@link Operator#OR} operator and proceed to the next step. */ - @Support({ POSTGRES_9_5 }) + @Support({ POSTGRES_9_5, SQLITE }) InsertOnConflictConditionStep orNotExists(Select select); } diff --git a/jOOQ/src/main/java/org/jooq/InsertOnConflictDoUpdateStep.java b/jOOQ/src/main/java/org/jooq/InsertOnConflictDoUpdateStep.java index 626548bebc..919c70dc4b 100644 --- a/jOOQ/src/main/java/org/jooq/InsertOnConflictDoUpdateStep.java +++ b/jOOQ/src/main/java/org/jooq/InsertOnConflictDoUpdateStep.java @@ -46,6 +46,7 @@ import static org.jooq.SQLDialect.HSQLDB; // ... // ... import static org.jooq.SQLDialect.POSTGRES_9_5; +import static org.jooq.SQLDialect.SQLITE; // ... // ... // ... @@ -59,6 +60,7 @@ import static org.jooq.SQLDialect.POSTGRES_9_5; * create.insertInto(table, field1, field2) * .values(value1, value2) * .onConflict(field1) + * .doUpdate() * .set(field2, value2) * .execute(); * @@ -71,7 +73,7 @@ public interface InsertOnConflictDoUpdateStep { /** * Add the DO UPDATE clause. */ - @Support({ CUBRID, DERBY, FIREBIRD_3_0, HSQLDB, POSTGRES_9_5 }) + @Support({ CUBRID, DERBY, FIREBIRD_3_0, HSQLDB, POSTGRES_9_5, SQLITE }) InsertOnDuplicateSetStep doUpdate(); /** diff --git a/jOOQ/src/main/java/org/jooq/InsertOnConflictWhereStep.java b/jOOQ/src/main/java/org/jooq/InsertOnConflictWhereStep.java index f2ce0c0bfa..1f8cf84c7a 100644 --- a/jOOQ/src/main/java/org/jooq/InsertOnConflictWhereStep.java +++ b/jOOQ/src/main/java/org/jooq/InsertOnConflictWhereStep.java @@ -42,6 +42,7 @@ import static org.jooq.SQLDialect.CUBRID; import static org.jooq.SQLDialect.DERBY; // ... import static org.jooq.SQLDialect.POSTGRES_9_5; +import static org.jooq.SQLDialect.SQLITE; // ... import java.util.Collection; @@ -57,9 +58,10 @@ import org.jooq.impl.DSL; * create.insertInto(table, field1, field2) * .values(value1, value2) * .values(value3, value4) - * .onDuplicateKeyUpdate() - * .set(field1, value1) - * .where(field2.eq(value5)) + * .onConflict(field1) + * .doUpdate() + * .set(field2, value2) + * .where(field3.eq(value5)) * .execute(); * *

@@ -89,7 +91,7 @@ public interface InsertOnConflictWhereStep extends InsertRetur * Add a WHERE clause to the INSERT statement's * ON DUPLICATE KEY UPDATE or ON CONFLICT ... DO UPDATE clause. */ - @Support({ CUBRID, DERBY, POSTGRES_9_5 }) + @Support({ CUBRID, DERBY, POSTGRES_9_5, SQLITE }) InsertOnConflictConditionStep where(Condition condition); /** @@ -97,7 +99,7 @@ public interface InsertOnConflictWhereStep extends InsertRetur * ON DUPLICATE KEY UPDATE or ON CONFLICT ... DO UPDATE clause, * connecting them with each other using {@link Operator#AND}. */ - @Support({ CUBRID, DERBY, POSTGRES_9_5 }) + @Support({ CUBRID, DERBY, POSTGRES_9_5, SQLITE }) InsertOnConflictConditionStep where(Condition... conditions); /** @@ -105,14 +107,14 @@ public interface InsertOnConflictWhereStep extends InsertRetur * ON DUPLICATE KEY UPDATE or ON CONFLICT ... DO UPDATE clause, * connecting them with each other using {@link Operator#AND}. */ - @Support({ CUBRID, DERBY, POSTGRES_9_5 }) + @Support({ CUBRID, DERBY, POSTGRES_9_5, SQLITE }) InsertOnConflictConditionStep where(Collection conditions); /** * Add a WHERE clause to the INSERT statement's * ON DUPLICATE KEY UPDATE or ON CONFLICT ... DO UPDATE clause. */ - @Support({ CUBRID, DERBY, POSTGRES_9_5 }) + @Support({ CUBRID, DERBY, POSTGRES_9_5, SQLITE }) InsertOnConflictConditionStep where(Field field); /** @@ -127,7 +129,7 @@ public interface InsertOnConflictWhereStep extends InsertRetur * @see DSL#condition(SQL) * @see SQL */ - @Support({ CUBRID, DERBY, POSTGRES_9_5 }) + @Support({ CUBRID, DERBY, POSTGRES_9_5, SQLITE }) @PlainSQL InsertOnConflictConditionStep where(SQL sql); @@ -143,7 +145,7 @@ public interface InsertOnConflictWhereStep extends InsertRetur * @see DSL#condition(String) * @see SQL */ - @Support({ CUBRID, DERBY, POSTGRES_9_5 }) + @Support({ CUBRID, DERBY, POSTGRES_9_5, SQLITE }) @PlainSQL InsertOnConflictConditionStep where(String sql); @@ -160,7 +162,7 @@ public interface InsertOnConflictWhereStep extends InsertRetur * @see DSL#sql(String, Object...) * @see SQL */ - @Support({ CUBRID, DERBY, POSTGRES_9_5 }) + @Support({ CUBRID, DERBY, POSTGRES_9_5, SQLITE }) @PlainSQL InsertOnConflictConditionStep where(String sql, Object... bindings); @@ -177,7 +179,7 @@ public interface InsertOnConflictWhereStep extends InsertRetur * @see DSL#sql(String, QueryPart...) * @see SQL */ - @Support({ CUBRID, DERBY, POSTGRES_9_5 }) + @Support({ CUBRID, DERBY, POSTGRES_9_5, SQLITE }) @PlainSQL InsertOnConflictConditionStep where(String sql, QueryPart... parts); @@ -185,13 +187,13 @@ public interface InsertOnConflictWhereStep extends InsertRetur * Add a WHERE EXISTS clause to the INSERT statement's * ON DUPLICATE KEY UPDATE or ON CONFLICT ... DO UPDATE clause. */ - @Support({ CUBRID, DERBY, POSTGRES_9_5 }) + @Support({ CUBRID, DERBY, POSTGRES_9_5, SQLITE }) InsertOnConflictConditionStep whereExists(Select select); /** * Add a WHERE NOT EXISTS clause to the INSERT statement's * ON DUPLICATE KEY UPDATE or ON CONFLICT ... DO UPDATE clause. */ - @Support({ CUBRID, DERBY, POSTGRES_9_5 }) + @Support({ CUBRID, DERBY, POSTGRES_9_5, SQLITE }) InsertOnConflictConditionStep whereNotExists(Select select); } diff --git a/jOOQ/src/main/java/org/jooq/InsertOnDuplicateSetStep.java b/jOOQ/src/main/java/org/jooq/InsertOnDuplicateSetStep.java index d8d4460483..42065b572b 100644 --- a/jOOQ/src/main/java/org/jooq/InsertOnDuplicateSetStep.java +++ b/jOOQ/src/main/java/org/jooq/InsertOnDuplicateSetStep.java @@ -48,6 +48,7 @@ import static org.jooq.SQLDialect.MARIADB; import static org.jooq.SQLDialect.MYSQL; // ... import static org.jooq.SQLDialect.POSTGRES_9_5; +import static org.jooq.SQLDialect.SQLITE; // ... // ... // ... @@ -95,21 +96,21 @@ public interface InsertOnDuplicateSetStep { * Set values for UPDATE in the INSERT statement's * ON DUPLICATE KEY UPDATE or ON CONFLICT ... DO UPDATE clause. */ - @Support({ CUBRID, DERBY, HSQLDB, MARIADB, MYSQL, POSTGRES_9_5 }) + @Support({ CUBRID, DERBY, HSQLDB, MARIADB, MYSQL, POSTGRES_9_5, SQLITE }) InsertOnDuplicateSetMoreStep set(Field field, T value); /** * Set values for UPDATE in the INSERT statement's * ON DUPLICATE KEY UPDATE or ON CONFLICT ... DO UPDATE clause. */ - @Support({ CUBRID, DERBY, HSQLDB, MARIADB, MYSQL, POSTGRES_9_5 }) + @Support({ CUBRID, DERBY, HSQLDB, MARIADB, MYSQL, POSTGRES_9_5, SQLITE }) InsertOnDuplicateSetMoreStep set(Field field, Field value); /** * Set values for UPDATE in the INSERT statement's * ON DUPLICATE KEY UPDATE or ON CONFLICT ... DO UPDATE clause. */ - @Support({ CUBRID, DERBY, HSQLDB, MARIADB, MYSQL, POSTGRES_9_5 }) + @Support({ CUBRID, DERBY, HSQLDB, MARIADB, MYSQL, POSTGRES_9_5, SQLITE }) InsertOnDuplicateSetMoreStep set(Field field, Select> value); /** @@ -123,7 +124,7 @@ public interface InsertOnDuplicateSetStep { * Field<T>. jOOQ will attempt to convert values to their * corresponding field's type. */ - @Support({ CUBRID, DERBY, HSQLDB, MARIADB, MYSQL, POSTGRES_9_5 }) + @Support({ CUBRID, DERBY, HSQLDB, MARIADB, MYSQL, POSTGRES_9_5, SQLITE }) InsertOnDuplicateSetMoreStep set(Map map); /** @@ -135,7 +136,7 @@ public interface InsertOnDuplicateSetStep { * * @see #set(Map) */ - @Support({ CUBRID, DERBY, HSQLDB, MARIADB, MYSQL, POSTGRES_9_5 }) + @Support({ CUBRID, DERBY, HSQLDB, MARIADB, MYSQL, POSTGRES_9_5, SQLITE }) InsertOnDuplicateSetMoreStep set(Record record); } diff --git a/jOOQ/src/main/java/org/jooq/InsertOnDuplicateStep.java b/jOOQ/src/main/java/org/jooq/InsertOnDuplicateStep.java index cfcde674ad..1c82a0504c 100644 --- a/jOOQ/src/main/java/org/jooq/InsertOnDuplicateStep.java +++ b/jOOQ/src/main/java/org/jooq/InsertOnDuplicateStep.java @@ -50,6 +50,7 @@ import static org.jooq.SQLDialect.MARIADB; import static org.jooq.SQLDialect.MYSQL; // ... import static org.jooq.SQLDialect.POSTGRES_9_5; +import static org.jooq.SQLDialect.SQLITE; // ... // ... @@ -113,9 +114,9 @@ public interface InsertOnDuplicateStep extends InsertReturning /** * Add an ON CONFLICT clause to this INSERT statement. *

- * Only {@link SQLDialect#POSTGRES} has native support for this clause. The - * other dialects can emulate it using MERGE, if table meta - * data is available. + * Only {@link SQLDialect#POSTGRES} and {@link SQLDialect#SQLITE} have + * native support for this clause. The other dialects can emulate it using + * MERGE, if table meta data is available. */ @Support InsertOnConflictDoUpdateStep onConflict(Field... keys); @@ -123,9 +124,9 @@ public interface InsertOnDuplicateStep extends InsertReturning /** * Add an ON CONFLICT clause to this INSERT statement. *

- * Only {@link SQLDialect#POSTGRES} has native support for this clause. The - * other dialects can emulate it using MERGE, if table meta - * data is available. + * Only {@link SQLDialect#POSTGRES} and {@link SQLDialect#SQLITE} have + * native support for this clause. The other dialects can emulate it using + * MERGE, if table meta data is available. */ @Support InsertOnConflictDoUpdateStep onConflict(Collection> keys); @@ -133,9 +134,9 @@ public interface InsertOnDuplicateStep extends InsertReturning /** * Add an ON CONFLICT DO NOTHING clause to this INSERT statement. *

- * Only {@link SQLDialect#POSTGRES} has native support for this clause. The - * other dialects can emulate it using MERGE, if table meta - * data is available. + * Only {@link SQLDialect#POSTGRES} and {@link SQLDialect#SQLITE} have + * native support for this clause. The other dialects can emulate it using + * MERGE, if table meta data is available. */ @Support InsertReturningStep onConflictDoNothing(); @@ -160,7 +161,7 @@ public interface InsertOnDuplicateStep extends InsertReturning *

* H2 supports this clause in MySQL mode. */ - @Support({ CUBRID, DERBY, H2, HSQLDB, MARIADB, MYSQL, POSTGRES_9_5 }) + @Support({ CUBRID, DERBY, H2, HSQLDB, MARIADB, MYSQL, POSTGRES_9_5, SQLITE }) InsertOnDuplicateSetStep onDuplicateKeyUpdate(); /** @@ -183,7 +184,7 @@ public interface InsertOnDuplicateStep extends InsertReturning *

INSERT IGNORE INTO ..
* * - * {@link SQLDialect#POSTGRES_9_5} + * {@link SQLDialect#POSTGRES_9_5} and {@link SQLDialect#SQLITE} *
INSERT INTO .. ON CONFLICT DO NOTHING
* * diff --git a/jOOQ/src/main/java/org/jooq/InsertQuery.java b/jOOQ/src/main/java/org/jooq/InsertQuery.java index 8c4001d87e..bfe51128e0 100644 --- a/jOOQ/src/main/java/org/jooq/InsertQuery.java +++ b/jOOQ/src/main/java/org/jooq/InsertQuery.java @@ -130,7 +130,7 @@ public interface InsertQuery extends StoreQuery, Insert void onConflict(Collection> fields); /** - * Whether use a On CONFLICT or + * Whether use a ON CONFLICT or * ON CONFLICT ON CONSTRAINT clause in this INSERT * statement. */ @@ -138,7 +138,7 @@ public interface InsertQuery extends StoreQuery, Insert void onConflictOnConstraint(Name constraint); /** - * Whether use a On CONFLICT or + * Whether use a ON CONFLICT or * ON CONFLICT ON CONSTRAINT clause in this INSERT * statement. */ @@ -146,7 +146,7 @@ public interface InsertQuery extends StoreQuery, Insert void onConflictOnConstraint(Constraint constraint); /** - * Whether use a On CONFLICT or + * Whether use a ON CONFLICT or * ON CONFLICT ON CONSTRAINT clause in this INSERT * statement. */ @@ -166,7 +166,7 @@ public interface InsertQuery extends StoreQuery, Insert * * @see InsertOnDuplicateStep#onDuplicateKeyUpdate() */ - @Support({ CUBRID, DERBY, H2, HSQLDB, MARIADB, MYSQL, POSTGRES_9_5 }) + @Support({ CUBRID, DERBY, H2, HSQLDB, MARIADB, MYSQL, POSTGRES_9_5, SQLITE }) void onDuplicateKeyUpdate(boolean flag); /** @@ -185,7 +185,7 @@ public interface InsertQuery extends StoreQuery, Insert *
INSERT IGNORE INTO ..
* * - * {@link SQLDialect#POSTGRES_9_5} + * {@link SQLDialect#POSTGRES_9_5} and {@link SQLDialect#SQLITE} *
INSERT INTO .. ON CONFLICT DO NOTHING
* * @@ -230,7 +230,7 @@ public interface InsertQuery extends StoreQuery, Insert * * @see InsertOnDuplicateStep#onDuplicateKeyUpdate() */ - @Support({ CUBRID, DERBY, H2, HSQLDB, MARIADB, MYSQL, POSTGRES_9_5 }) + @Support({ CUBRID, DERBY, H2, HSQLDB, MARIADB, MYSQL, POSTGRES_9_5, SQLITE }) void addValueForUpdate(Field field, T value); /** @@ -239,7 +239,7 @@ public interface InsertQuery extends StoreQuery, Insert * * @see InsertOnDuplicateStep#onDuplicateKeyUpdate() */ - @Support({ CUBRID, DERBY, H2, HSQLDB, MARIADB, MYSQL, POSTGRES_9_5 }) + @Support({ CUBRID, DERBY, H2, HSQLDB, MARIADB, MYSQL, POSTGRES_9_5, SQLITE }) void addValueForUpdate(Field field, Field value); /** @@ -252,7 +252,7 @@ public interface InsertQuery extends StoreQuery, Insert * * @see InsertOnDuplicateStep#onDuplicateKeyUpdate() */ - @Support({ CUBRID, DERBY, H2, HSQLDB, MARIADB, MYSQL, POSTGRES_9_5 }) + @Support({ CUBRID, DERBY, H2, HSQLDB, MARIADB, MYSQL, POSTGRES_9_5, SQLITE }) void addValuesForUpdate(Map map); /** @@ -264,7 +264,7 @@ public interface InsertQuery extends StoreQuery, Insert * * @param condition The condition */ - @Support({ CUBRID, DERBY, POSTGRES_9_5 }) + @Support({ CUBRID, DERBY, POSTGRES_9_5, SQLITE }) void addConditions(Condition condition); /** @@ -276,7 +276,7 @@ public interface InsertQuery extends StoreQuery, Insert * * @param conditions The condition */ - @Support({ CUBRID, DERBY, POSTGRES_9_5 }) + @Support({ CUBRID, DERBY, POSTGRES_9_5, SQLITE }) void addConditions(Condition... conditions); /** @@ -288,7 +288,7 @@ public interface InsertQuery extends StoreQuery, Insert * * @param conditions The condition */ - @Support({ CUBRID, DERBY, POSTGRES_9_5 }) + @Support({ CUBRID, DERBY, POSTGRES_9_5, SQLITE }) void addConditions(Collection conditions); /** @@ -300,7 +300,7 @@ public interface InsertQuery extends StoreQuery, Insert * * @param condition The condition */ - @Support({ CUBRID, DERBY, POSTGRES_9_5 }) + @Support({ CUBRID, DERBY, POSTGRES_9_5, SQLITE }) void addConditions(Operator operator, Condition condition); /** @@ -312,7 +312,7 @@ public interface InsertQuery extends StoreQuery, Insert * * @param conditions The condition */ - @Support({ CUBRID, DERBY, POSTGRES_9_5 }) + @Support({ CUBRID, DERBY, POSTGRES_9_5, SQLITE }) void addConditions(Operator operator, Condition... conditions); /** @@ -324,7 +324,7 @@ public interface InsertQuery extends StoreQuery, Insert * * @param conditions The condition */ - @Support({ CUBRID, DERBY, POSTGRES_9_5 }) + @Support({ CUBRID, DERBY, POSTGRES_9_5, SQLITE }) void addConditions(Operator operator, Collection conditions); /** diff --git a/jOOQ/src/main/java/org/jooq/LoaderOptionsStep.java b/jOOQ/src/main/java/org/jooq/LoaderOptionsStep.java index ea28441094..41787b792e 100644 --- a/jOOQ/src/main/java/org/jooq/LoaderOptionsStep.java +++ b/jOOQ/src/main/java/org/jooq/LoaderOptionsStep.java @@ -48,6 +48,7 @@ import static org.jooq.SQLDialect.MARIADB; import static org.jooq.SQLDialect.MYSQL; // ... import static org.jooq.SQLDialect.POSTGRES_9_5; +import static org.jooq.SQLDialect.SQLITE; // ... // ... // ... @@ -108,7 +109,7 @@ public interface LoaderOptionsStep extends LoaderSourceStep * the default. This cannot be combined with {@link #onDuplicateKeyError()} * or {@link #onDuplicateKeyIgnore()} */ - @Support({ CUBRID, DERBY, HSQLDB, MARIADB, MYSQL, POSTGRES_9_5 }) + @Support({ CUBRID, DERBY, HSQLDB, MARIADB, MYSQL, POSTGRES_9_5, SQLITE }) LoaderOptionsStep onDuplicateKeyUpdate(); /** diff --git a/jOOQ/src/main/java/org/jooq/impl/InsertQueryImpl.java b/jOOQ/src/main/java/org/jooq/impl/InsertQueryImpl.java index 4dfb8035b4..8499e04275 100644 --- a/jOOQ/src/main/java/org/jooq/impl/InsertQueryImpl.java +++ b/jOOQ/src/main/java/org/jooq/impl/InsertQueryImpl.java @@ -69,7 +69,6 @@ import static org.jooq.impl.Keywords.K_INTO; import static org.jooq.impl.Keywords.K_ON_CONFLICT; import static org.jooq.impl.Keywords.K_ON_CONSTRAINT; import static org.jooq.impl.Keywords.K_ON_DUPLICATE_KEY_UPDATE; -import static org.jooq.impl.Keywords.K_OR; import static org.jooq.impl.Keywords.K_SET; import static org.jooq.impl.Keywords.K_VALUES; import static org.jooq.impl.Keywords.K_WHERE; @@ -327,7 +326,8 @@ final class InsertQueryImpl extends AbstractStoreQuery impl - case POSTGRES: { + case POSTGRES: + case SQLITE: { toSQLInsert(ctx); ctx.formatSeparator() .start(INSERT_ON_DUPLICATE_KEY_UPDATE) @@ -418,8 +418,7 @@ final class InsertQueryImpl extends AbstractStoreQuery impl case MARIADB: case MYSQL_5_7: case MYSQL_8_0: - case MYSQL: - case SQLITE: { + case MYSQL: { toSQLInsert(ctx); ctx.start(INSERT_ON_DUPLICATE_KEY_UPDATE) .end(INSERT_ON_DUPLICATE_KEY_UPDATE); @@ -432,7 +431,8 @@ final class InsertQueryImpl extends AbstractStoreQuery impl case POSTGRES_9_5: case POSTGRES_10: case POSTGRES_11: - case POSTGRES: { + case POSTGRES: + case SQLITE: { toSQLInsert(ctx); ctx.formatSeparator() .start(INSERT_ON_DUPLICATE_KEY_UPDATE) @@ -543,13 +543,12 @@ final class InsertQueryImpl extends AbstractStoreQuery impl .visit(K_INSERT) .sql(' '); - // [#1295] [#4376] MySQL and SQLite have native syntaxes for - // INSERT [ OR ] IGNORE + // [#1295] MySQL dialects have native syntax for INSERT IGNORE + // [#4376] [#8433] for SQLite render using ON CONFLICT DO NOTHING + // rather than INSERT OR IGNORE if (onDuplicateKeyIgnore) if (SUPPORT_INSERT_IGNORE.contains(ctx.family())) ctx.visit(K_IGNORE).sql(' '); - else if (SQLDialect.SQLITE == ctx.family()) - ctx.visit(K_OR).sql(' ').visit(K_IGNORE).sql(' '); ctx.visit(K_INTO) .sql(' ')