forked from WorldException/pgloader
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 dimitri#965.
- Loading branch information
Showing
4 changed files
with
51 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
1 Hello World | ||
2 Hello World | ||
2 foobar foobaz |