# Vincit/objection.js

An SQL-friendly ORM for Node.js

Repository: https://github.com/Vincit/objection.js
Canonical: https://ross.abutalabs.com/products/objectionjs
Homepage: https://vincit.github.io/objection.js
Language: JavaScript
License: MIT
License Family: permissive
Last push: 2026-06-23T09:32:24+00:00

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

## Adoption (not part of the score)
Stars 7342, forks 641 (observed 2026-08-28T04:09:58.352048+00:00)

## What it is
Objection.js is an SQL-friendly ORM for Node.js built on the knex query builder, best described as a relational query builder with powerful relation-handling tools. It supports SQLite3, Postgres, and MySQL, offering declarative models, eager loading, graph inserts/upserts, transactions, TypeScript support, and optional JSON schema validation.

## Use cases
- define models and relationships for a SQL database in Node.js
- build type-safe SQL queries with a query builder instead of raw SQL
- eager load related rows and insert or upsert object graphs
- run database transactions easily in a Node.js app
- validate model data with JSON schema
- store complex JSON documents as single rows in a relational database

## When to choose
- you want full SQL power with a friendly Node.js API on Postgres, MySQL, or SQLite
- you already use knex and want relation handling on top
- you prefer working with queries over a heavy object-oriented entity layer
- you want official TypeScript support and optional validation

## When to avoid
- you need automatic schema creation and migrations from model definitions
- you want a fully object-oriented entity/active-record style ORM
- you use a database not supported by knex
- you need a custom query DSL instead of SQL-based querying

## Facets
- artifact type: library
- maturity: stable
- function: orm, database, database-driver, serialization, error-handling
- domain: databases, backend, web-development, developer-tools
- platform: -
- tags: sql, query-builder, knex, relational-databases, postgres, mysql, sqlite, eager-loading, transactions, json-schema-validation, nodejs, javascript, typescript

## Member repositories
- Vincit/objection.js (main) score 72

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:58.352048+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:38:27.449398+00:00, confidence not recorded.
  - readme: https://github.com/Vincit/objection.js (fetched 2026-08-28T04:09:58.352048+00:00, sha b0efd310c881)
  - homepage: https://vincit.github.io/objection.js (fetched 2026-08-29T08:34:04.711207+00:00, sha a8a03c033e3b)
- Data as of 2026-08-30T08:39:29.467469+00:00.
