Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/keydb/sqlite.ts>Keydb

Simple Key-value storage module with support for multiple database backends.
Latest
class Keydb
Re-export
import { Keydb } from "https://deno.land/x/keydb@1.0.0/sqlite.ts";

Simple and common Key-value storage interface for multiple Database backends.

Constructors

new
Keydb(adapter?: Adapter | string, options?: KeydbOptions)

Properties

optional
adapter: Adapter
optional
awaitReady: Promise<Adapter>
deserialize: (value: string) => any
namespace: string
serialize: (value: any) => string | undefined
optional
ttl: number

Methods

clear(): Promise<this>

Clear complete Database.

delete(key: string): Promise<boolean>

Delete a Key from Database.

get<T = any>(key: string): Promise<T | undefined>

Get a Value by Key name.

keys(): Promise<string[]>

Get an Array of all Key Names.

set(
key: string,
value: any,
ttl?: number,
): Promise<this>

Set a Key's Value.