# bookshelf/bookshelf

A simple Node.js ORM for PostgreSQL, MySQL and SQLite3 built on top of Knex.js

Repository: https://github.com/bookshelf/bookshelf
Canonical: https://ross.abutalabs.com/products/bookshelf
Homepage: http://bookshelfjs.org
Language: JavaScript
License: MIT
License Family: permissive
Topics: bookshelf, javascript, database, mysql, postgresql, sqlite, nodejs, orm
Last push: 2024-08-10T14:12:20+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 4928, "days_push": 753, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 6347, forks 574 (observed 2026-08-28T04:09:42.716774+00:00)

## What it is
Bookshelf is a lightweight JavaScript ORM for Node.js built on top of the Knex SQL query builder. It supports PostgreSQL, MySQL, and SQLite3 with promise-based APIs, transactions, eager relation loading, and polymorphic associations.

## Use cases
- map JavaScript models to relational database tables in Node.js
- define one-to-one, one-to-many, and many-to-many relations between models
- run database transactions with rollback support
- eagerly load nested relations to avoid N+1 queries
- drop down to raw Knex queries for custom SQL
- work with PostgreSQL, MySQL, or SQLite from the same ORM API

## When to choose
- you want a lean, simple ORM on top of Knex for Node.js
- you need flexible relation loading and polymorphic associations
- you want the ability to escape to raw SQL via Knex when needed

## When to avoid
- you need a modern, actively evolving ORM with first-class TypeScript support
- you use databases other than PostgreSQL, MySQL, or SQLite3
- you prefer newer alternatives like Prisma, TypeORM, or Drizzle

## Facets
- artifact type: library
- maturity: maintenance
- function: orm, database-driver, database
- domain: databases, backend, web-development, developer-tools
- platform: -
- tags: knex, sql, postgresql, mysql, sqlite, data-mapper, active-record, query-builder, nodejs, javascript

## Member repositories
- bookshelf/bookshelf (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:42.716774+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:46:07.386062+00:00, confidence not recorded.
  - readme: https://github.com/bookshelf/bookshelf (fetched 2026-08-28T04:09:42.716774+00:00, sha f526db6b9b3f)
  - homepage: http://bookshelfjs.org (fetched 2026-08-29T08:42:40.426718+00:00, sha f6882f8d31ec)
  - registry_npm: https://registry.npmjs.org/bookshelf (fetched 2026-08-29T08:42:40.428601+00:00, sha 6a2b6ba45228)
- Data as of 2026-08-30T08:39:29.467469+00:00.
