Skip to content

Commit

Permalink
Merge pull request #46 from richardhozak/fix-get-on-empty-db
Browse files Browse the repository at this point in the history
Fix PkvStore::get not returning NotFound on empty db when building for native (redb)
  • Loading branch information
johanhelsing authored Jan 12, 2024
2 parents bc654c5 + 97a79b5 commit b5beb2b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/redb_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ impl ReDbStore {
.expect("Failed to create directory to init key value store");
let db_path = dir_path.join("bevy_pkv.redb");
let db = Database::create(db_path).expect("Failed to init key value store");

let write_txn = db.begin_write().unwrap();
write_txn.open_table(TABLE).unwrap();
write_txn.commit().unwrap();

Self { db }
}
}
Expand Down

0 comments on commit b5beb2b

Please sign in to comment.