Fix unknown source type error, fix #237.

In passing also recognize the ".sqlite3" file type as being a SQLite
database file.
This commit is contained in:
Dimitri Fontaine 2015-05-22 11:32:30 +02:00
parent dc86b5e600
commit 62931e0312
2 changed files with 5 additions and 3 deletions

View File

@ -300,7 +300,8 @@
(source (if type
(parse-source-string-for-type type source)
(parse-source-string source)))
(type (parse-cli-type (conn-type source)))
(type (when source
(parse-cli-type (conn-type source))))
(target (parse-target-string (second arguments))))
;; some verbosity about the parsing "magic"

View File

@ -139,7 +139,7 @@
(defvar *data-source-filename-extensions*
'((:csv . ("csv" "tsv" "txt" "text"))
(:copy . ("copy" "dat")) ; reject data files are .dat
(:sqlite . ("sqlite" "db"))
(:sqlite . ("sqlite" "db" "sqlite3"))
(:dbf . ("db3" "dbf"))
(:ixf . ("ixf"))))
@ -215,13 +215,14 @@
:collect (parse 'generic-option guc)))
(defrule dbf-type-name (or "dbf" "db3") (:constant "dbf"))
(defrule sqlite-type-name (or "sqlite3" "sqlite") (:constant "sqlite"))
(defrule cli-type (or "csv"
"fixed"
"copy"
dbf-type-name
sqlite-type-name
"ixf"
"sqlite"
"mysql"
"mssql")
(:text t))