Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
community-cordova-plugin-dbcopy
Advanced tools
I dedicate a considerable amount of my free time to developing and maintaining many Cordova plugins for the community (See the list with all my maintained plugins). To help ensure this plugin is kept updated, new features are added, and bugfixes are implemented quickly, please donate a couple of dollars (or a little more if you can stretch) as this will help me to afford to dedicate time to its maintenance. Please consider donating if you're using this plugin in an app that makes you money, or if you're asking for new features or priority bug fixes. Thank you!
The Db Copy plugin allows you to copy a database file from a base64-encoded source to your application's storage and vice versa. It supports both Android and iOS platforms and provides functionality to facilitate the transfer of SQLite databases for Cordova applications.
To install the plugin, use the following Cordova command:
cordova plugin add community-cordova-plugin-dbcopy
The plugin provides two main functions that can be called from your JavaScript code.
copyDbFromStorage(options, successCallback, errorCallback)
Copies a database from a base64-encoded source to the application's storage.
Options
dbName
(string): The name of the database to copy.base64Source
(string): The base64-encoded database source.location
(string, optional): The location to store the database (default
, documents
, or external
). Default is default
.deleteOldDb
(boolean, optional): Whether to delete the existing database with the same name. Default is false
.Example
DbCopy.copyDbFromStorage({
dbName: 'myDatabase.db',
base64Source: '<base64_encoded_string>',
location: 'documents',
deleteOldDb: true
}, function() {
console.log('Database copied successfully.');
}, function(error) {
console.error('Error copying database: ', error);
});
copyDbToStorage(options, successCallback, errorCallback)
Copies a database from the application's storage to an external storage path.
Options
fileName
(string): The name of the database to copy.fullPath
(string): The full path where the database will be copied.overwrite
(boolean, optional): Whether to overwrite the existing file. Default is false
.Example
DbCopy.copyDbToStorage({
fileName: 'myDatabase.db',
fullPath: 'file:///storage/emulated/0/',
overwrite: true
}, function() {
console.log('Database copied to storage successfully.');
}, function(error) {
console.error('Error copying database to storage: ', error);
});
copyDbFromStorage(options, successCallback, errorCallback)
copyDbToStorage(options, successCallback, errorCallback)
This plugin is open-sourced under the Apache License, Version 2.0. See the LICENSE file for more information.
Contributions are welcome! Please create an issue or submit a pull request to contribute.
If you find any issues or have suggestions for new features, please report them on the GitHub Issues page.
If you find this plugin useful, consider making a donation to support ongoing development and maintenance. Your support is greatly appreciated!
FAQs
A plugin for db copy
We found that community-cordova-plugin-dbcopy demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.