Repository navigation
spice.js v3.3.0
Features
-
Cancel a query with an
AbortSignal.sql()andsqlJson()accept asignal. When the signal aborts, the client closes the request, so the runtime stops the query. Before, a timeout stopped only the caller'sawait, and the query continued on the runtime. An aborted query rejects with the signal'sreason(for example, aTimeoutErrorfromAbortSignal.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) fromGET /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-infetch, notnode-fetch. Before,sql()over HTTP failed intermittently on chunked/v1/sqlresponses. (#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.decimal128andParam.decimal256parameters now bind correctly over Arrow Flight. Before, they failed withCannot mix BigInt and other typesorvalue.subarray is not a function. Abigintparameter over HTTP now binds asInt64, the same as over Flight. Before, it was sent as a string. (#353) runtimeStatus()rejects a malformed/v1/statusresponse. 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
flightUrlorhttpUrlto 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:8090HTTP → https://data.spiceai.io{ apiKey, httpUrl: 'https://data.spiceai.io' }Flight → 127.0.0.1:50051, TLS offFlight → flight.spiceai.io:443, TLS on -
An empty
flightUrlorhttpUrlnow 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
UNAUTHENTICATEDorPERMISSION_DENIEDerror from Arrow Flight now gives anArrow Flight authentication failed ... check the apiKeyerror. 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
SpiceClientand 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/node26.4.0,@typescript-eslint/parser8.68.0 (#339, #341) - Test app:
sharp0.35.4 (#346)
Full changelog: v3.2.0...v3.3.0