querybara ddl
- CLI
- PostgreSQL
- MySQL
- MariaDB
querybara ddl reads the structure of a database and prints it as a DDL script, in dependency
order, ready to create the objects in an empty database. It writes no data and changes nothing.
Use it to keep the schema in version control or to review what a database contains.
Usage: querybara ddl [options] <target>
print the schema as a DDL script in dependency order
Arguments: target profile name or id, or connection URI
Options: --schema <name> PostgreSQL schema to dump; repeatable (default: all) --database <name> database to dump --out <file> write the script to a file instead of stdout --tls <mode> TLS mode for this run: disable, require, verify-ca or verify-full --ssh <user@host[:port]> reach URI targets through this SSH server; repeat for jump hosts, in order --ssh-key <path> SSH private key file (OpenSSH, PEM or PuTTY .ppk) --ssh-password-env <VAR> take the SSH password from this variable (default QUERYBARA_SSH_PASSWORD, else a prompt) --ssh-agent log in with the keys of ssh-agent (SSH_AUTH_SOCK) or Pageant --proxy <url> reach URI targets (or their first SSH server) through socks5://host:port or http://host:port --ssh-accept-new trust and remember an SSH host key not seen before (a changed key is always refused) --known-hosts <path> SSH known hosts file (default: the desktop app's) -h, --help show help for a commandThe --tls and SSH options are described in
Global options.
Examples
Section titled “Examples”Print the whole structure:
querybara ddl shop-prodWrite one PostgreSQL schema to a file:
Dump another database on the same MySQL server:
- On PostgreSQL,
--schemalimits the script to the schemas you name; by default it covers every schema other than the system schemas. MySQL and MariaDB dump the connected database, and warn if you pass--schema. - The script starts with a comment line naming the target, the engine, the server version and the database.
Related
Section titled “Related”Documents Querybara 0.1.1 · built frombc9f5aa