|
HigherLevelDatabaseAPI
Proposal for two new higher-level database APIs
Deprecated ProblemThis proposal seeks to address two issues that affect many people using the current database API:
SolutionThis can be solved by adding two new APIs: class ResultSet {
readonly property JsObject currentRow;
}
class Database {
JsArray executeToArray(String sql, optional JsArray params);
}Example usage: var resultSet = db.execute("SELECT Name, NumCLs FROM GearsTeam");
while (resultSet.currentRow) {
alert(resultSet.currentRow.Name + " has submitted " +
resultSet.currentRow.NumCLs + " change lists!");
resultset.next();
}
var rows = db.executeToArray("SELECT Name, NumCLs FROM GearsTeam");
for (var i = 0; i < rows.length; i++) {
alert(row.Name + " has submitted " + row.NumCLs + " change lists!");
}Details
Alternatives
|
► Sign in to add a comment