1. #181
    Sencha User
    Join Date
    Feb 2012
    Posts
    12
    Vote Rating
    0
    billtallitsch is on a distinguished road

      0  

    Default size limitations

    size limitations


    Are the size limitations for storage limited to the amount of hard disk space on the user's device when using this solution?

    When packaging with cordova, is this the right solution for storing and retrieving large video files (>500mb) on a users device for offline viewing? Maybe I need the Cordova SQLite plugins (for iOS)?

  2. #182
    Sencha User
    Join Date
    Jun 2012
    Posts
    136
    Vote Rating
    1
    munder is on a distinguished road

      0  

    Default How to guarantee unique records?

    How to guarantee unique records?


    This proxy has brilliantly solved a lot of the problems I was having. Thank you.
    I'm stuck, though, on one particular table, where I need to ensure that records are unique, and don't know how. This is my model:
    Code:
    Ext.define('LRS.model.Answers', {
        extend: 'Ext.data.Model',
    
    
        config: {
            fields: [
                {name: 'id', type:'int'},
                {name:'distribution_respondent_id',type:'int'},
                {name:'survey_id', type:'int'},
                {name:'question_id',type:'int'},
                {name:'question_response_value', type:'string'},
                {name:'response_skipped', type:'int'},
                {name:'response_skipreason', type:'string'},
                {name:'response_comment',type:'string'},
                {name:'date', type: 'long'},
                {name:'synced', type:'string'}
            ]
        },
        identifier: 'uuid'
    });
    Ideally, I would like to have a composite primary key on the fields 'survey_id' and 'question_id', as that would guarantee each row's uniqueness, but I haven't been able to find out how to create a composite key in a model. Having 'id' as unique would clearly guarantee that each row is unique, by virtue of the uniqueness of 'id', but doesn't stop repeated combinations of 'survey_id' and 'question_id'. Does anybody have any ideas?

  3. #183
    Sencha User
    Join Date
    Jan 2012
    Location
    London, UK
    Posts
    508
    Vote Rating
    73
    shepsii is a jewel in the rough shepsii is a jewel in the rough shepsii is a jewel in the rough shepsii is a jewel in the rough

      1  

    Default


    Maybe I can be of help....

    Apologies if I'm wrong on the following assumption (would be embarrassing on my own code!) but I don't believe that each table actually has an ID column; I think this is actually set from the auto-increment __ROWID__ on each websql/sqlite table (http://www.sqlite.org/autoinc.html). In that case your concerns about overriding the ID column as the primary key wouldn't apply, because strictly that column is not even part of the table's schema, in fact if you inspect the tables using the webkit dev tools, it doesn't even show.

    So theoretically, you should be able to modify the create table method on the proxy (perhaps extend the proxy and have an additional config for an array of primary keys?), modifying the create table statement should be fairly easy:
    http://stackoverflow.com/questions/7...ltiple-columns

    Hope this helps!
    I blog about Sencha Touch at www.senchatouchdev.com

  4. #184
    Sencha User
    Join Date
    Jan 2012
    Location
    London, UK
    Posts
    508
    Vote Rating
    73
    shepsii is a jewel in the rough shepsii is a jewel in the rough shepsii is a jewel in the rough shepsii is a jewel in the rough

      0  

    Default


    Sorry for hideously late reply (to billtallitsch)

    If you package to native, this will still use websql, therefore it's subject to the 5mb limit. In fact, asking for more space in a native app is not a good idea. webview's do not handle that request well.

    If you want more than 5mb you'll need to go ahead and use the plugin. I believe there's one for android too.
    I blog about Sencha Touch at www.senchatouchdev.com

  5. #185
    Sencha User
    Join Date
    Jun 2012
    Posts
    136
    Vote Rating
    1
    munder is on a distinguished road

      0  

    Default composite primarykey

    composite primarykey


    Thanks for the information, shepsii, and for the suggestion. Excellent idea. I have a tendency to work with what I've got (i.e. lazily rely on other people's hard work), but modifying the proxy is a great suggestion.

  6. #186
    Sencha Premium Member
    Join Date
    Nov 2012
    Posts
    17
    Vote Rating
    1
    NMP is on a distinguished road

      0  

    Default


    Quote Originally Posted by Qumhieh View Post
    hi again
    here is the error i got when i increase DB size over than 50 MB in IPAD (v5)
    "SECURITY_ERROM Exception 18: An attempt was made to break through the security policy of the user agent"

    i believe this is a privilege issue, but why its appear only when i increase the DB size? and how i can fix it?
    (my application is for IOS (IPAD) only)
    Did you find a solution for this? I'm also trying to create a larger DB than 50MB...

  7. #187
    Sencha Premium Member
    Join Date
    Oct 2011
    Location
    Duluth, MN
    Posts
    126
    Vote Rating
    4
    badgerb1 is on a distinguished road

      1  

    Default


    Quote Originally Posted by NMP View Post
    Did you find a solution for this? I'm also trying to create a larger DB than 50MB...
    Safari IOS has a 50MB limit so if you're doing a browser based application that's all you have. Web Views, which is what most "Native" apps actually use, also has this limit.

    If you are using Cordova/PhoneGap to create a native app, there's a plugin that looks like it allows larger limits. I haven't used anything like this however so I can't be sure.
    https://github.com/brodyspark/PhoneGap-SQLitePlugin-iOS

    Thanks
    Bob

  8. #188
    Sencha User
    Join Date
    Apr 2013
    Posts
    7
    Vote Rating
    1
    vn_service_desk is on a distinguished road

      0  

    Default


    Hi everyone,

    I have a question with the sqlite proxy . Can the application's database be deleted if user delete the cookies, cache .. in iOS settings ?

  9. #189
    Sencha User
    Join Date
    Nov 2012
    Posts
    23
    Vote Rating
    1
    Manoj Solanki is on a distinguished road

      0  

    Default


    No, the application database is not deleted or even effected when you clear cookies and data from "ios setting".

    I have checked it in simulator.

  10. #190
    Sencha Premium Member vadimv's Avatar
    Join Date
    Sep 2010
    Location
    Chisinau, Moldova
    Posts
    642
    Vote Rating
    25
    vadimv will become famous soon enough vadimv will become famous soon enough

      0  

    Default


    Quote Originally Posted by Manoj Solanki View Post
    No, the application database is not deleted or even effected when you clear cookies and data from "ios setting".

    I have checked it in simulator.
    But you check on device , you can delete websql databases by taping "clear cookies and data" button. If is native then yes, is not deleted.