Need advice about which tool to choose?Ask the StackShare community!
Doctrine 2 vs Bookshelf.js: What are the differences?
Developers describe Doctrine 2 as "An object-relational mapper (ORM) for PHP 5.3.2+ that provides transparent persistence for PHP objects". Doctrine 2 sits on top of a powerful database abstraction layer (DBAL). One of its key features is the option to write database queries in a proprietary object oriented SQL dialect called Doctrine Query Language (DQL), inspired by Hibernates HQL. On the other hand, Bookshelf.js is detailed as "Aims to provide a simple library for common tasks when querying databases in JavaScript". It stems from the Knex.js, which is a flexible query builder that works with PostgreSQL, MySQL and SQLite3. Bookshelf.js builds on top of this by providing functionality for creating data models, forming relations between these models, and other common tasks needed when querying a database.
Doctrine 2 and Bookshelf.js can be primarily classified as "Object Relational Mapper (ORM)" tools.
Pros of Bookshelf.js
- Uses both promises and callback methods3
Pros of Doctrine 2
- Great abstraction, easy to use, good docs14
- Object-Oriented10
- Easy setup7