0.30.0 - #1852
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
commit: |
|
⏱️ TypeScript Benchmark Results |
| } | ||
| } | ||
|
|
||
| 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>
There was a problem hiding this comment.
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-migrationconfig.transaction, refactoring migrator orchestration and expanding node tests. - Add a new
defineMigrationhelper 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_objectspecifically).
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.
There was a problem hiding this comment.
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
neverremoves type safety in a non-standard way. Elsewhere in tests, unsafe casts useunknownas the intermediary; usingunknownhere keeps the intent clear and avoidsnever(an uninhabited type) in assertions.
} as never as {
…o enforce direction. (#1957) * ... * ...
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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>
There was a problem hiding this comment.
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/promisesdoesn'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/promisesdoesn'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/promisesdoesn'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/promisesdoesn'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/promisesdoesn'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/promisesdoesn'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.
| * | ||
| * ```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' |
Hey 👋
This is the 0.30.0 version branch.
What's changed:
by @hwisu & @igalklebanov in feat: deny passing
BLOB-like columns to SQLite JSON helpers #1698migrateTo(name, { direction: 'Up' | 'Down' })to enforce direction. by @igalklebanov in feat(migrator): addmigrateTo(name, { direction: 'Up' | 'Down' })to enforce direction. #1957mysql2andmysql2/promiseinMysqlDialect. by @igalklebanov in feat(mysql): support bothmysql2andmysql2/promiseinMysqlDialect. #1958