Skip to content

Accept the Turso database under any Vercel integration prefix - #3

Merged
biluses merged 3 commits into
masterfrom
claude/clone-build-autonomous-repo-lou6ef
Sep 19, 2026
Merged

biluses merged 3 commits into
masterfrom
claude/clone-build-autonomous-repo-lou6ef

Conversation

@biluses

@biluses biluses commented Sep 19, 2026

Copy link
Copy Markdown
Owner

Why

The Vercel marketplace's "Connect a Project" dialog for Turso lets the environment-variable prefix be chosen (STORAGE_URL by default), so the app cannot rely on TURSO_DATABASE_URL / TURSO_AUTH_TOKEN being the names.

What changes

  • src/db/env.ts and scripts/db-env.mjs: one resolver finds the database by value and shape — DATABASE_URL first, then TURSO_DATABASE_URL, then any <PREFIX>_URL whose value is a libsql or turso.io URL, with its sibling <PREFIX>_AUTH_TOKEN / _TOKEN. Plain https URLs such as APP_URL are ignored.
  • The DB client, the boot migration and the migrate / credits / wipe scripts all go through it; the migrate script's Vercel error message says any prefix works.
  • Unit tests for the resolver.

Verified

Lint, typecheck, 38 unit tests green; VERCEL=1 STORAGE_URL=libsql://… node scripts/migrate.mjs reaches the remote branch, VERCEL=1 without a database still fails fast with the message; a VERCEL=1 build succeeds.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QktEqYfYA1H2gQRbvG88pU


Generated by Claude Code

biluses and others added 3 commits September 19, 2026 01:13
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
@vercel

vercel Bot commented Sep 19, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
vitrina Error Error Sep 19, 2026 1:15am UTC

@biluses
biluses merged commit 59c8f6e into master Sep 19, 2026
2 of 4 checks passed

This branch had an error being deployed

1 failed deployment
Preview — d779fe79 Deployed Sep 19, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant