aboutsummaryrefslogtreecommitdiff
path: root/src/db
diff options
context:
space:
mode:
authorNathan Perry <np@nathanperry.dev>2019-11-17 22:51:59 -0500
committerNathan Perry <np@nathanperry.dev>2019-11-17 22:51:59 -0500
commit8b2ccf363ac6894c21e256844948c8327645f0db (patch)
treef6742f2d7905613b8c0404bba46e237f984a8da2 /src/db
parent2a38c282dd57c2051a568549d62c80d6036e8920 (diff)
mostly fixed
Diffstat (limited to 'src/db')
-rw-r--r--src/db/mod.rs3
-rw-r--r--src/db/models.rs11
2 files changed, 11 insertions, 3 deletions
diff --git a/src/db/mod.rs b/src/db/mod.rs
index 2a6d1f4..db6cfb8 100644
--- a/src/db/mod.rs
+++ b/src/db/mod.rs
@@ -19,6 +19,9 @@ use r2d2_postgres::{
TlsMode,
};
+use anyhow::anyhow;
+use lazy_static::lazy_static;
+
use crate::{Error, Result};
pub use self::models::*;
diff --git a/src/db/models.rs b/src/db/models.rs
index a01a9c1..95acb16 100644
--- a/src/db/models.rs
+++ b/src/db/models.rs
@@ -1,5 +1,10 @@
use chrono::naive::NaiveDateTime;
-use diesel::prelude::*;
+use diesel::{
+ Identifiable,
+ Insertable,
+ prelude::*,
+ Queryable,
+};
use crate::{
db::schema::*,
@@ -57,7 +62,7 @@ impl NewMeme {
#[derive(Queryable, Identifiable, PartialEq, Debug)]
-#[table_name="audio"]
+#[table_name = "audio"]
pub struct Audio {
pub id: i32,
pub data: Vec<u8>,
@@ -97,7 +102,7 @@ impl Audio {
}
#[derive(Insertable, PartialEq, Debug)]
-#[table_name="audio"]
+#[table_name = "audio"]
pub struct NewAudio {
pub data: Vec<u8>,
pub metadata_id: i32,