Open Bug 1326565 Opened 7 years ago Updated 2 years ago

Add a way to get the name of a column in a row

Categories

(Toolkit :: Storage, defect, P3)

defect

Tracking

()

People

(Reporter: lina, Unassigned)

References

(Depends on 1 open bug)

Details

Attachments

(1 file)

Earlier, I wanted to dump a table's contents for debugging, similar to http://searchfox.org/mozilla-central/rev/51aa673e28802fe6ea89f4793721fc55334a6ac8/toolkit/components/places/tests/head_common.js#243-289.

It looks like I can get the column names using `mozIStorageStatement.getColumnName`, but, AFAICT, that's only implemented for synchronous statements. I'm also using Sqlite.jsm, which only exposes `mozIStorageRow` objects.

I could open a synchronous DB connection and dump the table that way. Since rows already store the column names, though, I thought it would make sense to add a `getColumnName` method to `mozIStorageRow`. It's only really useful for debugging, but I'm submitting a patch with a basic test in case it's useful.
off-hand, it would be much better if we'd have bug 512761, then you could probably just use common javascript syntax to get the keys, rather than adding further API complication to mozIStorageRow. So, if you'd have any time and ideas to complete that patch instead, that'd be very welcome.
In the lack of that, your request is understandable and we can probably take this.
Comment on attachment 8822911 [details]
Bug 1326565 - Add `mozIStorageRow.getColumnName`.

(In reply to Marco Bonardo [::mak] from comment #2)
> off-hand, it would be much better if we'd have bug 512761, then you could
> probably just use common javascript syntax to get the keys, rather than
> adding further API complication to mozIStorageRow.

Interesting, thanks for the pointer! I'm on PTO this week, but I'll have a look at Shawn's patch on bug 512761 when I get back. Clearing review in the meantime.
Attachment #8822911 - Flags: review?(mak77)
Depends on: 512761
Priority: -- → P3
I'm not likely to get back to untangling the XPConnect magic in bug 512761 soon, so unassigning myself for now, sorry.
Assignee: kit → nobody
Status: ASSIGNED → NEW
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: