rusty-postgres-0.1.1-beta has been yanked.

A Advanced Lightwight ORM and Query Builder for postgres
Usage
Create Schema without any hassale
let shop = model! {
"shop" => {
"id" => {
ID(UUID),NOTNULL,UNIQUE
},
"name" => {
Date(NOW)
},
"time" => {
Time(NOW)
},
"fingerprint" => {
DateTime(NOW)
},
"age" => {
NUMBER,DEFAULT(24)
},
"place" => {
STRING,NOTNULL,UNIQUE,INDEX,PRIMARY
},
"location" => {
Geography(POINT(Epsg4326))
}
"accuracy" => {
FLOAT,DEFAULT(0.0)
},
"bool" => {
BOOL
}
},
partition:{
type:"list",
to:"place"
}
};
Container
Build Schema
let container = container! {
client => postgres,
models => {
shop
}
};
Create
let create = create! {
connection => postgres,
model:"user_",
data:{
"story" => "billionairehari",
"age" => 24 as i32
},
select:{
"id"
}
};
FindOne
let find = find_one! {
connection => postgres,
model:"elonmusk",
select:{
"id"
},
condition:{
"story" => "billionairehari"
}
};
FindMany
let find = find_many! {
connection => postgres,
model:"elonmusk",
conditions:{
or => {
"story" => "haribillionaire"
},
"story" => "haribillionaire"
},
limit:4
};
Update
let update = update! {
connection => postgres,
model:"elonmusk",
select:{
"story"
},
data:{
"story" => "billionairehari"
},
conditions:{
"story" => "billionaires"
}
};
Delete
let delete = delete! {
connection => postgres,
model:"elonmusk",
conditions:{
"story" => "billionairehari"
},
select:{
"story"
}
};
DROP
delete_table! {
connection => postgres,
model => "photo",
cascade
}
.unwrap();