Skip to main content
@usenarrator/plugin-kysely The Kysely plugin reads a query builder chain as the query it builds. Joins, where clauses, the expression builder’s and and or, ordering and limits each become a bullet, and the like patterns read as “ends with” or “contains”. Inserts and updates list the columns they set, and upserts say what happens on a conflict.
The plugin declares library: { name: "kysely", versions: ">=0.27 <1" }. It only narrates files that import kysely or belong to a package that depends on it (see Dependency detection), and Drizzle and other query builders are left alone. Kysely’s sql template tag is read by the SQL plugin.

Examples

A select with a join
English
Writes and an upsert
English
A transaction
English

What it covers

  • selectFrom with select, joins (including callback and left joins), where, having, groupBy, orderBy, limit, offset and distinct.
  • The expression builder: eb(...) comparisons, and, or, not, exists subqueries, aggregates, JSON helpers, and destructured or typed builder parameters.
  • executeTakeFirst, executeTakeFirstOrThrow, execute and compile.
  • Writes: insertInto with one or many rows, onConflict, returning, updateTable and deleteFrom.
  • Transactions with an isolation level, $if, and clauses added to a builder held in a variable.

Translating

The English phrasebook is exported as en and typed as KyselyPhrases.