Skip to content

Conversation

@ryanmeador
Copy link

I've updated all the dependencies of FastLegS so that it works correctly with Node 0.6.0+.

I added an "or null" operator for WHERE clauses so you can say things like "value is 0 or null". I think this is a pretty common use case, and it was impossible to express before. Example of how it is used:

dataLayer.Feed.find(
    {
      "indexed_at.lte.or_null": indexTime
    },
    {
      only: [ 'id' ]
    },
    callback);

This will return all rows where the "indexed_at" column is before indexTime or "indexed_at" is NULL.

My third change is support for automatically setting created and updated time stamps for each row. You configure them like so:

exports.Feed = FastLegS.Base.extend({
  tableName: "feeds",
  primaryKey: "id",
  updateTimestamp: "updated_at",
  createTimestamp: "created_at"
});

The column names can be whatever you want, in this example I use the Ruby nomenclature of "updated_at" and "created_at" as the column names. You don't have to specify both created and updated. Every time you issue a create() or update() call, the relevant column will be updated (in the case of create(), update is also set to the same time).

@toots
Copy link

toots commented Jan 23, 2012

+1

@ryanmeador
Copy link
Author

Hi, can you please let me know why you have elected not to merge this pull request? If there's anything I can do to assist, I'd be happy to. I've been using my forked version for development for about a year, and I'd really like to be able to get back on mainline.

@thadclay
Copy link
Collaborator

thadclay commented Feb 1, 2013

Sorry about the crazy delay. This pull request was probably overlooked. I'm not going to merge these changes because they have no tests. Please submit another pull request with tests and we will get on it. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants