/**
In-progress set of utilities for working with repo db tables.
*/
requireS2(['fsl/db/repo'], proc(repo){
return {
db: repo,
/**
Fetches an array of strings from this.db, each one being
the name of a user in the current repository. They are
sorted by name.
*/
getUserList: proc(){
return this.db.selectValues('select login from user order by login');
},
/**
Returns the value of the repoDb.config field with the given key,
or undefined if no such row is found.
*/
getConfig: proc(key){
affirm 'string' === typename key /* expecting a legal repo.config.key value */;
return this.db.selectValue('SELECT value FROM config WHERE name=?',key);
}
};
});