From 62931e03122d7f8860e1034345cd26115e193ac2 Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Fri, 22 May 2015 11:32:30 +0200 Subject: [PATCH] Fix unknown source type error, fix #237. In passing also recognize the ".sqlite3" file type as being a SQLite database file. --- src/main.lisp | 3 ++- src/parsers/command-parser.lisp | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main.lisp b/src/main.lisp index 3324eeb..9f35b2e 100644 --- a/src/main.lisp +++ b/src/main.lisp @@ -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" diff --git a/src/parsers/command-parser.lisp b/src/parsers/command-parser.lisp index f66480d..6bdee0e 100644 --- a/src/parsers/command-parser.lisp +++ b/src/parsers/command-parser.lisp @@ -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))