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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/// # All in one aka Aio Database
/// ### Locally preserved database example
/// ```rust
/// //This will create a Test.db file at G:\ location
/// let file_db = AioDatabase::create::<Person>("G:\\".into(), "Test".into()).await;
/// ```
/// ### In-memory database example
/// ```rust
/// let in_memory_db = AioDatabase::create_in_memory::<Person>("Test".into()).await;
/// ```
/// #### Create a model
/// ```rust
/// use rs_aio_db::Reflect;
///
/// #[derive(Default, Clone, Debug, Reflect)]
/// struct Person {
/// name: String,
/// age: i32,
/// height: i32,
/// married: bool,
/// }
/// ```
///
/// #### For Inserting values:
/// ```rust
/// file_db.insert_value(Person {
/// name: "Mylo".into(),
/// age: 0,
/// height: 0,
/// married: true
/// }).await;
/// ```
///
/// #### For getting existing values / records:
/// ```rust
/// let get_record = file_db
/// .query()
/// .field("age")
/// .where_is(Operator::Gt(5.to_string()), Some(Next::Or))
/// .field("name")
/// .where_is(Operator::Eq("Mylo".into()), None)
/// .get_many_values::<Person>().await;
/// ```
///
/// #### Update existing values / records:
/// ```rust
/// let update_rows = file_db
/// .query()
/// .field("age")
/// .where_is(Operator::Eq((0).to_string()), Some(Next::Or))
/// .update_value(Person {
/// name: "Mylo".into(),
/// age: 5,
/// height: 5,
/// married: false
/// }).await;
/// ```
///
/// #### Deleting existing values / records:
/// ```rust
/// let delete_rows = file_db
/// .query()
/// .field("name")
/// .where_is(Operator::Eq("Mylo".into()), None)
/// .delete_value::<Person>().await;
/// ```
pub use Reflect;
pub use ;