DurableObjectSqlDatabasePersisterConfig
The DurableObjectSqlDatabasePersisterConfig
type represents the union of all possible configuration types for a DurableObjectSqlStoragePersister
.
DpcJson | DpcFragmented
This allows the persister to support multiple persistence modes.
- JSON mode (via
DpcJson
): Stores the entireStore
as JSON in a single row. - Fragmented mode (via
DpcFragmented
): Stores each piece of data as separate rows.
Example
These examples show some different configuration options.
// JSON mode (default)
{
mode: 'json',
storeTableName: 'my_store',
};
// Fragmented mode
{
mode: 'fragmented',
storagePrefix: 'app_',
};
Since
v6.3.0