Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including proactive-record with all npm packages installed. Try it out:

var proactiveRecord = require("proactive-record")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

proactive-record v0.0.7

An ORM that defines your database models for you.

proactive-record - Beyond Active Record

An ORM that defines your database models for you.



  • Works in node.js
  • Supports PostgreSQL
  • Extensible



Install using npm: npm install proactive-record


Assume you have a table with the following schema:

                                  Table "public.person"
  Column  |          Type          |                      Modifiers                      
 id       | integer                | not null default nextval('person_id_seq'::regclass)
 name     | character varying(255) | not null
 username | character varying(255) | not null
 email    | character varying(255) | not null
    "person_pkey" PRIMARY KEY, btree (id)


var Proactive = require('proactive-record');

Proactive.load('person', function(Person) {
    var p = new Person({
        name: 'Brian Moore',
        username: 'bmoore',
        email: ''

    Person.find({name: "Brian Moore"}, function(p) {
        // { name: 'Brian Moore',
        //   username: 'bmoore',
        //   email: ''}

Finder Methods

  • Model.find(finder)
  • finder can be:
  • integer,
  • array of integers,
  • {column: value} objects
  • Model.all() // TBD
  • Model.exists(field, value) // TBD

Other Methods

  • .save() // Create and Update
  • .delete() // Remove Record
  • .children('address', function(addresses){}) // Access Child Table Records
  • .parent('company', function(company){}) // Access Parent Table Record
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free