You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import{Database}from"bun:sqlite";constdb=newDatabase("dirty.sqlite",{create:true})constprep=db.prepare(`SELECT "hello"`)db.exec("pragma journal_mode = wal")// NOTE: If this line is uncommented, the `shm` and `wal` files are removed on exit// prep.finalize()db.close()
What is the expected behavior?
Normally, the shm and wal files are cleaned up on close. I suppose that's what's expected, but.. if manual finalize is required then it should probably be documented.
What do you see instead?
$ ls | grep dirty
dirty.sqlite
dirty.sqlite-shm
dirty.sqlite-wal
Additional information
No response
The text was updated successfully, but these errors were encountered:
it looks like calling .finalize() on prep doesn't work if there happened any writes:
import{Database}from'bun:sqlite'constdb=newDatabase('test.db')db.exec('PRAGMA journal_mode = WAL')// or simply db.exec('CREATE TABLE test (id INTEGER PRIMARY KEY)')constprep=db.prepare('CREATE TABLE test (id INTEGER PRIMARY KEY)')prep.run()prep.finalize()db.close()
❱ bun test.js
❱ ls test.db*
test.db test.db-shm test.db-wal
and in the code in the op, the .finalize() call doesn't seem to matter either anymore, btw.
has something changed in the last year?
What version of Bun is running?
0.5.8
What platform is your computer?
Linux 5.15.0-69-generic x86_64 x86_64
What steps can reproduce the bug?
Run this bun program at least twice:
What is the expected behavior?
Normally, the
shm
andwal
files are cleaned up on close. I suppose that's what's expected, but.. if manualfinalize
is required then it should probably be documented.What do you see instead?
$ ls | grep dirty dirty.sqlite dirty.sqlite-shm dirty.sqlite-wal
Additional information
No response
The text was updated successfully, but these errors were encountered: