1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//! ScrivaDB Rust client — async gRPC wrapper over `proto/scriva.proto`.
//!
//! All methods are `async` and require a Tokio runtime.
//!
//! # Quick start
//!
//! ```rust,no_run
//! use scriva::{ScrivaDB, FilterInput, FilterOp, FindOptions};
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
//! let mut db = ScrivaDB::connect("localhost", 5433, "dev-key").await?;
//!
//! db.create_collection("users").await?;
//!
//! let id = db.insert("users", serde_json::json!({"name": "Alice", "age": 30})).await?;
//! let record = db.find_by_id("users", id).await?;
//! println!("{:?}", record);
//!
//! let admins = db.find("users", FindOptions {
//! filter: Some(FilterInput::field("role", FilterOp::Eq, "admin")),
//! ..Default::default()
//! }).await?;
//! println!("{} admins", admins.len());
//!
//! db.drop_collection("users").await?;
//! Ok(())
//! }
//! ```
// ScrivaDbError wraps tonic::Status (a large type) by design, so callers can match
// its NotFound / AlreadyExists variants directly; boxing it would obscure the API.
pub
pub use ;