From ea2b65d4834d864029299809fb23f40ba2a56f90 Mon Sep 17 00:00:00 2001 From: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Date: Mon, 2 Jan 2023 21:05:56 -0800 Subject: Draw the owl --- src/bun.js/bindings/ZigGlobalObject.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/bun.js/bindings/ZigGlobalObject.cpp') diff --git a/src/bun.js/bindings/ZigGlobalObject.cpp b/src/bun.js/bindings/ZigGlobalObject.cpp index d8593a9fa..e5b55f177 100644 --- a/src/bun.js/bindings/ZigGlobalObject.cpp +++ b/src/bun.js/bindings/ZigGlobalObject.cpp @@ -1080,6 +1080,8 @@ enum ReadableStreamTag : int32_t { Bytes = 4, }; +extern "C" EncodedJSValue Bun__PostgreSQL__connect(JSGlobalObject*, CallFrame*); + // we're trying out a new way to do this lazy loading static JSC_DEFINE_HOST_FUNCTION(functionLazyLoad, (JSC::JSGlobalObject * globalObject, JSC::CallFrame* callFrame)) @@ -1099,6 +1101,7 @@ JSC: static NeverDestroyed bunStreamString(MAKE_STATIC_STRING_IMPL("bun:stream")); static NeverDestroyed noopString(MAKE_STATIC_STRING_IMPL("noop")); static NeverDestroyed createImportMeta(MAKE_STATIC_STRING_IMPL("createImportMeta")); + static NeverDestroyed bunSql(MAKE_STATIC_STRING_IMPL("bun:sql")); JSC::JSValue moduleName = callFrame->argument(0); if (moduleName.isNumber()) { @@ -1154,6 +1157,11 @@ JSC: JSFunction::create(vm, globalObject, 1, fileURLToPathString, functionFileURLToPath, ImplementationVisibility::Public, NoIntrinsic)); } + if (string == bunSql) { + return JSC::JSValue::encode( + JSFunction::create(vm, globalObject, 1, bunSql, Bun__PostgreSQL__connect, ImplementationVisibility::Public, NoIntrinsic)); + } + if (string == bunStreamString) { auto* obj = constructEmptyObject(globalObject); obj->putDirect(vm, JSC::PropertyName(JSC::Identifier::fromString(vm, "BufferList"_s)), reinterpret_cast(globalObject)->JSBufferList(), 0); -- cgit v1.2.3