an orm that does 80% of the work and gets out of the way for the remaining 20%
JavaScript
Latest commit 116c774 Oct 29, 2016 @chrisdickinson 2.7.0
Permalink
Failed to load latest commit information.
docs feat: add distinct(expr) Oct 11, 2016
lib update deps, fix bug in Conflict error Oct 26, 2016
test update deps, fix bug in Conflict error Oct 26, 2016
.gitignore
.travis.yml travis: npm ls Nov 2, 2015
README.md doc: use O.assign (vs. xtend) for examples (thanks @seldo!) May 23, 2016
package.json 2.7.0 Oct 29, 2016

README.md

ormnomnom

ORMnomnom is yet another Node ORM. It is specifically for use with postgres (via pg), exposes single-async-events as bluebird promises, and exposes async-iterables as streams. It requires a modern version of Node (v4+).

const orm = require('ormnomnom')

class Package {
  constructor (opts) {
    Object.assign(this, opts)
  }
}

class Author {
  constructor (opts) {
    Object.assign(this, opts)
  }
}

const PackageObjects = orm(Package, {
  id: orm.joi.number(),
  name: orm.joi.string().lowercase().required(),
  author: orm.fk(Author)
})

const AuthorObjects = orm(Author, {
  id: orm.joi.number(),
  name: orm.joi.string().lowercase().required(),
  email: orm.joi.string().email().required()
})

PackageObjects.filter({'author.name:startsWith': 'Gary'}).then(objects => {
  // list of objects
})

Documentation

License

MIT