Merge pull request #49 from mapbox/multi-index
Query from `map` table with more than one index.
This commit is contained in:
+1
-1
@@ -33,7 +33,7 @@ ZXYStream.prototype._read = function() {
|
|||||||
if (!stream.table) {
|
if (!stream.table) {
|
||||||
return this.source._db.get("select count(1) as count from sqlite_master where type = 'index' and tbl_name = 'map';", function(err, row) {
|
return this.source._db.get("select count(1) as count from sqlite_master where type = 'index' and tbl_name = 'map';", function(err, row) {
|
||||||
if (err) return stream.emit('error', err);
|
if (err) return stream.emit('error', err);
|
||||||
stream.table = row.count === 1 ? 'map' : 'tiles';
|
stream.table = row.count >= 1 ? 'map' : 'tiles';
|
||||||
return stream._read();
|
return stream._read();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user