dsql_dump is a utility to dump your DSQL database as SQL, much like
what pg_dump does. It allows you to take a DSQL database, and
restore it to a local PostgreSQL database for example.
If you find this utility useful, please star it on github.
npm i -g dsql_dumpdsql_dump will always connect as the "admin" user. Make sure your
AWS credentials allow connecting as admin to the cluster.
Dump the default schema (public):
dsql_dump > dump.sqlDump another schema:
dsql_dump --schema test > dump.sqlSupported options:
| Option | Description |
|---|---|
| -h, --host | DSQL cluster hostname (default: PGHOST or localhost) |
| -n, --schema | Dump the named schema only (default: public) |
| -a, --data-only | Dump only the data, not the schema (data definitions) |
| -s, --schema-only | Dump only the schema (data definitions), not the data |
| -c, --clean | Output commands to DROP all the dumped database objects prior to outputting the commands for creating them |
| --dsql-compatible | Output DSQL-compatible SQL for restore, including CREATE INDEX ASYNC |
| --help | Display help for command |
| --version | Display version number |
This package is in its "works for me" days. Contributions greatly appreciated!
Supported:
- CREATE TABLE
- CREATE INDEX
- CREATE VIEW
- CREATE FUNCTION
- CREATE DOMAIN