-
-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sqlite error: no such table: tablename_returning_temp #107
Comments
@ExtraHash thanks for the report and the branch that reproduces it, I'll look into it when I get a chance! |
Sounds good, let me know if I can help by providing more info or anything. |
Hello again, I happened to be reading the function i was having trouble with on this and had an epiphany about what was triggering it, and was able to build a small reproduction repo: https://github.com/ExtraHash/trilogy_bug_reprod/blob/master/src/index.ts#L23 Apparently, it's Promise.all() that is the cause. If i load up an array full of
|
Seems like there's a race condition where that temp table is created/removed: This is probably best solved along with #102, although interestingly I have used |
Adding a method for bulk insert is still on the table, but it's worth noting this would also likely be resolved if we could rely on native That would replace the workaround in trilogy that uses temporary separate tables and the triggers that pull from them. We'll need this PR to be merged: |
Running into this bug now, any advice on how to insert about 10 rows around the same time? |
I think at this point Another option as a workaround would be to wait for the previous insert to finish before starting the new one, which I know isn't ideal. |
description
I attempted to port a class i had which used knex to manage an sqlite database to this library. I'm getting these type of errors from both the sql.js and the sqlite3 driver.
It seems to happen specifically if I perform several rapid calls to the model.create() function.
Along this line of thinking, I attempted to create a small reproduction repo, but i constructed some similar data to what i'm saving and hammered the create() function as fast as I could, and had no dice getting it to throw. You can reproduce this bug if you run
yarn test
on this repo on thetrilogy
branch:https://github.com/vex-chat/libvex-js
I apologize I wasn't able to get a small reproduction of this, but hopefully you have some idea of what is going on by the stack trace.
error
expected
no error should be thrown
actual
error is thrown
Thank you
The text was updated successfully, but these errors were encountered: