@@ -24,7 +24,7 @@ const supportOPFS = await isOpfsSupported()
24
24
console . log ( 'support module worker:' , supportModuleWorker )
25
25
console . log ( 'support IDBBatchAtomicVFS:' , supportIDB )
26
26
console . log ( 'support OPFSCoopSyncVFS:' , supportOPFS )
27
- document . querySelector ( '.main' ) ?. addEventListener ( 'click' , async ( ) => {
27
+ document . querySelector ( '.main-idb ' ) ?. addEventListener ( 'click' , async ( ) => {
28
28
if ( ! db ) {
29
29
// const root = await window.showDirectoryPicker()
30
30
// db = await initSQLite(useIdbMemoryStorage('test.db', { url }))
@@ -37,6 +37,9 @@ document.querySelector('.main')?.addEventListener('click', async () => {
37
37
sqliteModule : db . sqliteModule . _sqlite3_libversion_number ( ) ,
38
38
sql : ( await db . run ( 'select sqlite_version() as a' ) ) [ 0 ] . a ,
39
39
} )
40
+ await db . close ( )
41
+ } )
42
+ document . querySelector ( '.main-memory' ) ?. addEventListener ( 'click' , async ( ) => {
40
43
await runSQL ( ( await initSQLite ( useMemoryStorage ( { url : syncUrl } ) ) ) . run )
41
44
} )
42
45
document . querySelector ( '.import' ) ?. addEventListener ( 'click' , async ( ) => {
@@ -163,7 +166,7 @@ document.querySelector('.clear')?.addEventListener('click', async () => {
163
166
console . log ( 'clear all IndexedDB' )
164
167
} )
165
168
166
- function download ( buffer : Uint8Array ) : void {
169
+ function download ( buffer : Uint8Array < ArrayBuffer > ) : void {
167
170
const blob = new Blob ( [ buffer ] )
168
171
const reader = new FileReader ( )
169
172
reader . readAsDataURL ( blob )
0 commit comments