tl;dr:
This week in Heave (2025.10.17)
Hey everyone,
It’s been a really productive week, and I'm super excited to share the progress I've made. I’ve been focused on hardening the library's foundation, and the results are something to be proud of.
The first thing I want to shout about is that all automated tests are green! I went on a bit of a testing spree, adding coverage for almost every part of the catalog
and the underlying sqlite
module. From basic get
and delete
functions to more complex persistence and data loading logic, I now have a solid safety net. This is a huge milestone for us, as it gives us the confidence to build new features without accidentally breaking things.
Another massive win for stability is that the library no longer panics on data conversion errors. Previously, if you tried to map an attribute to the wrong type, the program would just crash. That’s not a great experience! I've ripped out the old panic!
calls and replaced them with proper error handling by using TryFrom<Value>
. Now, instead of a crash, you’ll get a manageable error that you can handle gracefully in your own code.
Finally, I’ve made a key improvement to how the in-memory catalog works. The insert
function has been upgraded to an upsert
, which lets you create or update entities seamlessly. More importantly, the catalog's in-memory state is now perfectly coherent with the database after you persist your changes. This means what you see in your code is what you have in your database—no more guesswork or stale state.
I've updated the README
to reflect these changes and added a small disclaimer for early adopters. I am still moving fast, so expect some bumps along the way, but I're committed to making this library as reliable as possible.
These changes represent a big step forward in maturity and stability. Thanks for following along
Chore
- delete test scenarios used during initial implementation
- run cargo format
- update comments using upsert instead of insert
- increase verbosity level for cargo semver checks output
Doc
- update README with the new upsert function for catalog
- add a disclaimer on breaking changes and bugs for early adopters
Feat
- add EntityState::Updated, change name from insert to upsert in catalog
- catalog state is changed after persist, in memory state reflects db
Fix
- handle EntityState::Updated state while persisting catalog
- change expected entity status in test after changing from insert to upsert
- map error coming from sqlite module to correct FailedTo function error
Review
- change trait req for entity unwrap* functions to TryFrom
to handle errors - change trait requirements for EAV implementors
- replace panic! with generic rusqlite error while mapping attributes
Test
- add tests to catalog.get function
- add tests to catalog.list_by_class function
- add tests for catalog.list_by_class_and_attribute function
- add tests to catalog.delete function
- add tests to catalog.persist function
- add tests to catalog.persist function
- add tests to catalog.persist function
- add tests to catalog.load_by_id function
- add integration tests to catalog
- add tests to catalog.load_by_class function
- add tests to sqlite_init_db function
- add tests to sqlite_load_attributes function
- add tests to sqlite_load_by_class function
- add tests to sqlite_load_by_id function
- add tests to sqlite_map_row_to_attribute function
- add tests to sqlite_map_row_to_entity function
- add tests to sqlite_persist_catalog function
tags: #rust, #devlog, #project:heave