{"id":22015490,"url":"https://github.com/an-rahulpandey/cordova-plugin-dbcopy","last_synced_at":"2025-09-10T11:34:19.574Z","repository":{"id":15891652,"uuid":"18632949","full_name":"an-rahulpandey/cordova-plugin-dbcopy","owner":"an-rahulpandey","description":"Copy SQLite Database from www folder to default app database location","archived":false,"fork":false,"pushed_at":"2019-08-13T07:37:46.000Z","size":86,"stargazers_count":89,"open_issues_count":9,"forks_count":47,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-08-29T22:39:34.857Z","etag":null,"topics":["android","cordova","cordova-android-plugin","cordova-database-copy","cordova-ios-plugin","cordova-plugin","cordova-plugin-dbcopy","java","objective-c","phonegap-plugin","sqlite-database","sqliteplugin"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/an-rahulpandey.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-04-10T10:43:54.000Z","updated_at":"2024-02-04T10:07:41.000Z","dependencies_parsed_at":"2022-08-07T08:01:22.441Z","dependency_job_id":null,"html_url":"https://github.com/an-rahulpandey/cordova-plugin-dbcopy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/an-rahulpandey/cordova-plugin-dbcopy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/an-rahulpandey%2Fcordova-plugin-dbcopy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/an-rahulpandey%2Fcordova-plugin-dbcopy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/an-rahulpandey%2Fcordova-plugin-dbcopy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/an-rahulpandey%2Fcordova-plugin-dbcopy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/an-rahulpandey","download_url":"https://codeload.github.com/an-rahulpandey/cordova-plugin-dbcopy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/an-rahulpandey%2Fcordova-plugin-dbcopy/sbom","scorecard":{"id":190887,"data":{"date":"2025-08-11","repo":{"name":"github.com/an-rahulpandey/cordova-plugin-dbcopy","commit":"861f585e4313db828d6b8c7d354c32c83373d0d2"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":1,"reason":"Found 3/27 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: license.txt:0","Info: FSF or OSI recognized license: Apache License 2.0: license.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 6 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-16T20:39:06.448Z","repository_id":15891652,"created_at":"2025-08-16T20:39:06.448Z","updated_at":"2025-08-16T20:39:06.448Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274455519,"owners_count":25288557,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-10T02:00:12.551Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","cordova","cordova-android-plugin","cordova-database-copy","cordova-ios-plugin","cordova-plugin","cordova-plugin-dbcopy","java","objective-c","phonegap-plugin","sqlite-database","sqliteplugin"],"created_at":"2024-11-30T04:22:10.102Z","updated_at":"2025-09-10T11:34:19.544Z","avatar_url":"https://github.com/an-rahulpandey.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"cordova-plugin-dbcopy\n=====================\n\nAdd a prepopulated SQLite database in your Phonegap/Cordova Android and iOS app.\n### IMPORTANT NOTE\n\n1. The database file may have extensions or not for e.g the db file name would be sample.db or sample.sqlite or sample. It doesn't matter what is the file extension, just remember to use the whole filename with extensions(if having one otherwise not) as a paramter when passing to the plugin methods.\n\n2. Location Parameters in plugin function means -\n\n```\n       location = 0; // (Disable iCloud Backup) If set will copy the database to Library/LocalDatabase. The database will not be synced by the iCloud Backup.\n       or\n       location = 1; // If set will copy the database to Library folder instead of Documents folder.\n       or\n       location = 2; // It will copy the database in the default SQLite Database directory. This is the default location for database\n```\n3. For Android, please set the target-sdk-version to minimum 26 in config.xml\n\n\n### Database file location\n\nThe database file must be present inside the www folder.\n\n### Installation\n\nPlugin can be install with simple cordova plugin add command -\n\n    cordova plugin add https://github.com/an-rahulpandey/cordova-plugin-dbcopy.git\n\n\n### Plugin Response Success and Error\n\nPlugin send the response in following format in case of any error or success - \n\n\n```javascript \n{\n  message : \"message contains the response string like Invalid DB Location or DB Doesn't Exists or Db Copied Successfully\",\n  code: integer value such as 404, 200, 516\n}\n```\n \n Code -\n\n``` \n 404 - DB or Source or Destination Doesn't exists, see message string.\n 516 - DB Already Exists.\n 200 - Called Method Executed Successfully.\n```\n\n### Methods\n\nCurrently there are five methods supported by the plugin.\n\n**Copy**\n=========================================\n\nThis Method allows you the copy the database from www directory.\n```javascript \n    window.plugins.sqlDB.copy(dbname, location, success,error);\n```\n  Here -\n\n   **dbname** -\u003e Is the name of the database you want to copy. The dbname can be filename (without extensions) or filename.db or filename.sqlite. The plugin will look for and copy the file according to the filename provided here. And the same file name should be used while opening the database via [SQLitePlugin](https://github.com/litehelpers/Cordova-sqlite-storage).\n\n   **location** -\u003e You can pass three integer arguments here (Use 0 for Android)-\n\n ```javascript \n      (for ios only)\n       location = 0; // (Disable iCloud Backup) If set will copy the database to Library/LocalDatabase. The database will not be synced by the iCloud Backup.\n       or\n       location = 1; // If set will copy the database to Library folder instead of Documents folder.\n       or\n       location = 2; // It will copy the database in the default SQLite Database directory. This is the default location for database\n```\n\n   **success** -\u003e function will be called if the db is copied sucessfully.\n\n   **error** -\u003e function will be called if the there is some problem in copying the db or the file already exists on the location.\n   \n**Check Database Available on External Storage**\n===============================================\n```javascript \n    window.plugins.sqlDB.checkDbOnStorage(dbname, source, success, error);\n```\n Here - \n \n   **dbname** -\u003e Name of the database file which is available on external or intenral storage\n\n   **source** -\u003e Full native path for the folder in which db file is present. The \"/\" must be added at the end of path. For.eg. /sdcard/mydb/\n\n\n\n**Copy Database from Device Storage**\n===============================================\n\nThis is an untested version. Let me know if you have any suggestions. Also Pull Request are always welcome.\n```javascript \n    window.plugins.sqlDB.copyDbFromStorage(dbname, location, source, deleteolddb, success, error);\n```\n Here - \n \n   **dbname** -\u003e Is the name of the database you want to copy. The dbname can be filename (without extensions) or filename.db or filename.sqlite. The plugin will look for and copy the file according to the filename provided here. And the same file name should be used while opening the database via [SQLitePlugin](https://github.com/litehelpers/Cordova-sqlite-storage).\n\n   **location** -\u003e You can pass three integer arguments here (Use 0 for Android)-\n\n```\n       (for ios only)\n       location = 0; // (Disable iCloud Backup) If set will copy the database to Library/LocalDatabase. The database will not be synced by the iCloud Backup.\n       or\n       location = 1; // If set will copy the database to Library folder instead of Documents folder.\n       or\n       location = 2; // It will copy the database in the default SQLite Database directory. This is the default location for database\n```\n **source** -\u003e Source File location like /sdcard/mydb/db.db. Please provide a valid existing location and the dbname should be present in the path.\n \n **deleteolddb** -\u003e A boolean value if set to true, will delete the existing db from the local app database folder before copying the new db. Please provide proper boolean value true or false;\n\n **success** -\u003e function will be called if the db is copied sucessfully.\n\n **error** -\u003e function will be called if the there is some problem in copying the db or the file already exists on the location.\n \n**Copy Database To Device Storage**\n============================================\n\nThis is an untested version. Let me know if you have any suggestions. Also Pull Request are always welcome.\n```javascript \n    window.plugins.sqlDB.copyDbToStorage(dbname, location, destination, overwrite, success, error);\n```\n Here - \n \n **dbname** -\u003e Is the name of the database you want to copy. The dbname can be filename (without extensions) or filename.db or filename.sqlite. The plugin will look for and copy the file according to the filename provided here. And the same file name should be used while opening the database via [SQLitePlugin](https://github.com/litehelpers/Cordova-sqlite-storage).\n \n **location** -\u003e You can pass three integer arguments here (Use 0 for Android)-\n```javascript\n   (for ios only)\n   location = 0; // (Disable iCloud Backup) If set will copy the database to Library/LocalDatabase. The database will not be synced by the iCloud Backup.\n   or\n   location = 1; // If set will copy the database to Library folder instead of Documents folder.\n   or\n   location = 2; // It will copy the database in the default SQLite Database directory. This is the default location for database\n```\n   **destination** -\u003e Destination File location like /sdcard/mydb/ Please provide a valid existing location and \"/\" should be present at the end of the path. Do not append db name in the path.\n   \n   **overwrite** -\u003e if set to true, then will replace the file at the destination. Otherwise will throw an error, if destination file already exists.\n   \n   **success** -\u003e function will be called if the db is copied sucessfully.\n   \n   **error** -\u003e function will be called if the there is some problem in copying the db or the file already exists on the location.\n   \n   \n**Remove**\n==================================\nThis method allows you to remove the database from the apps default database storage location.\n\n```javascript \n    window.plugins.sqlDB.remove(dbname, location, success,error);\n```\n\nHere -\n\n  **dbname** -\u003e Is the name of the database you want to remove. If the database file is having any extension, please provide that also.\n\n  **location** -\u003e The integer value for the location of database, see the copy method for options.\n\n  **success** -\u003e function will be called if the db is removed sucessfully.\n\n  **error** -\u003e function will be called if the there is some problem in removing the db or the file doesn't exists on the default database storage location.\n\n###Example Usage\n\nIn your JavaScript or HTML use the following method -\n\n```javascript \nfunction dbcopy()\n{\n        //Database filename to be copied is demo.db\n\n        //location = 0, will copy the db to default SQLite Database Directory, /Library/LocalDatabase (Disable iCloud Backup)\n        window.plugins.sqlDB.copy(\"demo.db\", 0, copysuccess,copyerror);\n\n        or\n\n        //location = 1, will copy the database to /Library folder\n        window.plugins.sqlDB.copy(\"demo.db\", 1, copysuccess,copyerror);\n\n        or\n\n        //location = 2, will copy the database to /Documents folder \n        window.plugins.sqlDB.copy(\"demo.db\", 2, copysuccess,copyerror);\n\n}\n\nfunction removeDB()\n{\n      var location = 1;\n      window.plugins.sqlDB.remove(\"demo.db\", location, rmsuccess,rmerror);  \n}\n\nfunction copysuccess()\n{\n        //open db and run your queries\n         db = window.sqlitePlugin.openDatabase({name: \"demo.db\"});.\n}\n\nfunction copyerror(e)\n{\n        //db already exists or problem in copying the db file. Check the Log.\n        console.log(\"Error Code = \"+JSON.stringify(e));\n        //e.code = 516 =\u003e if db exists\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fan-rahulpandey%2Fcordova-plugin-dbcopy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fan-rahulpandey%2Fcordova-plugin-dbcopy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fan-rahulpandey%2Fcordova-plugin-dbcopy/lists"}