Skip to content

Import and export

  • PostgreSQL
  • MySQL
  • MariaDB
  • MongoDB
  • Redis / Valkey
  • Elasticsearch
  • CLI

You can start a profile from a connection URI instead of typing each field, and you can carry profiles to another machine in a passphrase-encrypted file.

  1. Open the New connection dialog: New connection in the side bar header’s menu (Connection actions).
  2. Paste the URI into Paste a URI to fill the form, under the engine cards. You do not need to pick the engine first: the URI names it.
  3. Choose Fill from URI, or press Enter. The dialog goes on to the form.

On the form, the URI button at the bottom shows the paste box again on the General tab, so you can fill an open form from a URI.

Querybara parses the URI and fills the engine, the endpoint, the user, the database, the TLS mode and the engine’s options. A password in the URI goes into the password field, set to Save in the OS keychain (or Remember for this session when no keychain is available). The name you typed and the environment, folder, colour and write guards stay as they are; with no name typed, Querybara names the connection after the host and database. Everything else comes from the URI: an SSH tunnel or a proxy set before is turned off.

The dialog confirms with “Filled from the URI”. Parameters Querybara does not use are listed after “Ignored:”.

Engine URI schemes
PostgreSQL postgres://, postgresql://, jdbc:postgresql://
MySQL mysql://
MariaDB mariadb://, or mysql:// while MariaDB is the chosen engine
MongoDB mongodb://, mongodb+srv://
Redis redis://, rediss://, redis+sentinel://, unix://
Elasticsearch http://, https://

TLS parameters in the URI set the TLS mode, and rediss://, https:// and mongodb+srv:// turn TLS on. A URI that says nothing about TLS leaves it off. See TLS modes.

Save a profile from a URI on the command line

Section titled “Save a profile from a URI on the command line”

querybara profiles add saves a profile under a name you choose. querybara profiles import-uri names it after the host and database:

Terminal window
querybara profiles add shop-dev "postgres://[email protected]:5432/shop" --folder Shop
querybara profiles import-uri "mongodb+srv://[email protected]/shop"

A password in the URI is saved only with --password-policy save and QUERYBARA_PASSPHRASE set; see Passwords and keychain.

Encrypted export and import run from the command line. The file holds the profiles and their folders, encrypted with AES-256-GCM under a key derived from your passphrase (scrypt). The passphrase comes from QUERYBARA_EXPORT_PASSPHRASE, or the CLI asks for it.

Terminal window
# every profile
querybara profiles export profiles.enc
# two profiles, with the saved secrets the CLI can read
querybara profiles export shop-profiles.enc --profile shop-dev --profile shop-prod --include-secrets
# on the other machine
querybara profiles import shop-profiles.enc
Option Command What it does
--profile <name> export Export this profile; repeat it for more. Without it, every profile is exported.
--include-secrets export Add the saved secrets that are readable here.
--replace import Replace profiles that already exist (same id). Without it, they are skipped with a warning.

Imported profiles keep their ids and their folders. They land in the store the desktop app uses, unless you point the CLI elsewhere with --store or QUERYBARA_STORE.

Documents Querybara 0.1.1 · built frombc9f5aa