Sequences
This commit is contained in:
parent
736d6e43f4
commit
f2d21d265b
|
@ -89,6 +89,7 @@ if ($_GET["ns"] !== "") {
|
||||||
if (support("view")) {
|
if (support("view")) {
|
||||||
echo '<a href="' . h(ME) . 'view=">' . lang('Create view') . "</a>\n";
|
echo '<a href="' . h(ME) . 'view=">' . lang('Create view') . "</a>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (support("routine")) {
|
if (support("routine")) {
|
||||||
echo "<h3>" . lang('Routines') . "</h3>\n";
|
echo "<h3>" . lang('Routines') . "</h3>\n";
|
||||||
$routines = routines();
|
$routines = routines();
|
||||||
|
@ -108,6 +109,21 @@ if ($_GET["ns"] !== "") {
|
||||||
echo '<p><a href="' . h(ME) . 'procedure=">' . lang('Create procedure') . '</a> <a href="' . h(ME) . 'function=">' . lang('Create function') . "</a>\n";
|
echo '<p><a href="' . h(ME) . 'procedure=">' . lang('Create procedure') . '</a> <a href="' . h(ME) . 'function=">' . lang('Create function') . "</a>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (support("sequence")) {
|
||||||
|
echo "<h3>" . lang('Sequences') . "</h3>\n";
|
||||||
|
$sequences = get_vals("SELECT sequence_name FROM information_schema.sequences WHERE sequence_schema = current_schema()");
|
||||||
|
if ($sequences) {
|
||||||
|
echo "<table cellspacing='0'>\n";
|
||||||
|
echo "<thead><tr><th>" . lang('Name') . "</thead>\n";
|
||||||
|
odd('');
|
||||||
|
foreach ($sequences as $val) {
|
||||||
|
echo "<tr" . odd() . "><th><a href='" . h(ME) . "sequence=" . urlencode($val) . "'>" . h($val) . "</a>\n";
|
||||||
|
}
|
||||||
|
echo "</table>\n";
|
||||||
|
}
|
||||||
|
echo "<p><a href='" . h(ME) . "sequence='>" . lang('Create sequence') . "</a>\n";
|
||||||
|
}
|
||||||
|
|
||||||
if (support("event")) {
|
if (support("event")) {
|
||||||
echo "<h3>" . lang('Events') . "</h3>\n";
|
echo "<h3>" . lang('Events') . "</h3>\n";
|
||||||
$result = $connection->query("SHOW EVENTS");
|
$result = $connection->query("SHOW EVENTS");
|
||||||
|
|
|
@ -846,7 +846,7 @@ if (!defined("DRIVER")) {
|
||||||
*/
|
*/
|
||||||
function support($feature) {
|
function support($feature) {
|
||||||
global $connection;
|
global $connection;
|
||||||
return !ereg("scheme" . ($connection->server_info < 5.1 ? "|event|partitioning" . ($connection->server_info < 5 ? "|view|routine|trigger" : "") : ""), $feature);
|
return !ereg("scheme|sequence" . ($connection->server_info < 5.1 ? "|event|partitioning" . ($connection->server_info < 5 ? "|view|routine|trigger" : "") : ""), $feature);
|
||||||
}
|
}
|
||||||
|
|
||||||
$driver = "sql"; ///< @var string JUSH identifier
|
$driver = "sql"; ///< @var string JUSH identifier
|
||||||
|
|
|
@ -489,7 +489,7 @@ WHERE tc.constraint_type = 'FOREIGN KEY' AND tc.table_name = " . $connection->qu
|
||||||
}
|
}
|
||||||
|
|
||||||
function support($feature) {
|
function support($feature) {
|
||||||
return ereg('^(comment|view|scheme|trigger|variables|drop_col)$', $feature); //! routine|sequence|
|
return ereg('^(comment|view|scheme|sequence|trigger|variables|drop_col)$', $feature); //! routine|
|
||||||
}
|
}
|
||||||
|
|
||||||
$driver = "pgsql";
|
$driver = "pgsql";
|
||||||
|
|
|
@ -52,6 +52,8 @@ if (isset($_GET["download"])) {
|
||||||
include "./event.inc.php";
|
include "./event.inc.php";
|
||||||
} elseif (isset($_GET["procedure"])) {
|
} elseif (isset($_GET["procedure"])) {
|
||||||
include "./procedure.inc.php";
|
include "./procedure.inc.php";
|
||||||
|
} elseif (isset($_GET["sequence"])) {
|
||||||
|
include "./sequence.inc.php";
|
||||||
} elseif (isset($_GET["trigger"])) {
|
} elseif (isset($_GET["trigger"])) {
|
||||||
include "./trigger.inc.php";
|
include "./trigger.inc.php";
|
||||||
} elseif (isset($_GET["user"])) {
|
} elseif (isset($_GET["user"])) {
|
||||||
|
|
|
@ -244,4 +244,10 @@ $translations = array(
|
||||||
'Schema has been altered.' => 'Schéma bylo změněno.',
|
'Schema has been altered.' => 'Schéma bylo změněno.',
|
||||||
'schema' => 'schéma',
|
'schema' => 'schéma',
|
||||||
'Schema' => 'Schéma',
|
'Schema' => 'Schéma',
|
||||||
|
'Sequences' => 'Sekvence',
|
||||||
|
'Create sequence' => 'Vytvořit sekvenci',
|
||||||
|
'Sequence has been dropped.' => 'Sekvence byla odstraněna.',
|
||||||
|
'Sequence has been created.' => 'Sekvence byla vytvořena.',
|
||||||
|
'Sequence has been altered.' => 'Sekvence byla změněna.',
|
||||||
|
'Alter sequence' => 'Pozměnit sekvenci',
|
||||||
);
|
);
|
||||||
|
|
34
adminer/sequence.inc.php
Normal file
34
adminer/sequence.inc.php
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
<?php
|
||||||
|
$SEQUENCE = $_GET["sequence"];
|
||||||
|
|
||||||
|
if ($_POST && !$error) {
|
||||||
|
$link = substr(ME, 0, -1);
|
||||||
|
if ($_POST["drop"]) {
|
||||||
|
query_redirect("DROP SEQUENCE " . idf_escape($SEQUENCE), $link, lang('Sequence has been dropped.'));
|
||||||
|
} elseif ($SEQUENCE == "") {
|
||||||
|
query_redirect("CREATE SEQUENCE " . idf_escape($_POST["name"]), $link, lang('Sequence has been created.'));
|
||||||
|
} elseif ($SEQUENCE != $_POST["name"]) {
|
||||||
|
query_redirect("ALTER SEQUENCE " . idf_escape($SEQUENCE) . " RENAME TO " . idf_escape($_POST["name"]), $link, lang('Sequence has been altered.'));
|
||||||
|
} else {
|
||||||
|
redirect($link);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
page_header($SEQUENCE != "" ? lang('Alter sequence') . ": " . h($SEQUENCE) : lang('Create sequence'), $error);
|
||||||
|
|
||||||
|
$row = array("name" => $SEQUENCE);
|
||||||
|
if ($_POST) {
|
||||||
|
$row = $_POST;
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
<form action="" method="post">
|
||||||
|
<p><input name="name" value="<?php echo h($row["name"]); ?>">
|
||||||
|
<input type="hidden" name="token" value="<?php echo $token; ?>">
|
||||||
|
<input type="submit" value="<?php echo lang('Save'); ?>">
|
||||||
|
<?php
|
||||||
|
if ($SEQUENCE != "") {
|
||||||
|
echo "<input type='submit' name='drop' value='" . lang('Drop') . "'$confirm>\n";
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</form>
|
1
todo.txt
1
todo.txt
|
@ -38,7 +38,6 @@ ORDER BY COUNT(*)
|
||||||
Export - http://www.postgresql.org/docs/8.4/static/functions-info.html
|
Export - http://www.postgresql.org/docs/8.4/static/functions-info.html
|
||||||
Column rights - http://www.postgresql.org/docs/8.4/static/functions-info.html
|
Column rights - http://www.postgresql.org/docs/8.4/static/functions-info.html
|
||||||
Dollar terminated string in SQL command
|
Dollar terminated string in SQL command
|
||||||
Sequences
|
|
||||||
bool in Editor
|
bool in Editor
|
||||||
Check PDO driver
|
Check PDO driver
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue