Open Bug 488180 Opened 15 years ago Updated 1 year ago

mozIStorageRow should provide an Iterator to JS consumers

Categories

(Toolkit :: Storage, enhancement, P3)

x86
All
enhancement

Tracking

()

People

(Reporter: ddahl, Unassigned)

References

(Depends on 1 open bug, )

Details

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
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
Severity: normal → S3
Depends on: 512761
You need to log in before you can comment on or make changes to this bug.