Skip to Content
Spiti

Manage plugin data

Choose where a plugin keeps its data, browse what it stored, and create or remove databases.

Choose a database at install

Plugins that keep data, such as notes or session history, store it in a SQLite database on your Mac. The install screen's Database section shows the plugin's reason and the tables it will create.

By default, Spiti creates a new database named after the plugin. If you already have databases, you can pick A new SQLite database or an existing one. Each existing database lists the plugins that already use it. In the terminal, spiti install asks the same question as a numbered list.

Several plugins can share one database. Each keeps its tables apart from the others and can't change another plugin's data. A plugin can read another plugin's tables only when it asked for them at install and both use the same database.

Spiti's own settings live in a separate file that no plugin can read or write.

Browse what a plugin stored

Open Settings → Databases. The Connections card lists each database with its size and the plugins that use it.

Choose Browse to see its tables, each with the plugin that owns it, its row count and its columns. Choose Browse on a table to read its rows. Type in Filter rows to match text in any column, and click a column header to sort it. Rows show 50 to a page. Browsing is read-only: you can't edit rows or run SQL here.

Create or remove a database

To set up a database that several plugins will share, enter a name under New database and choose Create database. Names use lowercase letters, digits and dashes. The new database appears as a choice the next time you install a plugin.

Remove is available only when no plugin uses the database. Confirm with Delete database to delete its file and everything in it.

Database files are kept in ~/.spiti/databases/, one .sqlite file each. When you remove a plugin, Spiti keeps its data for 30 days, so reinstalling it in that window brings the data back. See Rename or remove a plugin.

For plugin authors

Add a database block to spiti.json with a reason, "dialects": ["sqlite"], your schema file and your migrations folder. Without it, the plugin gets no data access. Define tables with table and the t column types from @spiti/sdk/db, then query them from server code with ctx.db. Small values by key go in ctx.kv, which needs the same block. Views read data through your plugin's queries.

Spiti applies your migrations before the plugin starts, at install and after an update. spiti plugin check confirms that your schema matches your migrations, that they run on an empty database and on seeded data, and that any step that drops or renames a table or column carries a -- spiti:destructive marker with a reason.

On this page