dbq f=txt a=db.dump db.type=pgsql $@
}
-dbq_data_src() {
- eval $(dbq t=data_src header=0 format=csv rows_fields=src name=$1)
-}
-
dbq_template() {
local t=$1
shift
# Specific function
$row_opt = [
'parser' => false,
+ 'db_type_from' => $type_from,
];
if ($fct = $this->conf_type('table.sql.create')) {
$row_opt['fct'] = $fct;
# INSERT
if ($insert and $t->type == 'table') {
- if ($type_from) $this->type = $type_from;
+# NB 04.12.17: Use instead "cleaner" option db_type_from
+# NB 04.12.17 if ($type_from) $this->type = $type_from;
$t->rows($row_opt);
- if ($type_to) $this->type = $type_to;
+# NB 04.12.17 if ($type_to) $this->type = $type_to;
}
}
public function rows(&$opt=[],$opt_by_val=null) {
$opt['TABLE'] = $this;
+ #
+ # Db type change
+ #
+ $db_type = $this->db()->type;
+ if (!empty($opt['db_type_from'])) {
+ $this->db()->type = $opt['db_type_from'];
+ }
+
#
# Fields
#
# Parser on/off (default: on)
if (!isset($opt['parser'])) $opt['parser'] = true;
+ if (!empty($opt['db_type_from'])) {
+ $this->db()->type = $db_type;
+ }
+
$count = 0;
while ($row = $st->fetch(PDO::FETCH_ASSOC, PDO::FETCH_ORI_NEXT)) {
$DB_TYPES['pgsql'] = array (
'extra_where' => 'denorm',
'regexp' => '~',
+'quote_name' => '"',
'localFile' => array (getenv('HOME').'/.pgpass','^[^:]+:[^:]+:<D.NAME>:(?P<user>[^:]+):(?<password>[^:]+)'),