turso "database ... not found" in CI
Turso looked up the database by name in your organization and found nothing. When you create a database per PR, this usually means the create step did not run first, the database was already destroyed, or the wrong org is selected.
What this error means
A "turso db show" or a libsql connection using the database URL fails with "database pr-123 not found" or "could not resolve database".
turso
Error: database "pr-123" not found. Run `turso db list` to see your databases.Common causes
The database was not created before use
A step referenced the per-PR database before turso db create ran, or the create step failed.
It was destroyed by a prior cleanup
A cleanup job already removed the database, but a later step still holds its name or URL.
How to fix it
Create the database per PR, then derive its URL
- Create the database with a deterministic per-PR name.
- Read its URL and mint a token for the connection.
- Destroy it when the PR closes.
Terminal
turso db create "pr-${{ github.event.number }}"
turso db show "pr-${{ github.event.number }}" --urlDestroy the database on PR close
Add a cleanup job so per-PR databases do not accumulate and names are freed.
Terminal
turso db destroy "pr-${{ github.event.number }}" --yesHow to prevent it
- Create the per-PR database before any step that uses it.
- Use one deterministic database name per PR across steps.
- Destroy the database on PR close to avoid leftover state and cost.
Related guides
turso "not authenticated" (TURSO_API_TOKEN) in CIFix Turso CLI "You are not logged in" in CI - the CLI needs a non-interactive token via TURSO_API_TOKEN becau…
Turso libsql connection failed (URL or auth token) in CIFix libsql connection failures to Turso in CI - the client needs both the libsql:// database URL and a fresh…
Neon "branch already exists" (create branch per PR) in CIFix Neon "branch with name X already exists" in CI - a rerun tries to recreate a branch that a prior run left…