`SelectFrom`, `UpdateTable` exports for `tsconfig - "declaration": true`
Author: x1progCreated Sep 6, 2026Updated Sep 6, 2026
// `SelectFrom` and `UpdateTable` are kysely's internal query-creator return
// helpers — not exported from the kysely root. They must be named here
// explicitly because this project builds with `declaration: true` and the
// inferred return types are not nameable in the emitted .d.ts (TS2883).
// Re-verify these paths on any kysely upgrade (PLAN-txh-handle §11.3).
import type { SelectFrom } from 'kysely/dist/parser/select-from-parser.js';
import type { UpdateTable } from 'kysely/dist/parser/update-parser.js';
import type { DB } from './kysely-codegen.js';
type Tx = ControlledTransaction<DB>;
/**
* The exact query surface the service/repo layers may use. `commit`,
* `rollback`, and `savepoint` are deliberately NOT part of it: only the
* edge (controller / middleware / scheduler job) may end a transaction.
*
* If a future feature needs another entry point (e.g. `deleteFrom`), add a
* delegating method here — that is the deliberate design point where the
* lower layers' surface grows. Never expose lifecycle methods.
*/
type TxHApi = Pick<Tx, 'selectFrom' | 'insertInto' | 'updateTable'>;
Imports above look ugly. I asking if there's a better way to go about this.
For now, i set "declaration": false in tsconfig so that my code compiles.
Help, direction are welcome.
Source: kysely-org/kysely