Skip to main content

Interface: AgentOsSqlStorageConfig

Defined in: packages/agentos/src/core/storage/SqlStorageAdapter.ts:97

Configuration options for the AgentOS SQL storage adapter.

Extends the base storage resolution options with AgentOS-specific settings.

Interface​

AgentOsSqlStorageConfig

Example​

const config: AgentOsSqlStorageConfig = {
filePath: './agentos.db',
priority: ['better-sqlite3', 'sqljs'],
enableAutoMigration: true,
messageRetentionDays: 90 // Keep 3 months of history
};

Extends​

  • StorageResolutionOptions

Properties​

capacitor?​

optional capacitor: CapacitorAdapterOptions

Defined in: packages/agentos/node_modules/.pnpm/@framers+sql-storage-adapter@0.9.2_better-sqlite3@13.0.3/node_modules/@framers/sql-storage-adapter/dist/core/resolver.d.ts:20

Options passed to the Capacitor adapter.

Inherited from​

StorageResolutionOptions.capacitor


enableAutoMigration?​

optional enableAutoMigration: boolean

Defined in: packages/agentos/src/core/storage/SqlStorageAdapter.ts:98

Create the tables and run the schema migrations in initialize() (default true). False leaves the schema to the host.


filePath?​

optional filePath: string

Defined in: packages/agentos/node_modules/.pnpm/@framers+sql-storage-adapter@0.9.2_better-sqlite3@13.0.3/node_modules/@framers/sql-storage-adapter/dist/core/resolver.d.ts:10

Absolute path for sqlite file (used by better-sqlite3/sql.js when persistence is desired).

Inherited from​

StorageResolutionOptions.filePath


indexedDb?​

optional indexedDb: IndexedDbAdapterOptions

Defined in: packages/agentos/node_modules/.pnpm/@framers+sql-storage-adapter@0.9.2_better-sqlite3@13.0.3/node_modules/@framers/sql-storage-adapter/dist/core/resolver.d.ts:29

Options passed to the IndexedDB adapter (browser persistence), all of them.

Inherited from​

StorageResolutionOptions.indexedDb


logger?​

optional logger: StorageLogger

Defined in: packages/agentos/node_modules/.pnpm/@framers+sql-storage-adapter@0.9.2_better-sqlite3@13.0.3/node_modules/@framers/sql-storage-adapter/dist/core/resolver.d.ts:38

The logger for this call's resolver lines (pino's fits). Default: the one setStorageLogger() set, else the console.

Inherited from​

StorageResolutionOptions.logger


messageRetentionDays?​

optional messageRetentionDays: number

Defined in: packages/agentos/src/core/storage/SqlStorageAdapter.ts:99

Delete messages older than this many days, in initialize() and after each stored message (0, the default, keeps every message)


openOptions?​

optional openOptions: StorageOpenOptions

Defined in: packages/agentos/node_modules/.pnpm/@framers+sql-storage-adapter@0.9.2_better-sqlite3@13.0.3/node_modules/@framers/sql-storage-adapter/dist/core/resolver.d.ts:31

Options forwarded to adapter.open.

Inherited from​

StorageResolutionOptions.openOptions


postgres?​

optional postgres: PostgresAdapterOptions

Defined in: packages/agentos/node_modules/.pnpm/@framers+sql-storage-adapter@0.9.2_better-sqlite3@13.0.3/node_modules/@framers/sql-storage-adapter/dist/core/resolver.d.ts:27

Options passed to the Postgres adapter, all of them: a connection string, or host, port, database, user and password, and the pool, SSL and timeout settings. Without a connection string or a host, database or user here, the connection string comes from DATABASE_URL.

Inherited from​

StorageResolutionOptions.postgres


priority?​

optional priority: AdapterKind[]

Defined in: packages/agentos/node_modules/.pnpm/@framers+sql-storage-adapter@0.9.2_better-sqlite3@13.0.3/node_modules/@framers/sql-storage-adapter/dist/core/resolver.d.ts:18

Explicit adapter priority override. The resolver builds postgres, better-sqlite3, capacitor, indexeddb and sqljs; memory builds sql.js, as sqljs does. Any other kind (electron-main, electron-renderer, supabase, or an unknown name) fails as a candidate with an error that names it, and the resolver goes on to the next one.

Inherited from​

StorageResolutionOptions.priority


quiet?​

optional quiet: boolean

Defined in: packages/agentos/node_modules/.pnpm/@framers+sql-storage-adapter@0.9.2_better-sqlite3@13.0.3/node_modules/@framers/sql-storage-adapter/dist/core/resolver.d.ts:33

Suppress fallback chain logs (adapter not-found warnings). Default: false.

Inherited from​

StorageResolutionOptions.quiet


segment?​

optional segment: string

Defined in: packages/agentos/node_modules/.pnpm/@framers+sql-storage-adapter@0.9.2_better-sqlite3@13.0.3/node_modules/@framers/sql-storage-adapter/dist/core/resolver.d.ts:78

Keeps the resolved adapter's tables apart from other users of the same database: on PostgreSQL a schema of the segment's name, on better-sqlite3 and sql.js a file with the segment in its name (app.sqlite3 becomes app-agentos.sqlite3), on IndexedDB and Capacitor a database name with the segment appended (app-db-agentos). Lower-case letters, digits and underscores; not public, information_schema or a name beginning with pg_. A name that cannot be a segment is refused before any adapter is tried, here or in postgres, indexedDb or capacitor, and so is a segment with postgres.pool, which the Postgres adapter cannot start in the segment. Takes the place of a segment in postgres, indexedDb or capacitor.

Without it, a local candidate whose options name no segment of their own (better-sqlite3 and sql.js have none), tried after a candidate whose options named one and failed, opens in that candidate's segment: a resolution that asked for a segment never falls through to the database every user of the file or the browser shares. A postgres candidate opens in the segment of its own options alone.

Inherited from​

StorageResolutionOptions.segment


strict?​

optional strict: boolean

Defined in: packages/agentos/node_modules/.pnpm/@framers+sql-storage-adapter@0.9.2_better-sqlite3@13.0.3/node_modules/@framers/sql-storage-adapter/dist/core/resolver.d.ts:57

Strict resolution, for servers: only the database the options name opens. Default: false.

  • The postgres candidate is the last one tried. When it fails to open, resolution throws a StorageResolutionError instead of trying a local SQLite database, whatever priority lists after it.
  • A Postgres server named by postgres or DATABASE_URL, with no priority, makes ['postgres'] the whole list.
  • An explicit filePath outranks DATABASE_URL: with a filePath and no postgres options that name a server, DATABASE_URL is not read.
  • postgres options that name no server, with no DATABASE_URL to fill in and no filePath, fail instead of opening the local default.

Without strict, a postgres candidate that fails falls through to the next candidate, and DATABASE_URL puts Postgres first even when a filePath is given.

Inherited from​

StorageResolutionOptions.strict