Skip to content

chore(release): version cnosdb-client - #52

Open
AayushMainali-Github wants to merge 1 commit into
mainfrom
changeset-release/main
Open

chore(release): version cnosdb-client#52
AayushMainali-Github wants to merge 1 commit into
mainfrom
changeset-release/main

Conversation

@AayushMainali-Github

@AayushMainali-Github AayushMainali-Github commented Jul 25, 2026

Copy link
Copy Markdown
Owner

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

cnosdb-client@0.3.0

Minor Changes

  • #56 d784699 Thanks @AayushMainali-Github! - Add sql, a tagged template that escapes interpolated values as CnosDB SQL literals. Strings use SQL-standard quote doubling, null/boolean/number/bigint/Date have fixed encodings, and anything else — including NaN, Infinity, and invalid dates — throws rather than guessing. Identifiers and statement structure stay in the literal parts of the template; this is a value escaper, not a query builder.

  • #55 f183f3b Thanks @AayushMainali-Github! - Add queryStream(), an async generator that yields query rows as they arrive instead of buffering the whole response. It asks CnosDB for chunked=true, which replies with successive JSON arrays written back to back; the client parses each array and yields its elements so memory stays proportional to one server batch.

    Row shape matches query() (alphabetically sorted keys, NULL columns omitted). SQL errors still arrive as an HTTP error before any row is sent; a failure after some rows have been yielded throws and leaves those rows consumed, so a partial result is visible rather than hidden. Breaking out of the loop or aborting options.signal cancels the underlying response.

  • #54 94cd075 Thanks @AayushMainali-Github! - Add an opt-in retry policy. Retries stay off unless configured, so the default remains one call, one request; enabling them retries ping, query, and queryTable on timeouts, connection failures, HTTP 429, and 5xx other than 501. Writes are retried only with retryWrites, and execute is never retried, because the client cannot tell whether a failed attempt took effect.

    Backoff doubles from backoff.initialMs up to backoff.maxMs with full jitter by default, a Retry-After header overrides the computed delay within that cap, and an AbortSignal ends the sequence immediately including mid-backoff.

    timeoutMs keeps its existing meaning as the budget for a single attempt rather than becoming a deadline across the sequence; retry.maxElapsedMs bounds the total. The reasoning, and the amendment to ADR-0006, are recorded in ADR-0009.

  • #51 6340578 Thanks @AayushMainali-Github! - Add client.queryTable(), which returns a result's columns alongside its rows. It requests CSV, the only CnosDB response format that carries column names in their true order, so the columns come back in the order the statement selected them and every row has exactly one value per column. On CnosDB 2.4.3 the columns survive an empty result, so a table with no matching rows can still be rendered with its headings; 2.4.1 returns an empty body instead and reports no columns.

    This matters because the JSON format used by query() sorts keys alphabetically and omits any column that is NULL for a given row, which makes row objects differ in shape and hides nulls entirely. Both behaviours are now documented in docs/compatibility.md.

    Values are returned as raw strings, because CnosDB sends no column types over HTTP in any response format; converting them would mean guessing.

    Also exports the Compression type from the package root, which was added as a client option in 0.2.0 but was not importable.

  • #53 2ef8eea Thanks @AayushMainali-Github! - Add splitPoints(), a generator that cuts a batch of points into Line Protocol payloads no larger than a chosen size. Sizing is by encoded UTF-8 bytes rather than point count, since points vary enormously in encoded length and server limits are measured in bytes; the separating newlines are counted too, so a payload that fits also fits on the wire.

    Splitting is opt-in with no default size, so existing writes are unchanged. A single point larger than maxBytes raises a RangeError naming its index and size rather than emitting an oversized payload.

    Sending the chunks is left to the caller, so a failure part way through a batch makes it obvious which chunks were already written.

@github-actions github-actions Bot added area: documentation Area: documentation area: release Area: release labels Jul 25, 2026
@AayushMainali-Github
AayushMainali-Github force-pushed the changeset-release/main branch 2 times, most recently from 07352f6 to 5ab2de8 Compare July 25, 2026 04:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: documentation Area: documentation area: release Area: release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant