Skip to content
an orm that does 80% of the work and gets out of the way for the remaining 20%
JavaScript
Find file
Latest commit 8a01e67 @chrisdickinson 2.0.2
Failed to load latest commit information.
docs fix typo
lib fix count + order queries
test add filter + count test
.gitignore further tests
.travis.yml travis: npm ls
README.md nix useless TOC link
package.json 2.0.2

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')
const extend = require('xtend')

class Package {
  constructor (opts) {
    extend(this, opts)
  }
}

class Author {
  constructor (opts) {
    extend(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

Something went wrong with that request. Please try again.