Files
bun.sh/src/sql/postgres/PostgresSQLContext.zig
taylor.fish 07cd45deae Refactor Zig imports and file structure (part 1) (#21270)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-07-22 17:51:38 -07:00

22 lines
650 B
Zig

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" });
}
const bun = @import("bun");
const jsc = bun.jsc;
const uws = bun.uws;