I've following two async operations and then final onResult and onFault defined. How can I chain following two async operations getConnection and then select and then finally calling onResult or onFault
Edit need help in promisifying following sequence.
    new Promise(this.getConnection)
        .then(this.select)
        .then(this.onResult)
getConnection: function(resolve, reject) {
    console.log('get connection')
    if(database = common.model.connections.Sync.getConnection()) {
        database.transaction(function(transaction){
            resolve(transaction);
        });
    } else {
        reject("Connection Error");
    }
},
select: function(transaction) {
    console.log('select', transaction)
    var self = this;
    var query = "SELECT * FROM configuration WHERE key = 'schedule'";
    self.transaction.executeSql(query, [], function(transaction, resultSet){self.selectTransactionComplete(transaction, resultSet)}, function(){self.selectTransactionError()});
},
selectTransactionComplete: function(transaction, resultSet) {
    console.log('select transaction complete')
    if(resultSet.rows.length == 0) {
        this.onResult(false);
    } else if(new Date().getTime() - new Date(common.Config.getLastSync()).getTime() > resultSet.rows.item(0).value) {
        this.onResult(true);
    }
},
selectTransactionError: function(error) {console.log(this.constructor.NAME, this.selectSQL); console.log(error);},
onResult: function(data) {
    console.log(data);
},
onFault: function(info) {
    console.log(info)
}
 
    