npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@qualithm/arrow-flight-sql-js

v1.6.6

Published

Arrow Flight SQL client for JavaScript and TypeScript runtimes.

Readme

Arrow Flight SQL JS

CI codecov npm

Arrow Flight SQL client for JavaScript and TypeScript runtimes.

SQL-specific functionality on top of Arrow Flight for database interactions. Built on @qualithm/arrow-flight-js as a peer dependency.

Features

  • Full Arrow Flight SQL protocol support
  • Query execution with Apache Arrow result sets
  • Prepared statements with parameter binding
  • Transaction support (begin, commit, rollback)
  • Database metadata queries (catalogs, schemas, tables, keys)
  • Query cancellation
  • TypeScript-first with comprehensive type definitions
  • Cross-runtime: Bun, Node.js 20+, Deno
  • Streaming results with async iterables
  • Comprehensive error handling with typed error codes
  • ESM-only, tree-shakeable

Installation

npm install @qualithm/arrow-flight-sql-js @qualithm/arrow-flight-js apache-arrow
# or
bun add @qualithm/arrow-flight-sql-js @qualithm/arrow-flight-js apache-arrow

Note: @qualithm/arrow-flight-js is a peer dependency and must be installed separately.

Quick Start

import { createFlightSqlClient, queryToTable } from "@qualithm/arrow-flight-sql-js"

const client = await createFlightSqlClient({
  host: "localhost",
  port: 8815,
  tls: false
})

const table = await queryToTable(client, "SELECT * FROM users WHERE active = true")
console.log("Rows:", table.numRows)

for (const row of table) {
  console.log(JSON.stringify(row))
}

client.close()

See the examples directory for complete, runnable demonstrations.

Examples

| Example | Description | | ----------------------------------------------------------- | ---------------------------------------------- | | basic-query.ts | Simple query execution with queryToTable() | | authentication.ts | Basic auth, bearer tokens, connection patterns | | updates.ts | INSERT, UPDATE, DELETE operations | | streaming-results.ts | Process large datasets with iterateResults() | | prepared-statements.ts | Parameterised queries and updates | | transactions.ts | Atomic operations with commit/rollback | | metadata-queries.ts | Catalogs, schemas, tables, keys, SQL info | | cancellation.ts | Cancel long-running queries | | error-handling.ts | FlightSqlError and FlightError handling |

API Reference

Query Execution

| Method | Description | | ------------------------- | ----------------------------------- | | query() | Execute a SQL query, get FlightInfo | | executeUpdate() | Execute INSERT/UPDATE/DELETE | | executePreparedQuery() | Execute a prepared statement query | | executePreparedUpdate() | Execute a prepared statement update |

Prepared Statements

| Method | Description | | --------------------------- | -------------------------------------- | | createPreparedStatement() | Create a new prepared statement | | closePreparedStatement() | Close and release a prepared statement | | bindParameters() | Bind parameter values |

Transactions

| Method | Description | | -------------------- | --------------------------- | | beginTransaction() | Start a new transaction | | commit() | Commit a transaction | | rollback() | Roll back a transaction | | endTransaction() | End transaction (low-level) |

Metadata

| Method | Description | | --------------------- | ------------------------------------ | | getCatalogs() | List available catalogs | | getDbSchemas() | List database schemas | | getTables() | List tables with optional filtering | | getTableTypes() | List supported table types | | getPrimaryKeys() | Get primary key info for a table | | getExportedKeys() | Get foreign keys referencing a table | | getImportedKeys() | Get foreign keys from a table | | getCrossReference() | Get foreign keys between two tables | | getSqlInfo() | Get SQL dialect/server capabilities | | getXdbcTypeInfo() | Get supported data types |

Result Utilities

| Function | Description | | --------------------- | ------------------------------------- | | queryToTable() | Execute query, return Arrow Table | | flightInfoToTable() | Convert FlightInfo to Arrow Table | | ticketToTable() | Get single ticket data as Arrow Table | | iterateResults() | Stream results as async iterable |

Cancellation

| Method | Description | | -------------------- | ---------------------- | | cancelFlightInfo() | Cancel a running query |

Development

Prerequisites

  • Bun (recommended), Node.js 20+, or Deno

Setup

bun install

Building

bun run build

Testing

# Unit tests
bun test

# Integration tests (requires running Arrow Flight SQL server)
FLIGHT_HOST=localhost FLIGHT_PORT=50051 bun run test:integration

Benchmarks

# Requires running Arrow Flight SQL server
FLIGHT_HOST=localhost FLIGHT_PORT=50051 bun run bench

Linting & Formatting

bun run lint
bun run format
bun run typecheck

License

Apache-2.0