diff options
Diffstat (limited to 'src/db')
-rw-r--r-- | src/db/connection.rs | 4 | ||||
-rw-r--r-- | src/db/interface.rs | 11 | ||||
-rw-r--r-- | src/db/models/envvar.rs | 2 | ||||
-rw-r--r-- | src/db/models/githash.rs | 2 | ||||
-rw-r--r-- | src/db/models/image.rs | 2 | ||||
-rw-r--r-- | src/db/models/submit.rs | 15 |
6 files changed, 12 insertions, 24 deletions
diff --git a/src/db/connection.rs b/src/db/connection.rs index 4e338d0..20c73bc 100644 --- a/src/db/connection.rs +++ b/src/db/connection.rs @@ -1,8 +1,8 @@ -use anyhow::Result; use anyhow::Error; +use anyhow::Result; use clap_v3::ArgMatches; -use diesel::prelude::*; use diesel::pg::PgConnection; +use diesel::prelude::*; use getset::Getters; use crate::config::Configuration; diff --git a/src/db/interface.rs b/src/db/interface.rs index e855bc5..bb473b2 100644 --- a/src/db/interface.rs +++ b/src/db/interface.rs @@ -1,14 +1,15 @@ -use std::path::PathBuf; use std::fmt::Display; +use std::path::PathBuf; +use std::process::Command; use clap_v3 as clap; -use clap::ArgMatches; -use anyhow::anyhow; use anyhow::Context; use anyhow::Error; use anyhow::Result; -use itertools::Itertools; +use anyhow::anyhow; +use clap::ArgMatches; use diesel::RunQueryDsl; +use itertools::Itertools; use crate::config::Configuration; use crate::db::DbConnectionConfig; @@ -25,8 +26,6 @@ pub fn interface(db_connection_config: DbConnectionConfig, matches: &ArgMatches, } fn cli(db_connection_config: DbConnectionConfig, matches: &ArgMatches, config: &Configuration) -> Result<()> { - use std::process::Command; - trait PgCliCommand { fn run_for_uri(&self, dbcc: DbConnectionConfig) -> Result<()>; } diff --git a/src/db/models/envvar.rs b/src/db/models/envvar.rs index 24403d6..f883661 100644 --- a/src/db/models/envvar.rs +++ b/src/db/models/envvar.rs @@ -1,5 +1,3 @@ -use std::ops::Deref; - use anyhow::Error; use anyhow::Result; use diesel::PgConnection; diff --git a/src/db/models/githash.rs b/src/db/models/githash.rs index bcd14fe..df7937c 100644 --- a/src/db/models/githash.rs +++ b/src/db/models/githash.rs @@ -1,5 +1,3 @@ -use std::ops::Deref; - use anyhow::Error; use anyhow::Result; use diesel::PgConnection; diff --git a/src/db/models/image.rs b/src/db/models/image.rs index de0b2cf..225bac7 100644 --- a/src/db/models/image.rs +++ b/src/db/models/image.rs @@ -1,5 +1,3 @@ -use std::ops::Deref; - use anyhow::Error; use anyhow::Result; use diesel::PgConnection; diff --git a/src/db/models/submit.rs b/src/db/models/submit.rs index 37f5189..1f81584 100644 --- a/src/db/models/submit.rs +++ b/src/db/models/submit.rs @@ -1,20 +1,15 @@ -use std::ops::Deref; - -use anyhow::anyhow; -use anyhow::Error; use anyhow::Context; +use anyhow::Error; use anyhow::Result; +use chrono::NaiveDateTime; use diesel::PgConnection; use diesel::prelude::*; -use chrono::NaiveDateTime; -use diesel::sql_types::Uuid; -use diesel::sql_types::Jsonb; -use crate::schema::submits::*; -use crate::schema::submits; +use crate::db::models::GitHash; use crate::db::models::Image; use crate::db::models::Package; -use crate::db::models::GitHash; +use crate::schema::submits::*; +use crate::schema::submits; #[derive(Queryable)] pub struct Submit { |