Node.js and querying with SQL

Hi there, I’m neck deep on my first influx implementation with InfluxDb Cloud and Node.js. Struggling to get everything working with some queries. I’d LOVE to just use plain old SQL to query the db. And I can get the query working perfectly in Data Explorer, but it seems that neither of the Node.js libraries enable SQL queries only Flux queries. The data explorer doesn’t use flux only SQL.

There is a influxdb3-client available but that doesn’t work due to a package.json issue. I’m using Vite.

So as far as I can tell, I’m locked out from SQL unless there is an undocumented way of using SQL with that library, and I’ll need to wrap my head around Flux.

Funny thing is that my data has several measures per data point, I need to return all of them, but flux seems to be returning them in a format where the points are disconnected.

Strange thing is that Flux seems to be returning data with datapoints broken up, so I’ve no way of recombining.

@Timmwardion My initial reaction is that you could just use straight Arrow Flight, but it doesn’t look like JS supports Arrow Flight directly ([JS] Arrow Flight JavaScript Client or Example · Issue #17325 · apache/arrow · GitHub). So the InfluxDB v3 client is your best bet.

Are you having dependency conflicts in your package.json?

Thanks @scott. I figured how to pivot and just pulled the whole dataset in and did it on the React side.

|> pivot(rowKey:[“_time”,“device”], columnKey: [“_field”], valueColumn: “_value”)