- From: zizxzy <notifications@github.com>
- Date: Fri, 30 Jun 2023 04:10:57 -0700
- To: w3c/IndexedDB <IndexedDB@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <w3c/IndexedDB/issues/406@github.com>
When I use the following code to create a new IndexedDB on my Edge browser. ``` const request = window.indexedDB.open('personDB', 1) var db request.onerror = function(error) { console.log('IndexedDB 打开失败', error) }; request.onsuccess = function(res) { console.log('IndexedDB 打开成功', res) db = res.target.result } request.onupgradeneeded = function(res) { db = res.target.result if (!db.objectStoreNames.contains('person')) { const db_table = db.createObjectStore('person', { keyPath: 'id' }) db_table.createIndex('indexName', 'name', { unique: false }) } } ``` And then I use the following code to output all database. ```js const promise = indexedDB.databases(); promise.then((databases) => { console.log(databases);// }); ``` ![image](https://github.com/w3c/IndexedDB/assets/43310343/ab60de80-5d23-4fa2-ae10-5d09637072a8) But when I use the following code to delete database,it don not work. ```js const deleteRequest = window.indexedDB.deleteDatabase('personDB') deleteRequest.onerror = function (event) { console.log("delete fail") } deleteRequest.onsuccess = function (event) { console.log("delete success") } ``` After a long time, there is still no output 'delete success'. ![image](https://github.com/w3c/IndexedDB/assets/43310343/a67fde5d-a88f-454e-afe8-b7e6f8351805) -- Reply to this email directly or view it on GitHub: https://github.com/w3c/IndexedDB/issues/406 You are receiving this because you are subscribed to this thread. Message ID: <w3c/IndexedDB/issues/406@github.com>
Received on Friday, 30 June 2023 11:11:03 UTC