Removes a lock from the database regardless of its owner.
The unique identifier for the lock to remove.
Removes a lock from the database only if it is currently held by the specified owner.
The unique identifier for the lock.
Returns ILockExpirationData | null
. The ILockExpirationData
data if successfully removed, otherwise null
if the lock wasn't found or the owner didn't match.
Updates the expiration date of a lock if it is currently held by the specified owner.
The unique identifier for the lock.
The new date and time when the lock should expire.
Returns a number greater than or equal to 1
if the lock's expiration was updated, or 0
if the lock wasn't found or the owner didn't match.
The
IDatabaseLockAdapter
contract defines a way for managing locks independent of data storage. This contract simplifies the implementation of lock adapters with CRUD-based databases, such as SQL databases and ORMs like TypeOrm and MikroOrm.IMPORT_PATH:
"@daiso-tech/core/lock/contracts"