Repository navigation
Accept the Turso database under any Vercel integration prefix - #3
Merged
Merged
Conversation
The Vercel marketplace lets the Turso connection choose its variable prefix, so the app and the scripts now find the libsql URL and token by value and shape (DATABASE_URL, TURSO_DATABASE_URL, or any <PREFIX>_URL with a libsql value and its sibling token). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QktEqYfYA1H2gQRbvG88pU
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QktEqYfYA1H2gQRbvG88pU
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QktEqYfYA1H2gQRbvG88pU
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch had an error being deployed
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.
Why
The Vercel marketplace's "Connect a Project" dialog for Turso lets the environment-variable prefix be chosen (
STORAGE_URLby default), so the app cannot rely onTURSO_DATABASE_URL/TURSO_AUTH_TOKENbeing the names.What changes
src/db/env.tsandscripts/db-env.mjs: one resolver finds the database by value and shape —DATABASE_URLfirst, thenTURSO_DATABASE_URL, then any<PREFIX>_URLwhose value is a libsql or turso.io URL, with its sibling<PREFIX>_AUTH_TOKEN/_TOKEN. Plain https URLs such asAPP_URLare ignored.Verified
Lint, typecheck, 38 unit tests green;
VERCEL=1 STORAGE_URL=libsql://… node scripts/migrate.mjsreaches the remote branch,VERCEL=1without a database still fails fast with the message; aVERCEL=1build succeeds.🤖 Generated with Claude Code
https://claude.ai/code/session_01QktEqYfYA1H2gQRbvG88pU
Generated by Claude Code