Skip to content

Commit

Permalink
Merge pull request #5 from LaswitchTech/dev
Browse files Browse the repository at this point in the history
Publishing v1.0.5
  • Loading branch information
LouisOuellet authored Aug 30, 2024
2 parents 624eec2 + 93b0de3 commit 14a28a7
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.4
1.0.5
35 changes: 33 additions & 2 deletions src/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -389,9 +389,10 @@ public function insert($query = "" , $params = []) {

// Log any errors and throw an exception
$this->Logger->error($e->getMessage());
throw New Exception( $e->getMessage() );

// Return
return false;
}
return false;
}

/**
Expand Down Expand Up @@ -694,6 +695,36 @@ public function getTable($table) {
}
}

/**
* Retrieve the tables in the database.
*
* @return array
* @throws Exception
*/
public function getTables() {
try {

// Retrieve the tables in the database
$result = $this->connection->query("SHOW TABLES");

// Initialize the tables array
$tables = array();

// Generate the tables array
while ($row = $result->fetch_row()) {
$tables[] = $row[0];
}

// Return the array of tables
return $tables;
} catch(Exception $e) {

// Log any errors and throw an exception
$this->Logger->error($e->getMessage());
throw new Exception($e->getMessage());
}
}

/**
* Retrieve the columns of a table.
*
Expand Down

0 comments on commit 14a28a7

Please sign in to comment.