node package manager
Easy sharing. Manage teams and permissions with one click. Create a free org ยป

jiraiya

ORM

A prety small and transactional ORM for SQL

Build Status

EXAMPLES

Go to tests for now... too tired

API

// Constructor example from test folder
var Person = function() {
}
Person.table = "persons"
Person.fields = {
  name: types.String,
  age: types.Number
}

ORM methods

  • orm.test(function(err){})
  • orm.sync(function(err){})
  • orm.drop(function(err){})
  • orm.define(Constructor)
  • var s = orm.session(function(err){})

Session methods

  • s.save(object, function(err){})
  • s.find(Constructor, {where}, function(err, arr){})
  • s.delete(object, function(err){})
  • s.commit(function(err){})
  • s.rollback(function(err){})