Add a connection
- Choose an engine.
In Connections, choose Add connection, or press ⌘N / Ctrl+N. Search for the database engine you need.
- Enter its details.
Use the host, port, database and credentials supplied by your server or provider. File databases use a file path instead. Give the connection a name you’ll recognise.
- Test, then connect.
Choose Test connection, then Add and connect. Editing an existing profile uses Save and connect.
Local files
Choose Open a SQLite file… in Connections to pick an existing SQLite database. DuckDB is also available as a file-based engine in the connection form. Work on a copy if you’re just exploring.
MySQL and MariaDB
You can leave Database empty. Connect to the server, then search or choose from the databases your account can access. Use the sidebar to open another database later.
Each tab keeps its own database. A database set in the connection profile becomes the default for new tabs.
Hosted PostgreSQL
Supabase, Neon, CockroachDB and Amazon Redshift use the PostgreSQL adapter. Select the provider in the engine list and enter its PostgreSQL connection details. Use the hostname and database from that provider, rather than the address of its dashboard.
Firebase
Choose Firebase Firestore for collections and documents, or Firebase Realtime Database for a JSON tree. They are separate engines.
- Firestore: use
https://firestore.googleapis.com, your project ID and the database ID, usually(default). - Realtime Database: use the instance URL shown in Firebase Console. Its database field sets the starting path, such as
/customers.
You can import a service-account or authorised-user JSON credential, or use an appropriate access token. Firestore also accepts Firebase ID tokens; Realtime Database does not. Pasted access tokens need replacing when they expire.
For local Firebase emulators, enable emulator mode, use a loopback URL and leave credentials empty. Firestore commonly uses http://127.0.0.1:8080; Realtime Database commonly uses http://127.0.0.1:9000 and needs your emulator’s namespace.
TLS and credentials
Remote connections require verified TLS. Plaintext is restricted to loopback addresses such as localhost on non-production profiles. If certificate validation fails, fix the trust or hostname settings rather than disabling verification.
Remembered passwords and tokens stay in macOS Keychain or Windows Credential Manager. Changing a saved connection’s engine, endpoint or authentication details may require entering its credential again.
Production
Mark live connections as Production to make them read only in Query Anvil. Use a reader account or role if you need the database server to enforce the same restriction.
SSH tunnels and interactive cloud sign-in aren’t built in. If your database requires a tunnel, establish it separately and connect through its local endpoint.
Connection problems
- Check the hostname, port and whether the server is listening.
- Check the username, password and database permissions. A successful login doesn’t grant access to every database.
- For remote servers, check firewall rules and certificate settings.
- Oracle also needs Oracle Instant Client installed on the computer.
