To utilize the LibsqlLockAdapter, you must install the "@libsql/client" package.

Note in order to use LibsqlLockAdapter correctly, ensure you use a single, consistent database across all server instances. This means you can't use libsql embedded replicas.

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>