kysely
0.29.9 · 12 Nov 2026MIT32M / weekRepositoryHomepagenpmAtom feed
0.29.9 is the newest release of 0.28.x.
In short
1 new1 fixed3 internal
Security
1 advisory affects 0.28.15; 0.28.17 fixes them
- HighKysely: JSON-path traversal injection via unsanitized path-leg metacharacters in `JSONPathBuilder.key()` / `.at()`GHSA-pv5w-4p9q-p3v2 · 11 May 2026Fixed in 0.28.17
Release note
Hey 👋
The introduction of dehydration in JSON functions/helpers caused an unexpected bug for consumers that have some columns defined as '${number}', e.g. '1' | '2' (also when wrapped in ColumnType or similar). Such columns, when participating in a JSON function/helper would dehydrate to number instead of staying as string.
Why dehydrate numeric strings to numbers in the first place? Select types in kysely describe the data after underlying driver's (e.g. pg) data transformation. Some drivers transform numeric columns to strings to be safe. When these columns participate in JSON functions, they lose original column data types - drivers don't know they need to transform to string - they return as-is.
This release introduces a special helper type that wraps your column type definition and tells kysely to NOT dehydrate it in JSON functions/helpers.
import type { NonDehydrateable } from 'kysely'
interface Database {
my_table: {
a_column: '1' | '2' | '3', // dehydrates to `number`
another_column: NonDehydrateable<'1' | '2' | '3'>, // stays `'1' | '2' | '3'`
column_too: NonDehydrateable<ColumnType<'1' | '2' | '3'>> // stays `'1' | '2' | '3'`
}
}Features
Add
NonDehydrateable<T>to allow opt-out from dehydration in JSON functions/helpers.
Bugfixes
PostgreSQL
PostgreSQL introspector unnecessarily slow in result processing. by @igalklebanov & @rubenferreira97
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.