Basic usage
Options
All options default to the values in
dbdock.config.json. Pass only the ones you want to override.
Result shape
Examples
Schema-only backup
Data-only backup
Plain SQL backup
grep, inspect, or feed to psql. Usually much larger than custom format.
Maximum compression for archival
One-off unencrypted backup
Error handling
createBackup are standard Error instances with a .code property for structured handling.
Alerts are automatic
If alerts are configured indbdock.config.json, they fire after createBackup — success or failure. You don’t need to do anything extra.
See SDK → alerts if you want to send alerts manually.
Performance tips
Large databases
Stream the output — which DBDock does by default — so you never buffer the whole dump. Avoid callingcreateBackup concurrently against the same database; PostgreSQL will serialize the dumps anyway and you’ll waste resources.
Remote databases with slow links
Run the backup process on a machine near the database, not near your storage. The dump is usually 2-10x larger than the compressed/encrypted output, so it’s cheaper to dump locally and upload than to dump across the internet.Monitoring
Measureresult.metadata.duration and alert if it drifts. Backup duration is a good proxy for database health.
See also
Listing backups
Query the backup history.
Scheduling
Run on a schedule.
Alerts
Programmatic alerts.

