mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-18 17:14:20 +01:00
move compute to the main thread for browser and node
- now, most of the work is happening on the main thread - for database in browser, we still have dedicated WebWorker - but it is used only for OPFS access and only for that - for syn in browser we still offload sync operations to the WebWorker
This commit is contained in:
@@ -192,7 +192,12 @@ class Database {
|
||||
}
|
||||
|
||||
try {
|
||||
this.db.batchSync(sql);
|
||||
let stmt = this.prepare(sql);
|
||||
try {
|
||||
stmt.run();
|
||||
} finally {
|
||||
stmt.close();
|
||||
}
|
||||
} catch (err) {
|
||||
throw convertError(err);
|
||||
}
|
||||
@@ -408,6 +413,10 @@ class Statement {
|
||||
throw convertError(err);
|
||||
}
|
||||
}
|
||||
|
||||
close() {
|
||||
this.stmt.finalize();
|
||||
}
|
||||
}
|
||||
|
||||
export { Database, Statement }
|
||||
Reference in New Issue
Block a user