Go to file
2014-04-10 16:45:20 +05:30
src Initial Commit 2014-04-10 16:08:44 +05:30
www Initial Commit 2014-04-10 16:08:44 +05:30
LICENSE Initial commit 2014-04-10 03:43:55 -07:00
plugin.xml Initial Commit 2014-04-10 16:08:44 +05:30
README.md Added Plugin Usage 2014-04-10 16:45:20 +05:30

cordova-plugin-dbcopy

Copy SQLite Database from assets(Android) or Resources(iOS) to App Directory

#####Note

If you are using this SQlite Plugin, then do not give the .db extension to your file while pasting it. Since the plugin automatically appends the .db extension while opening the database.

For example, if you are database name is demo.db, then remove the .db extension and paste the file with a name "demo" only (without quotes".

Android

Put your sqlite database in the assets directory.

iOS

Put your database in Resources directory and then Add it in to your Xcode Project. Right Click on the Resources directory, then click Add files.

Code

In your JavaScript or HTML use the following method -

function dbcopy()
{
        window.plugins.sqlDB.copy("demo",copysuccess,copyerror);
}

function copysuccess()
{
        //open db and run your queries
}

funtion copyerror()
{
        //db already exists or problem in copying the db file. Check the Log.
}