Closed
Bug 589355
Opened 15 years ago
Closed 15 years ago
IndexedDB: Add IDBObjectStore::Clear
Categories
(Core :: Storage: IndexedDB, defect)
Core
Storage: IndexedDB
Tracking
()
RESOLVED
FIXED
People
(Reporter: bent.mozilla, Assigned: bent.mozilla)
Details
(Keywords: dev-doc-complete)
Attachments
(1 file, 1 obsolete file)
|
8.79 KB,
patch
|
bent.mozilla
:
review+
jst
:
approval2.0+
|
Details | Diff | Splinter Review |
For clearing object stores.
Attachment #467974 -
Flags: review?(jonas)
Comment on attachment 467974 [details] [diff] [review]
Patch, v1
>+ClearHelper::DoDatabaseWork(mozIStorageConnection* aConnection)
>+{
>+ NS_PRECONDITION(aConnection, "Passed a null connection!");
>+
>+ nsCString table;
>+ if (mAutoIncrement) {
>+ table.AssignLiteral("ai_object_data");
>+ }
>+ else {
>+ table.AssignLiteral("object_data");
>+ }
>+
>+ NS_NAMED_LITERAL_CSTRING(osid, "osid");
>+
>+ nsCString query = NS_LITERAL_CSTRING("DELETE FROM ") + table +
>+ NS_LITERAL_CSTRING(" WHERE object_store_id = :") + osid;
This will create needless string concatenation. If you don't want to duplicate the string "osid" (which IMHO would be ok to duplicate), then use a #define or some such.
You should test that clearing a objectStore does *not* reset its autoincrement counter.
r=me with that.
Attachment #467974 -
Flags: review?(jonas) → review+
| Assignee | ||
Comment 2•15 years ago
|
||
With comments addressed.
Requesting approval for spec compliance. Has tests.
Attachment #467974 -
Attachment is obsolete: true
Attachment #469298 -
Flags: review+
Attachment #469298 -
Flags: approval2.0?
Updated•15 years ago
|
Attachment #469298 -
Flags: approval2.0? → approval2.0+
| Assignee | ||
Comment 3•15 years ago
|
||
| Assignee | ||
Updated•15 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Updated•15 years ago
|
Keywords: dev-doc-needed
Target Milestone: --- → mozilla2.0b5
Updated•15 years ago
|
Keywords: dev-doc-needed → dev-doc-complete
Component: DOM → DOM: IndexedDB
Target Milestone: mozilla2.0b5 → ---
You need to log in
before you can comment on or make changes to this bug.
Description
•