Skip to content

Fall back to 'SQLite' when /version endpoint is unavailable#53

Open
IceboxDev wants to merge 1 commit intodbeaver:develfrom
IceboxDev:fix/turso-version-fallback
Open

Fall back to 'SQLite' when /version endpoint is unavailable#53
IceboxDev wants to merge 1 commit intodbeaver:develfrom
IceboxDev:fix/turso-version-fallback

Conversation

@IceboxDev
Copy link
Copy Markdown

Turso's managed libSQL service does not expose a /version endpoint at all:

curl -H "Authorization: Bearer $TOKEN" https://<turso-host>/version
# HTTP/1.1 404 Not Found
# {"error":"route not found: [\"version\"]"}

LibSqlDatabaseMetaData.readServerVersion propagates the resulting IOException as SQLException, so getDatabaseProductName() throws. Clients that rely on the product name to pick a SQL dialect (JetBrains DataGrip / PyCharm in particular) classify the connection as UNKNOWN, which downstream causes a hang on result-set finalization.

Fix: when /version is unreachable, fall back to a static "SQLite" product name. libSQL is SQLite-compatible at the SQL level, so this gives clients a sensible dialect to pick. If /version is reachable (self-hosted product name. libSQL is SQLite-compatible at the SQL level, so this gives clients a sensible dialect to pick. If /version is reachable (self-hosted sqld), the actual server version is used as before.

@codacy-production
Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

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