Lawnchair indexing problems

320 Views Asked by At

I'm trying out Lawnchair but the documentation is sparse, to say the least. Here are a few questions:

1) How do I order a list of stored objects? Or, to put in another way, how do I define an index for the objects?

2) Is there any way to have more than one key?

Also, does anyone know another cross-platform (IndexedDB + WebSQL) database framework? persistence.js doesn't cut it since it requires Google Gears on Firefox.

2

There are 2 best solutions below

0
On

1) As of now, Lawnchair doesn't support order by feature. Anyway, possible solution for this is you can sort objects after you grabbed it from Lawnchair. Or maybe perhaps you can add a plugin for that here:

http://brian.io/lawnchair/plugins/

2) I have tried adding new keys or fields in Lawnchair. I think it's not possible for now.

You may want to indexedDBShim. It uses indexed-db api but supports websql as well.

https://github.com/axemclion/IndexedDBShim

0
On

Was just trying to answer that same question. Lawnchair seems most flexible and implements a bunch of stores, and you should add the index functionality to it yourself.

I found this presentation while doing research, there are many frameworks listed in the end of it, I will update this answer once I go over them: http://www.slideshare.net/casden/inbrowser-storage-and-me