To utilize the SqliteLockAdapter, you must install the "better-sqlite3" and "@types/better-sqlite3" packages.

Note the SqliteLockAdapter is limited to single server usage and cannot be shared across multiple servers but it can be shared between different processes. To use it correctly, ensure all process instances access the same consistent, persisted database.

IMPORT_PATH: "@daiso-tech/core/lock/implementations/adapters"

Implements

Constructors

Methods

  • The refresh method will upadte expiration of lock if it matches the given key and matches the given owner. Returns number of updated rows or documents.

    Parameters

    • key: string
    • owner: string
    • expiration: Date

    Returns Promise<number>

  • The update method will update a lock if it has expired, matches the given key and matches the given owner. Returns number of updated rows or documents.

    Parameters

    • key: string
    • owner: string
    • expiration: null | Date

    Returns Promise<number>