pgloader/test/csv-using-sexp.load
Dimitri Fontaine 12e788094b Improve sexp parser and standard symbols support.
Also add split-sequence to the list of special cases that we can use and is
not found in the pgloader.transforms package.

Fixes #965.
2019-05-14 15:49:24 +02:00

30 lines
574 B
Fish

/*
* See https://github.com/dimitri/pgloader/issues/965
*/
LOAD CSV
FROM INLINE(id,f1)
INTO postgresql:///pgloader
TARGET TABLE sexp
(
id,
f1 text using (format nil "~{~a~^ ~}"
(split-sequence #\Space f1 :remove-empty-subseqs cl:t))
)
WITH truncate,
fields terminated by ','
BEFORE LOAD DO
$$ drop table if exists sexp; $$,
$$ CREATE TABLE sexp
(
id int,
f1 text
)
$$;
1,Hello World
2,Hello World
2, foobar foobaz