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.
This commit is contained in:
Dimitri Fontaine 2014-05-15 23:28:21 +02:00
parent efda3eebfa
commit d6c457d89a
4 changed files with 11 additions and 4 deletions

View File

@ -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

7
test/sqlite-chinook.load Normal file
View File

@ -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';

View File

@ -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

BIN
test/sqlite/sqlite.db Normal file

Binary file not shown.