UNPKG

ll-callmobile-backend

Version:

VoIP Mobile Communications Backend with Supabase, Drizzle ORM, and Dynamic Querying - Deployable as Cloudflare Worker

72 lines 1.72 kB
import { PostgresJsDatabase } from 'drizzle-orm/postgres-js'; import * as schema from '../db/schema'; export type Database = PostgresJsDatabase<typeof schema>; /** * Filter operators for dynamic queries */ export type FilterOperator = 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte' | 'like' | 'in' | 'notIn' | 'isNull' | 'isNotNull'; /** * Sort direction for ordering results */ export type SortDirection = 'asc' | 'desc'; /** * Simple filter object for basic queries */ export type SimpleFilter = Record<string, any>; /** * Advanced filter for complex queries */ export interface AdvancedFilter { field: string; operator: FilterOperator; value: any; } /** * Sorting options */ export interface SortOption { field: string; direction: SortDirection; } /** * Pagination options */ export interface PaginationOptions { limit?: number; offset?: number; page?: number; pageSize?: number; } /** * Complete query options for advanced queries */ export interface QueryOptions { select?: string[]; where?: (SimpleFilter | AdvancedFilter)[]; orderBy?: SortOption[]; pagination?: PaginationOptions; } /** * Query result with metadata */ export interface QueryResult<T> { data: T[]; total: number; page?: number; pageSize?: number; totalPages?: number; } /** * Database table names (auto-generated from schema) */ export type TableName = 'test_cases' | 'clients' | 'vendors' | 'jobs'; /** * Configuration for the DynamicQuery service */ export interface DynamicQueryConfig { maxLimit?: number; defaultLimit?: number; allowedFields?: Record<TableName, string[]>; enableRawQueries?: boolean; } //# sourceMappingURL=types.d.ts.map