fix(rqlite): validate node via X-Rqlite-Version header before first query#504
Open
mustafash0099 wants to merge 2 commits into
Open
fix(rqlite): validate node via X-Rqlite-Version header before first query#504mustafash0099 wants to merge 2 commits into
mustafash0099 wants to merge 2 commits into
Conversation
…uery Before executing any SQL, probe the configured endpoint with GET / and verify the X-Rqlite-Version response header is present, as recommended by the rqlite project maintainer. - Add RqliteQueryable.testConnection() — throws with a clear message when the endpoint is unreachable or is not an rqlite node - Call testConnection() lazily inside transaction() on first use; result is cached so subsequent calls pay no overhead - Auth credentials are intentionally omitted from the probe request (the rqlite root path is a public health-check endpoint) - Add rqlite.test.ts covering: transformRawResult, testConnection, transaction integration, and query delegation Closes outerbase#59
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.
Problem
When connecting to an rqlite endpoint, Outerbase Studio would fail or return confusing errors if the configured URL pointed to a non-rqlite server (wrong host, wrong port, or misconfigured proxy).
Fixes #59
Solution
Before executing any SQL, RqliteQueryable now probes the configured endpoint with GET / and verifies the X-Rqlite-Version response header is present, as recommended by the rqlite maintainer in the issue and the rqlite CLI source.
Changes
src/drivers/database/rqlite.ts
src/drivers/database/rqlite.test.ts (new)
Test plan
/claim #59