Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Querying data

Execute a query

import redivis from 'redivis';

// Execute any SQL query and read the results
const query = redivis.query("SELECT 1 + 1 AS two, 'foo' AS bar");
await query.toRowsArray();
// [{ two: 2, bar: 'foo' }]

// The query can reference any table on Redivis
const irisQuery = redivis.query(`
  SELECT *
  FROM demo.iris_species.iris
  WHERE SepalLengthCm > 5
`);
await irisQuery.toRowsArray();
// [{ Id: 33, SepalLengthCm: 5.2, SepalWidthCm: 4.1, PetalLengthCm: 1.5, PetalWidthCm: 0.1, Species: 'Iris-setosa' }, ...]

// Other methods to read data:
// await query.toArrowTable()
// query.toArrowBatchIterator()
// await query.toReadStreams()

Execute a scoped query

Set a default scope

Stream large query results

Check a query's status

Was this helpful?