diff options
author | 2023-10-15 02:05:35 -0700 | |
---|---|---|
committer | 2023-10-15 02:05:35 -0700 | |
commit | 0a149bdbbbc3f284d0428c1117812c70e3abbcc4 (patch) | |
tree | f60a871bcf5b316dedcb199268ee8b27b92536d5 /src/sql/postgres.zig | |
parent | 93a7c97e94d40d883be5c21acf81050099975fa7 (diff) | |
download | bun-0a149bdbbbc3f284d0428c1117812c70e3abbcc4.tar.gz bun-0a149bdbbbc3f284d0428c1117812c70e3abbcc4.tar.zst bun-0a149bdbbbc3f284d0428c1117812c70e3abbcc4.zip |
okay we are starting to try it
Diffstat (limited to '')
-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" }); } } }; |