Skip to content

Commit

Permalink
Refactor var pg_query
Browse files Browse the repository at this point in the history
  • Loading branch information
TaQuangKhoi committed Aug 20, 2024
1 parent 25837f1 commit 8e2dc2d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ impl Table {

/// Get postgres row count, then update the struct and SQLite
pub fn update_row_count(&mut self) {
let query = "SELECT COUNT(*) FROM ".to_owned() + &self.name;
let pg_query = "SELECT COUNT(*) FROM ".to_owned() + &self.name;
let mut pg_conn = connect(self.database.clone()).unwrap();
let rows = pg_conn.query(
&query,
&pg_query,
&[],
).unwrap();
let count: i64 = rows[0].get(0);
Expand Down

0 comments on commit 8e2dc2d

Please sign in to comment.