NoBrainer

A Ruby ORM for RethinkDB

Introduction

NoBrainer is an ORM for RethinkDB. The goal of NoBrainer is to provide a similar interface compared to ActiveRecord and Mongoid to build data models on top of RethinkDB while providing precise semantics. Nevertheless, NoBrainer breaks a couple of established patterns to provide a consistent API. You may read more about these differences in the next section.

NoBrainer was created by Nicolas Viennot and is maintained by Guillaume Hain.

Dependencies

NoBrainer depends on a couple of things:

  • The RethinkDB database.
  • NoBrainer runs on Ruby MRI 2.x.
  • NoBrainer does not depend on Rails, but plays nicely with Rails 4 and Rails 5.
  • NoBrainer depends on the rethinkdb, activemodel, activesupport, middleware gems. These dependencies are automatically pulled in when you install the nobrainer gem.

Roadmap & Changelog

Latest gem version: 0.42.0 – Jun. 15, 2022.

master branch: master branch build status

Follow the Roadmap and read the Changelog.

Quick Start

The following assume you are using a Rails application, and that you are running a RethinkDB instance locally.


To install NoBrainer, add the nobrainer gem in your Gemfile and bundle install:

# Gemfile
gem 'nobrainer'

When using NoBrainer with Rails, NoBrainer comes with a set of default settings that allow you to start using NoBrainer right away without making any further configuration or database migrations.


Declare a model in app/models/user.rb:

class User
  include NoBrainer::Document
  field :name
  field :email
end

In a Rails console, you can create models which will be persisted to the database:

User.create(:name => 'Nico', :email => 'nicolas@viennot.biz')
User.count # returns 1

A Rails application example using NoBrainer can be found here.