18 lines
322 B
Rust
18 lines
322 B
Rust
use super::schema::events;
|
|
|
|
#[derive(Queryable, Debug)]
|
|
pub struct Event {
|
|
pub id: i32,
|
|
pub devicename: String,
|
|
pub value: i32,
|
|
pub timestamp: String,
|
|
}
|
|
|
|
#[derive(Insertable)]
|
|
#[table_name = "events"]
|
|
pub struct NewEvent<'a> {
|
|
pub devicename: &'a str,
|
|
pub value: i32,
|
|
pub timestamp: &'a str,
|
|
}
|