Use simpler query for getSortedVersions

The old one read and parsed JSON blobs from sqlite instead of just using
pre-existing columns.
This commit is contained in:
David Glasser
2014-11-18 14:02:07 -08:00
parent 88477358ac
commit f404f28275

View File

@@ -564,7 +564,8 @@ _.extend(RemoteCatalog.prototype, {
getSortedVersions: function (name) {
var self = this;
var match = this._getPackageVersions(name);
var match = this._columnsQuery(
"SELECT version FROM versions WHERE packageName=?", name);
if (match === null)
return [];
return _.pluck(match, 'version').sort(VersionParser.compare);
@@ -593,14 +594,6 @@ _.extend(RemoteCatalog.prototype, {
return result[0];
},
_getPackageVersions: function (name) {
if (!name) {
throw new Error("No name provided");
}
return this._contentQuery(
"SELECT content FROM versions WHERE packageName=?", name);
},
getAllBuilds: function (name, version) {
var result = this._contentQuery(
"SELECT * FROM builds WHERE builds.versionId = " +