Repository navigation
feat(cli): serve --http via libxsql http_query_server - #15
Merged
Merged
Conversation
…utor) Replace the hand-rolled run_http_mode (thinclient::server + setup_http_routes + timed_mutex admission) with xsql::thinclient::http_query_server using a statement_executor and use_queue=true. The thinclient now owns routing, auth, queue admission (max_queue/queue_admission_timeout via runtime_settings hooks), options (continue_on_error/include_sql), and formatting (json/text/csv/tsv). Serialization is preserved via use_queue=true (BN QueryEngine isn't concurrency-safe); the main thread runs run_until_stopped(). /status reports a cached function count (queried once at startup) + settings via status_fn; auth-gated /settings via extra_routes. PRAGMA bnsql.* runtime controls intact. Removes bnsql's duplicate CLI HTTP implementation. (REPL .http + plugin still use setup_http_routes; migrated separately.)
This was referenced Jun 23, 2026
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.
Replaces bnsql's hand-rolled CLI
run_http_mode(low-levelthinclient::server+setup_http_routes+timed_mutexadmission) withxsql::thinclient::http_query_server+ astatement_executor, removing the duplicated CLI HTTP server.How behavior is preserved
use_queue=true(BNQueryEngineisn't concurrency-safe) — the main thread runsrun_until_stopped(); the thinclient queue also provides admission timeout + max_queue viaruntime_settingshooks./status: cached function count (queried once at startup;status_fnruns off the main thread) + nested settings +tool./settings: auth-gated viaextra_routes.bnsql.*runtime controls intact; options +format=now handled by the thinclient.Tested live (
--http, ls binary)/status(functions=138 + settings),/settings200 w/ token & 401 without,?continue_on_error=1,?format=csv,PRAGMA bnsql.max_queueset+read, and graceful/shutdownexits 0 (previously aborted — fixed by #7).Scope
CLI
--httponly. REPL.http+ the BN plugin still usesetup_http_routes(non-queue; migrated separately — they need mutex-serialized non-queue execution, and the plugin path isn't testable headless).