• Lots of examples with NoSQL • Touted as great for: streaming, realtime applications, with buffers and websockets... • Not so much for model heavy applications as you’d see in Rails, Django, Laravel, $insert_language_framework_here
conventions for RESTful data syncing • Flexible, easily extended, literate codebase • Lightweight, doesn’t add features without a number of solid real world use cases • For the 90% use cases
• joins, where, having, union, aggregates, insert, update, delete, group by, order by, etc. • Builds the foundation of the Bookshelf.js • knex.raw(/* for very custom queries */)
database structure • Maintains consistency between datatypes in different query dialects • Eventually will be used with migrations (almost there) to keep things versioned as the database changes
selected through another model • Example, a “doctor” hasMany “appointments”, and an appointment hasOne “patient” • doctor.hasMany(Patients).through(Appointment)
• If something goes wrong, all of these queries are rolled back to their original state • One of the key features of relational db’s • Also, surprisingly absent from all Node ORM’s and query builders
pass the same connection along to each query • In Bookshelf, each async call (fetch, save, create, load, destroy), takes an “options” object which may optionally take a {transacting: t} - where “t” is the object in the transaction closure
the whole documentation, even worse if I wrote out code for all of it... • lots of relation types • transactions • connection pooling • well documented, decently tested • syntax & conventions from Backbone.js
implementers. A promise represents the eventual result of an asynchronous operation. The primary way of interacting with a promise is through its then method, which registers callbacks to receive either a promise’s eventual value or the reason why the promise cannot be fulfilled.
aren’t about a better syntax than callbacks • Promises are about error handling and making async code look synchronous • https://github.com/petkaantonov/ bluebird#what-are-promises-and-why- should-i-use-them
been able to get this working successfully in some of my projects • AMD + Shimming bookshelf in the Require.js config allows makes sharing code possible • Useful in cases where you have business- logic methods on your model or collection that are needed on both the client and server (validation, etc.)