jugglingdb/mysql-adapter — pull request #90 by jvskelton (2014-07-01 19:05:13+00:00)
Title: Added ability to query specific colums

Modified .all method to accept attributes property to select single or multiple columns.

Example 1:

model.all({where : {name: 'bill'}, attributes: 'id'}}, callback)
OR
model.all({attributes: 'id'}}, callback)

returns array of ids (e.g. [ 1, 2 ]):

Example 2 :

model.all({where : {name: 'bill'}, attributes: ['id']}}, callback)
OR
model.all({attributes: ['id']}}, callback)

returns array of objects(e.g. [{id: 1}, {id: 2}]):

Example 3:

model.all({where: {address: '123'}, attributes: ['id', 'name']},callback)
OR
model.all({, attributes: ['id', 'name']},callback)

returns [{id: 1, name: 'bill'}, {id: 2. name: 'alice'}]: