khonsulabs / bonsaidb

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

Entry API shouldn't require NamedCollection #313

Open ecton opened 7 months ago

ecton commented 7 months ago

Currently the only way to utilize the entry API is if you implement NamedCollection. This was done to make it so that the entry API can take an ID or the "name" key. We should offer a way to use an entry API via SerializedCollection that only allows the primary key.

This will cause conflicts with the NamedCollection API. I'm not sure if there's any way to unify the API without specialization, so most likely we should rename NamedCollection's entry API.