#document-database #disk #saved #collection #db #path #write

json-db

Simple library for a document database saved on disk

2 releases

0.1.2 Jan 22, 2023
0.1.1 Jan 22, 2023
0.1.0 Jan 22, 2023

#2341 in Database interfaces

27 downloads per month

Apache-2.0

8KB
143 lines

json-db

Simple library for a document database saved on disk

Usage

let db = JsonDB::init("your db name")?;

// Create a collection
db.create_collection("your collection path")?;

// Write data to a document in a collection
db.write("your collection path", "your document", "struct that implements serde::Serialize")?;

// Read data from a document in a collection
let data: impl serde::Deserialize = db.read("your collection path", "your document")?;

// Delete document in a collection
db.delete("your collection path", "your document")?;

// List all document in a collection
let list: Vec<String> = db.list("your collection path")?

Dependencies

~0.7–1.5MB
~34K SLoC