Skip to content

v3.3.0

Latest

Choose a tag to compare

@krinart krinart released this 27 Oct 19:28
3efa67f

spice.js v3.3.0

Features

  • Cancel a query with an AbortSignal. sql() and sqlJson() accept a signal. When the signal aborts, the client closes the request, so the runtime stops the query. Before, a timeout stopped only the caller's await, and the query continued on the runtime. An aborted query rejects with the signal's reason (for example, a TimeoutError from AbortSignal.timeout()) on both HTTP and Arrow Flight. The client does not retry an aborted query. (#345)

    await client.sql('SELECT * FROM taxi_trips', {
      signal: AbortSignal.timeout(5000),
    });
  • runtimeStatus(). Returns the status of each runtime connection (http, flight, metrics, opentelemetry) from GET /v1/status, as { name, endpoint, status }. Use it to find which endpoint is not ready. isSpiceReady() gives only one boolean for the full runtime. (#334, #350)

  • refreshDataset(). Starts an on-demand acceleration refresh. This is the same name that the other Spice SDKs use. refreshAcceleration() is now deprecated. It continues to work and sends the same request. (#355)

Fixes

  • HTTP queries on Node no longer fail with ERR_STREAM_PREMATURE_CLOSE. On Node, the client now uses the built-in fetch, not node-fetch. Before, sql() over HTTP failed intermittently on chunked /v1/sql responses. (#352)
  • API keys work on plaintext gRPC. The client now sends the API key, the user agent and custom headers on an insecure (grpc://) Flight connection. Before, a local runtime that requires an API key rejected all Flight queries. (#351)
  • Typed Flight parameters. Date, Param.timestamp, Param.date32, Param.decimal128 and Param.decimal256 parameters now bind correctly over Arrow Flight. Before, they failed with Cannot mix BigInt and other types or value.subarray is not a function. A bigint parameter over HTTP now binds as Int64, the same as over Flight. Before, it was sent as a string. (#353)
  • runtimeStatus() rejects a malformed /v1/status response. The error identifies the bad entry. (#350)

Behavior changes

  • The HTTP and Flight endpoints now address the same runtime. If you set only one of flightUrl or httpUrl to a Spice Cloud address or a local runtime address, the client now uses the matching address for the other one. If you set both, or if you set a different (self-hosted) address, the behavior does not change. (#347)

    Configuration Before After
    { apiKey, flightUrl: 'flight.spiceai.io:443' } HTTP → http://127.0.0.1:8090 HTTP → https://data.spiceai.io
    { apiKey, httpUrl: 'https://data.spiceai.io' } Flight → 127.0.0.1:50051, TLS off Flight → flight.spiceai.io:443, TLS on
  • An empty flightUrl or httpUrl now throws. Before, an empty or whitespace-only value counted as "not set". With an API key, this sent the queries and the key to Spice Cloud. This usually happens when an environment variable is not set. Remove the option to use the default. (#349)

  • A Flight authentication failure now throws. An UNAUTHENTICATED or PERMISSION_DENIED error from Arrow Flight now gives an Arrow Flight authentication failed ... check the apiKey error. Before, the client tried the query again over HTTP. (#351)

Node.js support

engines continues to be node >=20. CI now tests Node 22, 24 and 26. Node 20 is end-of-life, and CI no longer tests it. (#356)

Other changes

  • Removed an unused, older copy of SpiceClient and two helpers that only it used. The public API does not change. (#338)
  • The npm publish job uses Node 24. (#337)

Dependencies

  • Development dependency updates: @types/node 26.4.0, @typescript-eslint/parser 8.68.0 (#339, #341)
  • Test app: sharp 0.35.4 (#346)

Full changelog: v3.2.0...v3.3.0