List Items In An IndexedDB Database
NOTE
After writing this I found :
> https : //github.com/jakearchibald/idb > https : //github.com/jakearchibald/idb >
which I'm experimenting with and looks like I'll be using :
See The Stuff
This is how I'm getting a list of all the items for a specific data store in an IndexedDB database. Check the console for the output
JavaScript
let db
const DB_NAME = "Example_List_Items"
const DB_VERSION = 56
const DB_STORE_NAME = `widgets`
const DB_STORE_KEY = "id"
const
const
const
document.
- This page populates the data so there's something to list
- The main focus of this page is the [TODO: Code shorthand span ] function that expects a [TODO: Code shorthand span ] variable to be available with an open database connection
- Took a while to figure this one out. I'm still a yellow belt with IndexedDB so feel free to check my work
Footnotes And References
- •Using IndexedDB - MDN
This post has a lot in it, but it's structure didn't work very well for me. I've had to pull things out and make my own examples to figure out how things work
- •IDBOpenDBRequest - MDN
Docs about the connection for an IndexedDB. I was trying to figure out if [TODO: Code shorthand span ] is called after [TODO: Code shorthand span ] . I didn't see that in the docs, but that seems to be how things are working with the code
- •indexeddb-api examples from MDN's GitHub
There's a bunch of stuff in here that I want to look at for things like how to clear storage. It has [TODO: Code shorthand span ] in front of somethings. Not sure if that means it's jQuery or not. I don't see that called, so I'm not sure
- •
- •