Help › Connect to databases

Connect to SQLite

Open a SQLite database file, an in-memory database or a new file, and what is particular to SQLite in Querlyn.

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

A SQLite database is a file on your computer. There is no server, no user and no password, so the dialog asks for the file and little else. SQLite is part of Querlyn; there is nothing to install.

Open a database file

  1. Choose File › New Connection… and, under Database engine, SQLite.
  2. Under Database file, choose Browse… and pick the file, or type its full path. A path may start with ~ for your home folder. A path relative to some other folder is refused.
  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, empty database at the path. Browse… then asks where to save and suggests database.sqlite. Off by default, so a mistyped path is an error and not a new file. Testing the connection creates the file too.

Open read-only is about the file. The Read-only switch above it is Querlyn's own check on the statements you run; see Read-only connections. You can use either or both.

Use a database in memory

Enter :memory: as the database file. The database lives only while the connection is open. All tabs of the connection, and the sidebar, see the same database; another connection that also says :memory: gets its own.

What is particular to SQLite

  • Attached databases are listed as schemas. The sidebar shows main, temp and any attached database. A database you attach with ATTACH in a query tab belongs to that tab's session only: the sidebar does not show it, and it is not attached again next time.
  • Foreign keys are enforced. Querlyn turns enforcement on for its sessions. After a test or a connect, the connection's details say "Foreign keys: enforced" and the journal mode.
  • Values are shown as they are stored. SQLite keeps a BOOLEAN, DATE or DATETIME column as a number or a text, and Querlyn shows that number or text.
  • A result you have not read to the end holds a read lock. While a large result is only partly loaded, another program may have to wait to write to the file. Closing the tab lets go of it.
  • Changing a table may rebuild it. SQLite cannot change a column's type or drop a constraint in place, so the table designer creates a new table, copies the rows and swaps the names, in one transaction. See Create and change tables.
  • Parameters are written ?, ?1, :name, @name or $name, and their values are bound to the statement.
  • Backups are copies made with SQLite's own backup mechanism, which is safe while the file is in use. See Back up and restore a database.

What does not apply to SQLite

  • Explain Analyze: SQLite reports no measured plan. Explain shows the query plan.
  • Server Activity, SSH and other routes, TLS and cloud sign-in: there is no server.
  • Functions and procedures: SQLite has none that are stored in the file.
  • Loading SQLite extensions is turned off.

Help for Querlyn 0.1.0. All help topics