Skip to content

chore(deps): update dependency kysely to v0.29.9 - #231

Merged
jackchuka merged 1 commit into
mainfrom
renovate/kysely-0.x
Nov 16, 2026
Merged

jackchuka merged 1 commit into
mainfrom
renovate/kysely-0.x

Conversation

@renovate

@renovate renovate Bot commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
kysely (source) 0.29.8 → 0.29.9 age confidence

Release Notes

kysely-org/kysely (kysely)

v0.29.9: 0.29.9

Compare Source

Hey 👋

A small batch of bug fixes. Please report any issues. 🤞😰🤞

Kysely's migrator no longer records timestamps that go backwards when the wall clock jumps back during a migration run (WSL2/VM time sync, an NTP step, an unsmeared leap second). Such timestamps made every later migrateToLatest() fail with "corrupted migrations", even though the migrations ran in the correct order. The migrator now reads the latest recorded timestamp while holding the migration lock, and records each new migration at max(now, latest + 1ms), so the order holds across runs and hosts. Executed migrations with an invalid timestamp now fail with "corrupted migrations" instead of being sorted arbitrarily.

Migration tables that already have out-of-order timestamps need a one-time repair. Run the query for your dialect below. It goes through executed migrations in name order, which is the order the migrator runs them in by default, and moves every timestamp that isn't later than the previous one to 1 millisecond after it. Running it again changes nothing.

Replace kysely_migration with your migration table's name, prefixed with the schema if you set migrationTableSchema. Run it while no migrations are running. Skip this if you use allowUnorderedMigrations: true. Name order isn't the execution order in that mode, and out-of-order timestamps don't block migrations there.

PostgreSQL and PGlite:

with ordered as (
  select
    name,
    (extract(epoch from "timestamp"::timestamptz) * 1000)::bigint as executed_at,
    row_number() over (order by name collate "C") as position
  from kysely_migration
),
repaired as (
  select
    name,
    executed_at,
    position + max(executed_at - position) over (order by position) as repaired_executed_at
  from ordered
)
update kysely_migration
set "timestamp" = to_char(
  (timestamptz 'epoch' + repaired_executed_at * interval '1 millisecond') at time zone 'UTC',
  'YYYY-MM-DD"T"HH24:MI:SS.MS"Z"'
)
from repaired
where kysely_migration.name = repaired.name
  and repaired.repaired_executed_at <> repaired.executed_at;

MySQL 8.0+:

update kysely_migration
join (
  select
    name,
    executed_at,
    position + max(executed_at - position) over (order by position) as repaired_executed_at
  from (
    select
      name,
      timestampdiff(
        microsecond,
        '1970-01-01',
        str_to_date(`timestamp`, '%Y-%m-%dT%H:%i:%s.%fZ')
      ) div 1000 as executed_at,
      row_number() over (order by cast(name as binary)) as position
    from kysely_migration
  ) as ordered
) as repaired using (name)
set kysely_migration.`timestamp` = concat(
  date_format(
    timestamp '1970-01-01 00:00:00' + interval repaired.repaired_executed_at * 1000 microsecond,
    '%Y-%m-%dT%H:%i:%s.'
  ),
  lpad(repaired.repaired_executed_at mod 1000, 3, '0'),
  'Z'
)
where repaired.repaired_executed_at <> repaired.executed_at;

MS SQL Server 2016+:

with ordered as (
  select
    name,
    datediff_big(millisecond, '1970-01-01', convert(datetime2(3), [timestamp], 127)) as executed_at,
    row_number() over (order by name collate Latin1_General_BIN2) as position
  from kysely_migration
),
repaired as (
  select
    name,
    executed_at,
    position + max(executed_at - position) over (order by position rows unbounded preceding) as repaired_executed_at
  from ordered
)
update kysely_migration
set [timestamp] = convert(
    varchar(19),
    dateadd(
      millisecond,
      repaired.repaired_executed_at % 86400000,
      dateadd(day, repaired.repaired_executed_at / 86400000, cast('1970-01-01' as datetime2(3)))
    ),
    126
  ) + '.' + right('00' + cast(repaired.repaired_executed_at % 1000 as varchar(3)), 3) + 'Z'
from kysely_migration
join repaired on repaired.name = kysely_migration.name
where repaired.repaired_executed_at <> repaired.executed_at;

SQLite 3.33+:

with ordered as (
  select
    name,
    cast(round((julianday("timestamp") - 2440587.5) * 86400000) as integer) as executed_at,
    row_number() over (order by name collate binary) as position
  from kysely_migration
),
repaired as (
  select
    name,
    executed_at,
    position + max(executed_at - position) over (order by position) as repaired_executed_at
  from ordered
)
update kysely_migration
set "timestamp" = strftime('%Y-%m-%dT%H:%M:%S', repaired_executed_at / 1000, 'unixepoch')
  || printf('.%03dZ', repaired_executed_at % 1000)
from repaired
where kysely_migration.name = repaired.name
  and repaired.repaired_executed_at <> repaired.executed_at;

The binary collations (collate "C", cast(name as binary), etc.) make the database sort names the same way the migrator does in JavaScript.

Also, PGlite 0.5.15+ commits that roll back aborted transactions now throw AbortedTransactionError, same as PostgreSQL since 0.29.8.

🚀 Features

🐞 Bugfixes

PostgreSQL 🐘 / PGlite 🟨
PGlite 🟨

📖 Documentation

📦 CICD & Tooling

⚠️ Breaking Changes

  • key() and at() no longer accept a 2nd type argument for the output type (e.g. .key<'url', number>('url')). It was never documented. Use $castTo<T>() to override the output type. (#​2228)

🐤 New Contributors

What's Changed

Full Changelog: kysely-org/kysely@v0.29.8...v0.29.9


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate
renovate Bot requested a review from a team as a code owner November 15, 2026 17:56

@jackchuka jackchuka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kysely 0.29.8 → 0.29.9 (patch, bug fixes incl. migrator timestamp). Safe to merge.

@renovate
renovate Bot force-pushed the renovate/kysely-0.x branch from 4007623 to bee99d2 Compare November 16, 2026 02:16
@jackchuka
jackchuka merged commit 0cd7d85 into main Nov 16, 2026
7 checks passed
@jackchuka
jackchuka deleted the renovate/kysely-0.x branch November 16, 2026 02:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant