An ORM for Backbone-Relational.
Want to see pretty graphs? Log in now!
npm install backbone-relational-mapper
|22||downloads in the last week|
|44||downloads in the last month|
|Last Published By|
|Version||0.0.12 last updated a year ago|
|Keywords||backbone, orm, sql, postgres, pg|
|Dependencies||coffee-script, amd-loader, backbone-relational, inflection|
This module is absolutely not ready for any usage, as it is in very early development. Pull requests are welcome, but be aware that everything may change very fast; your relevant pull request today may not be relevant tomorrow.
npm install backbone-relational-mapper should do the trick. Open an issue if it doesn't.
You also need a database driver:
npm install pg (the only supported database is Postgres at the moment).
First you need to configure your database connection:
Backbone.DB.connect dialect: 'postgres' host: 'localhost' database: 'my_database' user: 'my_user' password: 'my_password'
You should only need to do this once; it should persist across calls to
Then, you should define your models as you would do in Backbone-Relational, with an added
class SomeModel extends Backbone.RelationalModel fields: some_text_field: 'TEXT'