Re: IndexedDB: Syntax for specifying persistent/temporary storage

2013-12-17 Thread Kyaw Tun
Option C) using numeric priority are good enough for most web application. It has advantage of easy to implement. Option C) can be combined with option B) by defining that 0 means temporary, 1 means persistent and undefined means default. Any other values should throw error. Since we can query

Re: [IndexedDB] MultiEntry compound index proposal

2013-11-16 Thread Kyaw Tun
Sorry multiEntry attribute in 'clad-name' is true. On Nov 17, 2013 12:21 PM, Kyaw Tun kyaw...@yathit.com wrote: Current IndexedDB spec does not allow MultiEntry index for array keyPath (compound index). Implementation of multiEntry compound index is rather straight forward, but ambiguous

Re: Sync API for workers

2013-10-13 Thread Kyaw Tun
Actually only IDBRequest need to be sync, which are prone to error and complicate workflow. Async workflow on database opening and transaction request are fine. Kyaw

[IndexedDB] blocked event should have default operation to close the connection

2013-10-09 Thread Kyaw Tun
An application receive blocked event on IndexedDB database instance when another app open the database with a newer version. The receiving application must close the connection so that other tab receive open success event. Otherwise database open request will be pending. Most developer are

Re: Updating Quota API: Promise, Events and some more

2013-08-14 Thread Kyaw Tun
How an IndexedDB database use persistent storage?

Re: Updating Quota API: Promise, Events and some more

2013-08-14 Thread Kyaw Tun
That still feels like an odd mix of two APIs. An approach that we (Moz + Google) have talked about would be to extend the IDBFactory.open() call with an options dictionary, e.g. request = indexedDB.open({ name: ..., version: ..., storage: temporary }); On a tangent... An open question is

[IndexedDB] Feature detection pattern for array key support

2013-08-06 Thread Kyaw Tun
Some browsers does not support array key. I use indexedDB.cmp([1, 2], [1, 2]). It works by getting error on not supported bowser. Is there a clear hack to detect it? Thanks, Kyaw

Re: [IndexedDB] IDBRequest.onerror for DataCloneError and DataError

2013-06-11 Thread Kyaw Tun
.org/2008/webapps/wiki/IndexedDatabaseFeatures On 5/19/13 9:37 PM, ext Kyaw Tun wrote: Sorry for reposting again for http://lists.w3.org/Archives/** Public/public-webapps/**2013AprJun/0422.htmlhttp://lists.w3.org/Archives/Public/public-webapps/2013AprJun/0422.htmlPerhaps I am not well

Re: [IndexedDB] Inform script of corruption recovery

2013-06-11 Thread Kyaw Tun
.org/2008/webapps/wiki/IndexedDatabaseFeatures On 5/19/13 11:14 PM, ext Kyaw Tun wrote: It will be good, if we can provide data priority per database and/or per object store. Web app already assume Indexeddb data is temporary, recovery process are in place at the beginning after database

Re: [IndexedDB] request feedback on IDBKeyRange.inList([]) enhancement

2013-05-21 Thread Kyaw Tun
Thank you. - 1000 get() calls in single txn: ~1600ms - getAll for all 1000 keys:~1200ms I would expect getAll could have better than that. It seems context switching between js and database is cheap. In that case, cursor walk could even better perform.

Re: [IndexedDB] request feedback on IDBKeyRange.inList([]) enhancement

2013-05-20 Thread Kyaw Tun
for the feedback! On May 19, 2013, at 9:25 PM, Kyaw Tun kyaw...@yathit.com wrote: IDBKeyRange.inList looks practically useful, but it can be achieve continue (continuePrimary) cursor iteration. Performance will be comparable except multiple round trip between js and database. I'm sorry, but I don't

Re: [IndexedDB] request feedback on IDBKeyRange.inList([]) enhancement

2013-05-19 Thread Kyaw Tun
is not a useful feature in query. In fact, I will like result be respective ordering of given key list. Kyaw Tun

[IndexedDB] IDBRequest.onerror for DataCloneError and DataError

2013-05-19 Thread Kyaw Tun
Sorry for reposting again for http://lists.w3.org/Archives/Public/public-webapps/2013AprJun/0422.html Perhaps I am not well explain enough. In put and add method of object store and index, DataCloneError and DataError are immediately throw before executing IDBRequest. It seems good that exception

Re: [IndexedDB] Inform script of corruption recovery

2013-05-19 Thread Kyaw Tun
It will be good, if we can provide data priority per database and/or per object store. Web app already assume Indexeddb data is temporary, recovery process are in place at the beginning after database is successfully open. So silently drop all data and set version to 0 is good way to go. I think

[IndexedDB] Does Abort this algorithm mean Abort transaction?

2013-05-15 Thread Kyaw Tun
When ConstraintError occur in 'steps for storing a record into an object store', it said 'Abort this algorithm without taking any further steps.' I assume the transaction can be still be used, except that this request fail. However both Chrome and Firefox implementation abort transaction. Is that

Re: [IndexedDB] Does Abort this algorithm mean Abort transaction?

2013-05-15 Thread Kyaw Tun
Oh yes, it works great. What a nice twist! I learned IndexedDB for one year (literally), still not get it. On Thu, May 16, 2013 at 12:03 PM, Jonas Sicking jo...@sicking.cc wrote: On Wed, May 15, 2013 at 7:45 PM, Kyaw Tun kyaw...@yathit.com wrote: When ConstraintError occur in 'steps

Prefer Error than exception for DataCloneError and DataError

2013-04-29 Thread Kyaw Tun
In put and add method of object store and index, DataCloneError and DataError are immediately throw before executing IDBRequest. It seems good that exception are throw immediately, but in practical use case, these exception are in async workflow (inside transaction callback). Exception break the

Why not be multiEntry and array keyPath togather?

2013-04-25 Thread Kyaw Tun
createIndexhttp://www.w3.org/TR/IndexedDB/#widl-IDBObjectStore-createIndex-IDBIndex-DOMString-name-any-keyPath-IDBIndexParameters-optionalParametersAPI specification state that If keyPath is and Array and the multiEntry property in the optionalParameters is true, then a DOMException of type

[IndexedDB] better way of deleting records

2013-01-15 Thread Kyaw Tun
From developer point of view, IDBObjectStore.delete method cannot be used directly in most use case, since IDBObjectStore.delete returns undefined. IDBObjectStore.delete(random_key) always receives onsuccess event, but nothing happen. Currently I use cursor or count method before deleting to make

Re: [IndexedDB] How to recover data from IndexedDB if the origin domain don't exist anymore?

2013-01-15 Thread Kyaw Tun
It will need to address limiting quota. How about ad firm collect data from multiple origins? Since user agent can delete IndexedDB data anytime, duplicate copy of IndexedDB data to be more persistant is not much meaningful. I think it is too much complex in security and privacy issue, but very

Re: [IndexedDB] How to recover data from IndexedDB if the origin domain don't exist anymore?

2013-01-09 Thread Kyaw Tun
In this situation, I will go with CouchDB. If used with IndexedDB, I will send data back JSON data to blob storage server like Google Cloud Storage or S3.

Re: IDBCursor should walk on secondary ordering of index value

2012-12-12 Thread Kyaw Tun
If you have that information from your other filtering, then why not just fetch them directly? Like IDBObjectStore.get(primary_key)? The use case, here, is key joining without serialization, so that it is very fast. We also want single scan. get method involve serialization and resanning. The

IDBCursor should walk on secondary ordering of index value

2012-12-05 Thread Kyaw Tun
Index records are stored in ascending order of key (index key) followed by ascending order of value (primary key). However, current IndexedDB API expose retrieving only by index key. For example, the following operation on ‘tag‘ index of ‘article’ object store will retrieve the first

Re: IDBCursor should walk on secondary ordering of index value

2012-12-05 Thread Kyaw Tun
On Thu, Dec 6, 2012 at 6:47 AM, Joshua Bell jsb...@chromium.org wrote: On Wed, Dec 5, 2012 at 7:50 AM, Kyaw Tun kyaw...@yathit.com wrote: Index records are stored in ascending order of key (index key) followed by ascending order of value (primary key). However, current IndexedDB API

RE: [IndexedDB] coupled transactions

2012-11-20 Thread Kyaw Tun
I don't understand why the two transactions need to be coupled. I want to use more efficient cursor walk in single transaction or reuse transaction, since I know keys will be coming in order. The producer object has a read only transaction, so it won't commit any changes. The consumer

[IndexedDB] Can IDBTransaction.oncomplete callback be used as active state?

2012-11-18 Thread Kyaw Tun
Transaction is active as long as I send request from the IDBRequest callback. Is there any other way to prevent committing? If there any way to detect transaction active flag? I expect IDBTransaction.oncomplete callback can be used to flag inactive state, but it is not according to my few test.

[IndexedDB] coupled transactions

2012-11-18 Thread Kyaw Tun
Coupled transactions exists when two or more transactions should be committed together but transactions are in different scopes or mode. Currently I find this problem challenging to solve with IndexedDB API. This can be solved by merging transactions into single transaction, but it will be

Put request need created flag

2012-11-14 Thread Kyaw Tun
I have hard to understand how to use add method effectively. On my indexeddb wrapper library development, the wrapper database instance dispatches installable event for creating, deleting and updating a record. Interested components register and listen to update UI or sync to server. That

IDBObjectStore require openKeyCursor method

2012-11-13 Thread Kyaw Tun
In contrast to IDBIndex, IDBObjectStore does not have openKeyCursor method. This method fetch list of keys of a given range without cost of serialization. There is no other ways to iterate keys only from IDBObjectStore. However efficient fetching of keys in a specific range is required in high