Expand description
§ergokv
ergokv is a library for easy integration with TiKV, providing derive macros for automatic CRUD operations.
§Usage
Add this to your Cargo.toml:
[dependencies]
ergokv = "0.1"Then, in your Rust file:
use ergokv::Store;
use serde::{Serialize, Deserialize};
use uuid::Uuid;
#[derive(Store, Serialize, Deserialize)]
struct User {
#[key]
id: Uuid,
#[index]
username: String,
email: String,
}This will generate load, save, delete, by_username, set_username, and set_email methods for User.
Re-exports§
pub use ciborium;pub use futures;pub use serde_json;
Structs§
- Local
Cluster - A structure storing a local cluster.
- Prefix
Trie - A prefix trie implementation that stores its nodes in TiKV.
Functions§
- connect
- Helper function to connect to a single or multiple TiKV pd-server
Derive Macros§
- Store
- Derives the
Storetrait for a struct, generating methods for CRUD operations in TiKV.