Help › Connect to databases
Connect to a database
Add a connection, fill in the connection dialog, test it, and connect and disconnect.
Querlyn 0.1.0 is not released yet. This help describes it ahead of release.
A connection tells Querlyn where a database is and how to sign in. You add it once. After that it is listed in the sidebar under CONNECTIONS, and any query tab can use it.
Querlyn connects to PostgreSQL, MySQL, MariaDB, SQLite, DuckDB, SQL Server, Amazon Redshift, ClickHouse, Oracle Database, Snowflake, Google BigQuery, MongoDB, Apache Cassandra, Apache Kafka, Redis and Amazon DynamoDB, and to the databases that speak their protocols: CockroachDB, YugabyteDB, TimescaleDB, ScyllaDB, TiDB, SingleStore, Azure SQL Database and the hosted services Neon, Supabase, AlloyDB, Aurora and PlanetScale. What works on each database compares them, and each has a topic of its own; see Each database.
Add a connection
- Choose , or use this link: . The + button at the top of the sidebar offers the same, and while you have no connections the sidebar shows an Add Connection… button.
- Open the Database engine list and choose the kind of database. The rest of the dialog changes to what that engine needs. See Choose the database engine.
- Fill in the dialog. The connection dialog goes through every part.
- Choose Test Connection to try it without saving anything.
- Choose Save & Connect. The connection is saved, selected in the sidebar, and connected. Save beside it saves without connecting.
There are two shorter ways to fill the dialog:
- If you have the connection as a URL, copy it and choose Paste URL at the top of the dialog. See Paste a connection URL.
- If another database tool already has your connections, see Import connections.
Choose the database engine
Database engine is a list at the top of the dialog. Click it, or move to it with ⇥ on macOS or Tab on Windows and Linux and press ↩ on macOS or Enter on Windows and Linux, Space or ↓ on macOS or Down on Windows and Linux.
- Recent comes first: the engines of the connections you saved or connected lately on this computer.
- Then every engine, under Relational, Warehouses, Document and wide-column and Streaming.
- A database that speaks another engine's protocol is listed right under that engine, with the protocol beside its name: CockroachDB under PostgreSQL, TiDB under MySQL, Azure SQL Database under SQL Server, ScyllaDB under Apache Cassandra. See Connect to CockroachDB, TiDB and other compatible databases.
Type to narrow the list. A few letters of the name are enough, and so are
names people commonly use: postgres or pg finds PostgreSQL and every
database on its protocol, mssql finds SQL Server, maria finds MariaDB,
mongo finds MongoDB. ↑ on macOS or Up on Windows and Linux and ↓ on macOS or Down on Windows and Linux move through the list,
↩ on macOS or Enter on Windows and Linux chooses, and ⎋ on macOS or Esc on Windows and Linux closes the list and leaves the
engine as it was.
The connection dialog
The dialog reads from top to bottom: what the connection is, where it goes, and then what Querlyn does with it. A server database shows all of the parts below; a database that is a file (SQLite, DuckDB) shows the file's own options in place of Host to Route.
| Part | What it is for |
|---|---|
| Database engine | The kind of database: an engine, or a database that speaks an engine's protocol, such as CockroachDB or TiDB. It sets the usual port and examples. See Choose the database engine. |
| Name | What the sidebar calls the connection. Leave it empty to use the database and the host ([email protected]), the host when no database is named, or the file's name. |
| Environment | Local, Development, Testing, Staging or Production. It decides how careful Querlyn is with this connection. A new connection starts as Development. See Choose an environment. |
| Host and Port | The server's address. The port starts as the engine's usual one. |
| Database | The database to open. Leave it empty for the one the server gives your user by default, where the engine has one. |
| User | The name you sign in with. |
| Authentication | Shown for engines that also accept a cloud sign-in: Password, AWS IAM or Microsoft Entra ID. See Sign in with AWS or Entra ID. |
| Where the password is kept | A list: Save in Keychain and Ask every time first, the password managers below. See Choose where passwords are kept. |
| Password | Shown when the password is kept in the keychain. |
| TLS | Whether the connection is encrypted and the server's certificate checked. See Encrypt a connection with TLS. |
| Route | How Querlyn reaches the server: Direct, SSH, Kubernetes or AWS SSM. See Reach a database through SSH and Kubernetes and SSM tunnels. |
| Send sign-in tokens to this host | Shown only when a Microsoft Entra ID, Google Cloud or Snowflake key-pair sign-in would send its token to a server that is not the provider's. Kept on this computer only. See Where tokens are sent. |
| Read-only | Blocks statements that change data on this connection. See Read-only connections. |
| Allow from the command line | Whether the querlyn command may use this connection and its saved password on this computer. Production starts with it off, the others with it on. Kept on this computer only. See Allow a connection from the command line. |
| Query history | What the history keeps of what you run on this connection: Full (including SQL), Metadata only or Off. Production starts with Metadata only, the others with Full (including SQL). See What is recorded. |
| Undo journal | Whether this computer keeps the rows of the dry runs you commit, so that they can be reverted: Keep or Off. Production starts with Off, the others with Keep. Shown only for engines that can dry-run. See The undo journal. |
| Migration history tables | Only if a migration tool keeps its history under a name of your own: the tables' names, separated by commas. Shown for engines that speak SQL. See History tables under other names. |
For a file database the dialog has Database file with a Browse… button instead, and the checkboxes Open read-only and Create the file if it does not exist. See Connect to SQLite and Connect to DuckDB.
When something is missing or cannot be right, the dialog says what in red above its buttons and does not save: for example "Enter the server's host name or IP address." or "The port must be a number from 1 to 65535."
Test before you save
Choose Test Connection (). Querlyn tries the whole way to the database and lists each step as it goes, so when something fails you can see which step it was. When the test succeeds, the last line says what answered, for example "Connected: PostgreSQL 18.0 · app as alice" or "Connected: CockroachDB 25.2.24 (PostgreSQL protocol) · defaultdb as app".
A test saves nothing, and it never saves a password. While a test runs, Cancel Test stops it ().
Save, or save and connect
The dialog has two buttons for saving:
| Button | What it does | Command |
|---|---|---|
| Save | Saves the connection and closes the dialog. Nothing connects, so you can change a Production connection without opening it. | |
| Save & Connect | Saves, then connects. |
↩ on macOS or Enter on Windows and Linux in a field of the dialog does what Save & Connect does. When you edit a connection that is connected, Save & Connect is unavailable and ↩ on macOS or Enter on Windows and Linux saves: the connection stays open as it is, and what you changed applies the next time it connects.
Read a connection error explains the steps and what to do about each.
Connect and disconnect
A saved connection connects when you need it. Any of these connects it:
- Open it in the sidebar: click the arrow beside its name, or select it and press → on macOS or Right on Windows and Linux. It shows Connecting… and then its databases or schemas.
- Select it and choose , or the Connect button at the top of the sidebar.
- Run a statement in a query tab that uses it.
Querlyn never connects by itself when it starts.
To close a connection, select it and choose . If one of its tabs has an open transaction, row changes that are not applied yet or an export still running, Querlyn asks first.
The connection's menu (right-click it in the sidebar) also has , which closes the connection, drops its SSH tunnels and connects again. Use it after the network changed under a connection that goes through SSH.
What each tab gets
Every query tab has its own session on the database, so a transaction or a temporary table in one tab is not seen in another. Querlyn opens one more session per connection for itself, to read the names of your tables for the sidebar and for completion.
A tab works in the database the connection names, or in the server's default when the connection names none, until you put it on another database of the same server. The bar above the editor shows the tab's database after the connection's name; see Choose a tab's connection and database.
Each database
- Connect to PostgreSQL
- Connect to MySQL or MariaDB
- Connect to SQLite
- Connect to DuckDB
- Connect to SQL Server
- Connect to Amazon Redshift
- Connect to ClickHouse
- Connect to Oracle Database
- Connect to Snowflake
- Connect to Google BigQuery
- Connect to MongoDB
- Connect to Apache Cassandra
- Connect to Apache Kafka
- Connect to CockroachDB, TiDB and other compatible databases
To change or remove a connection later, see Manage connections.
Help for Querlyn 0.1.0. All help topics