reheat

A red hot Node.js ORM for RethinkDB.

npm install reheat
42 downloads in the last week
106 downloads in the last month

reheat

Current Version: 1.0.0-beta.5

A red hot Node.js ORM for RethinkDB.

This is beta software! API may fluctuate before 1.0.0.

You can use it, but be prepared to keep a close eye on the changelog.

All documentation can be found at http://reheat.codetrain.io/.

What is reheat?

Reheat is an ORM for RethinkDB, built for the Node.js platform.

Benefits of using reheat:

  • Less code to write
  • Less code to test
  • Less code to maintain
  • Less code that can break
  • Improved sense of well-being

Features:

  • Connection pool
  • Easy Model lifecycle setup/access (beforeUpdate(), afterDestroy(), etc.)
  • Robust and flexible Schema definition for your Models
  • Automatic validation based on Schema
  • Convert req.query to ReQL query (great for your app's API).
  • Query builder (it's just ReQL, easy!)
  • Connection and Schema can each be used on their own
  • Relationships/Associations

Roadmap:

  • Transactions (and rollbacks)
  • Migrations
  • You tell me!

Quick, what is RethinkDB?

From the RethinkDB website:

An open-source distributed database built with love.

Enjoy an intuitive query language, automatically parallelized queries, and simple administration.

Table joins and batteries included.

RethinkDB is awesome and ReQL makes data access fun, but still, who loves writing tons of code to pull data into and out of a database? Reheat exists to eliminate boilerplate and level up your RethinkDB experience!

Install reheat

npm install reheat --save

Go!
var reheat = require('reheat');

var connection = new reheat.Connection({
    db: 'local'
});

var Post = reheat.Model.extend({
    tableName: 'post',
    connection: connection
}, {
       beforeCreate: function (cb) {
           this.setSync('tags', []);
           cb();
       }
});

var post = new Post({
    author: 'Jason Dobry',
    title: 'How to reheat your app'
});

post.isNew(); // true

post.save(function (err, post) {
    post.toJSON();  //  {
                    //      id: '1c83229b-1628-4098-a618-abc05af1ebdb',
                    //      author: 'Jason Dobry',
                    //      title: 'How to reheat your app',
                    //      tags: []
                    //  }

    post.isNew();   //  false
});

Resources

Getting Started

Getting Started - Read how to install reheat and get it running in your application.

Guide

Guide - List of tutorials on how to use reheat.

API

API - Reference API documentation for reheat.

Community

Mailing List - Ask questions and get help.

Issues - Found a bug? Feature request? Submit an issue!

GitHub - View the source code for reheat.

Project Status

Branch Master
Version NPM version
Source master
Build Status Build Status
Code Climate Code Climate
Dependency Status Dependency Status
Coverage Coverage Status

License

MIT License

Copyright (C) 2013-2014 Jason Dobry

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

npm loves you