rc.4#5788
Conversation
… for sql fields where columns are decoders, codecs for subqueries, better codec bypass for legacy custom column json api, fixed `bun-sql\/pg` selects
db. subqueries, .sync() for sqlite count, codecs…- Removed RQBv1 from `sqlite`, removed RQBv1 `TSchema`, `TFullSchema` arguments from `sqlite` entities' generics - Fixed instances of `sqlite` query errors not being wrapped in `DrizzleQueryError` (`db.batch()` excluded due to api incompatibility) - Fixed type error on `CockroachArrayBuilder` constructor caused by referencing internal field's type - Removed `mapResult` method from `PreparedQuery` interface, removed `mapResult`, `mapBatchResult` from `pg` and `sqlite` raw queries - Fixed wrong `bun-sqlite` run result type - Switched `sqlite` RQBv2 to array mode - Enabled optimized default query mappers for `sqlite` - Reworked `sqlite` sessions: replaced per-driver `PreparedQuery` instances with executors passed via sessions, similar to current `postgresql` and `mysql` implementations, moved `useJitMappers` flag handling to dialect
…les (#5827) * fix(drizzle-kit): prevent Postgres pull from failing for non-admin roles - stop relying on column metadata JSON from information_schema during introspection - resolve identity settings from sequence catalog data via seqId lookup - avoid throwing when generated expression metadata is unavailable - add regression test for non-admin introspection (issue #5568) * changelog: add entry for v1.0.0-rc.4 to document fix for Postgres pull failure in non-admin roles * fix(introspect): update queries to respect schema privileges for non-admin roles
|
How come there is already an 1.0.0-rc.4-5d5b77c release on npm but not on github? |
|
@verheyenkoen every commit on feature branches is published on npm, it's no longer the case, we will manually publish them because we've hit 100mb npm limit and waiting for them to clear hundreds of redundant releases |
- Added support for `@tursodatabase/serverless` package - Updated `@tursodatabase/database`, `@tursodatabase/database-wasm` to v0.6.0, updated session internals for asynchronous prepare on driver side - Supported nested transactions in `@tursodatabase/database`, `@tursodatabase/database-wasm`
- Split SQLite into `async`, `effect` versions (`sync` remains subtype of `async`) - Removed `SQLiteSyncDialect`, `SQLiteAsyncDialect`, moved generic SQLite `async`\\`sync` migrators to `sqlite-core/async/session` as `migrateSync`, `migrateAsync` - Fixed `sqlite` cache using same cache entry for different execute methods - `@effect/sql-pglite` driver - `@effect/sql-sqlite-node` driver - `@effect/sql-sqlite-bun` driver - `@effect/sql-sqlite-do` driver - `@effect/sql-sqlite-wasm` driver - `@effect/libsql` driver - Moved `EffectDrizzlePgConfig` to `drizzle-orm/pg-core/effect/utils` - Made `cache` field in `EffectCacheShape` optional
Introduce a programmatic SDK (drizzle-kit/src/sdk/) for generate/push, unify the CLI around an envelope contract (drizzle-kit/src/cli/contract.ts), and extract shared generate/push pipelines into schema.ts. Adds SDK conformance + regression tests and reworks affected CLI/dialect/api modules accordingly.
Production changes - validations/common.ts: pre-merge import path lost its src/ alias; switch back to relative ../../utils/schemaValidator so jiti resolves at test time. - utils-node.ts loadModule: jiti.import branch was missing the mod.default ?? mod unwrap that the Bun/Deno and ESM branches both perform. Without it drizzleConfigFromFile receives a namespace object with default-forwarding proxy fields that zod's safeParse drops, so config.schema / config.sql / config.tablesFilter become undefined and the prepare* helpers throw RequiredParamsCliError on otherwise valid configs. - commands/utils.ts prepareExportConfig: take sql from the CLI options first, then from the config file, then default true; previously the CLI --sql=false flag was ignored when the rest of the command came from a config file. Also re-export the CheckConfig type the dispatch needs. Test adaptations - 8 cli-*.test.ts files: replaced vi.spyOn(console, 'log') + 'process.exit unexpectedly called with "1"' assertions with res.error.message checks built from the same error() / wrapParam() helpers the runtime uses, so the captured CliError message matches byte-for-byte (including ANSI). Three GenerateConfig / push expected fixtures gained the missing explain + hints fields. cli-check.test.ts, cli-pull.test.ts, cli-studio.test.ts now self-set TEST_CONFIG_PATH_PREFIX so they work under test:other (which doesn't set it). - conformance-live-db.test.ts push mysql describe gained a beforeAll that drops every table in the active mysql database. Without it, leftover tables from earlier mysql test files in the same run made the diff engine treat new tables as rename_or_create candidates and emit missing_hints instead of the expected ok / no_changes envelopes.
…-undefined
Today (2026-05-20) is the postpone date in five integration-test files for the
"Query error wrapping" / "Mappers: deep nullification" / "Same table name joined
between schemas" gates, so vitest started running them and they fail because sync
drivers (better-sqlite3, sqljs, postgres.js, mssql/tedious, cockroach pg) still
return raw driver errors instead of DrizzleQueryError. Per the repo's skipIf
convention (drizzle-orm/.claude/skills/tests), bump the dates to one month forward
rather than fix in-band: integration-tests/tests/{sqlite/sqlite-common,
pg/common-cache, pg/common-pt2, cockroach/common, mssql/mssql}.ts, plus the
@ts-ignore searchable-marker comment in pg/common-pt2.ts.
Also rewrite the no-useless-undefined violations in
drizzle-kit/tests/sdk/regressions/no-stdout.test.ts (process.exit mock
implementation): `() => undefined` to `() => {}` so the gate that ran lint on the
last green CI build (post-merge) passes. Behavior is identical; the spy still
swallows the exit call.
Tests
- cli-{check,export,generate,migrate,pull,push,studio}.test.ts: assertion text
for every `validate config #N` case now matches beta's exact wording
byte-for-byte, constructed via the same error() / wrapParam() helpers the
runtime uses. The mechanism is res.error.message (not console.log spy +
process.exit) because the cli path throws DrizzleCliError; the literal
text it asserts is identical to beta.
- cli-studio.test.ts #5/#6: prepareStudioConfig is still in the legacy
humanLog + process.exit path, so those tests keep beta's spy mechanism
unchanged; the only deviation is stripAnsi() on captured calls because
withStyle.error wraps the message with chalk codes.
Runtime
- validations/common.ts: configCommonSchema.dialect is now optional. The
early MissingConfigDialectCliError throw in drizzleConfigFromFile is gone
so each prepare* helper owns the dialect-missing wording (mirrors beta).
- commands/utils.ts:
- prepareCheckParams: wrapParam('dialect', config.dialect) was being
passed the imported zod schema; pass the actual config value.
- prepareGenerateConfig + prepareExportConfig: reorder RequiredParamsCliError
builders to dialect-first / schema-second; drop the wrapParam('out',...)
line from generate so the message matches beta exactly.
- drizzleConfigFromFile: removed the chalk.grey wrap around "Reading config
file" so spy assertions can compare against plain text (matches beta).
- validations/mssql.ts: rewrote printConfigConnectionIssues to match the
postgres.ts shape — url branch, server-form branch, generic fallthrough
with "Either connection \"url\" or \"server\", \"user\", \"password\" are
required for MsSQL database connection". The previous form duplicated the
same "Please provide required params for MsSQL driver:" header on both
branches and had no fallthrough.
Verified
- pnpm tsc --noEmit -p tsconfig.json + tsconfig.typetest.json both clean
- TEST_CONFIG_PATH_PREFIX=./tests/cli/ vitest run tests/other/ → 376/376 pass
loadModule used to apply `mod?.default ?? mod` in all three branches
(Bun/Deno, jiti, ESM Node), so every caller silently received the
default export when present. Only drizzleConfigFromFile actually needs
that — drizzle.config.ts uses `export default defineConfig(...)` —
while the 11 schema-loading call sites in cli/commands/studio.ts and
dialects/*/drizzle.ts iterate `Object.entries(mod)` to find PgTable /
MySqlTable / Relations values, where the unwrap masks bugs and silently
rescues non-canonical `export default { tables }` schemas.
Add an explicit `{ defaultExport }` options flag, default false. All
three branches now return `defaultExport ? (mod?.default ?? mod) : mod`.
drizzleConfigFromFile passes `{ defaultExport: true }`; the schema-
loading call sites are unchanged and now receive the raw namespace.
Behavior change: schema files using `export default { users, posts }`
stop working — must switch to named exports (`export const users =
pgTable(...)`), the documented drizzle pattern.
- pnpm exec tsc --noEmit -p tsconfig.json → 0
- vitest run tests/other/ → 376/376
…d and align `primary_key` hint kind on the wire Ship five SKILL.md files under `drizzle-kit/skills/` (drizzle-migrations, drizzle-generate, drizzle-push, drizzle-hints, drizzle-responses-and-errors) with deduped shared sections — response envelope owned by drizzle-responses-and-errors, reasons by drizzle-hints, per-dialect notes by drizzle-migrations. Descriptions trimmed to <=25 words; `metadata.version: "1.0.0"` on all five; worked examples added for the `privilege` 5-tuple and the `add_unique` constraint-name slot. Catalog ships via the new `drizzle-kit skills` install subcommand and a `tests/skills/catalog.test.ts` smoke gate; the build copies the catalog into `dist/skills/`. Rename the rename/create kind literal `primary key` (space) to `primary_key` (underscore) across the zod schema in `src/cli/hints.ts`, the runtime resolver call sites, and the hint test fixtures. Both rename-or-create and confirm-data-loss unions now carry a `primary_key` entry but stay discriminated by the outer `type` field. `foreign key` sites preserved. `JSON_CONTRACT.md` updated. Add a `humanizeKind` helper so TTY prompts render "primary key" rather than the wire literal.
…ocal-path `npx skills` invocation and package-manager detection
…adata.revision` bumps on `drizzle-kit/skills/**` Move skills revision into a dedicated `drizzle-kit skills version` subcommand; diff the whole feature branch against an auto-detected fork point so the gate covers multi-commit branches; and run the skills-revision gate only for pull requests, not raw pushes.
…ractivity axes, and ship the public SDK and agent skills - Replace the `--json` boolean with `--output text|json` and decompose `isJsonMode()` into orthogonal `outputFormat()` and `isInteractive()` predicates (interactive = text output and a TTY) - Accept a raw `Hint[]` for the SDK `hints` option and root-export `Hint`/`MissingHint`; map a malformed `Hint[]` to `invalid_hints` rather than `internal_error` - Add a `drizzle-output-modes` skill; separate output format from interactivity in the generate/push skills; reference sibling skills by name instead of file links; correct the `confirm_data_loss` `view` availability to postgresql/cockroach materialized views only - Extract the output-agnostic hint vocabulary into `HINTS.md` and trim `JSON_CONTRACT.md`/`OUTPUT_MODES.md` - Drop the duplicated `--output` default; delete the redundant text-mode regression tests; convert the SDK `.test-d.ts` files to vitest type tests asserting flat push credentials and `hints: Hint[]`
Register the `output` option on `check`, set CLI context in the transform, and route the success path through a `{status:'ok',dialect}` envelope (suppressing the human line in JSON mode) exiting via `statusToExitCode`. Surface integrity and non-commutativity failures as a `check_error` envelope: enrich the conflict throw-site `meta` with a JSON-serializable `details[]` (per-conflict `parentId`/`parentPath` and a two-element `branches` array of `{leafId, leafPath, statementDescription}`), guard `statusToExitCode` with `assertUnreachable`, build the `unsupported` message as a plain string, and label the `up` command's collision check as `up`.
Type the parsed snapshot in `checkHandler` as `object` to match `validatorForDialect`'s `(snapshot: object)` input, and guard the parse so a syntactically broken snapshot or a valid-but-non-object body (primitive or `null`) re-throws as `malformed` instead of escaping as `internal_error` or crashing on `'version' in <primitive>`.
Document the envelopes in `JSON_CONTRACT.md`, `OUTPUT_MODES.md`, and the agent skills, and add Docker-free spawn-based and brotest regression suites pinning the parse contract, envelope shapes, exit codes, and the non-object-snapshot path.
… the flattened merges to their pre-rebase content and apply rc4's `connectToTursoRemote` alias to the sqlite/turso dispatch in `cli/schema.ts`
- Route turso connection-layer driver-info logs through `humanLog` so they print only outside `--output json` - Surface turso connection failures via the typed `DatabaseDriverCliError` envelope - Document `database_driver_error` and the `turso` dialect in `JSON_CONTRACT.md` and `OUTPUT_MODES.md` - Fix the migrations skill to use `dialect: 'turso'` and bump the umbrella skill revision
Every interactive push confirm now short-circuits to the typed `missing_hints` path under a non-TTY stdin, so drizzle-kit's own error fires before hanji's `render()` with a deterministic non-zero exit. - Gate each `suggestions()` data-loss branch on `json || !isInteractive()` and each `Select` guard on `isInteractive()`, across all six dialects - Route unsupported mssql `rename_schema`/`rename_column` and mysql `drop_pk_dependency` ops through `UnsupportedSchemaChangeError` under non-TTY instead of silently applying - Enrich the `confirm_data_loss` text report with entity and reason - Defensively guard the dead legacy prompt sites - Run `suggestions()` in the dialect test mocks within an interactive text context so the legacy grouped-warning assertions still hold - Add Docker-free regression coverage
…tion; omit the gate from the manual publish workflow
|
There are still plenty of show-stoppers for |
Add machine-readable output modes (`--output text|json`), a typed SDK, and agent skills to drizzle-kit
…ts as a sticky PR comment
Add `check` composite GitHub Action posting `drizzle-kit check` results as a sticky PR comment
Which exact issues are show-stoppers for you? |
Note, these aren't just bug reports - they are PRs, some of which haven't been commented on by a maintainer in over a year. I had the new Claude Fable 5 try and migrate a new project I'm doing from |
|
As for this, would you mind sharing affected column, your drizzle version, and, if possible, affected data sample? |
I started this project on the betas and have literally been using the RC.2 since the day it was published on npm, and all of my experience with these issues is with the RC.2. I will spend the morning putting together a repro - I may not have been hitting the precise issues I mentioned but there are definitely still several issues that Claude provided solid reasoning runtime patches still couldn't fix, many of which ressembled those I mentioned. I really wanted to move to bun and spent a couple of hours trying to find workarounds and Claude convinced me to abandon my efforts. |
Sorry @Sukairo-02 , a day late. Opus rustled up the following: https://github.com/AntonOfTheWoods/bun-sql-drizzle-repros What the repros prove (rc.2)Same drizzle code, same DB,
|
* Fix commutativity speed from 105s to <100ms * Care about enum order for commutativity, fix statements detection for open branches
|
Hi @Sukairo-02, |
1 - scalar import { refineCodecs } from 'drizzle-orm/codecs';
import { bunSqlPgCodecs } from 'drizzle-orm/bun-sql/postgres';
const db = drizzle({
client,
codecs: refineCodecs(bunSqlPgCodecs, {
json: {
normalizeParam: (p) => JSON.stringify(p),
},
jsonb: {
normalizeParam: (p) => JSON.stringify(p),
},
}),
});Shall It be confirmed that this is expected behaviour despite the inconsistency, we'll add separate set of codecs for 2 - raw const rawProbe = pgTable('raw_probe', (t) => ({
id: t.integer(),
ts: t.timestamp({
withTimezone: true,
}),
doc: t.jsonb(),
}));
await db.execute(`drop table if exists raw_probe`);
await db.execute(`create table raw_probe (id int, ts timestamptz, doc jsonb)`);
await db.execute(
sql`insert into raw_probe (id, ts) values (1, ${sql.param(new Date('2026-05-20T00:00:00Z'), rawProbe.ts)})`,
);
await db.execute(sql`insert into raw_probe (id, doc) values (2, ${sql.param({ a: 1 }, rawProbe.doc)})`);Although this will only be possible after this patch is out ( |
ORM
Viewtypes when usingSubqueryin selectionSQLfieldsSQLfield when.mapWith(column)is set (fixes [BUG]: [1.0.0-rc.2] [pg]db.select({ maxTimestamp: max(table.timestamp) }).from(table)returns a string value (mode: 'date') #5724)Subqueryfields' columns' codecs not being applied to subqueryrc.3db.selectinbun-sql/pgdriver (fixes [BUG]: await db.select() sends empty column list (select from "table") with bun-sql + PostgreSQL in 1.0.0-rc.3 #5779, [BUG]: bun-sql driver produces empty SELECT column list with snakeCase.table — "select from table" #5802)db.$countbuilder to include.sync()executor for sync driverssqlite, removed RQBv1TSchema,TFullSchemaarguments fromsqliteentities' genericssqlitequery errors not being wrapped inDrizzleQueryError(db.batch()excluded due to api incompatibility)CockroachArrayBuilderconstructor caused by referencing internal field's typemapResultmethod fromPreparedQueryinterface, removedmapResult,mapBatchResultfrompgandsqliteraw queriesbun-sqliterun result typesqliteRQBv2 to array modesqlitesqlitesessions: replaced per-driverPreparedQueryinstances with executors passed via sessions, similar to currentpostgresqlandmysqlimplementations, moveduseJitMappersflag handling to dialectstringoverload on.comment(sqlCommenterComment)in query builders@tursodatabase/database,@tursodatabase/database-wasm@tursodatabase/database-wasmatdrizzle-orm/tursodatbase/wasm-migratorasync,effectversions (syncremains subtype ofasync)SQLiteSyncDialect,SQLiteAsyncDialect, moved generic SQLiteasync\syncmigrators tosqlite-core/async/sessionasmigrateSync,migrateAsyncsqlitecache using same cache entry for different execute methodsEffectDrizzlePgConfigtodrizzle-orm/pg-core/effect/utilscachefield inEffectCacheShapeoptionalDrivers
@tursodatabase/database,@tursodatabase/database-wasmto v0.6.0, updated session internals for asynchronous prepare on driver side@tursodatabase/serverlessdriver support@tursodatabase/syncdriver support@effect/sql-pglitedriver support@effect/sql-sqlite-nodedriver support@effect/sql-sqlite-bundriver support@effect/sql-sqlite-dodriver support@effect/sql-sqlite-wasmdriver support@effect/sql-libsqldriver supportKit