UNPKG

agnostic-query

Version:

Type-safe fluent builder for portable query schemas. Runtime-agnostic, database-agnostic — the same QuerySchema drives Drizzle, Kysely, db0, or raw SQL.

9 lines (8 loc) 598 B
import type { QuerySchema } from '../core'; import type { QueryOrderBy } from '../core/order-by.js'; import type { QueryWhere } from '../core/where.js'; import type { SqlResult } from '../sql/types.js'; import type { Db } from './types.js'; export declare const toDb0Where: (where?: QueryWhere | undefined) => SqlResult | undefined; export declare const toDb0OrderBy: <TShape extends Record<string, any>>(orderBy?: QueryOrderBy<TShape>[] | null) => SqlResult | undefined; export declare const toDb0: <T extends Record<string, any>, D extends Db>(db: D, json: QuerySchema<T>) => Promise<T[]> | T[];