Skip to main content
Module

x/fast_storage/local_storage.ts>LocalStorage

An optimized key-value storage based on sqlite.
Go to Latest
class LocalStorage
import { LocalStorage } from "https://deno.land/x/fast_storage@v1.8/local_storage.ts";

Constructors

new
LocalStorage(path?: string, tableName?: string)

Properties

private
database: sqlite.DB
private
path: string | undefined
private
tableName: string

Methods

delete(key: string): Promise<void>
deleteList(keyStartsWith: string): Promise<void>
deleteRange(start?: string, end?: string): Promise<void>
get(key: string)
getList(keyStartsWith: string, getKey?: boolean): Promise<any[]>
getRange(
start?: string,
end?: string,
getKey?: boolean,
): Promise<any[]>
set(key: string, value: any): Promise<void>