polarisation / indexeddb-export-import Goto Github PK
View Code? Open in Web Editor NEWExport/import an IndexedDB database to/from JSON. Can be used to backup and restore.
License: MIT License
Export/import an IndexedDB database to/from JSON. Can be used to backup and restore.
License: MIT License
if this module is already installed in the project, running the npm insatll fails with the message
`npm install
npm ERR! code EISGIT
npm ERR! path **\node_modules\indexeddb-export-import
npm ERR! git **\node_modules\indexeddb-export-import: Appears to be a git
repo or submodule.
npm ERR! git **\node_modules\indexeddb-export-import
npm ERR! git Refusing to remove it. Update manually,
npm ERR! git or move it out of the way first.
npm ERR! A complete log of this run can be found in:
npm ERR! **\AppData\Roaming\npm-cache_logs\2020-06-01T13_10_57_546Z-debug.log`
This error is caused because tar.gz in version 2.0.2 has a directory **. git ** inside, the solution is to remove and resend. The package **. zip ** is OK
I have a requirement to take a backup of indexed database from the browser. Can you please point me to a place that explains this or give me some pointers of how to use this library to run the backup from a browser.
ArrayBuffer should be exported via some tricky way instead of JSON.stringify
.
When importing a backup into a browser that didn't have an existing database I get the following error:
Uncaught DOMException: Failed to execute 'transaction' on 'IDBDatabase': The storeNames parameter was empty.
This is due to idbDatabase.objectStoreNames
being an empty list in
const transaction = idbDatabase.transaction(
idbDatabase.objectStoreNames,
'readwrite'
);
Any help would be appreciated!
Example provided uses exportToJson but the method inside the package is exportToJsonString
applicable for importFromJson as well
This may be a very naive question but index creation is very slow for me and I have a large (400k+) table with a few indexes. Following the examples I am still getting the browser creating indexes internally (which use a lot of CPU and take several minutes, so it is very visible), so it appears this project doesn't do that. I would have been very surprised if it could do this but if you don't ask you will never know!
I'm saving sets to my database, eg new Set()
and while they show as a Set in the indexeddb inspector, they appear as empty objects {}
in the exported JSON.
Something like this in the Chrome inspector:
{
items: Set(12)
}
becomes:
{
"items": {}
}
Hi,
When trying to bundling my project with webpack and UglifyJs I get the following error:
ERROR in static/js/vendor.a27e424093e8687946a1.js from UglifyJs
Unexpected token: name (count) [./node_modules/indexeddb-export-import/index.js:50,0][static/js/vendor.a27e424093e8687946a1.js:51531,6]
...
ERROR in static/js/vendor.c242818493dd22375921.js from UglifyJs
Unexpected token: name (count) [./node_modules/indexeddb-export-import/index.js:76,0][static/js/vendor.c242818493dd22375921.js:51557,5]
I'm trying to save a copy (whether JSON or some other format) of a third-party's site's indexedDB. Is that something that this library could help with? If so, what's a rough sketch of how to do that?
We are trying to converting our Web App into an Electron APP.
We use DexieJS in our Web App, so we prefer to use it as well in our Electron APP.
However, we are worried about the data safety, since there are maybe some scenarios, the data inside indexedDB MIGHT be deleted. Such as reinstall the App, auto update the App etc. We are not sure about it. But we can not risk it.
I found this project while searching around the internet. I am wondering maybe this could be used to backup the indexedDB.
Is this possible?
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.