-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I couldn't worked it out with PhoneGap for my project #49
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. |
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. |
basically I added 3 .js treo files in the dist directory into my js/vendor/shim as below,
but it returns me the error below that 'schema' not defined. How can I surpass this?
Many thanks in advance..
The text was updated successfully, but these errors were encountered: