awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
bookshelf avatar

bookshelf/bookshelf

0
View on GitHub↗
6,352 stars·575 forks·JavaScript·MIT·22 viewsbookshelfjs.org↗

Bookshelf

Bookshelf is a JavaScript ORM for Node.js that provides a structured way to define and interact with database models. It centers on a model-driven approach where developers register models, define their relations, and manage data persistence through a consistent interface.

The library distinguishes itself through its comprehensive handling of model relationships and data transformations. It supports defining one-to-one, one-to-many, many-to-many, and polymorphic associations, with the ability to eager load related models in a single query to avoid performance pitfalls. Bookshelf also automates common data tasks such as converting between snake_case database columns and camelCase model properties, generating UUIDs for new records, parsing and stringifying JSON columns, and applying custom value transformations on assignment.

For data lifecycle management, Bookshelf offers soft deletion to preserve records for recovery, cascade deletion of related models, row-level locking during transactional fetches, and event hooks that fire on create, update, and delete operations. It wraps multiple database operations in transactions that commit or roll back as a single unit, and includes a plugin system for extending functionality. Debug logging of SQL statements is available for development, and password hashing with bcrypt can be integrated directly into model lifecycle hooks.

Features

  • Database Transactions - Wraps multiple queries in a transaction that commits on success or rolls back on failure.
  • Model Registries - Registers models by name so they can be referenced as strings in relations and retrieved later.
  • Eager Loading - Fetches related models in a single query to prevent N+1 query problems.
  • Polymorphic Relations - Defines one-to-one, one-to-many, many-to-many, and polymorphic database associations.
  • Case-Conversion Mappings - Automatically translates between snake_case database columns and camelCase model properties.
  • Data Format Transformations - Parses and formats attribute values when reading from or writing to the database for data normalization.
  • Cascade Deletions - Automatically removes associated records when a parent model is destroyed.
  • Property Value Transformers - Applies custom processor functions to transform values whenever assigned to a model property.
  • Soft Deletion - Marks records as deleted instead of removing them permanently, preserving data for recovery or auditing.
  • Database Column Serialization - Handles serialization and deserialization of JSON data stored in database columns without manual hooks.
  • Bcrypt Implementations - Integrates bcrypt password hashing directly into model lifecycle hooks for secure credential storage.
  • Computed Properties - Defines computed properties on models that behave like regular attributes without database persistence.
  • Plugin Loaders - Ships a plugin system that loads third-party or custom extensions by name, function, or array.
  • Direct Database Debugging - Logs all SQL statements executed by the ORM when debug mode is enabled.
  • Model - Automatically assigns a unique identifier to each model instance on creation.
  • Model Lifecycle Hooks - Hooks into lifecycle events on models to execute custom logic when records are created, updated, or deleted.
  • Databases - Backbone.js-style ORM for SQL databases.
  • Object Relational Mappers - ORM for PostgreSQL, MySQL, and SQLite.

Star history

Star history chart for bookshelf/bookshelfStar history chart for bookshelf/bookshelf

How this analysis was created: This summary and feature list are AI-generated from collected project material and can contain mistakes. Stars, license and language are imported from GitHub. Inclusion does not mean that we have tested or audited this project. Check the source documentation for any feature you depend on. Learn more on our About page.

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Projects sharing features with Bookshelf

These projects share indexed features with Bookshelf. Shared tags can include platform or build tooling; verify the primary use case before treating a result as a replacement.
  • vincit/objection.jsVincit avatar

    Vincit/objection.js

    7,343View on GitHub↗

    Objection.js is an object-relational mapper for Node.js that maps SQL database tables to classes and rows to model instances. It functions as a high-level abstraction layer built on top of the Knex.js query builder to provide structured model definitions and relational data mapping. The project distinguishes itself through its ability to manage complex object graphs, allowing for the persistence and eager-loading of deeply nested related data in single operations. It incorporates a data integrity layer that uses JSON schema validation to verify model instances before they are persisted to the

    JavaScript
    View on GitHub↗7,343
  • go-pg/pggo-pg avatar

    go-pg/pg

    5,785View on GitHub↗

    pg is a PostgreSQL object-relational mapper (ORM) for Go that maps Go structs to database tables and provides a fluent query builder for constructing SQL statements programmatically. At its core, it automatically generates CREATE TABLE statements from Go struct definitions using struct tags and naming conventions, and builds queries through method chaining with placeholder-based parameter binding to prevent SQL injection. The library distinguishes itself through relation-aware join generation that automatically constructs JOIN clauses for has-one, has-many, many-to-many, and polymorphic assoc

    Go
    View on GitHub↗5,785
  • sequelize/sequelizesequelize avatar

    sequelize/sequelize

    30,349View on GitHub↗

    Sequelize is an object-relational mapping library that provides a unified interface for managing relational data through code. By implementing the Active Record pattern, it maps database tables to application objects, allowing developers to perform standard create, read, update, and delete operations using high-level method calls. The library abstracts complex database interactions by translating these calls into optimized, engine-specific SQL statements, ensuring consistent behavior across different database systems. The project distinguishes itself through a comprehensive suite of tools for

    TypeScriptdb2-ibm-ifeature-richjavascript
    View on GitHub↗30,349
  • dotnet/efcoredotnet avatar

    dotnet/efcore

    14,587View on GitHub↗

    Entity Framework Core is an object-relational mapper that enables developers to interact with database systems using strongly-typed code. It serves as a comprehensive data access framework, providing a unified interface for mapping application objects to relational and non-relational database schemas while managing the lifecycle of data operations through a central context. The project distinguishes itself through a provider-based architecture that decouples core data access logic from specific database engines, allowing for consistent interaction across diverse storage systems. It features a

    C#aspnet-productc-sharpdatabase
    View on GitHub↗14,587
Compare all 30 related projects→

Frequently asked questions

What does bookshelf/bookshelf do?

Bookshelf is a JavaScript ORM for Node.js that provides a structured way to define and interact with database models. It centers on a model-driven approach where developers register models, define their relations, and manage data persistence through a consistent interface.

What are the main features of bookshelf/bookshelf?

The main features of bookshelf/bookshelf are: Database Transactions, Model Registries, Eager Loading, Polymorphic Relations, Case-Conversion Mappings, Data Format Transformations, Cascade Deletions, Property Value Transformers.

Which projects share features with bookshelf/bookshelf?

Projects with overlapping indexed features include: vincit/objection.js — Objection.js is an object-relational mapper for Node.js that maps SQL database tables to classes and rows to model… go-pg/pg — pg is a PostgreSQL object-relational mapper (ORM) for Go that maps Go structs to database tables and provides a fluent… sequelize/sequelize — Sequelize is an object-relational mapping library that provides a unified interface for managing relational data… dotnet/efcore — Entity Framework Core is an object-relational mapper that enables developers to interact with database systems using… typeorm/typeorm — TypeORM is an object-relational mapper for TypeScript and JavaScript that bridges the gap between object-oriented… jeremyevans/sequel — Sequel is a relational database toolkit for Ruby that provides object-relational mapping, a fluent SQL query builder,…