Skip to content

createSqliteStateAdapter

createSqliteStateAdapter<TTxContext, TIdType>(__namedParameters): Promise<StateAdapter<TTxContext, TIdType> & object>

Defined in: packages/sqlite/src/state-adapter/state-adapter.sqlite.ts:492

TTxContext extends BaseTxContext

TIdType extends string = `${string}-${string}-${string}-${string}-${string}`

() => TIdType = ...

Function to generate new job IDs. Must return unique values — collisions are a hard error (the unique constraint rejects duplicates).

Default Value

() => crypto.randomUUID()

string = "TEXT"

SQL type for the primary key column.

Default Value

"TEXT"

SqliteStateProvider<TTxContext>

SQLite state provider wrapping the database connection.

string = "queuert_"

Prefix for all table names.

Default Value

"queuert_"

(id) => boolean

Predicate returning true if the ID is acceptable. Runs on both generated and caller-supplied IDs; failures throw InvalidJobIdError.

Promise<StateAdapter<TTxContext, TIdType> & object>