Skip to content

@databases/cache@1.1.0

Compare
Choose a tag to compare
@ForbesLindesay ForbesLindesay released this 19 Feb 17:37
b8ffa7a

New Features

  • Added Cache.deletePrefix(prefix). This lets you delete all keys with a given prefix from the cache. deletePrefix will throw an error if any of the keys are not serialized to a string. They can either already be strings, or you can use mapKey to convert them into strings if you want to use this method. (#317)

    Using this method with replication enabled will result in this new type of replication event:

    interface ReplicationDeletePrefixEvent {
      readonly kind: 'DELETE_PREFIX';
      readonly name: string;
      readonly prefix: string;
    }
  • You can now pass multiple keys to Cache.delete(...keys) to more efficiently delete multiple keys in a single call. (#317)

    Passing multiple keys with replication enabled will result in this new type of replication event:

    interface ReplicationDeleteMultipleEvent {
      readonly kind: 'DELETE_MULTIPLE';
      readonly name: string;
      readonly keys: unknown[];
    }

Bug Fixes

  • Provide slightly stricter types for TypeScript (#318)