pgloader
$ pgloader Community High Riskpgloader migrates schemas and streams bulk data into PostgreSQL using COPY from MySQL, SQLite, MS SQL, DBF, or CSV/fixed-width files. Load scripts (.load) can be validated ahead of execution with pgloader --dry-run, though stdout output is summary text rather than JSON.
brew install pgloader pgloader streams multi-gigabyte COPY pipelines directly between local files/source DBs and PostgreSQL; MCP is unsuitable for bulk ETL.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Runs non-interactively with --dry-run, --quiet, and --verbose, but reports summary tables in plain text rather than --json.
- Supports
--dry-runand--quiet; text summary output only
--dry-run validates scripts and DB connections without mutating targets, though .load scripts using include drop are destructive.
- Native
--dry-runcheck;include dropclause can drop target tables
Installable via brew install pgloader and Linux distro packages, though building from source requires SBCL Common Lisp.
- Available via Homebrew and apt; SBCL dependency if compiled from source
Dramatically faster and more resilient than custom scripts for heterogeneous MySQL/SQLite/CSV-to-PostgreSQL migrations.
- Automated type casting and multi-threaded PostgreSQL
COPYstreaming
Widely adopted community tool (dimitri/pgloader) under the PostgreSQL License, though release cadence is modest.
- Mature open-source project (
dimitri/pgloader)
Detailed DSL and CLI flag documentation on pgloader.readthedocs.io.
- Comprehensive command reference on Read the Docs
Security, Auth & Guardrails
Connection strings live in .load DSL scripts or CLI URI arguments (mysql://..., postgresql://...); supports ~/.pgpass and PGPASSWORD.
100% free under the permissive PostgreSQL License.
# pgloader Agent Rules - Always run `pgloader --dry-run --verbose <script.load>` before executing a `.load` script. - Check `WITH include drop` in `.load` files—it drops target Postgres tables before loading. - Store DB passwords in `~/.pgpass` or `PGPASSWORD` rather than committing them in `.load` scripts.
Agent-Ready Command Recipes
Safe Read-Only Queries
.load migration script pgloader --dry-run --verbose migration.load
Parses the load script and tests source/target DB connectivity without writing data.
Controlled Writes & Previews
pgloader --quiet app.sqlite postgresql://postgres@localhost:5432/app
Migrates schema and streams table rows from app.sqlite into a local PostgreSQL database.
Strengths for Agents
- +
--dry-runvalidates.loadsyntax and database connectivity before moving data. - + Handles MySQL/SQLite-to-PostgreSQL type mapping and parallel
COPYout of the box.
Caveats & Pitfalls
- ! No
--jsonoutput mode for parsing row counts or per-table error summaries. - ! Source builds rely on SBCL Common Lisp and can lag behind newer MySQL 8 auth plugins without SSL/auth tweaks.