QueryOptions
Selects the rows a database query returns: which ones match, their order, and how many.
Verwendung
Reuse a filter when querying a typed table.
Dieser Typ wird verwendet von db.query
// Reuse a filter when querying a typed table.
import { db, type Comparison, type Table } from 'kuito';
type Product = { id: string; price: number };
export function affordableProducts(products: Table<Product>) {
const price: Comparison<number> = { gte: 0, lte: 50 };
return db.query(products, { where: { price }, orderBy: { price: 'asc' } });
}Typdeklaration
export interface QueryOptions<T> {
where?: Where<T>;
/** Columns to sort by, the first first. */
orderBy?: { readonly [K in Column<T>]?: 'asc' | 'desc' };
limit?: number;
}Mitglieder 3
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
where | Where<T> | Nein | — |
orderBy | { readonly [K in Column<T>]?: "asc" | "desc"; } | Nein | Columns to sort by, the first first. |
limit | number | Nein | — |
Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.