Help › Connect to databases

Connect to DuckDB

Open a DuckDB database file or an in-memory database, choose its options, and what is particular to DuckDB in Querlyn.

Querlyn 0.1.0 is not released yet. This help describes it ahead of release.

A DuckDB database is a file on your computer, or a database in memory. DuckDB itself is part of Querlyn (version 1.5), with JSON and Parquet support built in, so there is nothing to install.

Open a database file

  1. Choose File › New Connection… and, under Database engine, DuckDB.
  2. Under Database file, choose Browse… and pick the file, or type its full path. Enter :memory: for a database in memory.
  3. Choose an Environment, as for any connection.
  4. Choose Test Connection, then Save & Connect.

The file's options

OptionWhat it does
Open read-onlyQuerlyn opens the file read-only and cannot write to it.
Create the file if it does not existMakes a new database at the path. Browse… then asks where to save and suggests database.duckdb.
Allow DuckDB to download extensionsOff: DuckDB does not download or load extensions on its own, and reading JSON and Parquet still works because they are built in. INSTALL and LOAD statements you run yourself still work. On: DuckDB may download an extension from extensions.duckdb.org when a query needs one, for example httpfs for files at an https:// address.

Note: An extension is code that runs inside Querlyn. Turn downloads on only for connections where you need them.

A database in memory is gone when the connection closes. All tabs of the connection, and the sidebar, see the same database.

One file, one set of options

Querlyn opens each DuckDB file once and shares it between every tab and every saved connection that names it. If a second connection asks for the same file with other options (read-only, or extension downloads), Querlyn refuses it and says the file is already open with other options. Close the first connection, or give both the same options.

What is particular to DuckDB

  • Query files directly. read_csv, read_json and read_parquet, and COPY … (FORMAT parquet), work without any extension.
  • Attached databases are listed as schemas, each named after its database and showing that database's main schema. A tab's temporary tables are not listed.
  • Macros are listed under Functions.
  • No savepoints. Inside a transaction you opened yourself, editing rows in the results and Explain Analyze are refused; commit or roll back first. Outside a transaction both work.
  • An error can fail the transaction. When a statement fails while it runs inside a transaction, DuckDB aborts the transaction and the tab shows Transaction failed — roll back. Committing it then discards its changes, and Querlyn says so.
  • TIMESTAMPTZ values are shown in UTC. DuckDB's time zone support is an extension (ICU) that is not built into Querlyn.
  • Parameters are written ?, $1 or $name, and their values are bound to the statement. A :name is not a parameter in DuckDB.
  • Backups are DuckDB files. See Back up and restore a database.
  • The table designer refuses what DuckDB cannot change in place, such as adding a foreign key to an existing table, and says what to do instead. DuckDB has no identity columns; use a sequence.

What does not apply to DuckDB

  • Server Activity, SSH and other routes, TLS and cloud sign-in: there is no server.
  • Columns of type VARIANT cannot be shown; cast them to VARCHAR in the query.

Help for Querlyn 0.1.0. All help topics