khonsulabs / bonsaidb

A developer-friendly document database that grows with you, written in Rust
https://bonsaidb.io/
Apache License 2.0
1.01k stars 37 forks source link

PrimaryKey of () causes uncoverable collection #224

Closed ecton closed 2 years ago

ecton commented 2 years ago

A user tried to use a primary key of () to create a singleton-like colleciton. This is currently causing a crash upon attempting to push a second value:

https://gist.github.com/freopen/301f977fa6a8c76333410dfc31e84df8

ecton commented 2 years ago

This has been fixed in an upstream dependency, arc-bytes:

https://github.com/khonsulabs/arc-bytes/commit/e9f098382f2d87a0313e395aaafb66f09378c24f

Running cargo update should pull in version 0.3.4, which contains the fix. Running the sample code twice now produces a DocumentConflict, rather than a crash.