Re: URLs into IndexedDB databases

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