Use the "table name" option when loading from DBF, fix #175.

The command parser for DBF sources wasn't (anymore?) considering the
value of the "table name = " option, only considering the option from
the connection string.

Make it so that the option now takes preference over the DSN tablename
option when both are set.
This commit is contained in:
Dimitri Fontaine 2015-02-18 14:52:14 +01:00
parent a8e728a740
commit 8f4eb73cad
2 changed files with 4 additions and 2 deletions

View File

@ -84,7 +84,8 @@
,@(pgsql-connection-bindings pg-db-conn gucs)
,@(batch-control-bindings options)
,@(identifier-case-binding options)
(table-name ,(pgconn-table-name pg-db-conn))
(table-name ,(or (getf options :table-name)
(pgconn-table-name pg-db-conn)))
(source-db (with-stats-collection ("fetch" :state state-before)
(expand (fetch-file ,dbf-db-conn))))
(source

View File

@ -17,7 +17,8 @@
(with-connection (conn (source-db db3))
(unless (and (slot-boundp db3 'columns) (slot-value db3 'columns))
(setf (slot-value db3 'columns)
(list-all-columns (fd-db3 conn) (source db3))))
(list-all-columns (fd-db3 conn)
(or (target db3) (source db3)))))
(let ((transforms (when (slot-boundp db3 'transforms)
(slot-value db3 'transforms))))