#tauri-plugin-sql V2 Failed to load resource?

2 messages · Page 1 of 1 (latest)

dusty grail
#

I've been using tauri-plugin-sql V2 for a few months now with no issues, but even though I haven't been touching the query code, I've recently started seeing this error pop up:

Failed to load resource: the server responded with a status of 400 (Bad Request)

I think it's completely locking the database though 😭: "error returned from database: (code: 5) database is locked". p sure this is caused by the former error (see example)

dusty grail
#

For example in this screenshot...

  • await db.execute('BEGIN TRANSACTION;') resolves, but later...
  • await db.execute('COMMIT;') will reject with the error cannot commit - no transaction is active...
  • The 3 executes between them are all inserts, so the transaction should be active I think?

But if I look at my devtool sources tab, I can see that the very first execute (BEGIN TRANSACTION;) has a "failed to load resource" error (with a 200 response). Also, just by the timing of the logs, it looks like it's stalling?

also, since it's a 200, and the error is thrown elsewhere (via ipc?), the execute resolves, so there isn't a great way to handle errors. If any of the inserts fail (the same way), I end up with bad states, since we are no long respecting the BEGIN TRANSACTION;.

So basically... I am confused 😵‍💫