← Back to Help

SQLite Guide

Everything you need to open and work with local SQLite databases in SQLAgent.

Getting Started

How do I open a SQLite database?

Select SQLite in the database picker, then either:

  • Paste a file path directly into the text field
  • Click Browse to pick a file from Finder

Supported extensions: .sqlite, .sqlite3, and .db. SQLite is file-based — no host, port, or credentials needed.

Can I open Wrangler / Miniflare D1 files?

Yes. Wrangler's local D1 development stores SQLite files in .wrangler/state/v3/d1/. You can open these files directly in SQLAgent to inspect your local D1 data during development.

File Validation

How does file validation work?

When you enter a file path, SQLAgent validates it instantly before you connect. The validation banner shows:

  • Valid database (green) — file size, table count, read & write access, and file owner
  • Read-only database (orange) — you can browse and query, but writes will fail
  • File not found (red) — the path doesn't exist
  • Not a valid SQLite database (red) — the file exists but isn't a readable SQLite file
  • Permission denied (red) — you don't have read access, shows the file owner
What permissions are shown?

The validation banner shows your read/write access and the file owner. If the file is read-only for your user, SQLAgent warns you and opens the database in read-only mode. This helps you understand why writes might fail before you even try.

Recent Databases

How do recent databases work?

Every SQLite database you connect to is saved in the Recent Databases list on the connection form. Each entry shows:

  • File name and directory path
  • Relative timestamp (e.g. "2 hours ago")
  • File status — orange warning if the file no longer exists

Click any recent database to instantly load its path and reconnect. Hover over the timestamp to reveal a delete button.

Troubleshooting

File not found

The file does not exist at the specified path. Check that the path is correct and the file hasn't been moved or deleted. The validation banner turns red and blocks the Connect button.

Not a valid SQLite database

The file exists but is not a readable SQLite database. It may be corrupted, encrypted (e.g. SQLCipher), or simply not a database file. Verify by running file yourfile.sqlite in Terminal.

Permission denied

You don't have permission to read this file. The validation banner shows the file owner. You may need to adjust permissions with chmod 644 yourfile.sqlite or run SQLAgent as a user with access.

Read-only database

The database is readable but not writable. You can browse and query data, but INSERT, UPDATE, and DELETE operations will fail. To enable writes, check the file permissions and ownership.

Database is locked

Another process has an exclusive lock on the SQLite database. Close other applications using the file (e.g. another database client, a running server, or a Wrangler dev instance) and try again.

SQLite SQL Differences

If you're coming from MySQL, here are the key syntax differences in SQLite.

String concatenation

Use || instead of CONCAT():

first_name || ' ' || last_name

Date functions

SQLite uses different date functions:

  • datetime('now') instead of NOW()
  • date('now') instead of CURDATE()
  • strftime() instead of DATE_FORMAT()
Schema inspection

SQLite doesn't have SHOW or DESCRIBE. Use these instead:

  • Tables: SELECT name FROM sqlite_master WHERE type='table'
  • Columns: PRAGMA table_info('table_name')
  • Indexes: PRAGMA index_list('table_name')
Auto-increment

In SQLite, use INTEGER PRIMARY KEY for auto-incrementing IDs. The AUTOINCREMENT keyword is optional and behaves differently than MySQL's AUTO_INCREMENT.

TRUNCATE TABLE

SQLite doesn't support TRUNCATE TABLE. Use DELETE FROM table_name instead.

See the full Error Reference for all error messages.