SQLite in Bun.sql (#21640)

### What does this PR do?

Support sqlite in the Bun.sql API

Fixes #18951
Fixes #19701

### How did you verify your code works?

tests

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
This commit is contained in:
Alistair Smith
2025-08-19 23:15:53 -07:00
committed by GitHub
parent 9b363e4ef6
commit 784271f85e
41 changed files with 11262 additions and 2740 deletions

View File

@@ -120,7 +120,8 @@ pub fn onJSError(this: *@This(), err: jsc.JSValue, globalObject: *jsc.JSGlobalOb
});
}
pub fn onError(this: *@This(), err: PostgresSQLStatement.Error, globalObject: *jsc.JSGlobalObject) void {
this.onJSError(err.toJS(globalObject), globalObject);
const e = err.toJS(globalObject) catch return;
this.onJSError(e, globalObject);
}
pub fn allowGC(thisValue: jsc.JSValue, globalObject: *jsc.JSGlobalObject) void {
@@ -377,7 +378,8 @@ pub fn doRun(this: *PostgresSQLQuery, globalObject: *jsc.JSGlobalObject, callfra
stmt.deref();
this.deref();
// If the statement failed, we need to throw the error
return globalObject.throwValue(this.statement.?.error_response.?.toJS(globalObject));
const e = try this.statement.?.error_response.?.toJS(globalObject);
return globalObject.throwValue(e);
},
.prepared => {
if (!connection.hasQueryRunning() or connection.canPipeline()) {