Repository navigation
fix: support http(s) connection strings and sqld namespace URLs - #7
Merged
Merged
Conversation
The host only forwards the raw URI to a plugin for schemes declared in .tabularium's connection_uri_schemes, so http://localhost:8080/dev/example/ was rejected as an unsupported driver before the plugin saw it. Declare http/https, after which resolve_backend keeps the verbatim URL and its path, posting to /dev/example/v2/pipeline. Release 1.0.1.
When the host sends params decomposed (host/port/database) instead of the verbatim URI, the database value was ignored on the remote branch: http://192.0.2.10:8080/dev/example/ became a POST to /v2/pipeline, so sqld picked the namespace from the Host header and returned 404. Treat a multi-segment database value as a path prefix; Turso database names cannot contain a separator.
sqld resolves the namespace from the x-namespace header, not the URL path: 0.24.x ignores a /dev/<ns>/ prefix and falls back to the Host header (the first octet of an IP literal, and a 404). Derive the namespace from the URL path (dev/example -> example) and send it as x-namespace; plain Turso hosts get no header. Verified against sqld 0.24.33: test_connection and get_tables return real data.
jonaspm
force-pushed
the
fix/http-connection-string-schemes
branch
from
September 15, 2026 19:03
35375ca to
186426e
Compare
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
Three gaps made a sqld namespace URL (
http://192.0.2.10:8080/dev/example/) unusable from Tabularis (all found during manual testing against a real self-hosted sqld):.tabulariumdeclaredconnection_uri: truebut itsconnection_uri_schemesonly listedturso,wss,wsandfile. The host resolves a pasted connection string's protocol against that registry, sohttp:///https://URIs were rejected as an unsupported driver before the plugin ever saw them — even thoughresolve_backend/normalize_remote_urlalready handled those schemes.databasevalue was ignored on the remote branch, so the plugin builthttp://host:8080and posted to/v2/pipelineinstead of the namespaced URL.x-namespaceheader, not the URL path — 0.24.x serves/dev/<ns>/v2/pipelinebut still takes the namespace from the Host header (the first octet of an IP literal), producing a404 Namespace ... doesn't exist. The plugin now derives the namespace from the URL path (dev/example→example) and sends it asx-namespace..tabularium: declarehttpandhttps; mention the sqld namespace form inconnection_string_examplesrc/client.rs: keep a multi-segmentdatabasevalue as a path prefix on the bare-host branch; Turso names contain no/, so plain names stay pathlesssrc/hrana.rs:namespace_from_url_path+x-namespaceheader; plain hosts (Turso) send no headerconnection_uriresolution, decomposed host/port/database (with/without trailing slash), plain-name no-path guard, namespace derivation/absenceCargo.tomland.tabulariumCloses #6
Test plan
just test— 98 tests passjust lint— clippy-D warningsclean{"connection_uri":"http://localhost:8080/dev/example/"}→ capturedPOST /dev/example/v2/pipeline{"host":"127.0.0.1","port":8080,"database":"dev/example/","ssl_mode":"disable"}→ capturedPOST /dev/example/v2/pipelinetest_connectionsucceeds and metadata queries return real data; raw HTTP probes confirmed/dev/<ns>/v2/pipeline+x-namespace: <ns>→ 200, while the same request without the header → 404.Release
Merging this unblocks
git tag v1.0.1, which triggers the release workflow. Runjust dev-install+ restart Tabularis to reload the manifest locally.