| 28 | } |
| 29 | |
| 30 | async list(): Promise<string[]> { |
| 31 | const prefix = `${this.cacheNamePrefix}:`; |
| 32 | const allCacheNames = await this.adapter.caches.keys(); |
| 33 | const dbCacheNames = allCacheNames.filter((name) => name.startsWith(prefix)); |
| 34 | |
| 35 | // Return the un-prefixed table names, so they can be used with other `CacheDatabase` methods |
| 36 | // (for example, for opening/deleting a table). |
| 37 | return dbCacheNames.map((name) => name.slice(prefix.length)); |
| 38 | } |
| 39 | |
| 40 | async open(name: string, cacheQueryOptions?: CacheQueryOptions): Promise<Table> { |
| 41 | if (!this.tables.has(name)) { |