-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split off db_util classes for each driver
- Loading branch information
Showing
23 changed files
with
802 additions
and
634 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<?php | ||
/** | ||
* Query | ||
* | ||
* Free Query Builder / Database Abstraction Layer | ||
* | ||
* @author Timothy J. Warren | ||
* @copyright Copyright (c) 2012 | ||
* @link https://github.com/aviat4ion/Query | ||
* @license http://philsturgeon.co.uk/code/dbad-license | ||
*/ | ||
|
||
// -------------------------------------------------------------------------- | ||
|
||
/** | ||
* Abstract class defining database / table creation methods | ||
*/ | ||
abstract class DB_Util { | ||
|
||
private $conn; | ||
|
||
/** | ||
* Save a reference to the connection object for later use | ||
*/ | ||
public function __construct(&$conn) | ||
{ | ||
$this->conn =& $conn; | ||
} | ||
|
||
// -------------------------------------------------------------------------- | ||
// ! Abstract Methods | ||
// -------------------------------------------------------------------------- | ||
|
||
/** | ||
* Get database-specific sql to create a new table | ||
* | ||
* @abstract | ||
* @param string $name | ||
* @param array $columns | ||
* @param array $constraints | ||
* @param array $indexes | ||
* @return string | ||
*/ | ||
abstract public function create_table($name, $columns, array $constraints=array(), array $indexes=array()); | ||
|
||
/** | ||
* Get database-specific sql to drop a table | ||
* | ||
* @abstract | ||
* @param string $name | ||
* @return string | ||
*/ | ||
abstract public function delete_table($name); | ||
|
||
/** | ||
* Return an SQL file with the database table structure | ||
* | ||
* @abstract | ||
* @return string | ||
*/ | ||
abstract public function backup_structure(); | ||
|
||
/** | ||
* Return an SQL file with the database data as insert statements | ||
* | ||
* @abstract | ||
* @return string | ||
*/ | ||
abstract public function backup_data(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.