mirror of
https://github.com/oven-sh/bun
synced 2026-02-16 22:01:47 +00:00
22 lines
650 B
Zig
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;
|