I couldn't worked it out with PhoneGap for my project
erhanyasar opened this issue · 6 comments
@erhanyasar you need to define the schema for your database - take a look at the example in the README https://github.com/treojs/treo#example
var treo = window.treo
// define db schema
var schema = treo.schema()
.version(1)
.addStore('books', { key: 'isbn' })
.addIndex('byTitle', 'title', { unique: true })
.addIndex('byAuthor', 'author')
.version(2)
.getStore('books')
.addIndex('byYear', 'year')
.version(3)
.addStore('magazines')
.addIndex('byPublisher', 'publisher')
.addIndex('byFrequency', 'frequency');
// open db
var db = treo('library', schema);
Actually I have doubts how to implement the above code to my project. I'll need some advise I guess, it will not be a solely solution to copy it to my project @unkillbob
@erhanyasar perhaps you need an introduction to IndexedDB? I did an introductory presentation on IndexedDB and treo a couple of years ago, here's my slide deck https://unkillbob.github.io/indexeddb-treo-presentation/ - its probably not much help without the corresponding presentation but hopefully it helps a little. If not perhaps see if you can find a decent blog post or online course on IndexedDB.
your link is just opens and stay with the screen below fyi
Oh sorry I should have explained, you can navigate the presentation with the left & right arrow keys!
@unkillbob hello again, it's been months and I'm still searching for it; hence not found a solution yet. Issued same with IndexedDBShim/issues/#260 so that waiting for a clue.