import { Insertable, Selectable, Selection, Transaction, Updateable } from 'kysely'; import { SelectableColumnTuple, SelectedRow, SelectionColumn } from '../lib/type-utils.js'; import { TableMapperTransforms } from './table-mapper-transforms.js'; import { AbstractTableMapper } from './abstract-table-mapper.js'; /** * Table mapper that defaults to passing through all query inputs and output * unchanged, allowing the selective overloading of transforms. * @typeParam DB Interface whose fields are table names defining tables. * @typeParam TB Name of the table. * @typeParam KeyColumns Tuple of the names of the table's key columns. * Defaults to `[]`, indicating no key columns. Supports up to 4 columns. * @typeParam SelectedColumns Columns to return from selection queries. * Defaults to `['*']`, returning all columns. May specify aliases. * @typeParam SelectedObject Type of objects returned by select queries. * @typeParam InsertedObject Type of objects inserted into the table. * @typeParam UpdatingObject Type of objects used to update rows of the table. * @typeParam Type of the count of the number of affected rows. * @typeParam InsertReturnColumns Columns to return from the table on insert * queries that return columns. `['*']` returns all columns; `[]` returns * none. May specify aliases. Defaults to `KeyColumns`. * @typeParam UpdateReturnColumns Columns to return from the table on update * queries that return columns. `['*']` returns all columns; `[]` returns * none and is the default. May specify aliases. * @typeParam InsertReturn Type returned from inserts. Defaults to an object * whose properties are the columns of `InsertReturnColumns`. * @typeParam UpdateReturn Type returned from updates. Defaults to an object * whose properties are the columns of `UpdateReturnColumns`. */ export declare class TableMapper> | Readonly<[]> = [], SelectedColumns extends Readonly[]> | ['*'] = ['*'], SelectedObject = SelectedRow, InsertedObject = Insertable, UpdatingObject = Updateable, ReturnCount = bigint, InsertReturnColumns extends Readonly[]> | ['*'] = Readonly, UpdateReturnColumns extends Readonly[]> | ['*'] = [], InsertReturn = InsertReturnColumns extends ['*'] ? Selectable : Selection, UpdateReturn = UpdateReturnColumns extends ['*'] ? Selectable : Selection> extends AbstractTableMapper { /** * Returns a new table mapper that uses the provided transformations, along * with the settings of the current table mapper. * @param transforms The transforms to use. * @returns A new table mapper that uses the provided transforms. */ withTransforms, InsertedObject = Insertable, UpdatingObject = Updateable, ReturnCount = bigint, InsertReturn = InsertReturnColumns extends ['*'] ? Selectable : Selection, UpdateReturn = UpdateReturnColumns extends ['*'] ? Selectable : Selection>(transforms: Readonly>): TableMapper; /** * Returns a new table mapper that issues queries in the provided * transaction, using the present table mapper's configuration. * @param transaction The transaction to use. * @returns A new table mapper that issues queries in the provided * transaction. */ forTransaction(trx: Transaction): TableMapper; } //# sourceMappingURL=table-mapper.d.ts.map