Skip to content

Commit

Permalink
Cleanup and verbose CI
Browse files Browse the repository at this point in the history
  • Loading branch information
pawurb committed Jan 24, 2024
1 parent 21dd7b9 commit a1115ec
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 17 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
- name: Test
env:
DATABASE_URL: postgresql://postgres:secret@localhost:5432/rust_pg_extras
RUST_BACKTRACE: 1
uses: actions-rs/cargo@v1
with:
command: test
4 changes: 1 addition & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::env;
pub mod structs;
use sqlx::postgres::PgPoolOptions;
pub use structs::all_locks::AllLocks;
pub use structs::bloat::Bloat;
pub use structs::blocking::Blocking;
Expand Down Expand Up @@ -323,7 +324,6 @@ pub enum PgExtrasError {
}

async fn get_rows<T: Tabular>(query: &str) -> Result<Vec<T>, PgExtrasError> {
use sqlx::postgres::PgPoolOptions;
let pool = match PgPoolOptions::new()
.max_connections(5)
.connect(db_url()?.as_str())
Expand All @@ -347,8 +347,6 @@ fn db_url() -> Result<String, PgExtrasError> {

#[cfg(test)]
mod tests {
use crate::structs::db_settings;

use super::*;

#[tokio::test]
Expand Down
3 changes: 1 addition & 2 deletions src/structs/all_locks.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate::structs::shared::{get_default_interval, Tabular};
use sqlx::postgres::types::PgInterval;
use sqlx::postgres::PgRow;
use sqlx::postgres::{types::PgInterval, PgRow};
use sqlx::Row;

#[derive(Debug, Clone)]
Expand Down
3 changes: 1 addition & 2 deletions src/structs/blocking.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate::structs::shared::{get_default_interval, Tabular};
use sqlx::postgres::types::PgInterval;
use sqlx::postgres::PgRow;
use sqlx::postgres::{types::PgInterval, PgRow};
use sqlx::Row;

#[derive(Debug, Clone)]
Expand Down
3 changes: 1 addition & 2 deletions src/structs/calls.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate::structs::shared::{get_default_interval, Tabular};
use sqlx::postgres::types::PgInterval;
use sqlx::postgres::PgRow;
use sqlx::postgres::{types::PgInterval, PgRow};
use sqlx::Row;

#[derive(Debug, Clone)]
Expand Down
3 changes: 1 addition & 2 deletions src/structs/locks.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate::structs::shared::{get_default_interval, Tabular};
use sqlx::postgres::types::PgInterval;
use sqlx::postgres::PgRow;
use sqlx::postgres::{types::PgInterval, PgRow};
use sqlx::Row;

#[derive(Debug, Clone)]
Expand Down
3 changes: 1 addition & 2 deletions src/structs/long_running_queries.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate::structs::shared::{get_default_interval, Tabular};
use sqlx::postgres::types::PgInterval;
use sqlx::postgres::PgRow;
use sqlx::postgres::{types::PgInterval, PgRow};
use sqlx::Row;

#[derive(Debug, Clone)]
Expand Down
3 changes: 1 addition & 2 deletions src/structs/outliers.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate::structs::shared::{get_default_interval, Tabular};
use sqlx::postgres::types::PgInterval;
use sqlx::postgres::PgRow;
use sqlx::postgres::{types::PgInterval, PgRow};
use sqlx::Row;

#[derive(Debug, Clone)]
Expand Down
3 changes: 1 addition & 2 deletions src/structs/shared.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use sqlx::postgres::types::PgInterval;
use sqlx::postgres::PgRow;
use sqlx::postgres::{types::PgInterval, PgRow};
use std::env;

pub trait Tabular {
Expand Down

0 comments on commit a1115ec

Please sign in to comment.