started with ormx bot found a lack of documentation that made me stop

first_own_trials
Gandalf 2023-06-11 17:00:50 +02:00
parent 1a5003347c
commit 20a6d1e114
1 changed files with 26 additions and 0 deletions

26
src/types.rs Normal file
View File

@ -0,0 +1,26 @@
#[derive(ormx::Table)]
#[ormx(table = "users", id = user_id, insertable)]
struct User {
#[ormx(column = "id")]
user_id: u32,
name: String,
#[ormx(get_optional(&str))]
email: String,
#[ormx(default, set)]
last_login: Option<NaiveDateTime>,
password: String, // sure about the type?
}
#[derive(ormx::Table)]
#[ormx(table = "trees", insertable)]
struct Tree {
id: u32,
lat: i32,
lon: i32,
#[ormx(get_optional(&str))]
species: String,
age: u32,
health: String,
}