]> git.nbdom.net Git - nb.git/commitdiff
table filter for function sql
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 7 Apr 2016 16:21:56 +0000 (18:21 +0200)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 7 Apr 2016 16:21:56 +0000 (18:21 +0200)
lib/php/db.php

index 41b6bebdad27fa8fb36f65afd93d5f6fd9029550..e62bb7912bd823974e4bdba1c4998e38a2bc7cde 100644 (file)
@@ -648,6 +648,11 @@ EOF;
     $this->pset('orderby',null);
     $this->pset('format','sql');
     $r = array();
+
+    $tables = array();
+    foreach (explode(',',self::p('table')) as $t) {
+      $tables[$t] = 1;
+    }
     #if (NB_EOL == "\n")
 
     echo ''
@@ -667,6 +672,7 @@ EOF;
 # NB 03.04.16     }
 
     foreach ($this->tables() as $t) {
+      if ($tables and empty($tables[$t->name])) continue;
       if ($insert) {
         echo "\n-- Table: ".$t->name."\n";
         #echo 'DROP TABLE IF EXISTS '.$t->sql_name().';'.NB_EOL;