Comments (23)
How did you add the plugin and what platform are you using. What is the exact error message, does it showing window.plugins.sqlDB undefined?
from cordova-plugin-dbcopy.
hi,
i have copied the databasehelper.java and sqldb.java under src folder of my project.
Then added the sqldb.js inside www folder.
Then added my demo.sqlite file under assets directory.
and called in javscript as you said .
function dbcopy()
{
window.plugins.sqlDB.copy("demo",copysuccess,copyerror);
}
from cordova-plugin-dbcopy.
Do not add the plugin manually, please add the plugin using the Cordova CLI -
cordova plugin add https://github.com/an-rahulpandey/cordova-plugin-dbcopy.git
from cordova-plugin-dbcopy.
ok let me add using this.Thankyou
from cordova-plugin-dbcopy.
Hi,
i my sample database name is test.sqlite have defined like this
var db = window.plugins.sqlDB.copy("test",copysuccess,copyerror);
alert(db);
but i get it as "undefined"
please guide me where i am wrong.
from cordova-plugin-dbcopy.
Use the demo code as shown in the read me, call the dbcopy function and put the console.log or alert in the copysuccess method. If you are using any IDE, you can check for error in their log section.
from cordova-plugin-dbcopy.
HI,
I am having my "test.sqlite" inside assets directory and trying to call like below.still i get alert as
copy error.
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
alert("onDeviceReady");
var db = window.plugins.sqlDB.copy("test",copysuccess,copyerror);
alert(db);
}
function copysuccess()
{
alert("copysuccess");
}
function copyerror()
{
alert("copyerror");
}
from cordova-plugin-dbcopy.
First delete your existing app from the device, then compile and run the new app with this change
var db = window.plugins.sqlDB.copy("test.sqlite",copysuccess,copyerror);
Also if you are using eclipse, check the Logcat. I have not removed the logging from the current code, it will also give you the exact error message.
One more thing, it goes to copy error method -
- When there is a problem while copying the database.
- When the database already exists in the current location.
You can use following method to know the exact issue -
function copyerror(e)
{
alert(JSON.stringify(e));
}
from cordova-plugin-dbcopy.
Hi,
Just now i got into copy success function
i just changed the line
var db = window.plugins.sqlDB.copy("test.sqlite",copysuccess,copyerror);
into
var db = window.plugins.sqlDB.copy("test.db",copysuccess,copyerror);
Thanks
from cordova-plugin-dbcopy.
HI,
select query inside copy success always returns "no table found".below is my code
document.addEventListener("deviceready", onDeviceReady, false);
var db
function onDeviceReady() {
alert("onDeviceReady");
window.plugins.sqlDB.copy("Databases.db",copysuccess,copyerror);
}
function copysuccess()
{
alert("copysuccess");
db = window.openDatabase("Databases", "1.0", "Test DB", 1000000);
db.transaction(queryDB, errorCB);
}
function copyerror()
{
alert("copyerror");
//db.transaction(queryDB, errorCB);
}
function queryDB(tx) {
alert("started");
tx.executeSql("select id from halal_product",[],renderEntries,errorCB);
}
function renderEntries(tx,results){
alert("res.rows.length: " + results.rows.length);
}
function errorCB(err) {
alert("Error processing SQL : "+err.message);
}
from cordova-plugin-dbcopy.
You have to use SQLite Plugin -
https://github.com/brodysoft/Cordova-SQLitePlugin
from cordova-plugin-dbcopy.
yes i have used it alerady but it says no table found
from cordova-plugin-dbcopy.
Run the code in simulator and then copy the db from the data directory. Open the downloaded db in Sqlitebrowser and check if everything is proper or not.
from cordova-plugin-dbcopy.
HI,
if i give the path like this
db = window.sqlitePlugin.openDatabase('/data/data/com.qr.app/databases/qrapp.db',"1.0", "qr", 1000000);
it opens correctly.
from cordova-plugin-dbcopy.
var db = window.sqlitePlugin.openDatabase("Databases.db", "1.0", "Test DB", -1);
In your previous code there was no .db extension.
from cordova-plugin-dbcopy.
I have also the problem that I am not able to talk to my sqlite db on an iphone.
In xcode I have this warning:
warning: no rule to process file '/Library/WebServer/Documents/rcs/dev/platforms/ios/Myapp/Plugins/me.rahul.plugins.sqlDB/sqlDB.h' of type sourcecode.c.h for architecture arm64
In the debug console I receive this:
- [debug] OPEN database: rcsappmobile.db
- [debug] Initializing SQLitePlugin
- [debug] Detected docs path: /var/mobile/Containers/Data/Application//Documents
- [debug] Detected Library path: /var/mobile/Containers/Data/Application//Library
- [debug] no cloud sync at path: /var/mobile/Containers/Data/Application//Library/LocalDatabase
- [debug] open full db path: /var/mobile/Containers/Data/Application//Library/LocalDatabase/rcsappmobile.db
- [debug] Good news: SQLite is thread safe!
- [debug] DB opened: rcsappmobile.db
I have no problems on Android!
I created also an issue on Stackoverflow with more info regarding my code: http://stackoverflow.com/q/36705044/2425177
Any ideas?
from cordova-plugin-dbcopy.
See #25
from cordova-plugin-dbcopy.
Can you help me? I added the sqlDB plugin using cordova, but still having call to unknown plugin: sqlDB error.
from cordova-plugin-dbcopy.
@IoTFusion Try building your project with Cordova CLI.
from cordova-plugin-dbcopy.
when db copy it crash app.
from cordova-plugin-dbcopy.
from cordova-plugin-dbcopy.
my db present in www folder of cordova-plugin-dbcopy
basically my database copied but not whole database.
my database size is 25 MB and when copy just start and reach to just 12 KB my app crashed.
it's says like "unfortunatley , your app closed".
i am using Telerik app builder and my code as below
my code:
window.plugins.sqlDB.copy("mydb",null, function (error) {
alert(JSON.stringify(error));
console.log(JSON.stringify(error));
});
also i tried
window.plugins.sqlDB.copy("mydb",0,null, function (error) {
alert(JSON.stringify(error));
console.log(JSON.stringify(error));
});
from cordova-plugin-dbcopy.
from cordova-plugin-dbcopy.
Related Issues (20)
- copyDbFromStorage: DB Not Present in www folder HOT 2
- Copy from a different folder HOT 3
- Issue with Android copyDbFromStorage HOT 3
- Issue when building Android for ionic HOT 2
- copyDbFromStorage seems to fail for Android 9 HOT 4
- I can't insert or update after copied HOT 1
- Build error in v 2.1.0 HOT 4
- Phonegap build failed with latest version (2.1.1) HOT 8
- copying on a usb storage HOT 1
- copyDbFromStorage copy Db to wrong path in Android 9 HOT 4
- customize output file name HOT 1
- What's error code: 400? HOT 2
- Issue on Android 9 *AFTER* succesfull copy on device HOT 1
- Playstore shows crashed Apps
- Ionic 4 problem copy database.db HOT 3
- Error during installation of plugin HOT 1
- error during plugin installation
- copy to device storage
- showing database already exists HOT 1
- Does sqliteDbCopy run on Capacitor? error:400 HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cordova-plugin-dbcopy.