Comments (3)
Why is "no loops" a requirement?
from idb.
For loop take alot of time i think i miss something
from idb.
Nah, the type of loop is very rarely the performance problem, it's almost always what's inside the loop that causes performance issues.
// Let's say you had a database like this:
const db = await openDB('Articles', 1, {
upgrade(db) {
// Create a store of objects
const store = db.createObjectStore('articles', {
// The 'id' property of the object will be the key.
keyPath: 'id',
});
},
});
// And you had an array of articles:
const articles = [
// …articles…
];
// I'd add them all like this:
const tx = db.transaction('articles', 'readwrite');
await Promise.all(articles.map((article) => tx.store.add(article)));
await tx.done;
from idb.
Related Issues (20)
- Incorrect type of cursor value HOT 9
- Firebase Warning: Original error: (0 , _idb.openDB) is not a function. (app/idb-get). HOT 1
- IDBPTransaction TxStores type checking support HOT 1
- Typescript: cannot compose schema from multiple files HOT 1
- cannot delete particular data in store using IDBKeyRange and cursor. HOT 4
- idb does not detect changes HOT 1
- index.count and db.countFromIndex doesnt work in safari HOT 5
- Open Is Still Successful If Upgrade Throws Exception
- How to use it in a REPL? HOT 1
- Consider adding TypeDoc?
- Database persistence HOT 2
- Add support for Typescript 5.2's `using` keyword
- No able create more the 5 table object in Indexdb
- egronomic way to provide schema via JSDoc
- ConstraintError: Key already exists in the object store. HOT 2
- Not able to import openDB from idb/with-async-ittr in Ver 8
- Comment confusing `unlisten`
- delete only takes key as string but autoincremented keys are numbers HOT 1
- When I try to use main.js in my app I get a referenc eerror-
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 idb.