diff options
Diffstat (limited to 'src/sql/postgres.zig')
-rw-r--r-- | src/sql/postgres.zig | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/sql/postgres.zig b/src/sql/postgres.zig index 6bc4e8602..bcd8225de 100644 --- a/src/sql/postgres.zig +++ b/src/sql/postgres.zig @@ -1489,6 +1489,20 @@ pub const PostgresSQLContext = struct { onQueryResolveFn: JSC.Strong = .{}, onQueryRejectFn: JSC.Strong = .{}, + + pub fn init(globalObject: *JSC.JSGlobalObject, callframe: *JSC.CallFrame) callconv(.C) JSC.JSValue { + var ctx = &globalObject.bunVM().rareData().postgresql_context; + ctx.onQueryResolveFn.create(callframe.argument(0), globalObject); + ctx.onQueryRejectFn.create(callframe.argument(1), globalObject); + } + + comptime { + if (!JSC.is_bindgen) { + @export(init, .{ + .name = "PostgresSQLContext__init", + }); + } + } }; pub const PostgresSQLQuery = struct { @@ -1707,7 +1721,7 @@ pub const PostgresSQLQuery = struct { comptime { if (!JSC.is_bindgen) { - @export(call, .{ .name = "PostgresqlQuery__createInstance" }); + @export(call, .{ .name = "PostgresSQLQuery__createInstance" }); } } }; |