How to Open a SQLite File on Mac
A database file shouldn’t require a database-admin setup. Here’s how to get from a SQLite file in Finder to the rows inside it.
1. Check what kind of file you have
SQLite files commonly end in .sqlite, .sqlite3 or .db. The extension is a convention, not a guarantee: other applications use .db for different formats. An ordinary SQLite 3 file has a specific identifying header. SQLite documents that header in its database file-format reference.
A CSV is different. It is plain-text tabular data, not a SQLite database. Petti can import CSV into a table in an open database; it does not currently treat a CSV file as a directly queryable database.
Preview it in Finder with Quick Look
With Petti installed, select your SQLite file in Finder and press Space. Petti’s Quick Look extension shows table names, counts of tables, views and indexes, file size and modification date. Choose Open with Petti to browse the data.
2. Open the database in Petti
- Launch Petti and choose Open Database, or press ⌘O.
- Select the database file. Petti starts with a read-only connection.
- Choose a table from the sidebar. Its first page of rows appears in the grid.
Use the current-table search to find text, click a column header to sort, or add filters for more specific conditions. The filter bar makes those conditions visible. Clear All removes the filters and search while keeping your sort order.
3. Browse first, edit deliberately
You do not need to unlock a database to inspect its contents. When you do need a change, click the lock, double-click a cell, edit its value, and press Return to save. Edits affect the actual database. For a file that matters, work from a proper backup and check the result before returning it to the application that owns it.
Keep WAL files with their database
You may see a -wal file alongside the main database. In SQLite’s write-ahead logging mode, committed changes can still be in that log. Moving only the main file can leave recent data behind. Prefer an application’s backup/export function or a SQLite-aware backup over copying files from a running app. See SQLite’s WAL documentation.
If the file doesn’t open
Check that it is really SQLite, that you have permission to read it, and that it is not encrypted. SQLCipher databases are not supported by Petti 1. A file used by another running application may also be busy. Keep the original intact; don’t rename or delete companion files to make an error disappear.
Next: learn what read-only mode protects, or see how Petti handles large SQLite tables.