Skip to content
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

Closed
erhanyasar opened this issue Aug 18, 2016 · 6 comments
Closed

I couldn't worked it out with PhoneGap for my project #49

erhanyasar opened this issue Aug 18, 2016 · 6 comments

Comments

@erhanyasar
Copy link

basically I added 3 .js treo files in the dist directory into my js/vendor/shim as below,

screen shot 2016-08-18 at 21 26 44

but it returns me the error below that 'schema' not defined. How can I surpass this?

screen shot 2016-08-18 at 21 36 06

Many thanks in advance..

@unkillbob
Copy link
Contributor

unkillbob commented Aug 18, 2016

@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);

@erhanyasar
Copy link
Author

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

@unkillbob
Copy link
Contributor

@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.

@erhanyasar
Copy link
Author

Tx for your time and real friendly hand, I'm digging into IndexedDB with a couple of source hence your link is just opens and stay with the screen below fyi. Have a nice day!

screen shot 2016-08-22 at 09 48 38

@unkillbob
Copy link
Contributor

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!

@erhanyasar
Copy link
Author

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants