yathit / ydn-db

Javascript database module for Indexeddb, Web SQL and localStorage storage mechanisms supporting version migration, advanced query, SQL and transaction.
Apache License 2.0
503 stars 41 forks source link

Schema Versioning in IndexedDB not working #22

Closed arunkarthik92 closed 9 years ago

arunkarthik92 commented 10 years ago

If I add schema = {stores : [some_schema], version : 1}; It works in websql but it does not work in indexeddb

yathit commented 10 years ago

It works. Can you make a jsfiddle?

arunkarthik92 commented 10 years ago

Please find the attached File

Regards Arun

On Mon, Sep 15, 2014 at 4:19 PM, Kyaw Tun notifications@github.com wrote:

It works. Can you make a jsfiddle?

— Reply to this email directly or view it on GitHub https://github.com/yathit/ydn-db/issues/22#issuecomment-55575355.

yathit commented 10 years ago

???

arunkarthik92 commented 10 years ago

Versioning for indexeddb is not working in this code.

On Tue, Sep 16, 2014 at 9:17 AM, Kyaw Tun notifications@github.com wrote:

???

— Reply to this email directly or view it on GitHub https://github.com/yathit/ydn-db/issues/22#issuecomment-55691566.

yathit commented 10 years ago

Close due to un-clear bug report.

arunkarthik92 commented 10 years ago

This code is not working in indexeddb <!DOCTYPE html>

Test ```
Employee id
Employee name
```
yathit commented 10 years ago

Thanks for posting complete example.

I found some issues in your example:

autoIncrement is boolean, while you are setting as stirng 'true'. in schema keyPath is eid, whereas you are setting sid. In general database connection do not close. keep connection open.

Here is the fix for your file: http://jsfiddle.net/kyawtuns/78p3n5Ls/