diff --git a/src/parser.lisp b/src/parser.lisp index 86a0c3d..3f2906e 100644 --- a/src/parser.lisp +++ b/src/parser.lisp @@ -1698,6 +1698,7 @@ load database (summary (null *state*)) (*state* (or *state* (pgloader.utils:make-pgstate))) (state-after ,(when after `(pgloader.utils:make-pgstate))) + (*csv-path-root* ,*cwd*) ,@(pgsql-connection-bindings pg-db-uri gucs) ,@(batch-control-bindings options)) diff --git a/test/csv-filename-pattern.load b/test/csv-filename-pattern.load new file mode 100644 index 0000000..548782b --- /dev/null +++ b/test/csv-filename-pattern.load @@ -0,0 +1,10 @@ +load csv + from all filenames matching ~ (id, field) + into postgresql:///pgloader?matching + with fields optionally enclosed by '"', + fields terminated by ',', + truncate + + before load do + $$ drop table if exists matching; $$, + $$ create table matching(id int, field text); $$; diff --git a/test/data/matching-1.csv b/test/data/matching-1.csv new file mode 100644 index 0000000..7745fb4 --- /dev/null +++ b/test/data/matching-1.csv @@ -0,0 +1 @@ +1,"foo" diff --git a/test/data/matching-2.csv b/test/data/matching-2.csv new file mode 100644 index 0000000..044cfe0 --- /dev/null +++ b/test/data/matching-2.csv @@ -0,0 +1 @@ +2,"bar" diff --git a/test/data/matching-3.csv b/test/data/matching-3.csv new file mode 100644 index 0000000..bee5a20 --- /dev/null +++ b/test/data/matching-3.csv @@ -0,0 +1 @@ +3,"baz"