jugglingdb/mysql-adapter — pull request #91 by jvskelton (2014-07-02 20:21:21+00:00)
Title: Created ability to query specific colums

See #90.

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'}]: