Skip to content

docs(qwp): make the pooled facade first-class and add more ws ingest/query examples#61

Open
kafka1991 wants to merge 3 commits into
mainfrom
pool_example
Open

docs(qwp): make the pooled facade first-class and add more ws ingest/query examples#61
kafka1991 wants to merge 3 commits into
mainfrom
pool_example

Conversation

@kafka1991

@kafka1991 kafka1991 commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

What & why

The examples/ module had drifted from java.md, which calls the pooled QuestDB handle "the recommended entry point." The examples instead led with the low-level primitives — QwpQueryClient for queries and Sender.fromConfig(...) over legacy ILP (tcp/http) for ingest.

This PR reworks the examples so the pooled QWP (WebSocket) facade is the first-class API for both ingest and query, adds a broad set of new ws examples, and keeps the low-level primitives and the ILP transports as a clearly-labeled reference.

Changes

Query examples → pooled facade. Every QWP query example now uses db.query() / db.executeSql() instead of QwpQueryClient — binds, cancellation, DDL/DML, compression, flow-control, streaming, column reads, and error handling. BasicQueryExample (the docs-embedded qwp-query) queries the same trades schema the ingest examples write, so the ingest and query snippets on the docs page compose.

New ws ingest & facade examples

  • root — QuestDBExample (ingest+query round-trip), QuestDBSeparateConfigExample, ConnectionErrorExample
  • sender/ (ws) — WsExample, WsConcurrentIngestExample, WsColumnTypesExample, WsArrayExample, WsAuthTlsExample, WsAdvancedExample, WsStoreAndForwardExample, WsFailoverExample
  • query/ArrayResultExample, BinaryResultExample, ConcurrentQueryExample, MultiInFlightQueryExample, QueryCancellationExample, QueryFailoverExample

Kept as low-level / legacy reference

  • query/QwpQueryClientExample — the low-level QwpQueryClient primitive
  • sender/SenderErrorHandlingExample — low-level Sender + SenderErrorHandler (the facade doesn't expose this callback)
  • the six ILP sender/ examples (tcp / http / TLS / ECDSA); BasicExample is renamed TcpExample to match its transport-named siblings

Manifest. Added qwp-pool / qwp-ingest / qwp-query entries to examples.manifest.yaml (mirroring the Go client's go.md) so java.md can embed them via <RemoteRepoExample>; the ilp* entries keep their names, with the ilp / ilp-from-conf paths following the TcpExample rename.

Every example compiles in CI (root reactor, JDK 8 + JDK 25) and was run against a live QuestDB while preparing this PR — the resulting doc-vs-server fixes are in the commit messages.

Follow-ups (not in this PR)

  • documentation repo: add <RemoteRepoExample name="qwp-*" lang="java"> tags to java.md. The docs plugin fetches examples.manifest.yaml from the client's default branch, so this can only land after merge.
  • parent questdb repo: bump the submodule pointer in a separate commit once this merges.

Convert the QWP query examples from the low-level QwpQueryClient to the
pooled QuestDB facade (db.query()/db.executeSql()), and add ws-pooled
ingest and facade examples so the recommended entry point is what the
examples lead with. Keep one low-level QwpQueryClient example and the ILP
Sender examples as the legacy-transport reference.

New:
- root: QuestDBExample (ingest+query round-trip), QuestDBSeparateConfigExample,
  ConnectionErrorExample, BinaryColumnExample
- sender (ws): WsExample, WsConcurrentIngestExample, WsColumnTypesExample,
  WsArrayExample, WsAuthTlsExample, WsAdvancedExample, WsStoreAndForwardExample,
  WsFailoverExample, SenderErrorHandlingExample (low-level)
- query: QwpQueryClientExample (low-level), ArrayResultExample,
  MultiInFlightQueryExample, QueryCancellationExample, QueryFailoverExample

Wire qwp-pool/qwp-ingest/qwp-query into examples.manifest.yaml (mirroring the
Go client) while keeping the ilp* entries.

Verified by running every example against a live QuestDB; fixes from that:
- BindAllTypesExample: ::GEOHASH(60b) is invalid (cast(.. as GEOHASH) works);
  ::FLOAT is widened to DOUBLE, so read c_float as a double
- WsArrayExample: only double arrays are supported for ingest
- ErrorHandlingExample: COPY isn't rejected on egress; use an invalid column
- ConnectionErrorExample: connect() eagerly warms the sender pool, so bad
  hosts surface as LineSenderException

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@kafka1991 kafka1991 changed the title chore(examples): make the pooled QuestDB facade the first-class API chore(qwp): make the pooled QuestDB facade the first-class API Jul 2, 2026
@kafka1991 kafka1991 changed the title chore(qwp): make the pooled QuestDB facade the first-class API docs(examples): make the pooled QuestDB (QWP) facade the first-class API Jul 2, 2026
@kafka1991 kafka1991 changed the title docs(examples): make the pooled QuestDB (QWP) facade the first-class API chore(qwp): make the pooled facade first-class and add ws ingest/query examples Jul 2, 2026
@kafka1991 kafka1991 changed the title chore(qwp): make the pooled facade first-class and add ws ingest/query examples chore(qwp): make the pooled facade first-class and add more ws ingest/query examples Jul 2, 2026
@kafka1991 kafka1991 changed the title chore(qwp): make the pooled facade first-class and add more ws ingest/query examples docs(examples): make the pooled facade first-class and add more ws ingest/query examples Jul 2, 2026
@kafka1991 kafka1991 changed the title docs(examples): make the pooled facade first-class and add more ws ingest/query examples docs(qwp): make the pooled facade first-class and add more ws ingest/query examples Jul 2, 2026
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