JSPM

@ceramic-sdk/flight-sql-client

0.12.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 104
  • Score
    100M100P100Q82390F
  • License MIT

A FlightSQL client. Currently only supports Node.js

Package Exports

  • @ceramic-sdk/flight-sql-client
  • @ceramic-sdk/flight-sql-client/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@ceramic-sdk/flight-sql-client) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@ceramic-sdk/flight-sql-client

A client library for interacting with Arrow Flight SQL enabled databases from Node.js.

This library provides a thin wrapper around the flight-sql client implementation in the arrow-flight crate. Node bindings are created with the help of napi-rs. Originally forked from lakehouse-rs npm and github.

Usage

Install library

yarn add @ceramic-sdk/flight-sql-client
# or
npm install @ceramic-sdk/flight-sql-client
# or
pnpm add @ceramic-sdk/flight-sql-client

Create a new client instance

import { ClientOptions, createFlightSqlClient } from '@ceramic-sdk/flight-sql-client';
import { tableFromIPC } from 'apache-arrow';

const options: ClientOptions = {
  username: undefined,
  password: undefined,
  tls: false,
  host: '127.0.0.1',
  port: 5102,
  headers: [],
};

const client = await createFlightSqlClient(options);

Execute a query against the service

const buffer = await client.query('SELECT * FROM my_tyble');
const table = tableFromIPC(buffer);

Or inspect some server metadata

const buffer = await client.getTables({ includeSchema: true });
const table = tableFromIPC(buffer);

Development

Requirements:

  • Rust
  • node.js >= 18
  • Pnpm

Install dependencies via

pnpm i

Build native module

pnpm build

Run tests

pnpm test

Release

TODO