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

x/keydb/postgres.ts>PostgresAdapter

Simple Key-value storage module with support for multiple database backends.
Latest
class PostgresAdapter
implements Adapter
import { PostgresAdapter } from "https://deno.land/x/keydb@1.0.0/postgres.ts";

Constructors

new
PostgresAdapter(client: Client, table?: string)

Properties

db: Client
table: string

Methods

clear(namespace?): Promise<this>
delete(key: string, namespace?): Promise<boolean>
deleteExpired(namespace?): Promise<void>
get(key: string, namespace?): Promise<KeydbFields | undefined>
has(key: string, namespace?): Promise<boolean>
keys(namespace?): Promise<string[]>
query<T = any>(sql: string, params?: any[]): Promise<T[]>
set(
key: string,
value: any,
namespace?,
ttl?,
): Promise<this>

Static Methods

connect(dbOptions?: ConnectionOptions | string, table?: string)

Connect to a Postgres Database and create Adapter.