Interface: DBInstanceConfig
Defined in: db/db.ts:86
Extended by
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
debug? | boolean | If true, the DB will be in debug mode. Defaults to false. | db/db.ts:132 |
maxShardCommits? | number | Maximum commits per shard. Controls RAM: each shard holds approximately (max * 2.5 * 80 + max * 1.5 * 32) bytes of metadata. Defaults to 100,000 (server) or 25,000 (browser). | db/db.ts:144 |
minShardCommits? | number | Shards below this count are candidates for merging. Defaults to 10% of maxShardCommits. | db/db.ts:148 |
mode? | DBMode | The mode of operation for this database instance. | db/db.ts:94 |
orgId? | string | Optional organization id used to sandbox the data of a specific organization in a multi-tenant deployment. Defaults to "localhost". | db/db.ts:99 |
path | string | Absolute path to the directory that'll store the DB's data. | db/db.ts:90 |
peers? | string | Iterable<string, any, any> | Absolute URLs of peer nodes to sync with. This option is only used for server cluster configurations, where multiple server nodes act as a single logical node in the network, sharing the same root session and cryptographic keys. In a server cluster, all peers listed here must share the same public/private root keys, and will coordinate as one logical entity. For client applications, this argument is not needed—React hooks and the client library automatically set up communication with the server as required. | db/db.ts:112 |
queryInactivityTimeoutMs? | number | Auto-close queries after this many ms of inactivity. A query is inactive when no external DocumentChanged listeners are attached. Set to 0 (default) to disable. A closed query releases its source-repo listener, which may make the repo eligible for idle close. | db/db.ts:173 |
registry? | DataRegistry | Optional schema registry to use for this database instance. If not provided, the default global registry (DataRegistry.default) will be used. The registry contains all schema definitions and authorization rules that this database instance will work with. Authorization rules define who can read, write, or delete data based on user permissions and data properties. | db/db.ts:127 |
repoInactivityTimeoutMs? | number | Auto-close repositories after this many ms of inactivity. Each resource owns its own one-shot timer. Set to 0 (default) to disable. System repos (/sys/) are never auto-closed. When a repo is manually closed via closeRepo(), any open queries sourcing from it are closed first. Auto-close does NOT close queries — listener pins prevent that. Repo and query timeouts are independent: a query keeps its source repo alive via a listener pin even after the repo's own idle timer would have fired. Only after all dependent queries close does the repo become eligible for idle close. | db/db.ts:163 |
splitThreshold? | number | Commit count that triggers a background shard split. Defaults to 75% of maxShardCommits. | db/db.ts:146 |
storageFormat? | StorageFormat | The on-disk format for repository commit logs. Defaults to 'goat' (compact binary). Use 'jsonl' for human-readable output during development or debugging. | db/db.ts:138 |
trusted? | boolean | If true, all security mechanisms are bypassed in favor of speed. Set this to true when running purely in a trusted backend environment. Defaults to false. | db/db.ts:118 |