Skip to content

0.30.0 - #1852

Draft
igalklebanov wants to merge 6 commits into
masterfrom
next
Draft

0.30.0#1852
igalklebanov wants to merge 6 commits into
masterfrom
next

Conversation

@igalklebanov

@igalklebanov igalklebanov commented May 16, 2026

Copy link
Copy Markdown
Member

Hey 👋

This is the 0.30.0 version branch.

What's changed:

@vercel

vercel Bot commented May 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
kysely Ready Ready Preview, Comment Jul 26, 2026 5:21pm

Request Review

@igalklebanov igalklebanov added enhancement New feature or request sqlite Related to sqlite typescript Related to Typescript breaking change Includes breaking changes helpers Related to library's helpers labels May 16, 2026
@pkg-pr-new

pkg-pr-new Bot commented May 16, 2026

Copy link
Copy Markdown

commit: 979db93

Comment thread test/typings/test-d/sqlite-json.test-d.ts Fixed
Comment thread test/typings/test-d/sqlite-json.test-d.ts Fixed
Comment thread test/typings/test-d/sqlite-json.test-d.ts Fixed
@github-actions

github-actions Bot commented May 16, 2026

Copy link
Copy Markdown

⏱️ TypeScript Benchmark Results

✅ ⏱️  No benchmark changes detected.

}
}

async function testJsonArrayFrom(db: Kysely<Database>) {
)
}

async function testJsonObjectFrom(db: Kysely<Database>) {
)
}

async function testJsonBuildObject(db: Kysely<Database>) {
* Per-migration transaction configuration

* Let disabling options take precedence

* ...

---------

Co-authored-by: Igal Klebanov <igalklebanov@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the upcoming 0.30.0 release branch by introducing (1) stricter compile-time typing for SQLite JSON helpers to reject BLOB-like values, and (2) a new migration transaction configuration model (transactionMode plus per-migration config.transaction) with accompanying tests and documentation updates.

Changes:

  • Add compile-time BLOB/Uint8Array rejection for SQLite JSON helper inputs, plus new typings tests.
  • Introduce transactionMode ('per-run' | 'per-migration' | 'none') and per-migration config.transaction, refactoring migrator orchestration and expanding node tests.
  • Add a new defineMigration helper and update migration docs/examples and test migration modules accordingly.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
test/typings/tsconfig.json Adds Node types to support Buffer-based typing tests.
test/typings/test-d/sqlite-json.test-d.ts New tsd coverage for SQLite JSON helper BLOB rejections and allowed cases.
test/node/src/test-migrations/migration1.ts Updates test migration to use defineMigration default export style.
test/node/src/migration.test.ts Adds extensive coverage for transactionMode + per-migration transaction config behavior/precedence.
test/node/src/json.test.ts Adjusts JSON helper typing usage in runtime tests to accommodate SQLite helper type changes.
src/util/object-utils.ts Removes getLast helper (no longer needed after migrator refactor).
src/migration/migrator.ts Implements transactionMode, per-migration transaction orchestration, and related state/refactor changes.
src/migration/migration.ts Introduces Migration, MigrationConfig, and defineMigration public helper.
src/migration/index.ts Re-exports the new migration module definitions.
src/migration/file-migration-provider.ts Updates Migration type import location.
src/helpers/sqlite.ts Adds ExtractBlobs-based type checks to SQLite JSON helpers to deny BLOB-like inputs.
site/src/css/custom.css Layout tweak to prevent wide code blocks from forcing doc column width.
site/docs/migrations.mdx Documents defineMigration, transactionMode, per-migration config, and migration transaction guidance.
Comments suppressed due to low confidence (3)

src/migration/migration.ts:60

  • JSDoc grammar: "types duties" reads like a typo; consider "typing duties" for clarity.
 * Helps define a single migration by taking over types duties and enforcing the contract.

src/helpers/sqlite.ts:164

  • Same as above: the error message should be helper-agnostic (this is jsonObjectFrom, but the message currently mentions json_object specifically).
  expr: IsNever<ExtractBlobs<O>> extends true
    ? SelectQueryBuilderExpression<O>
    : KyselyTypeError<'SQLite does not support passing `BLOB` values to `json_object`. Cast to `TEXT`.'>,

src/helpers/sqlite.ts:233

  • Same as above for jsonBuildObject: consider a helper-agnostic error message since this check triggers from the helper API, not directly from json_object.
  obj: IsNever<ExtractBlobs<O>> extends true
    ? O
    : KyselyTypeError<'SQLite does not support passing `BLOB` values to `json_object`. Cast to `TEXT`.'>,

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/migration/migration.ts
Comment thread src/helpers/sqlite.ts
Comment thread test/node/src/json.test.ts
Comment thread src/migration/migrator.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (3)

src/migration/migration.ts:16

  • Grammar: "it's" is a contraction; this should be the possessive "its" in the JSDoc.
   * The `down` method that reverts the changes made by it's sibling {@link Migration.up}

src/migration/migrator.ts:1139

  • Grammar: "have not yet ran" should be "have not yet run".
   * Migrations that have not yet ran.

test/node/src/json.test.ts:75

  • Casting through never removes type safety in a non-standard way. Elsewhere in tests, unsafe casts use unknown as the intermediary; using unknown here keeps the intent clear and avoids never (an uninhabited type) in assertions.
  } as never as {

Comment thread src/migration/migration.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (2)

src/migration/migration.ts:17

  • Use possessive "its" (not the contraction "it's") in this JSDoc sentence.
   * The `down` method that reverts the changes made by it's sibling {@link Migration.up}
   * method.

src/migration/migration.ts:60

  • Typo/grammar: "types duties" should be "typing duties" in this JSDoc.
 * Helps define a single migration by taking over types duties and enforcing the contract.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 24 out of 24 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (3)

src/migration/migration.ts:17

  • JSDoc grammar: "it's sibling" should be "its sibling" (possessive).
  /**
   * The `down` method that reverts the changes made by it's sibling {@link Migration.up}
   * method.

src/migration/migration.ts:60

  • JSDoc wording: "types duties" reads like a typo; consider "typing duties".
 * Helps define a single migration by taking over types duties and enforcing the contract.

src/migration/migrator.ts:1198

  • JSDoc grammar: "have not yet ran" should be "have not yet run".
  /**
   * Migrations that have not yet ran.
   */
  readonly pendingMigrations: ReadonlyArray<NamedMigration>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 24 out of 24 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (9)

src/migration/migrator.ts:108

  • The Node built-in module node:fs/promises doesn't provide a default export in ESM. The example should use a namespace import (or named imports), otherwise the snippet will throw at runtime in ESM environments.
   * import fs from 'node:fs/promises'

src/migration/migrator.ts:153

  • The Node built-in module node:fs/promises doesn't provide a default export in ESM. The example should use a namespace import (or named imports), otherwise the snippet will throw at runtime in ESM environments.
   * import fs from 'node:fs/promises'

src/migration/migrator.ts:176

  • The Node built-in module node:fs/promises doesn't provide a default export in ESM. The example should use a namespace import (or named imports), otherwise the snippet will throw at runtime in ESM environments.
   * import fs from 'node:fs/promises'

src/migration/migrator.ts:200

  • The Node built-in module node:fs/promises doesn't provide a default export in ESM. The example should use a namespace import (or named imports), otherwise the snippet will throw at runtime in ESM environments.
   * import fs from 'node:fs/promises'

src/migration/migrator.ts:295

  • The Node built-in module node:fs/promises doesn't provide a default export in ESM. The example should use a namespace import (or named imports), otherwise the snippet will throw at runtime in ESM environments.
   * import fs from 'node:fs/promises'

src/migration/migrator.ts:327

  • The Node built-in module node:fs/promises doesn't provide a default export in ESM. The example should use a namespace import (or named imports), otherwise the snippet will throw at runtime in ESM environments.
   * import fs from 'node:fs/promises'

src/migration/migrator.ts:1196

  • Grammar: "ran" should be "run" in this JSDoc sentence.
   * Migrations that have not yet ran.

src/migration/migration.ts:17

  • Grammar: "it's" should be "its" (possessive) in this JSDoc comment.
   * The `down` method that reverts the changes made by it's sibling {@link Migration.up}
   * method.

src/migration/migration.ts:60

  • Wording: "types duties" reads like a typo; consider "typing duties" (or "type duties") for clarity.
 * Helps define a single migration by taking over types duties and enforcing the contract.

Comment thread src/migration/migrator.ts
*
* ```ts
* import { promises as fs } from 'node:fs'
* import fs from 'node:fs/promises'
*
* ```ts
* import { promises as fs } from 'node:fs'
* import fs from 'node:fs/promises'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change Includes breaking changes enhancement New feature or request helpers Related to library's helpers sqlite Related to sqlite typescript Related to Typescript

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants