1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-05 13:47:33 +02:00

removed unused code

This commit is contained in:
David Grudl
2015-10-22 02:05:08 +02:00
parent 52f0793991
commit 31cd9594a1
4 changed files with 1 additions and 37 deletions

View File

@@ -34,11 +34,6 @@ class MySqlReflector implements Dibi\Reflector
*/ */
public function getTables() public function getTables()
{ {
/*$this->query("
SELECT TABLE_NAME as name, TABLE_TYPE = 'VIEW' as view
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA = DATABASE()
");*/
$res = $this->driver->query('SHOW FULL TABLES'); $res = $this->driver->query('SHOW FULL TABLES');
$tables = []; $tables = [];
while ($row = $res->fetch(FALSE)) { while ($row = $res->fetch(FALSE)) {
@@ -58,12 +53,6 @@ class MySqlReflector implements Dibi\Reflector
*/ */
public function getColumns($table) public function getColumns($table)
{ {
/*$table = $this->escapeText($table);
$this->query("
SELECT *
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = $table AND TABLE_SCHEMA = DATABASE()
");*/
$res = $this->driver->query("SHOW FULL COLUMNS FROM {$this->driver->escapeIdentifier($table)}"); $res = $this->driver->query("SHOW FULL COLUMNS FROM {$this->driver->escapeIdentifier($table)}");
$columns = []; $columns = [];
while ($row = $res->fetch(TRUE)) { while ($row = $res->fetch(TRUE)) {
@@ -91,13 +80,6 @@ class MySqlReflector implements Dibi\Reflector
*/ */
public function getIndexes($table) public function getIndexes($table)
{ {
/*$table = $this->escapeText($table);
$this->query("
SELECT *
FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE
WHERE TABLE_NAME = $table AND TABLE_SCHEMA = DATABASE()
AND REFERENCED_COLUMN_NAME IS NULL
");*/
$res = $this->driver->query("SHOW INDEX FROM {$this->driver->escapeIdentifier($table)}"); $res = $this->driver->query("SHOW INDEX FROM {$this->driver->escapeIdentifier($table)}");
$indexes = []; $indexes = [];
while ($row = $res->fetch(TRUE)) { while ($row = $res->fetch(TRUE)) {

View File

@@ -55,12 +55,6 @@ class SqliteReflector implements Dibi\Reflector
*/ */
public function getColumns($table) public function getColumns($table)
{ {
$meta = $this->driver->query("
SELECT sql FROM sqlite_master WHERE type = 'table' AND name = {$this->driver->escapeText($table)}
UNION ALL
SELECT sql FROM sqlite_temp_master WHERE type = 'table' AND name = {$this->driver->escapeText($table)}
")->fetch(TRUE);
$res = $this->driver->query("PRAGMA table_info({$this->driver->escapeIdentifier($table)})"); $res = $this->driver->query("PRAGMA table_info({$this->driver->escapeIdentifier($table)})");
$columns = []; $columns = [];
while ($row = $res->fetch(TRUE)) { while ($row = $res->fetch(TRUE)) {

View File

@@ -217,7 +217,7 @@ final class Translator
$v = $this->formatValue($v, FALSE); $v = $this->formatValue($v, FALSE);
$vx[] = $k . ($v === 'NULL' ? 'IS ' : '= ') . $v; $vx[] = $k . ($v === 'NULL' ? 'IS ' : '= ') . $v;
} elseif ($pair[1] === 'ex') { // TODO: this will be removed } elseif ($pair[1] === 'ex') {
$vx[] = $k . $this->formatValue($v, 'ex'); $vx[] = $k . $this->formatValue($v, 'ex');
} else { } else {

View File

@@ -369,18 +369,6 @@ class dibi
} }
/**
* Replacement for majority of dibi::methods() in future.
*/
public static function __callStatic($name, $args)
{
//if ($name = 'select', 'update', ...') {
// return self::command()->$name($args);
//}
return call_user_func_array([self::getConnection(), $name], $args);
}
/********************* fluent SQL builders ****************d*g**/ /********************* fluent SQL builders ****************d*g**/