import { Kysely, InsertQueryBuilder, Insertable } from 'kysely'; import { SelectionColumn } from '../lib/type-utils.js'; import { CompilingValuesQuery } from './compiling-values-query.js'; import { InsertTransforms } from '../mappers/table-mapper-transforms.js'; /** * Compiling mapping query for inserting rows into a database table. */ export declare class CompilingMappingInsertQuery, InsertedObject, InsertReturnColumns extends Readonly[]> | ['*'], InsertReturn> extends CompilingValuesQuery> { protected readonly columnsToInsert: Readonly<(keyof Insertable & string)[]>; protected readonly transforms: Readonly>; constructor(db: Kysely, qb: QB, columnsToInsert: Readonly<(keyof Insertable & string)[]>, transforms: Readonly>, returnColumns: Readonly); /** * Inserts the provided object into the table as a row, first transforming * it into a row via `insertTransform` (if defined). Also retrieves the * columns specified in `returnColumns`, returning them to the caller as * `InsertReturn`, after transformation by `insertReturnTransform`. * If `returnColumns` is empty, returns `undefined`. * * 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 object; * otherwise returns `undefined`. */ returnOne(obj: InsertedObject): Promise; /** * Runs the query, inserting rows into the table without returning any * columns. * * On the first execution, compiles and discards the underlying Kysely * query builder. Subsequent executions reuse the compiled query. * @param objOrObjs The object or objects to be inserted. * @returns Returns `true`; throws an exception on error. */ run(obj: InsertedObject): Promise; protected applyInsertTransform(obj: InsertedObject): Insertable; } //# sourceMappingURL=compiling-insert-query.d.ts.map