W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2013

Re: URLs into IndexedDB databases

From: Kornel Lesiński <kornel@geekhood.net>
Date: Thu, 18 Jul 2013 14:58:26 +0100
To: public-webapps@w3.org
Message-ID: <op.w0e7rof2te2ec8@aimac>
On Mon, 15 Jul 2013 09:57:30 +0100, Jonas Sicking <jonas@sicking.cc> wrote:

> indexeddb:<origin>/<persistence>/<database>/<objectStore>/<index>/<key>/<keypath>
>
> Each piece above would have to be encoded such that it contains only
> valid, non-'/', URL characters. For things like database name and
> objectStore name this is easy by simply %-encoding characters.
>
> For the key this is significantly messier. We have to encode things
> like Dates and numbers, as well as Arrays. There's no shortage of ways
> of doing this, but there's no particularly clean way to do it either I
> think.

That makes sense and I think key encoding is solvable with some  
microsyntax (I'll refrain from bikeshedding it here :)


But what these URLs will be used for? Probably not for simple values that  
are smaller than the URL itself (what can you do with a URL that points to  
an integer?)

So maybe the key use-case will be linking to Blobs in indexedb (e.g.  
images, full documents) and then it would suffice if only those Blobs had  
permanent URLs (e.g. window.URL.createObjectURL would be permanent for  
stored blobs).

> A third problem here is that it seems unfortunate to generate a new
> URL scheme for each storage format we have.

I don't see a problem with that. If they have different addressing scheme,  
they logically should have different URL scheme. localdata: just pushes  
scheme name to the path.

-- 
regards, Kornel
Received on Thursday, 18 July 2013 13:58:58 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:26:57 UTC