Permalink
Switch branches/tags
Nothing to show
Commits on Feb 5, 2012
  1. Added new line character to file

    Michael Yagudaev committed Feb 5, 2012
  2. Boolean must be passed as either the word TRUE/FALSE to postgres or '…

    Michael Yagudaev committed Feb 5, 2012
    …0', '1' or 'TRUE'/'FALSE' but cannot be the integer 0 and 1. Passing 0 and 1 causes Postgres to return an error, preventing the record from being updated/inserted.
Commits on Jan 19, 2012
Commits on Jan 16, 2012
  1. Change postgres example to a more simple one.

    dresende committed Jan 16, 2012
    Fix postgres escaping by using native module escapes just like previously
    done on insertRecords(). This should fix #28
Commits on Jan 10, 2012
Commits on Jan 9, 2012
  1. Add database-alias.js to set some common alias to some database proto…

    dresende committed Jan 9, 2012
    …cols.
    
    For now, this file has only 2 alias:
    
    "pg" -> "postgresql"
    "postgres" -> "postgresql"
  2. Try to fix postgresql escaping similar to mysql escaping.

    dresende committed Jan 9, 2012
    The difference is node-mysql uses "?" as escape value dropin and
    node-postgres uses "$1", "$2", etc.. An advantage is the it seems
    it escapes dates directly.
  3. Merge pull request #25 from willow/master

    dresende committed Jan 9, 2012
    Check if a property is string-type before validating it in the predefined pattern matching validator
  4. Check if a property is string-type before validating it in the predef…

    chengyin committed Jan 9, 2012
    …ined pattern matching validator.
Commits on Jan 3, 2012
  1. Change orm.connect() to support arguments in any order.

    dresende committed Jan 3, 2012
    It will check for arguments type. Callback is no longer mandatory.
  2. Change .hasMany() to also support options just like .hasOne()

    dresende committed Jan 3, 2012
    autoFetch option can now be used in .hasMany() associations. These
    fetching also check fetchDepth.
  3. Model instances now have an optional opts parameter.

    dresende committed Jan 3, 2012
    For now it only accepts the option fetchDepth which should not be
    used directly and should be set in the model. Like this:
    
    var Person = orm.define("person", {
        ...
    }, {
        fetchDepth: 2
    });
    
    This restricts autoFetch of associations to a maximum of 2 hops.
    You can also use this to only fetch the next hop, that's probably
    be the default sometime in the future..
Commits on Jan 2, 2012
  1. Change model instances to inherit from EventListener

    dresende committed Jan 2, 2012
    Model associations can now have options. The first implemented
    options is autoFetch that retrieves the associations before
    returning the records you want.
    
    **BE CAREFULL FOR CIRCULAR OR VERY DEEP ASSOCIATIONS**
    
    To achieve this, I changed Model.hasOne() to support arguments
    in any order, a string being the association name, an (optional)
    Model (if not the same) and an object with options. Example:
    
    Person.hasOne("Mother", { autoFetch: true });
    
    This is still experimental but feel free to post any issues or
    suggestions.
Commits on Dec 17, 2011
  1. Merge pull request #21 from biesnecker/master

    dresende committed Dec 17, 2011
    Fixed association key creation in postgresql
Commits on Dec 6, 2011
Commits on Dec 5, 2011
Commits on Dec 3, 2011
  1. Fix .hasMany not really getting associations when using Model.get*()

    dresende committed Dec 3, 2011
    Also, you can now write this:
    
        var Person = orm.define("person", {
            "name": String,
             "pet": [ Pet ] // same as Person.hasMany("pets", Pet, "pet");
        });
  2. Fix mysql query when no callback is made (missing _values)

    dresende committed Dec 3, 2011
    Fix when an empty Array is passed in a condition
  3. Add better support for Date objects on mysql connector

    dresende committed Dec 3, 2011
    I'm not sure this is right yet, but at least it should use
    FROM_UNIXTIME() and Date.getTime() to insert/update a proper
    date on the database. PostgreSQL needs some update like this.
  4. Update mysql connector to use mysql module escaping (fixes #14)

    dresende committed Dec 3, 2011
    This should fix issue #14 at least for mysql. Date handling has been
    a little tweaked but not yet correct I think.