aboutsummaryrefslogtreecommitdiff
path: root/src/db.rs
diff options
context:
space:
mode:
authorFxQnLr <[email protected]>2024-02-18 21:16:46 +0100
committerFxQnLr <[email protected]>2024-02-18 21:16:46 +0100
commit2f9f18b80a9e2134f674f345e48a5f21de5efadd (patch)
treec4202bb5c1a490233e89d928cf8c5b91258d4c90 /src/db.rs
parent016fa3a31f8847d3f52800941b7f8fe5ef872240 (diff)
downloadwebol-2f9f18b80a9e2134f674f345e48a5f21de5efadd.tar
webol-2f9f18b80a9e2134f674f345e48a5f21de5efadd.tar.gz
webol-2f9f18b80a9e2134f674f345e48a5f21de5efadd.zip
Refactor stuff. Use Postgres Types
Diffstat (limited to 'src/db.rs')
-rw-r--r--src/db.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/db.rs b/src/db.rs
index 489a000..47e907d 100644
--- a/src/db.rs
+++ b/src/db.rs
@@ -1,13 +1,13 @@
1use serde::Serialize; 1use serde::Serialize;
2use sqlx::{PgPool, postgres::PgPoolOptions}; 2use sqlx::{PgPool, postgres::PgPoolOptions, types::{ipnetwork::IpNetwork, mac_address::MacAddress}};
3use tracing::{debug, info}; 3use tracing::{debug, info};
4 4
5#[derive(Serialize, Debug)] 5#[derive(Serialize, Debug)]
6pub struct Device { 6pub struct Device {
7 pub id: String, 7 pub id: String,
8 pub mac: String, 8 pub mac: MacAddress,
9 pub broadcast_addr: String, 9 pub broadcast_addr: String,
10 pub ip: String, 10 pub ip: IpNetwork,
11 pub times: Option<Vec<i64>> 11 pub times: Option<Vec<i64>>
12} 12}
13 13