Getting Started¶
Prerequisites¶
Using Tasks¶
This library contains a number of Luigi tasks that you can use in your own pipelines. These include:
dbgdb.tasks.postgres.load.PgLoadTask
- for loading data (like file geodatabases) into your PostgreSQL database;
dbgdb.tasks.postgres.extract.PgExtractTask
- for extrating data from your PostgreSQL database; and
dbgdb.tasks.postgres.drop.PgDropSchemaTask
- if you need to drop an import schema because you’re starting over.
Using the Command Line¶
Most of the commands you run with the command-line interface (CLI) create Luigi tasks which are then submitted to a Luigi scheduler.
Note
The -l parameter indicates that the tasks should be run using the local scheduler. The examples listed below use this parameter. If you want to submit tasks to the Luigi daemon (luigid) you can simply omit this parameter.
Getting Help¶
dbgdb has its own command-line help.
dbgdb --help
Loading Data¶
You can load a file geodatabase with the load subcommand.
dbgdb -l load --schema myschema /path/to/your/data.gdb
Extracting Data¶
You can extract all of the data within a schema to an output file with the extract subcommand.
dbgdb -l extract --schema myschema /path/to/your/exported/data.db
Note
At the moment, we can export to GeoPackage or Spatialite formats. Support for ESRI File Geodatabases (gdb) is still in the works.
Dropping a Schema¶
If the target schema for your load command already exists, you may notice Luigi reporting there was nothing to do because, from the task’s perspective, the work has already been done. If you need to drop a schema, you can use the drop subcommand.
dbgdb -l drop schema myschema