mozIStorageRow should provide an Iterator to JS consumers

NEW
Unassigned

Status

()

P3
enhancement
10 years ago
2 years ago

People

(Reporter: ddahl, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

10 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b4pre) Gecko/20090412 Shiretoko/3.5b4pre
Build Identifier: 

Inside of statement.executeAsync({handleResult: function(){}}):

Instead of doing this: 

for(let row = aResultSet.getNextRow();
         row;
         row = aResultSet.getNextRow())) {
 let value = row.getResultByName("username");
}
Allow me to do this via JS:

for(var i=0; i < aResultSet.count; i++) {
     let row = aResultSet[i];
    // row then is an object: {id:6789, name:'david', car:'Toyota', bought:'2009-04-02'}
}

Better yet, add a "results" Iterator to the callback interface. or both. Should I file another bug?

Reproducible: Always
(Reporter)

Updated

10 years ago
Status: NEW → UNCONFIRMED
(In reply to comment #0)
> Better yet, add a "results" Iterator to the callback interface. or both. Should
> I file another bug?
Let's morph this into the Iterator bug, and bug 512761 is for adding the language helper (has a broken wip even!)
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Allow access to column data via column name: "row.name" instead of method call → mozIStorageRow should provide an Iterator to JS consumers
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.