Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chrisdickinson/ormnomnom
an orm that does 80% of the work and gets out of the way for the remaining 20%
https://github.com/chrisdickinson/ormnomnom
Last synced: 20 days ago
JSON representation
an orm that does 80% of the work and gets out of the way for the remaining 20%
- Host: GitHub
- URL: https://github.com/chrisdickinson/ormnomnom
- Owner: chrisdickinson
- Created: 2011-01-18T05:01:49.000Z (almost 14 years ago)
- Default Branch: main
- Last Pushed: 2023-03-07T17:14:49.000Z (almost 2 years ago)
- Last Synced: 2024-04-13T22:25:16.502Z (8 months ago)
- Language: JavaScript
- Homepage:
- Size: 1.11 MB
- Stars: 169
- Watchers: 7
- Forks: 24
- Open Issues: 25
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# ormnomnom
ORMnomnom is yet another Node ORM. It is specifically for use with postgres
(via [pg](http://npm.im/pg)), exposes single-async-events as
[bluebird](http://npm.im/bluebird) promises, and exposes async-iterables as
[streams](http://nodejs.org/api/stream.html). It requires a modern version of
Node (v4+).```javascript
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: { type: 'integer' },
name: { type: 'string', pattern: '^[a-z0-9]$'},
author: orm.fk(Author)
})const AuthorObjects = orm(Author, {
id: { type: 'integer' },
name: { type: 'string', pattern: '^[a-z0-9]$'},
email: { type: 'string', format: 'email'}
})PackageObjects.filter({'author.name:startsWith': 'Gary'}).then(objects => {
// list of objects
})
```## Documentation
* **Introduction**
* [Getting Started with ORMnomnom](docs/getting-started.md)
* [Building models](docs/building-models.md)
* [Making queries](docs/making-queries.md)
* [Decorators](docs/decorators.md)
* **Reference documentation**
* [Data access objects](docs/ref/dao.md)
* [QuerySets](docs/ref/queryset.md)
* [Clauses](docs/ref/queryset.md#clauses)## License
MIT