Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Christopher J. Brody
    @brodybits
    I am trying to reproduce it, hang on
    laoyao
    @laoyao
    many thanks
    Christopher J. Brody
    @brodybits
    I spent 2-3 hours trying to get click events until I discovered this article: http://www.shdon.com/blog/2013/06/07/why-your-click-events-don-t-work-on-mobile-safari
    Christopher J. Brody
    @brodybits
    @laoyao when I try the test in a fresh project (using JQuery Mobile) it is working OK for me. Can you please try it in a fresh project?
    laoyao
    @laoyao
    i make some custom code in sqliteplugin.js and sqliteplugin.m
    i give the custom file to u?can you help me test it in your fresh project?
    @brodybits
    Christopher J. Brody
    @brodybits
    You say that you see the problem when you run the custom code? Best if you can send me the results of git diff. You can send it in the private chat or to info@litehelpers.net
    laoyao
    @laoyao
    ok i will give you a email
    Christopher J. Brody
    @brodybits
    You can send either the results of git diff, or just send your version of SQLitePlugin.js & SQLitePlugin.m, if you like.
    laoyao
    @laoyao
    i send the js and m file
    Sven Roeterdink
    @swennemans
    He guys, I'm comparing performance on Phonegap vs Swift. I'm doing some actions that I want to benchmark.
    I'm here just checking to see if my code is not completely off, could someone take a quick glance at it, and maybe give advice?
    My function where the inserting happens is:
    function loadDocs(tx) {
      var q = "INSERT INTO test_table (data, data_num) VALUES (?,?)";
      for (var i = 0; i < 1500; i++) {
          tx.executeSql(q, ["test", i], function (tx, res) {
           })
       }
    }

    and then:

     var startTime = (Date.now() / 1000);
     db.transaction(loadDocs, [], querySuccess, errorCB);

    I stop timing in my succesCB.

    Thanks :smile: :shipit:
    Christopher J. Brody
    @brodybits
    Looks OK to me
    Chun-Sheng, Li
    @peter279k
    blob
    Hi everyone,I follow this Manual installation - Android version.I install the library (step by step).
    I used the js sample code but it was not worked.They output the error message: "database not open"
    I don't know what happen and I am sure I have included the libraries correctly.Thaks for help me.
    blob
    This is my file source tree.
    Christopher J. Brody
    @brodybits
    I saw it. You also need sqlite-native-driver.jar (hope I got the name right)
    Chun-Sheng, Li
    @peter279k
    blob
    I add the sqlite-native-driver.jar and I got the another errors
    blob
    Christopher J. Brody
    @brodybits
    See litehelpers/Cordova-sqlite-storage#306
    Chun-Sheng, Li
    @peter279k
    OK, I got it.Thanks.
    It worked finally.
    Christopher J. Brody
    @brodybits
    Thanks, happy to hear!
    Rakesh Vidya Chandra
    @krvc

    Hello, I am a newbie who is trying to upgrade an old Cordova IOS app. I need a suggestion on whether Cordova-sqlite-storage plugin is the fix for my issue. Issue: I do need to access the database which is already existing. The old code consists of a function which tries to get the database and it looks like :

        NSArray *libraryPaths = NSSearchPathForDirectoriesInDomains
        (NSLibraryDirectory, NSUserDomainMask, YES);
        NSString *libraryDir = [libraryPaths objectAtIndex:0];
       masterPath = [libraryDir stringByAppendingPathComponent:@"Caches/"];
       databasePath = [libraryDirstringByAppendingPathComponent:@"Caches/file__0/"];      masterFile = [masterPath stringByAppendingPathComponent:masterName];
        databaseFile = [databasePath
                        stringByAppendingPathComponent:databaseName];
        // Execute the "checkAndCreateDatabase" function
        [self checkAndCreateDatabase];
    
        NSUserDefaults* appPreferences = [NSUserDefaults standardUserDefaults];
        NSBundle* mainBundle = [NSBundle mainBundle];
    ...........
    .........

    I am facing the an error: sqlite prepare statement error - no such table
    when I run the app. Should I use the Cordova-sqlite-storage plugin instead of using this code. Please correct me if I am missing anything.

    Thanks in advance.
    Christopher J. Brody
    @brodybits
    The old code seems to put the database in a Caches/file__0 subdirectory but the sqlite plugin does not look there. I can think of a couple of options to solve this:
    You should be able to use the Cordova File plugin to copy the database to Documents if it does not already exist there. This is very similar to how the pre-populated database functionality works.
    Christopher J. Brody
    @brodybits
    The second option is to use the pre-populated database functionality but modify SQLitePlugin.m to copy the database from Caches/file__0 instead of www.
    Rakesh Vidya Chandra
    @krvc
    Thanks a lot for your suggestions Chris :smile: I will try out your suggestions.
    Carson Huang
    @kot09
    Hey brodybits. If I use a query like this "CREATE TABLE IF NOT EXISTS ...", what would be be the callback's parameters? I want something to happen only on the creation
    Christopher J. Brody
    @brodybits
    You can add a success callback function in your tx.executeSql('CREATE TABLE IF NOT EXIST...'... statement. If the CREATE TABLE statement is executed successfully your success callback function is called if provided with the tx and results parameters. The results parameter will not have any useful information for CREATE or DROP queries.
    Rakesh Vidya Chandra
    @krvc
    Hello Chris, I am using Sqlite storage plugin while upgrading my IOS Cordova project. When I run the application I am facing an issue with the error: Deprecated attempt to access property 'userAgent' on a non-Navigator object. And my remote debugger is taking me to the SqlitePlugin.js file in the stacktrace of error. What would be the culprit. This is my stack trace: http://imgur.com/B38P38p
    Rakesh Vidya Chandra
    @krvc
    Thank you Chris for your prompt response. I tried that solution, but it didn't work. If you have a look on to the stacktrace you can see the cordova file that is being accessed is cordova-3.1.0.js. But I have updated my IOS platform to Cordova-3.8.0. Could it be the reason for the issue?
    Christopher J. Brody
    @brodybits
    It is possible. Please make sure you are running with the right version of the Cordova Javascript.
    Rakesh Vidya Chandra
    @krvc
    Thank you Chris
    rickarddahlinfor
    @rickarddahlinfor
    Hi! I’m trying to use the auto-vaccum pragma, but can’t get it to work. I’m doing the "PRAGMA auto_vaccum = 1;” directly after running the openDatabase function (the database file do not exist before the openDatabase call). I then add about 100 mb of data, then deleting it. I expected the db file to reduce itself after the delete, but it remains at 100 mb. As far as I understand it, this should work… I’m using ”io.litehelpers.cordova.sqlite 0.7.7” on cordova 5.1.1.
    Christopher J. Brody
    @brodybits
    Hi sorry I did not see your message earlier. Please specify which platform and open database options. I have read about some problems with auto_vacuum in the past
    Best if you can raise this as an issue
    rickarddahlinfor
    @rickarddahlinfor

    Hi again! I have now made some more testing, and I got ”PRAGMA AUTO_VACUUM = 1;” to work by executing ”VACUUM;” directly after the auto_vacuum statement is executed. This is (?) a bug and I will file an issue on it.

    I using an iOS 8.4 simulator. The open parameters are "window.sqlitePlugin.openDatabase({name: db_name, location: 2, createFromLocation: 1});”.

    Christopher J. Brody
    @brodybits
    Thanks for letting me know. This may be because of how sqlite3.c is built. I will document this in the readme when I get a chance.
    greatredpie
    @greatredpie
    Hi. Sorry bit of a phone gap noob. When building this app with build.phonegap.com can I just add this plugin to the config.xml file, rather than installing the plugin using the CLI. As shown here: http://docs.build.phonegap.com/en_US/configuring_plugins.md.html#Plugins
    Christopher J. Brody
    @brodybits
    Yes that should work. If not you can file an issue.
    lyric123123
    @lyric123123
    blob
    This is my file source tree.