Streaming
public async query(
queryText: string,
onData: ((data: Table) => void) | undefined = undefined
): Promise<Table>import { SpiceClient } from "@spiceai/spice";
const spiceClient = new SpiceClient(process.env.API_KEY);
const query = `
SELECT s_suppkey, s_name
FROM tpch.supplier
`
const allSuppliers = await spiceClient.query(query)
allSuppliers.toArray().forEach((row) => {
processSupplier(row.toJSON())
});Last updated
Was this helpful?