1. #1
    Sencha User tomalex0's Avatar
    Join Date
    Apr 2009
    Location
    San Jose, CA
    Posts
    589
    Vote Rating
    16
    tomalex0 will become famous soon enough

      0  

    Default SqliteProxy

    SqliteProxy


    I used to work with sqlite storage for while but didn't thought to write down a separate proxy until i came across http://www.sencha.com/forum/showthre...roxy.IndexedDB by grgur . So heavily depending on his code set and help from Lisimba I tried to write down another sqliteproxy for sencha touch. This is just in initial stage.

    I write down the proxy based on implementing a Demo Functionality and it works fine for it. Usecase of others will be different. So please have a look and let me know your feed back.

    You can find code and demo implementation under
    SqliteProxy-Github

    Note : Sencha guys already planned for this.


    Sencha Touch Demos

    IosToggleField Forum - Github
    Form Validation
    Forum - Github
    Iphone Settings Menu
    Forum
    Sqlite Storage & Login Manifest
    Forum
    KitchenSink MVC
    Forum - Github
    SqliteProxy-v1 Forum - Github
    SqliteProxy-v2
    Forum - Github
    Arshaw Fullcalendar Forum - Github






  2. #2
    Sencha User
    Join Date
    Sep 2011
    Posts
    3
    Vote Rating
    0
    temolesto is on a distinguished road

      0  

    Thumbs up


    Thanks a lot, i'm just starting with Sencha and this is the first thing that i was looking into.

  3. #3
    Sencha User tomalex0's Avatar
    Join Date
    Apr 2009
    Location
    San Jose, CA
    Posts
    589
    Vote Rating
    16
    tomalex0 will become famous soon enough

      0  

    Default


    Nice to know that this turned out to be helpful for you. If you come across any issues please let me know
    Sencha Touch Demos

    IosToggleField Forum - Github
    Form Validation
    Forum - Github
    Iphone Settings Menu
    Forum
    Sqlite Storage & Login Manifest
    Forum
    KitchenSink MVC
    Forum - Github
    SqliteProxy-v1 Forum - Github
    SqliteProxy-v2
    Forum - Github
    Arshaw Fullcalendar Forum - Github






  4. #4
    Sencha User
    Join Date
    Sep 2011
    Posts
    3
    Vote Rating
    0
    temolesto is on a distinguished road

      0  

    Default


    how can i change the Proxy.dbConfig.dbQuery of a sqliteproxy after definition of the store or model

    i want to press a button and change the criteria of the selected rows of the table, i have tried this when updating

    Code:
    var p = myStore.getProxy();
    p.queryDB(p.dbConfig.dbConn, 'Update table set column=300;');
    successfully executing the update query or select some data
    Code:
    function querySuccess(tx, results) {
        document.getElementById('total').innerHTML=results.rows.item(0).Num+' Total';
        }
        var p = this.store.getProxy();
        p.queryDB(p.dbConfig.dbConn, 'select count(*) as Num FROM table;',querySuccess);
    but now i want to change the dbquery of the storage and i cant find how to do this
    Code:
    var p = this.store.getProxy();
    p.dbconfig.dbQuery = 'Select * from table order by column desc Limit 30';
    im just starting with sencha and js in general, thanks for your help

  5. #5
    Sencha User tomalex0's Avatar
    Join Date
    Apr 2009
    Location
    San Jose, CA
    Posts
    589
    Vote Rating
    16
    tomalex0 will become famous soon enough

      0  

    Default


    Can you try

    Code:
    this.store.load();
    after setting the dbQuery
    Sencha Touch Demos

    IosToggleField Forum - Github
    Form Validation
    Forum - Github
    Iphone Settings Menu
    Forum
    Sqlite Storage & Login Manifest
    Forum
    KitchenSink MVC
    Forum - Github
    SqliteProxy-v1 Forum - Github
    SqliteProxy-v2
    Forum - Github
    Arshaw Fullcalendar Forum - Github






  6. #6
    Sencha User
    Join Date
    Sep 2011
    Posts
    3
    Vote Rating
    0
    temolesto is on a distinguished road

      0  

    Default


    thanks, my error was actually dbconfig should be dbConfig

    Code:
    var p = this.store.getProxy();
    p.dbConfig.dbQuery = 'Select * from table order by column desc Limit 30';
    this.store.load();
    thanks for your help

  7. #7
    Sencha User
    Join Date
    Sep 2011
    Posts
    4
    Vote Rating
    0
    karthiktheraja is on a distinguished road

      0  

    Default


    Hi I am new to sencha touch and I want to use sqlite for offline data store . I want know whether there is performance difference between Phonegap sqlite and sqliteproxy.Does sqliteproxy supports iphone , android and Blackberry . Can you please tell me whether there is any memory restriction . Kindly help me to proceed further ....

  8. #8
    Sencha User tomalex0's Avatar
    Join Date
    Apr 2009
    Location
    San Jose, CA
    Posts
    589
    Vote Rating
    16
    tomalex0 will become famous soon enough

      0  

    Default


    @karthik

    I haven't tried it in Phonegap,
    Regarding support, sqlite Db is supported in all webkit based browsers. So sqlite proxy meant to work with those .
    I think developement on sqlite in browser has been dropped by w3c and likely to be replaced with indexDB.
    http://www.w3.org/TR/webdatabase/

    By default device will use 5MB of space, if it tends to exceed it will prompt an option to increase the space.

    I'm also not sure about how phonegap works with DB that we creates using html5 websql?
    Sencha Touch Demos

    IosToggleField Forum - Github
    Form Validation
    Forum - Github
    Iphone Settings Menu
    Forum
    Sqlite Storage & Login Manifest
    Forum
    KitchenSink MVC
    Forum - Github
    SqliteProxy-v1 Forum - Github
    SqliteProxy-v2
    Forum - Github
    Arshaw Fullcalendar Forum - Github






  9. #9
    Sencha User
    Join Date
    Sep 2011
    Posts
    4
    Vote Rating
    0
    karthiktheraja is on a distinguished road

      0  

    Default @tomalex0

    @tomalex0


    Thanks for your reply . I followed your sample and It works great . But I am not able to understand the flow of your code. I am just doing a login form validation . I need to create a login table and need to insert ,select and delete user account. In your example you have commented out select query but still i get a log for select query. Please give me a short explanation of how to work with your code. I want know how your code is working with browser sqlite as in phoneGap I used window.openDatabase("Database","1.0","PhoneGap Demo", 200000); method to open database.

  10. #10
    Sencha User tomalex0's Avatar
    Join Date
    Apr 2009
    Location
    San Jose, CA
    Posts
    589
    Vote Rating
    16
    tomalex0 will become famous soon enough

      0  

    Default


    Hi,
    The way proxy read is done like that it takes either tablename or query. If you have specified query it will be executed else select all from tablename.
    So in both case there will be a select query executed when store load in initiated.

    When any action is carried out with model having sqlite proxy it will create a table with fields mentioned in model. The inner function already checks for if table already exists.

    Lookout the property isTableField.

    I have also made a small change in github code.
    Sencha Touch Demos

    IosToggleField Forum - Github
    Form Validation
    Forum - Github
    Iphone Settings Menu
    Forum
    Sqlite Storage & Login Manifest
    Forum
    KitchenSink MVC
    Forum - Github
    SqliteProxy-v1 Forum - Github
    SqliteProxy-v2
    Forum - Github
    Arshaw Fullcalendar Forum - Github






Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..."