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.

18 lines (17 loc) 975 B
import { ilike, like, 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 opMap: { '=': import("drizzle-orm").BinaryOperator; '>': import("drizzle-orm").BinaryOperator; '>=': import("drizzle-orm").BinaryOperator; '<': import("drizzle-orm").BinaryOperator; '<=': import("drizzle-orm").BinaryOperator; like: typeof like; ilike: typeof ilike; }; export declare const toDrizzleWhere: (table: any, where?: QueryWhere | null, extraConditions?: SQL) => SQL | undefined; export declare const toDrizzleOrderBy: <TShape extends Record<string, any>>(table: any, orderBy?: QueryOrderBy<TShape>[]) => SQL[]; export declare const toDrizzle: <TShape extends SchemaShape>(db: any, table: any, querySchema?: QuerySchema<TShape>) => Promise<TShape[]>;