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
//! # `Sqlorm`
//!
//! **An ergonomic lightweight SQL framework for comfortable database operations.**
//!
//! ## Overview
//!
//! Sqlorm is a lightweight sql framework based on [sqlx](https://github.com/launchbadge/sqlx).
//!
//! It provides macro-generated code for communicating with database, and it is designed to be performant and easy to use.
//!
//! ## Main features:
//! - **Easy to use**: Sqlorm generates all code for specific struct using `sqlorm::table` macro.
//! - **Type-safe (mostly)**: Since 90% of code is geneated at compile time, all types are checked at compile time.
//! - **Performant**: Sqlorm introduces a minimal overhead over sqlx (thanks to macros).
//!
//! To get start, look at [`sqlorm::table`](https://docs.rs/sqlorm/latest/sqlorm/attr.table.html)
//!
//! ## Todo list:
//! - [x] Generic, type-safe query builder for each entity.
//! - [x] Support for postgres.
//! - [x] Support for sqlite.
//! - [x] Support for most common relations (belongs-to, has-many, has-one).
//! - [x] Modular system for optional extended functionality (additional ways to query, etc).
//! - [x] Partial update support ( a big one )
//! - [x] Limit, offset support
//! - [x] Improved filtering system. ( OR, AND )
//! - [x] Renaming fields
//! - [x] Soft delete support
//! - [x] Transactions
//! - [x] Order-by clauses
//! - [ ] Improved update, delete QueryBuilder. (e.g. User::insert())
//! - [ ] Cross-relations filters
//! - [ ] Add support for custom, user-defined selectable types
//! - Problems:
//! When loading relations batch, we need to move all foreign filters from original query to
//! batch query. For that we need to rebuild qb and executor
//! //! e.g. User::query().with_posts().filter(Post::read_time.gt_(4))
//!
//! Optional todos:
//! -[ ] Compile-time entity<->schema type check
//!
//!
//!
//! ## Usage
//!
//! To use this crate you must activate **one** of the following features (else the crate wont compile):
//! - `postgres`
//! - `sqlite`
pub use HashMap;
pub use *;
pub use ;
pub use Entity;
pub use table;