fix(drizzle-kit): normalize turso:// URLs and stop bundling @tursodatabase/serverless - #6169
Open
webdevsamran wants to merge 1 commit into
Open
fix(drizzle-kit): normalize turso:// URLs and stop bundling @tursodatabase/serverless#6169webdevsamran wants to merge 1 commit into
webdevsamran wants to merge 1 commit into
Conversation
…abase/serverless drizzle-kit detects the user-installed @tursodatabase/serverless via checkPackage but, because the package was missing from the esbuild externals list, the bundled CLI shipped with a pinned 1.1.3 copy that lacks turso:// URL normalization - so turso:// connection URLs failed at runtime. Add @tursodatabase/serverless to driversPackages so the user's installed version is used, matching the checkPackage intent, and translate turso:// to https:// in normaliseSQLiteUrl for libsql-family drivers so older driver copies keep working.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #6164.
drizzle-kitdetects the user-installed@tursodatabase/serverlessviacheckPackage(...)and logs "Using '@tursodatabase/serverless' driver", but the bundled CLI (dist/bin.cjs) actually ships with a pinned 1.1.3 copy of the package. Root cause:build.cli.tsmarks driver packages as esbuildexternalso they resolve from the user's install at runtime — commit 481ccf1 added@tursodatabase/database,@sqlitecloud/drivers, andbunto that list but missed@tursodatabase/serverless. The staticawait import('@tursodatabase/serverless')inside the bundle therefore resolves to the bundled snapshot, and since 1.1.3 only normalizeslibsql://(notturso://),turso://connection URLs fail even though the user's installed driver supports them.Two complementary changes:
build.cli.ts: add'@tursodatabase/serverless'todriversPackagesso the user's installed version is used at runtime — matching the existingcheckPackageintent.src/utils/utils-node.ts: translateturso://→https://in thelibsqlbranch ofnormaliseSQLiteUrl. The libsql-family clients speak HTTPS to the same host, and doing this in the kit keeps behavior correct regardless of which driver copy ends up resolving.Testing
New unit tests in
drizzle-kit/tests/other/sqlite-url.test.ts:turso://host→https://host(including query strings)libsql://,file:, and bare paths unchanged