mirror of
https://github.com/dimitri/pgloader.git
synced 2026-05-04 18:36:12 +02:00
Fix integer parsing support for SQLite.
The function needs to return a string to be added to the COPY stream, we still need to make sure whatever given here looks like an integer. Given the very dynamic nature of data types in SQLite, the integer-to-string function was already a default now, but failed to be published before in its fixed version, somehow.
This commit is contained in:
parent
fe3601b04c
commit
b1d4e94f2a
@ -193,14 +193,15 @@
|
||||
values."
|
||||
(declare (type (or null string fixnum) integer-string))
|
||||
(when integer-string
|
||||
(typecase integer-string
|
||||
(integer (princ-to-string integer-string))
|
||||
(string (handler-case
|
||||
(parse-integer integer-string :start 0)
|
||||
(condition (c)
|
||||
(declare (ignore c))
|
||||
(parse-integer integer-string :start 1
|
||||
:end (- (length integer-string) 1))))))))
|
||||
(princ-to-string
|
||||
(typecase integer-string
|
||||
(integer integer-string)
|
||||
(string (handler-case
|
||||
(parse-integer integer-string :start 0)
|
||||
(condition (c)
|
||||
(declare (ignore c))
|
||||
(parse-integer integer-string :start 1
|
||||
:end (- (length integer-string) 1)))))))))
|
||||
|
||||
(defun float-to-string (float)
|
||||
"Transform a Common Lisp float value into its string representation as
|
||||
|
||||
@ -11,6 +11,7 @@ load database
|
||||
$$ create schema if not exists sqlite; $$
|
||||
|
||||
cast column character.f1 to text drop typemod,
|
||||
column appointments.time to timestamptz drop default
|
||||
column appointments.time to timestamptz drop default,
|
||||
type intege to integer
|
||||
|
||||
set work_mem to '16MB', maintenance_work_mem to '512 MB', search_path to 'sqlite';
|
||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user