mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 10:58:56 +00:00
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:
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user