Phials plugin documentation
User guide
AI Disclosure: This page was generated by an LLM and may contain inaccuracies. Hand-crafted documentation will be implemented over time on the road to 1.0

Store plugin data

Choose the persistence contract that matches what the data means:

  • Plugin settings store user-configurable behavior that belongs in Settings and has declared defaults and reset behavior.
  • Plugin storage stores small plugin-owned values by key.
  • Plugin database stores structured records that need indexes, filtering, sorting, or relationships.

All three contracts are scoped to the plugin’s stable ID. A plugin does not choose host filenames, database filenames, or physical SQL table names.

Choose and implement a store

  1. Choose between settings, storage, and a database before designing the data shape.
  2. Store key-value plugin data for small durable documents, cursors, and caches.
  3. Define a plugin database schema for queryable records and indexes.
  4. Query and update plugin database tables with typed rows, logical table names, helpers, and parameterized SQL.
  5. Handle plugin data lifecycle and removal across activation, reload, updates, and uninstall.

For user-facing configuration, start with Add plugin settings. Do not mirror the same value into settings, storage, and a table; choose one source of truth and derive runtime state from it.

Public data contracts

The generated reference provides exact signatures for:

The data APIs are available through the plugin-scoped PluginAPI passed to onActivate.