import { Kysely, UpdateQueryBuilder, UpdateResult, Updateable } from 'kysely'; import { ParametersObject } from 'kysely-params'; import { SelectionColumn } from '../lib/type-utils.js'; import { CompilingValuesQuery } from './compiling-values-query.js'; import { CountTransform, UpdateTransforms } from '../mappers/table-mapper-transforms.js'; /** * Compiling mapping query for updating rows in a database table. */ export declare class CompilingMappingUpdateQuery, UpdatingObject, UpdateReturnColumns extends Readonly[]> | ['*'], ReturnCount, UpdateReturn, Parameters extends ParametersObject> extends CompilingValuesQuery> { protected readonly columnsToUpdate: Readonly<(keyof Updateable & string)[]>; protected readonly transforms: Readonly & UpdateTransforms>; constructor(db: Kysely, qb: QB, columnsToUpdate: Readonly<(keyof Updateable & string)[]>, transforms: Readonly & UpdateTransforms>, returnColumns: Readonly); /** * Runs the query, returning the number of rows updated, in the required * client representation. Accepts values for any parameters embedded in * the query. * * On the first execution, compiles and discards the underlying Kysely * query builder. Subsequent executions reuse the compiled query. * @param obj The object which which to update the rows. * @returns Number of rows updated, in client-requested representation. */ returnCount(params: Parameters, obj: UpdatingObject): Promise; /** * Updates rows with the values that result from transforming the object via * `insertTransform` (if defined). For each row updated, retrieves the * columns specified in `returnColumns` (if defined), returning them to the * caller as an `UpdateReturn`, after transformation by any provided * `updateReturnTransform`. If `returnColumns` is empty, returns `undefined`. * Accepts values for any parameters embedded in the query. * * On the first execution, compiles and discards the underlying Kysely * query builder. Subsequent executions reuse the compiled query. * @returns If `returnColumns` is not empty, returns an array containing one * object for each row updated; otherwise returns `undefined`. */ returnAll(params: Parameters, obj: UpdatingObject): Promise; /** * Updates rows with the values that result from transforming the object via * `updateTransform` (if defined). For the first row updated, retrieves the * columns specified in `returnColumns` (if defined), returning them to the * caller as an `UpdateReturn`, after transformation by any provided * `updateReturnTransform`. If `returnColumns` is empty, returns `undefined`. * Accepts values for any parameters embedded in the query. * * On the first execution, compiles and discards the underlying Kysely * query builder. Subsequent executions reuse the compiled query. * @returns If `returnColumns` is empty, returns `undefined`. Otherwise, * returns the first object if at least one row was updated, or `null` if * no rows were updated. */ returnOne(params: Parameters, obj: UpdatingObject): Promise; /** * Runs the query, updating rows, without returning any columns. Accepts * values for any parameters embedded in the query. * * On the first execution, compiles and discards the underlying Kysely * query builder. Subsequent executions reuse the compiled query. * @param obj The object which which to update the rows. * @returns `true` if any rows were updated, `false` otherwise. */ run(params: Parameters, obj: UpdatingObject): Promise; protected applyUpdateTransform(obj: UpdatingObject): Updateable; protected applyUpdateReturnTransform(source: UpdatingObject, returns: any): any; } //# sourceMappingURL=compiling-update-query.d.ts.map