From 62eda41e673e6397112eec319b825dc12972f35b Mon Sep 17 00:00:00 2001 From: glendc Date: Mon, 8 Apr 2024 23:56:57 +0200 Subject: [PATCH] add changelog for 0.1.0 --- CHANGELOG.md | 50 ++++++++++++++++++++++++++++++++++++++++++++++++-- README.md | 4 ++-- 2 files changed, 50 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b74d32b..7843359 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,52 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -# Unreleased +# 0.1.0 (2024-04-09) -- None. \ No newline at end of file +Implement the first version of this library, `venndb`. +Released as `venndb` (0.1.0) and `venndb-macros` (0.1.0). + +API Example: + +```rust +use venndb::VennDB + +#[derive(Debug, VennDB)] +pub struct Employee { + #[venndb(key)] + id: u32, + name: String, + is_manager: bool, + is_admin: bool, + #[venndb(skip)] + foo: bool, + #[venndb(filter)] + department: Department, +} + +fn main() { + let db = EmployeeDB::from_iter(/* .. */); + + let mut query = db.query(); + let employee = query + .is_admin(true) + .is_manager(false) + .department(Department::Engineering) + .execute() + .expect("to have found at least one") + .any(); + + println!("non-manager admin engineer: {:?}", employee); +} +``` + +This API, using nothing more then a `derive` macro allows to: + +- store rows of data in a generated `database`; +- query the database using the defined `filter` fields; +- get references to rows directly by a `key`; + +The crate comes with examples and a detailed README. + +Please share with us if you have any feedback about this first version, +how you are using it, what you would like different, etc. diff --git a/README.md b/README.md index 56babc1..c1814b4 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,7 @@ to learn how to use the `VennDB` and its generated code. > ❓ Why use this over Database X? -`venndb` is not a database, but is close enough for some specific purposes. It shines for long-lived read-only use cases where you need to filter on plenty of binary properties and get a rando mmatching result. +`venndb` is not a database, but is close enough for some specific purposes. It shines for long-lived read-only use cases where you need to filter on plenty of binary properties and get a rando matching result. Do not try to replace your usual database needs with it. @@ -105,7 +105,7 @@ Alternatively you can also [join our Discord][discord-url] and start a conversat > ❓ Can I use _any_ type for a `#[venndb(filter)]` property? Yes, as long as it implements `PartialEq + Eq + Hash + Clone`. -That said, we do recomment that you use `enum` values if you can, or some other highly restricted form. +That said, we do recommend that you use `enum` values if you can, or some other highly restricted form. Using for example a `String` directly is a bad idea as that would mean that `bE` != `Be` != `BE` != `Belgium` != `Belgique` != `België`. Even though these are really referring all to the same country. In such cases a much better idea is to at the very least create a wrapper type such as `struct Country(String)`, to allow you to enforce sanitization/validation when creating the value and ensuring the hashes will be the same for those values that are conceptually the same.