Skip to content


Subversion checkout URL

You can clone with
Download ZIP
branch: master
Commits on Jun 15, 2012
  1. Fixes helpers.buildSqlOrder when order fields are not trimmed

    This was found by the unit tests
  2. Adds mocha unit tests to database helpers and validators

    This is still an early stage, still need a lot of tests.
    To run them:
    npm install -g mocha
    cd /path/to/orm
    mocha -R spec
Commits on Jun 14, 2012
  1. Updates LICENSE to include 2012 year

    Comes a bit late but who cares..
  2. Merge pull request #63 from emilecantin/master

    Updated to clarify what sync() does at the moment.
  3. @emilecantin
Commits on Jun 4, 2012
  1. Adds moment dependency, handles Dates onSave better (fixing #52)

    Adds moment dependency to try to better handle Dates. In the future, dates can have timezone shifting automatically when saving/fetching to/from database.
    Dates were converted from "0000-00-00" to null when invalid.
  2. Lints orm base code

  3. Lints on associations module

  4. Updates many associations by improving speed (using JOIN queries)

    It also adds an option to .hasMany().
    Album = ...
    Artist = ...
    Artist.hasMany("albums", Album, "artist", { link: Artist });
    The 'link' option will create a method on Album called .getArtist() that will retrieve the Artist from an Album.
Commits on Jun 1, 2012
  1. Changes mysql database driver to support JOINs (simple JOINs for now).

    Updates ORM to support finding Model records from a hasMany child (fixes #49).
    Person.hasMany("pets", Pet, "pet"); // <-- 'pet' is the key to use in Person.find()
    Pet.get(1, function (Deco) {
    	Person.find({ pet: Deco }, function (DecoOwners) {
    		// ...
  2. Use the new mysql createClient() method.

    Better check if mysql is really connected by issuing a SHOW STATUS and waiting 3 sec. max (trying to fix #59)
Commits on May 31, 2012
  1. Fix conditions when using a one association.

    This changes condition keys from 'association' to 'association_id' when
    there is a one association with that key.
  2. Enable adding Model associations directly on Model definition.

    var Product = db.define("product", {
    var Sale = db.define("sale", {
        product: Product,
    That property is the same as doing this association:
    Sale.hasOne("product", Product);
Commits on May 20, 2012
  1. Merge pull request #57 from migerh/tablename

    moved replace %table in query
  2. @migerh

    moved replace %table in query

    migerh authored
Commits on Apr 30, 2012
  1. Adds allowNull and fixes default model property parameters

    "default" option was in conflict with "not null". If a default parameter would be set, "not null" was not defined.
    "allowNull" (if defined and true) will not set "not null", otherwise "not null" will always be set (no matter if "default" is set or not)
  2. Adds opts to .sync() (hoping to fix #51)

    This opts will be passed directly to .createCollection(). Every database engine can use this to adjust the creation of the table(s) using a different encoding or engine (in the mysql case).
  3. Merge pull request #50 from shellka/master

    Like operator for postgresql
Commits on Apr 16, 2012
  1. @shellka
Commits on Apr 2, 2012
  1. Update npm version

  2. Change to fix bad this usage (hope it fixes #43)

    - Call beforeSave(self) instead of beforeSave(this)
  3. Linted orm.js

Commits on Feb 28, 2012
  1. Change validations to be able to also define them per property.

    The previous behavior is still available, the validators can be
    placed in the options of the Model.
    The new behavior allows one to add validators to a property inline.
    You can add only 1 validator (function) or an Array of validators.
    var Person = db.define("person", {
    	"age": { type: "int", validators: ... }
Something went wrong with that request. Please try again.