import { Insertable, Selectable, Updateable } from 'kysely'; import { SelectableColumnTuple, SelectedRow, SelectionColumn } from '../lib/type-utils.js'; import { TableMapperTransforms } from './table-mapper-transforms.js'; /** * Transforms for a table mapper that only receives and returns * entire table rows, given by type `Selectable`. * @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 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. */ export declare class EntireRowTransforms> | Readonly<[]>, InsertReturnColumns extends Readonly[]> | ['*'], UpdateReturnColumns extends Readonly[]> | ['*']> implements Required, Selectable, Selectable, number, InsertReturnColumns, UpdateReturnColumns, Selectable, Selectable>> { readonly keyColumns: KeyColumns; /** * Constructs an object providing transforms for entire table rows. */ constructor(keyColumns: KeyColumns); /** * Transform a count of the number of rows affected into a number. */ countTransform(count: bigint): number; /** * Transforms inserted objects into inserted rows, removing the columns * that are keys having falsy values. */ insertTransform(obj: Selectable, _columns: Readonly<(keyof Insertable)[]> | ['*']): Insertable; /** * Transforms the returns of an insert query into the the object returned * to the caller, merging the returned values into the inserted object. */ insertReturnTransform(source: Selectable, returns: InsertReturnColumns extends [] ? never : SelectedRow): Selectable; /** * Returns selected rows to the caller as selected objects, unchanged. */ selectTransform(row: Selectable): Selectable; /** * Provides updating objects as the update values for an update query. */ updateTransform(source: Selectable, _columns: Readonly<(keyof Updateable)[]> | ['*']): Updateable; /** * Transforms the returns of an update query into the the object returned * to the caller, merging the returned values into the updating object. */ updateReturnTransform(source: Selectable, returns: UpdateReturnColumns extends [] ? never : SelectedRow): Selectable; } //# sourceMappingURL=entire-row-transforms.d.ts.map