yiisoft / yiisoft/db-sqlite

Error on `upsert()` to table with several unique/primary keys

Open
#394 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type:bug
Dominant language
PHP
Stars
30
Forks
13
Avg merge
1d 23h
Merged PRs (30d)
3

Description

There is table with one primary key and yet another unique key. On upsert() usage throws error:

SQLSTATE[HY000]: General error: 1 ON CONFLICT clause does not match any PRIMARY KEY or UNIQUE constraint

Seems for SQLite requires created separate ON CONFLICT clause for each of keys.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported upsert() failure against a SQLite table with one primary key and another unique key. Inspect the SQLite driver's upsert path and add or update coverage for this schema; done means the upsert succeeds without the ON CONFLICT constraint error.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, sqlite
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.