import { Kysely, SelectQueryBuilder } from 'kysely'; import { ParametersObject } from 'kysely-params'; import { SelectionColumn } from '../lib/type-utils.js'; import { ParameterizableMappingQuery } from './parameterizable-query.js'; import { CompilingMappingSelectQuery } from './compiling-select-query.js'; import { SelectTransform } from '../mappers/table-mapper-transforms.js'; /** * Mapping query for selecting rows from a database table. */ export declare class MappingSelectQuery[]> | ['*'], SelectedObject, QB extends SelectQueryBuilder> implements ParameterizableMappingQuery { readonly db: Kysely; readonly qb: QB; protected readonly transforms: Readonly>; constructor(db: Kysely, qb: QB, transforms: Readonly>); /** * Returns a compiling query that can be executed multiple times with * different parameters (if any parameters were provided), but which only * compiles the underlying Kysely query builder on the first execution. * Frees the query builder on the first execution to reduce memory usage. * @typeParam Parameters Record characterizing the parameter names and * types that were previously embedded in the query, if any. * @returns A compiling select query. */ compile = {}>(): CompilingMappingSelectQuery, Parameters>; /** * Modifies the underlying Kysely query builder. All columns given in * `SelectedColumns` are already selected, but you can select additional * columns or add column aliases. * @param factory A function that takes the current query builder and * returns a new query builder. */ modify>(factory: (qb: QB) => NextQB): MappingSelectQuery; /** * Retrieves zero or more rows from the table, using `selectTransform` * (if provided) to map the rows to objects of type `SelectedObject`. * @returns An array of objects for the selected rows, possibly empty. */ returnAll(): Promise; /** * Retrieves a single row from the table, using `selectTransform` * (if provided) to map the row to an object of type `SelectedObject`. * @returns An object for the selected rows, or null if not found. */ returnOne(): Promise; } //# sourceMappingURL=select-query.d.ts.map