Closed phiresky closed 4 years ago
Does this still make a problem? I haven't seen this happen.
This also only happened to me when my disk was overloaded so the db was kept locked for longer periods of time..
Testing it by forcing the db to lock via
❯ sqlite3 ~/.histdb/zsh-history.db
SQLite version 3.31.1 2020-01-27 19:55:54
Enter ".help" for usage hints.
sqlite> begin;
sqlite> create table a(b);
sqlite> # just keep it open
it does seem like it doesn't happen anymore - i think that's because of WAL - when wal is active, read queries like PRAGMA user_version
which migrate does still work when db is locked
I have same issue, I can't make this plugin work.
steps:
❯ sqlite3 ~/.histdb/zsh-history.db
SQLite version 3.31.1 2020-01-27 19:55:54
Enter ".help" for usage hints.
sqlite> begin;
sqlite> create table a(b);
sqlite> # just keep it open
Open new shell -> Error: near line 8: database is locked
histdb strace
give empty result.
@tmpm697 just that alone is not indicative of an issue, it's expected that if you keep the db locked intentionally you won't be able to write to it
This still seems to happen when the database does not exist at all (on the first run). not sure why
I'll see if I can reproduce and put in a check to make it not happen.
sqlite3 ~/.histdb/zsh-history.db
and copy the content of https://github.com/larkery/zsh-histdb/blob/master/db_migrations/0to2.sql
to the sqlite shell solve the problem
When a shell is started while the histdb database is locked, the shell interprets that as the current schema version being "" so it thinks the schema is outdated: