UNPKG

@flavoai/fastfold

Version:

Zero-boilerplate backend for React apps with auto-generated CRUD and declarative security

49 lines 1.45 kB
import { QueryParams } from '../../types'; export declare class DrizzleAdapter { private db; private schema; constructor(db: any, schema: Record<string, any>); /** * Get table schema object by name */ getTable(tableName: string): any; /** * Query records from a table */ query<T = any>(tableName: string, params?: QueryParams): Promise<T[]>; /** * Create a new record */ create<T = any>(tableName: string, data: any): Promise<T>; /** * Update a record by ID */ update<T = any>(tableName: string, id: string | number, data: any): Promise<T>; /** * Delete a record by ID */ delete(tableName: string, id: string | number): Promise<boolean>; /** * Count records in a table */ count(tableName: string, where?: Record<string, any>): Promise<number>; /** * Find a single record by ID */ findById<T = any>(tableName: string, id: string | number): Promise<T | null>; /** * Query with relations using Drizzle's relational query API */ queryWithRelations<T = any>(tableName: string, params?: QueryParams & { with?: Record<string, boolean>; }): Promise<T[]>; /** * Build where conditions for Drizzle queries */ private buildWhereConditions; /** * Get available table names from schema */ getTableNames(): string[]; } //# sourceMappingURL=drizzle.d.ts.map