add real db
This commit is contained in:
8
src/models/link.rs
Normal file
8
src/models/link.rs
Normal file
@@ -0,0 +1,8 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct Link {
|
||||
id: u16,
|
||||
link: String,
|
||||
name: String,
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
mod link;
|
||||
mod value;
|
||||
pub use value::Value;
|
||||
pub use value::OPTIONS;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
use chrono::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug)]
|
||||
@@ -62,7 +61,7 @@ impl Value {
|
||||
};
|
||||
|
||||
sqlx::query!(
|
||||
"INSERT INTO data(service, device, type, data, date_data) VALUES (?, ?, ?, ?, NOW())",
|
||||
"INSERT INTO donnees(service, capteur, type, donnee, date_donnee) VALUES (?, ?, ?, ?, NOW())",
|
||||
option.service,
|
||||
option.device,
|
||||
option.r_type,
|
||||
|
||||
Reference in New Issue
Block a user