]> git.nbdom.net Git - nb.git/commitdiff
filter for db.tables
authorNicolas Boisselier <nicolas.boisselier@semantico.com>
Tue, 26 Apr 2016 15:52:47 +0000 (16:52 +0100)
committerNicolas Boisselier <nicolas.boisselier@semantico.com>
Tue, 26 Apr 2016 15:52:47 +0000 (16:52 +0100)
lib/php/db.php

index ba41429c4c945b64fc9373ebeced576675d71f67..c6d982035c9657b16b975ea13ded17eaf4d5c55a 100644 (file)
@@ -426,7 +426,14 @@ EOF;
           $return = true;
 
         } elseif ($action == 'db.tables' or $action == 'tables') {
-          foreach ($this->tables() as $t) { $rows[] = $t->infos(); }
+          # Filters
+          $name = self::p('name','');
+          $type = self::p('type','');
+          foreach ($this->tables() as $t) {
+            if (!empty($name) and strpos($t->name,$name) === false) continue;
+            if (!empty($type) and strpos($t->type,$type) === false) continue;
+            $rows[] = $t->infos();
+          }
           $return = $this->out2($rows);
 
         } elseif ($action == 'db.conf') {