Skip to content

Commit

Permalink
SQLiteCompiler INSERT ON CONFLICT
Browse files Browse the repository at this point in the history
  • Loading branch information
safris committed Jun 19, 2023
1 parent 59b2b0d commit 52a6b16
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions jsql/src/main/java/org/jaxdb/jsql/SQLiteCompiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -345,15 +345,18 @@ void compileInsertOnConflict(final data.Column<?>[] columns, final Select.untype
compileInsert(columns, false, compilation);
}

sql.append(" ON CONFLICT (");
for (int i = 0, i$ = onConflict.length; i < i$; ++i) { // [A]
if (i > 0)
sql.append(", ");
sql.append(" ON CONFLICT ");
if (onConflict != null) {
sql.append('(');
for (int i = 0, i$ = onConflict.length; i < i$; ++i) { // [A]
if (i > 0)
sql.append(", ");

onConflict[i].compile(compilation, false);
onConflict[i].compile(compilation, false);
}
sql.append(')');
}

sql.append(')');
if (doUpdate) {
sql.append(" DO UPDATE SET ");

Expand Down

0 comments on commit 52a6b16

Please sign in to comment.