xavierlacot/joli.js — pull request #33 by iamyellow (2012-10-19 07:44:02+00:00)
Title: can set SQL computed value to a field

Maybe others find interesting some changes I made to joli.js in order to (for example) create a new record setting its properties with SQL statements. Well, I think an example will explain this better than me:

```javascript
var data = this.newRecord({
id: "SQL(strftime('%Y%m%d%H%M%f', 'now'))",
userId: 33,
message: 'hi',
flag: 0
});
```

In this example the 'id' field will be a timestamp generated using SQLite time functions. Then:

```javascript
data.save();
Ti.API.info(data.get('id')); // this prints something like '20121019070437.809'
```

Hope you find useful enough :)