betterddb
Version:
A definition-based DynamoDB wrapper library that provides a schema-driven and fully typesafe DAL.
29 lines • 1.14 kB
TypeScript
import { type NativeAttributeValue } from "@aws-sdk/lib-dynamodb";
import { type BetterDDB } from "../betterddb.js";
import { type Operator } from "../operator.js";
import { type PaginatedResult } from "../types/paginated-result.js";
export declare class QueryBuilder<T> {
private parent;
private key;
private keyConditions;
private filterConditions;
private expressionAttributeNames;
private expressionAttributeValues;
private index?;
private limit?;
private lastKey?;
private ascending;
constructor(parent: BetterDDB<T>, key: Partial<T>);
usingIndex(indexName: string): this;
sortAscending(): this;
sortDescending(): this;
where(operator: Operator, values: Partial<T> | [Partial<T>, Partial<T>]): this;
filter(attribute: keyof T, operator: Operator, values: unknown): this;
limitResults(limit: number): this;
startFrom(lastKey: Record<string, NativeAttributeValue>): this;
/**
* Executes the query and returns a Promise that resolves with an array of items.
*/
execute(): Promise<PaginatedResult<T>>;
}
//# sourceMappingURL=query-builder.d.ts.map