mirror of
https://github.com/vrana/adminer.git
synced 2025-08-29 17:19:52 +02:00
Driver specific create and drop database
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1480 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
@@ -500,6 +500,27 @@ if (!defined("DRIVER")) {
|
||||
return "BINARY " . $connection->quote($val);
|
||||
}
|
||||
|
||||
/** Create database
|
||||
* @param string
|
||||
* @return string
|
||||
*/
|
||||
function create_database($db, $collation) {
|
||||
return queries("CREATE DATABASE " . idf_escape($db) . ($collation ? " COLLATE " . $connection->quote($collation) : ""));
|
||||
}
|
||||
|
||||
/** Drop databases
|
||||
* @param array
|
||||
* @return bool
|
||||
*/
|
||||
function drop_databases($databases) {
|
||||
foreach ($databases as $db) {
|
||||
if (!queries("DROP DATABASE " . idf_escape($db))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/** Rename database from DB
|
||||
* @param string new name
|
||||
* @return string
|
||||
@@ -508,7 +529,7 @@ if (!defined("DRIVER")) {
|
||||
function rename_database($name, $collation) {
|
||||
global $connection;
|
||||
$return = false;
|
||||
if (queries("CREATE DATABASE " . idf_escape($name) . ($collation ? " COLLATE " . $connection->quote($collation) : ""))) {
|
||||
if (create_database($name, $collation)) {
|
||||
//! move triggers
|
||||
$return = true; // table list may by empty
|
||||
foreach (tables_list() as $table) {
|
||||
@@ -648,6 +669,9 @@ if (!defined("DRIVER")) {
|
||||
return $return;
|
||||
}
|
||||
|
||||
/** Get trigger options
|
||||
* @return array ("Timing" => array(), "Type" => array())
|
||||
*/
|
||||
function trigger_options() {
|
||||
return array(
|
||||
"Timing" => array("BEFORE", "AFTER"),
|
||||
|
Reference in New Issue
Block a user