# @quillsql/node

> Quill Server SDK for Node.js

Latest version **0.9.26** (published 2026-09-02) · ISC license · 0 weekly downloads

## Install

```sh
npm install @quillsql/node
pnpm add @quillsql/node
yarn add @quillsql/node
bun add @quillsql/node
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.9.26 |
| Published | 2026-09-02 |
| First published | 2023-07-18 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 11 |
| Unpacked size | 832.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | lagambino |
| Maintainers | shawnm1 |

## Links

- npm: https://www.npmjs.com/package/@quillsql/node
- npm.io page: https://npm.io/package/@quillsql/node

## Dependencies (11)

- [pg](https://npm.io/package/pg.md) ^8.11.3
- [axios](https://npm.io/package/axios.md) ^1.6.5
- [mssql](https://npm.io/package/mssql.md) ^11.0.1
- [redis](https://npm.io/package/redis.md) ^4.6.12
- [dotenv](https://npm.io/package/dotenv.md) ^16.3.1
- [mysql2](https://npm.io/package/mysql2.md) ^3.9.1
- [ts-jest](https://npm.io/package/ts-jest.md) ^29.1.1
- [snowflake-sdk](https://npm.io/package/snowflake-sdk.md) ^2.1.0
- [@databricks/sql](https://npm.io/package/@databricks/sql.md) 1.7.1
- [@clickhouse/client](https://npm.io/package/@clickhouse/client.md) ^1.9.0
- [@google-cloud/bigquery](https://npm.io/package/@google-cloud/bigquery.md) ^7.4.0

## Recent versions

- 0.9.26 (latest) — 2026-09-02
- 0.9.25 — 2026-08-18
- 0.9.24 — 2026-07-28
- 0.9.23 — 2026-07-07
- 0.9.22 — 2026-07-07
- 0.9.21 — 2026-07-01
- 0.9.20 — 2026-06-15
- 0.9.19 — 2026-04-13
- 0.9.18 — 2026-04-08
- 0.9.17 — 2026-02-18
- 0.9.16 — 2026-02-18
- 0.9.15 — 2026-02-18
- 0.9.14 — 2026-02-16
- 0.9.13 — 2026-02-13
- 0.9.12 — 2026-01-28
- … 99 more at https://npm.io/package/@quillsql/node/versions

## README

# Quill Node SDK

## Installation

```shell
$ npm install @quillsql/node

# Or, if you prefer yarn
$ yarn add @quillsql/node
```

## Usage

Instantiate quill with your credentials and add the below POST endpoint.

Note that we assume you have an organization id on the user returned by your auth middleware. Queries will not work properly without the organization id.

```js
const quill = require("@quillsql/node")({
  privateKey: process.env.QULL_PRIVATE_KEY,
  databaseConnectionString: process.env.POSTGRES_READ,
});

// "authenticateJWT" is your own pre-existing auth middleware
app.post("/quill", authenticateJWT, async (req, res) => {
  // assuming user fetched via auth middleware has an organizationId
  const { organizationId } = req.user;
  const { metadata } = req.body;
  const result = await quill.query({
    tenants: [{ tenantField: "organization_id", tenantIds: [organizationId] }],
    metadata,
  });
  res.send(result);
});
```

## Streaming

```js
const quill = require("@quillsql/node")({
  privateKey: process.env.QULL_PRIVATE_KEY,
  databaseConnectionString: process.env.POSTGRES_READ,
});

app.use(express.json());

app.post("/quillStream", authenticateJWT, async (req, res) => {
  // assuming user fetched via auth middleware has an organizationId
  const { organizationId } = req.user;
  const { metadata } = req.body;

  res.setHeader("Content-Type", "text/event-stream");
  res.setHeader("Cache-Control", "no-cache");
  res.setHeader("Connection", "keep-alive");

  try {
    const stream = await quill.stream({
      tenants: [
        { tenantField: "organization_id", tenantIds: [organizationId] },
      ],
      metadata,
    });

    for await (const event of stream) {
      if (event.type === "start") {
        // pass
      } else if (event.type === "text-delta") {
        res.write(`data: ${JSON.stringify(event.delta)}\n\n`);
      } else if (event.type === "error") {
        res.write(`data: ${JSON.stringify({ error: event.errorText })}\n\n`);
      } else if (event.type === "finish") {
        res.write("data: [DONE]\n\n");
        res.end();
      }
    }
  } catch (err) {
    console.log("error in stream", err)
    res.write(`data: ${JSON.stringify({ error: err })}\n\n`);
  }
});
```

## For local testing (dev purposes only)

Create an .env file with the following key-value pairs:

```
QUILL_PRIVATE_KEY=
DB_URL=
ENV=development
BACKEND_URL=
```

Use the following commands to start a locally hosted dev server.

```
npm install
npm run dev-server
```

You should be able to ping your local server at `http://localhost:3000`.

---
_Source: https://npm.io/package/@quillsql/node · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
