Whenever I use UPSERT statement, and the entry already exists ,I get the following error:
Uncaught ResponseError: There was a problem with a datastore transaction: An IndexedDB error occured: failed to execute indexed db request: ConstraintError: Key already exists in the object store.
Steps to reproduce
import { Surreal } from 'surrealdb';
import { surrealdbWasmEngines } from '@surrealdb/wasm';
const db = new Surreal({
engines: surrealdbWasmEngines({
strict: false,
capabilities: {
guest_access: true,
functions: true,
network_targets: true,
},
}),
});
await db.connect(`test://ns/db`);
await db.use({
namespace: 'ns',
database: 'db',
});
await db.query('UPSERT _:1 SET q = 1;');
await db.query('UPSERT _:1 SET q = 2;'); // fails
Describe the bug
Whenever I use
UPSERT
statement, and the entry already exists ,I get the following error:Steps to reproduce
Expected behaviour
Should update on matching id
SurrealDB version
"surrealdb": "^1.0.6", "@surrealdb/wasm": "^1.0.2"
Contact Details
dmitrii.a.baranov@gmail.com
Is there an existing issue for this?
Code of Conduct