sqlitepgloader

pgloader does not find sqlite database file


to work myself into pgloader I have created a sqlite3 db from an csv file.

If I open the file and do select star from the data it shows the correct data

path is /tmp/tt.db

this works

sqlite3 /tmp/tt.db

but

pgloader sqlite:///tmp/tt.db

which should work according to the documentation failes with

No such file or directory: "sqlite:///tmp/tt.db"

any idea why ?


Solution

  • Not personally familiar with pgloader, but from the documentation, it appears that if you give it a single argument, it's treated as the name of a script file to read directives from. If you pass it two arguments, the first is treated as a data source, and the second as a connection string that describes the target database you want to import into.

    pgloader loads data from various sources into PostgreSQL. It can transform the data it reads on the fly and submit raw SQL before and after the loading. It uses the COPY PostgreSQL protocol to stream the data into the server, and manages errors by filling a pair of reject.dat and reject.log files.

    pgloader operates either using commands which are read from files:

    pgloader commands.load
    

    or by using arguments and options all provided on the command line:

    pgloader SOURCE TARGET
    

    Your example uses only a single argument, so it's looking for that file instead of interpreting the argument as a URI.