Coder Social home page Coder Social logo

Comments (10)

an-rahulpandey avatar an-rahulpandey commented on June 11, 2024

Can you paste the log from Xcode? or do this in error function console -

console.log("error in copy db", error)

from cordova-plugin-dbcopy.

anilkunchalaece avatar anilkunchalaece commented on June 11, 2024
INSTALL SUCCESS


LAUNCH SUCCESS


0     178269   log      error in copy db, DB Already Exists
1     178271   log      Error in Error callbackId: sqlDB368979961 : Error: Database location or iosDatabaseLocation setting is now mandatory in openDatabase call.
JS changed:   www/js/app.js
JS changed:   www/js/app.js
0     182186   log      error in copy db, DB Already Exists

i am using ionic run command.

from cordova-plugin-dbcopy.

anilkunchalaece avatar anilkunchalaece commented on June 11, 2024

Hi, Problem is in line
db = $cordovaSQLite.openDB("demo.db");

thanks for quick reply

from cordova-plugin-dbcopy.

an-rahulpandey avatar an-rahulpandey commented on June 11, 2024

Like the error says you have to pass databaselocation or iOSDatabaseLocation paramter while opening the db. For. e.g

$cordovaSQLite.openDB({name : 'demo.db.sqlite',location : 'default'});

location depends on where you copied the db.

from cordova-plugin-dbcopy.

anilkunchalaece avatar anilkunchalaece commented on June 11, 2024

Hi,
i am not getting any tables from the data base, where am i doing wrong ?

` window.plugins.sqlDB.copy("demo.db",0,function() {
            console.log("db read")
            db = $cordovaSQLite.openDB({name : 'demo.db',location : 'default'});
        }, function(error) {
            console.log("error in copy db",error.message)
            db = $cordovaSQLite.openDB({name: "demo.db",location: 'default'})
        })`

and in controller

` $scope.showTables = function(){
      console.log("show table")
      $cordovaSQLite.execute(db,"SELECT name FROM sqlite_temp_master WHERE type=?",['table']).then(function(res){
        console.log("tables"+res.rows.length)
      }),function(err){
        console.log('error in reading tables'+err)
      }
    }

})`

in assests folder the db is copying and have the tables

from cordova-plugin-dbcopy.

an-rahulpandey avatar an-rahulpandey commented on June 11, 2024

Remove the old db and recopy it. I think there might something wrong with the database or query. Use this to check sqlite database - http://sqlitebrowser.org/

from cordova-plugin-dbcopy.

anilkunchalaece avatar anilkunchalaece commented on June 11, 2024

dbcheck

it is showing file.
for reading the data i am using this, it's also giving me nothing


          $scope.loadDb = function(){
            console.log("values reading from db");
            $scope.val = [];
            $cordovaSQLite.execute(db, "SELECT * FROM example").then(function(res) {
                console.log(res.rows.length);
                for (var i = 0; i < res.rows.length; i++) {
                    $scope.val.push(res.rows.item(i).firstname)
                    //console.log('added' + res.rows.item(i).firstname)
                }



            }),function(err){
                console.log('error'+err.message)
            }
 //       })
    }


from cordova-plugin-dbcopy.

an-rahulpandey avatar an-rahulpandey commented on June 11, 2024

Have you deleted the old app and installed new app? Also what is the error message in $cordovaSQLite.execute function?

from cordova-plugin-dbcopy.

anilkunchalaece avatar anilkunchalaece commented on June 11, 2024

i uninstalled and run the emulator.
now it is working.
Thankyou so much for your quick replys..
btw what is the problem ?

from cordova-plugin-dbcopy.

an-rahulpandey avatar an-rahulpandey commented on June 11, 2024

It might be database location problem which was copied somewhere else. Sqlite Plugin would have created a new blank database.

from cordova-plugin-dbcopy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.