From 8f4eb73cadaaeb7b96f14493fc5059c2171e24eb Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Wed, 18 Feb 2015 14:52:14 +0100 Subject: [PATCH] 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. --- src/parsers/command-dbf.lisp | 3 ++- src/sources/db3/db3.lisp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/parsers/command-dbf.lisp b/src/parsers/command-dbf.lisp index 40a349a..2765941 100644 --- a/src/parsers/command-dbf.lisp +++ b/src/parsers/command-dbf.lisp @@ -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 diff --git a/src/sources/db3/db3.lisp b/src/sources/db3/db3.lisp index 08efcdc..843dc3d 100644 --- a/src/sources/db3/db3.lisp +++ b/src/sources/db3/db3.lisp @@ -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))))