OptionalfileOptionalpriorityExplicit 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.
OptionalcapacitorOptions passed to the Capacitor adapter.
OptionalpostgresOptions 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.
OptionalindexedOptions passed to the IndexedDB adapter (browser persistence), all of them.
OptionalopenOptions forwarded to adapter.open.
OptionalquietSuppress fallback chain logs (adapter not-found warnings). Default: false.
OptionalloggerThe logger for this call's resolver lines (pino's fits). Default: the one
setStorageLogger() set, else the console.
OptionalstrictStrict resolution, for servers: only the database the options name opens. Default: false.
StorageResolutionError instead of trying a local
SQLite database, whatever priority lists after it.postgres or DATABASE_URL, with no
priority, makes ['postgres'] the whole list.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.
OptionalsegmentKeeps 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.
Absolute path for sqlite file (used by better-sqlite3/sql.js when persistence is desired).