Cannot openDatabase in WebWorker?

47 views
Skip to first unread message

Html5Coder

unread,
Mar 29, 2010, 2:32:40 AM3/29/10
to Chromium HTML5
We are setting up a localDB using openDatabase
we can do this successfully within a html page

When using WebWorker setup from same html page
cannot use openDatabase to open a database?

Using script from:
http://www.whatwg.org/specs/web-workers/current-work/

as below
<script>
new Worker('worker.js');
</script>

The worker itself is as follows:
var server = new WebSocket('ws://whatwg.org/database');
var database = openDatabase('demobase', '1.0', 'Demo Database',
10240);
server.onmessage = function (event) {
// data is in the format "command key value"
var data = event.data.split(' ');
switch (data[0]) {
case '+':
database.transaction(function(tx) {
tx.executeSql('INSERT INTO pairs (key, value) VALUES (?, ?)',
data[1], data[2]);
});
case '-':
database.transaction(function(tx) {
tx.executeSql('DELETE FROM pairs WHERE key=? AND value=?',
data[1], data[2]);
});
}
};

Using 5.0.360.0 dev then run the page, right click to inspect element,
then click storage, you can view the localdb.
When we openDatabase from html page no problem, the localDB shows
here, but when trying to open with WebWorker as per above and other
minified attempts, localDB never opens and cannot be seen?

Any ideas?

Jeremy Orlow

unread,
Mar 29, 2010, 5:34:07 AM3/29/10
to Html5Coder, Chromium HTML5, Eric Uhrhane
I believe the WebSQLDatabase support in Chromium is still not complete (and not yet implemented in any other browser).

J


--
You received this message because you are subscribed to the Google Groups "Chromium HTML5" group.
To post to this group, send email to chromiu...@chromium.org.
To unsubscribe from this group, send email to chromium-html...@chromium.org.
For more options, visit this group at http://groups.google.com/a/chromium.org/group/chromium-html5/?hl=en.


Eric Uhrhane

unread,
Mar 29, 2010, 1:08:25 PM3/29/10
to Jeremy Orlow, Html5Coder, Chromium HTML5
Trying again with group membership...

On Mon, Mar 29, 2010 at 9:24 AM, Eric Uhrhane <er...@google.com> wrote:
> Jeremy's right; I'm working on it, but it's not there yet.  I hope to
> have it all working no later than two months from now.

Html5Coder

unread,
Mar 29, 2010, 7:20:29 PM3/29/10
to Chromium HTML5
Excellent, we will continue to develop our code as standard js
functions for now and eagerly await your completion!
Thanks for your replies.


On Mar 30, 4:08 am, Eric Uhrhane <er...@google.com> wrote:
> Trying again with group membership...
>
>
>
> On Mon, Mar 29, 2010 at 9:24 AM, Eric Uhrhane <er...@google.com> wrote:
> > Jeremy's right; I'm working on it, but it's not there yet.  I hope to
> > have it all working no later than two months from now.
>
> > On Mon, Mar 29, 2010 at 2:34 AM, Jeremy Orlow <jor...@chromium.org> wrote:
> >> I believe the WebSQLDatabase support in Chromium is still not complete (and
> >> not yet implemented in any other browser).
> >> J
>

> >>> To post to this group, send email to chromium-ht...@chromium.org.


> >>> To unsubscribe from this group, send email to

> >>> chromium-html5+unsubscr...@chromium.org.

Reply all
Reply to author
Forward
0 new messages