GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: parse UPDATE OR conflict algorithms in the SQLite dialect by DylanMerigaud · Pull Request #2885 · JSQLParser/JSqlParser

Conversation

@DylanMerigaud

@DylanMerigaud DylanMerigaud commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Part of #2852 (the UPDATE OR part; WITHOUT ROWID and STRICT are not in this PR).

INSERT OR REPLACE already parsed, and #2853 added INSERT OR ABORT, FAIL, IGNORE and ROLLBACK. SQLite takes the same five conflict algorithms after UPDATE OR (lang_update), and the issue's table shows UPDATE OR IGNORE t SET a = 1 and UPDATE OR REPLACE t SET a = 1 stopping at Encountered: <K_UPDATE> / "UPDATE".

What changes:

  • New enum UpdateConflictAlgorithm (ABORT, FAIL, IGNORE, REPLACE, ROLLBACK), next to UpdateModifierPriority.
  • Update gets getConflictAlgorithm(), setConflictAlgorithm() and withConflictAlgorithm(). The value is null for an UPDATE without OR, so existing statements build the same object. Update.toString() and UpdateDeParser print OR <algorithm> right after UPDATE.
  • The Update production reads [ <K_OR> RelObjectName() ] after UPDATE, and AbstractJSqlParser.updateOrAlgorithm maps the word to the enum. This is the shape feat: parse INSERT OR ABORT, FAIL, IGNORE and ROLLBACK (SQLite) #2853 settled on for INSERT OR, which keeps the addition to CCJSqlParser to one optional (the constant-pool headroom of JaCoCo instrumentation of CCJSqlParser is approaching the constant-pool limit #2866).
  • UPDATE OR needs Dialect.SQLITE. Without it, or with a word that is not one of the five, the statement is a parse error.
  • usage.rst lists UPDATE OR in the SQLITE row of the dialect table.

Tests, all in SQLiteTest:

  • testUpdateOrConflictAlgorithm, one case per algorithm: parse and round trip through toString() and the deparser, in upper and lower case, and getConflictAlgorithm() returns that algorithm.
  • testUpdateOrConflictAlgorithmNeedsSqliteDialect, one case per algorithm: rejected without the dialect.
  • testUpdateOrUnknownAlgorithm: UPDATE OR NOTHING is rejected with the dialect.
  • testUpdateWithoutConflictAlgorithm: a plain UPDATE keeps getConflictAlgorithm() null.

The two rejection tests would also pass on a parser with no UPDATE OR support at all; a comment above each says so. They pin the dialect guard and the word check.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@DylanMerigaud
feat: parse UPDATE OR conflict algorithms in the SQLite dialect
e60aeb9
SQLite accepts ABORT, FAIL, IGNORE, REPLACE and ROLLBACK after
UPDATE OR. Update gets a conflictAlgorithm (UpdateConflictAlgorithm),
printed by toString() and UpdateDeParser. The grammar reads the word
with RelObjectName and AbstractJSqlParser.updateOrAlgorithm decides
it, as INSERT OR does. UPDATE OR needs Dialect.SQLITE.

Part of JSQLParser#2852
@chinmayajha chinmayajha mentioned this pull request Nov 6, 2026
feat: parse SQLite WITHOUT ROWID and STRICT table options #2903
Open
@manticore-projects
manticore-projects merged commit e27929f into JSQLParser:master Nov 9, 2026
16 of 17 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@manticore-projects

manticore-projects commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Thank you for your contribution!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@DylanMerigaud @manticore-projects
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.