This crate is a set of macros used to generate simple CRUD functions for your Serde structs
Adom is not intended to be a full on ORM like diesel. Its for the people that want to use the postgres driver directly. But want to eliminate some of the boiler plate code on their simple table objects.
Add an attribute to the top of your struct to connect it to the DB table
```rust
pub struct Order{ id: i32, customer: String, total: f64, } ```
Congratulations nothing happened, but you can now use Adom
To use Adom add derive statements to add useful functions to your struct
```rust
pub struct Order{ id: i32, customer: String, total: f64, } ```
Each derive adds functions related to the DB action. Add only what you want or need
AdomSelect
AdomCreate
AdomUpdate
AdomDelete
There are a couple of helper attribute that modify the behaver of Adom
AdomColumn - used to if the struct field name doesn't match the DB columns name
```
pub struct Order{ id: i32, #[AdomColumn = "customer_name"] customer: String, total: f64, } ```
AdomIgnore - ignore a field on your struct
```
pub struct Order{
id: i32,
customer: String,
total: f64,
#[AdomIgnore]
randomextrafieldthathasnothingtodowith_db: Vec
AdomAuditable - auto fill and update the traditional DB auditing fields
```
pub struct Order{ id: i32, customer: String, total: f64, updatedat: SystemTime, createdat: SystemTime, updatedby: String, createdby: String, } ```