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
//! In-memory SQL-like query engine and lightweight data store.
//!
//! `fosk` lets tests and prototypes create JSON-backed collections in memory,
//! then query them with a small SQL-like language. Most users start with
//! [`Db`], configure id behavior with [`DbConfig`] and [`IdType`], and work
//! with collection handles returned by [`Db::create`] or [`Db::get`].
//!
//! # Example
//!
//! ```
//! use fosk::{Db, DbConfig};
//! use serde_json::json;
//!
//! let db = Db::new_with_config(DbConfig::int("id"));
//! let people = db.create("people");
//!
//! people.add(json!({ "name": "Ada", "age": 37 }));
//!
//! let rows = db
//! .query("SELECT id, name FROM people WHERE age > 30")
//! .expect("query should execute");
//!
//! assert_eq!(rows.len(), 1);
//! ```
/// Database handles, collection handles, configuration, and schema metadata.
pub use ;