m4heshd / better-sqlite3-multiple-ciphers

better-sqlite3 with multiple-cipher encryption support 🔒
MIT License
137 stars 27 forks source link

Async/await support with `iterate()` #97

Closed titanism closed 1 month ago

titanism commented 1 month ago

Curious as to the support of async/await, e.g. await foo() inside an iterate() call?

https://github.com/m4heshd/better-sqlite3-multiple-ciphers/blob/master/docs/api.md#iteratebindparameters---iterator

titanism commented 1 month ago

Also if an error is thrown inside, it doesn't seem to exit the iterator.

m4heshd commented 1 month ago

Did you check to see if it functions properly on the upstream? If not, this issue should be opened on the BS3 repo instead.

titanism commented 1 month ago

It doesn't, in both cases if you have a promise that rejects inside of a transaction, then the rejected error doesn't get caught and it keeps iterating.

m4heshd commented 1 month ago

I see. Then I urge you to open an issue there (I see that you already did) to get proper support for this. Glad you caught this. Closing the issue here.

titanism commented 1 month ago

https://github.com/WiseLibs/better-sqlite3/issues/1218

titanism commented 1 month ago

seemed to be a bug in my code, closing