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.
10 lines (9 loc) • 669 B
TypeScript
import { type SQL } from 'drizzle-orm';
import type { QuerySchema } from '../core/index.js';
import type { QueryOrderBy } from '../core/order-by.js';
import type { SchemaShape } from '../core/schema';
import type { QueryWhere } from '../core/where.js';
export declare const toDrizzleWhere: (table: any, where?: QueryWhere | null, extra?: SQL) => SQL | undefined;
export declare const toDrizzleOrderBy: <TShape extends Record<string, any>>(table: any, orderBy?: QueryOrderBy<TShape>[]) => SQL<unknown>[];
export declare const toDrizzle: <TShape extends SchemaShape>(db: any, table: any, querySchema?: QuerySchema<TShape>) => Promise<TShape[]>;
export default toDrizzle;