@firetiger-oss/flight-sql-client
Version: 
A TypeScript/JavaScript client for Apache Arrow Flight and Flight SQL protocols
37 lines (26 loc) • 855 B
Markdown
A TypeScript/JavaScript client for Apache Arrow Flight and Flight SQL protocols.
```bash
npm install @firetiger-oss/flight-sql-client
```
```typescript
import { FlightSQLClient } from "@firetiger-oss/flight-sql-client";
const client = new FlightSQLClient({
  host: "localhost",
  port: 4317,
  plaintext: true,
  token: "your-bearer-token",
});
// This 'table' has type Arrow.dom.Table
// https://arrow.apache.org/js/current/classes/Arrow.dom.Table.html
const table = await client.executeQuery("SELECT count(*) AS n FROM logs");
// Use the 'toArray()' method to convert the table to an array of row objects, for example:
// [ {"n": 3} ]
console.log(table.toArray());
await client.close();
```
- `@grpc/grpc-js` - gRPC implementation
- `apache-arrow` - Arrow data format support