Skip to main content
Module

x/discordeno/template/beginner/deps.ts>KwikTable

Discord API library for Deno
Extremely Popular
Go to Latest
class KwikTable
Re-export
import { KwikTable } from "https://deno.land/x/discordeno@13.0.0-rc45/template/beginner/deps.ts";

Constructors

new
KwikTable(kwik: Kwik, tableName: string)

Properties

private
kwik: Kwik
private
readonly
tableName: string

Methods

private
saveFile(id: string, data: Partial<T>)

Saves the provided document as a file

create(id: string, data?: Partial<T>)

Create a document with the provided data

delete(id: string): Promise<boolean>

Deletes a document from the table.

deleteMany(filter: Partial<T> | ((value: T) => boolean))

Deletes all documents in a table that match a filter

deleteOne(filter: Partial<T> | ((value: T) => boolean))

Deletes one document in a table that match a filter

findMany(filter: Record<string, unknown> | ((value: T) => boolean), returnArray?: false): Promise<Map<string, T>>

Get all documents from a table that match a filter

findMany(filter: Record<string, unknown> | ((value: T) => boolean), returnArray?: true): Promise<T[]>
findOne(filter: Record<string, unknown> | ((value: T) => boolean))

Gets the first document from a table that match a filter

get(id: string): Promise<T | undefined>

Get a document from the table.

getAll(): Promise<Map<string, T>>

Get all documents of the table.

has(id: string): Promise<boolean>

Check if a document exists

set(id: string, data?: Partial<T>)

Set a document data.

update(id: string, data?: Partial<T>)

Updates a documents' data. If this document does not exist, it will create the document.

updateOne(filter: Partial<T> | ((value: T) => boolean), data: Partial<T>)

Gets the first document from a table that match a filter