# v0.4.28 (2026-05-10)
## Features - Add bun:sqlite adapter with automatic runtime detection (Bun/Node) - Add bulk API key import (format: `name|sk-key`, one per line) ## Fixes - Fix add API key for custom providers
This commit is contained in:
@@ -86,14 +86,15 @@ export async function createSqlJsAdapter(filePath) {
|
||||
}
|
||||
|
||||
function transaction(fn) {
|
||||
db.exec("BEGIN");
|
||||
const sp = `sp_${Math.random().toString(36).slice(2)}`;
|
||||
db.exec(`SAVEPOINT ${sp}`);
|
||||
try {
|
||||
const result = fn();
|
||||
db.exec("COMMIT");
|
||||
db.exec(`RELEASE ${sp}`);
|
||||
scheduleSave();
|
||||
return result;
|
||||
} catch (e) {
|
||||
db.exec("ROLLBACK");
|
||||
try { db.exec(`ROLLBACK TO ${sp}`); db.exec(`RELEASE ${sp}`); } catch {}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user