refactor(postgres) improve postgres code base (#20808)

Co-authored-by: cirospaciari <6379399+cirospaciari@users.noreply.github.com>
This commit is contained in:
Ciro Spaciari
2025-07-07 18:41:01 -07:00
committed by GitHub
parent 19a855e02b
commit aa06455987
73 changed files with 5542 additions and 4995 deletions

View File

@@ -0,0 +1,23 @@
tcp: ?*uws.SocketContext = null,
onQueryResolveFn: JSC.Strong.Optional = .empty,
onQueryRejectFn: JSC.Strong.Optional = .empty,
pub fn init(globalObject: *JSC.JSGlobalObject, callframe: *JSC.CallFrame) bun.JSError!JSC.JSValue {
var ctx = &globalObject.bunVM().rareData().postgresql_context;
ctx.onQueryResolveFn.set(globalObject, callframe.argument(0));
ctx.onQueryRejectFn.set(globalObject, callframe.argument(1));
return .js_undefined;
}
comptime {
const js_init = JSC.toJSHostFn(init);
@export(&js_init, .{ .name = "PostgresSQLContext__init" });
}
// @sortImports
const bun = @import("bun");
const JSC = bun.JSC;
const uws = bun.uws;