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.

10 lines (9 loc) 635 B
import type { QuerySchema } from '../core'; import type { QueryOrderBy } from '../core/order-by.js'; import type { FieldPath, SchemaShape } from '../core/schema.js'; import type { QueryWhere } from '../core/where.js'; import type { SqlResult } from './types.js'; export declare const fieldToStr: (field: FieldPath) => string; export declare const toSqlWhere: (where?: QueryWhere | null) => SqlResult | undefined; export declare const toSqlOrderBy: <TShape extends SchemaShape>(orderBy?: QueryOrderBy<TShape>[]) => SqlResult | undefined; export declare const toSql: <TShape extends SchemaShape>(json: QuerySchema<TShape>) => SqlResult;