From d6c457d89aa8581a45ce64f2b53c871958f3ec7f Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Thu, 15 May 2014 23:28:21 +0200 Subject: [PATCH] Add support for SQLite "double" data type, Fix #59. This time with a test case rather than trying to blindly address the problem in a very small amount of time. --- src/sources/sqlite.lisp | 6 +++--- test/sqlite-chinook.load | 7 +++++++ test/sqlite.load | 2 +- test/sqlite/sqlite.db | Bin 0 -> 8192 bytes 4 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 test/sqlite-chinook.load create mode 100644 test/sqlite/sqlite.db diff --git a/src/sources/sqlite.lisp b/src/sources/sqlite.lisp index 89f51d3..57c450d 100644 --- a/src/sources/sqlite.lisp +++ b/src/sources/sqlite.lisp @@ -21,6 +21,8 @@ ((string-equal sqlite-type-name "datetime") "timestamptz") + ((string-equal sqlite-type-name "double") "double precision") + (t sqlite-type-name))) (defmethod format-pgsql-column ((col coldef) &key identifier-case) @@ -128,6 +130,7 @@ ;; objects, where we only want to deal with text. ;; (cond ((or (string-equal "float" coltype) + (string-equal "double precision" coltype) (and (<= 7 (length coltype)) (string-equal "numeric" coltype :end2 7))) #'pgloader.transforms::float-to-string) @@ -135,9 +138,6 @@ ((string-equal "text" coltype) nil) - ((string-equal "double" coltype) - "double precision") - (t (compile nil (lambda (c) (when c diff --git a/test/sqlite-chinook.load b/test/sqlite-chinook.load new file mode 100644 index 0000000..cfe3662 --- /dev/null +++ b/test/sqlite-chinook.load @@ -0,0 +1,7 @@ +load database + from 'sqlite/Chinook_Sqlite_AutoIncrementPKs.sqlite' + into postgresql:///pgloader + + with include drop, create tables, create indexes, reset sequences + + set work_mem to '16MB', maintenance_work_mem to '512 MB'; \ No newline at end of file diff --git a/test/sqlite.load b/test/sqlite.load index cfe3662..dae136e 100644 --- a/test/sqlite.load +++ b/test/sqlite.load @@ -1,5 +1,5 @@ load database - from 'sqlite/Chinook_Sqlite_AutoIncrementPKs.sqlite' + from 'sqlite/sqlite.db' into postgresql:///pgloader with include drop, create tables, create indexes, reset sequences diff --git a/test/sqlite/sqlite.db b/test/sqlite/sqlite.db new file mode 100644 index 0000000000000000000000000000000000000000..c02a9da6339251a0359215ada278f584f677a321 GIT binary patch literal 8192 zcmeI#y9&ZE6b9gvD7vT>N^w1lpr9ahaP&qu7qu^tYQ13FKxv=Ow{h_S99&I`yEqE} zPjXHYlI7d7+pI4|%txK4s$ieGBm~WwiAa8?X;p-&_0QTiyZ;tR<9oktZVBf`W*`uN z00bZa0SG_<0uX=z1Rwwb2>d3n5{;hciEE*vBu;d8vQw_M!6FPeTrAfC+mk`2(wO&W zl@F$q;fPhL%dFsoF3q!{{hLeYLC(t*1OgC%00bZa0SG_<0uX=z1Rwx`e-`M-n%j(2 PK70CAnxf{4qt>lACx#{| literal 0 HcmV?d00001