Skip to content

Commit

Permalink
Remove unused methods
Browse files Browse the repository at this point in the history
  • Loading branch information
pawurb committed Jan 23, 2024
1 parent 65dae64 commit 20063ea
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions src/structs/shared.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use pg_interval::Interval;
use postgres::{Client, NoTls, Row};
use postgres::Row;
use std::env;

pub trait Tabular {
Expand All @@ -15,14 +15,3 @@ pub fn get_default_interval() -> Interval {
pub fn get_default_schema() -> String {
env::var("PG_EXTRAS_SCHEMA").unwrap_or("public".to_string())
}

pub fn get_rows(query: &str) -> Vec<Row> {
connection()
.query(query, &[])
.unwrap_or_else(|_| Vec::new())
}

fn connection() -> Client {
let database_url = env::var("DATABASE_URL").expect("$DATABASE_URL is not set");
Client::connect(&database_url, NoTls).unwrap()
}

0 comments on commit 20063ea

Please sign in to comment.