Comments (9)
I'll find some time to take a close look at that. Sorry I haven't so far.
from idb.
To make it easier for me to debug this, can you reproduce the issue in the Typescript playground? Here's a demo that shows a cursor with a correct type.
from idb.
@jakearchibald yes, demo with broken types
from idb.
We have to improve type for createObjectStore
, to require exists property for keyPath.
We must consider case with a composite keyPath
from idb.
It looks like you've just missed part of the value definition? This works.
from idb.
@jakearchibald you're right, we use typescript exactly to avoid data misses. Types for createObjectStore
must make impossible a missed property and generate compile time error for such cases
from idb.
I'll accept a PR for this if it works, but keyPath
is pretty complex.
from idb.
@jakearchibald agree about complexity, maybe i will try to fix when will have time. Let's mark this as bug and needs help
from idb.
I think my PR #252 solves this issue - add and put accept an object with or without the auto incrementing keyPath being present, but any object returned from the database has the keyPath value defined. Example
from idb.
Related Issues (20)
- Tx does not rollback ? HOT 1
- Unable to build project with Node 18 with yarn link HOT 3
- Error when building Next.js HOT 1
- Force to close DB HOT 1
- Typescript Schema typing error HOT 3
- Remove Edge-specific code HOT 1
- Support discriminated union type or similar in database schemas HOT 3
- KnownKeys on ts > 4.2 HOT 1
- How to delete an object store? HOT 4
- Aborting a Transaction HOT 4
- Can't do async data migrations in the sync upgrade function HOT 7
- need method to bulk insert HOT 3
- 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
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.