From: Nicolas Boisselier Date: Thu, 7 Apr 2016 16:21:56 +0000 (+0200) Subject: table filter for function sql X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=5edb5529bd346b7bb9814bf4e7f0df4d29bde3d0;p=nb.git table filter for function sql --- diff --git a/lib/php/db.php b/lib/php/db.php index 41b6bebd..e62bb791 100644 --- a/lib/php/db.php +++ b/lib/php/db.php @@ -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;