datastore-core
Version:
Wrapper implementation for interface-datastore
24 lines • 1.17 kB
TypeScript
import { BaseDatastore } from './base.js';
import type { Batch, Datastore, Key, KeyQuery, Pair, Query } from 'interface-datastore';
import type { AbortOptions, AwaitIterable } from 'interface-store';
/**
* A datastore that can combine multiple stores. Puts and deletes
* will write through to all datastores. Has and get will
* try each store sequentially. Query will always try the
* last one first.
*
*/
export declare class TieredDatastore extends BaseDatastore {
private readonly stores;
constructor(stores: Datastore[]);
put(key: Key, value: Uint8Array, options?: AbortOptions): Promise<Key>;
get(key: Key, options?: AbortOptions): Promise<Uint8Array>;
has(key: Key, options?: AbortOptions): Promise<boolean>;
delete(key: Key, options?: AbortOptions): Promise<void>;
putMany(source: AwaitIterable<Pair>, options?: AbortOptions): AsyncIterable<Key>;
deleteMany(source: AwaitIterable<Key>, options?: AbortOptions): AsyncIterable<Key>;
batch(): Batch;
query(q: Query, options?: AbortOptions): AwaitIterable<Pair>;
queryKeys(q: KeyQuery, options?: AbortOptions): AwaitIterable<Key>;
}
//# sourceMappingURL=tiered.d.ts.map