# joist-knex

Latest version **2.5.0** (published 2026-11-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install joist-knex
pnpm add joist-knex
yarn add joist-knex
bun add joist-knex
```

## Health

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

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.5.0 |
| Published | 2026-11-02 |
| First published | 2025-02-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 46 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 384 |
| Maintainers | shaberman |

## Links

- npm: https://www.npmjs.com/package/joist-knex
- Repository: https://github.com/joist-orm/joist-orm
- npm.io page: https://npm.io/package/joist-knex

## Recent versions

- 2.5.0 (latest) — 2026-11-02
- 2.5.0-next.30 (next) — 2026-11-21
- 2.5.0-next.29 — 2026-11-21
- 2.5.0-next.28 — 2026-11-21
- 2.5.0-next.27 — 2026-11-20
- 2.5.0-next.26 — 2026-11-20
- 2.5.0-next.25 — 2026-11-20
- 2.5.0-next.24 — 2026-11-19
- 2.5.0-next.23 — 2026-11-16
- 2.5.0-next.22 — 2026-11-15
- 2.5.0-next.21 — 2026-11-14
- 2.5.0-next.20 — 2026-11-14
- 2.5.0-next.19 — 2026-11-14
- 2.5.0-next.18 — 2026-11-14
- 2.5.0-next.17 — 2026-11-14
- … 527 more at https://npm.io/package/joist-knex/versions

## README

# joist-knex

`joist-knex` provides a `buildQuery` function that takes `em.find`-style input and returns a Knex `QueryBuilder`.

This is useful for creating the "last 5%" of queries that need SQL features that `em.find` doesn't support, i.e. primarily aggregation, but also more complicated joins, query conditions, etc.

Knex itself is well-suited to this task, because it has structured methods like `clearOrder`, `select`, etc. to help munge the initial `buildQuery`-created query into the custom query, without tedious string parsing.

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