Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
564 views
in Technique[技术] by (71.8m points)

windows - IndexedDB view all Databases and Object Stores

I'm using IndexedDB in a Windows 8 app and I'm very new to both. I've been able to successfully create, read, update, delete objects from object stores, and have created a couple databases and a few object stores. My question is how can I list all of my object stores and databases? I create a few bogus ones that are not needed and I would like to clean things up a bit, but I can't remember what they are named. Maybe this is anal retentive, but it seems like it should be possible to list all databases and stores. Thanks!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

At the time of writing this post [chrome 72], You can list all the databases using following command in console of the browser. Essentially indexedDB.databases() is a Promise. You can use it to get list of all databases as an array. Run a loop on the array to get the names of databases.

indexedDB.databases().then(r => console.log(r))

Hope this helps


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...