diff options
author | 2023-01-02 21:05:56 -0800 | |
---|---|---|
committer | 2023-01-02 21:05:56 -0800 | |
commit | ea2b65d4834d864029299809fb23f40ba2a56f90 (patch) | |
tree | b178b1c6327ed9b450b8764b0c13dea63112ee55 /src/bun.js/bindings/ZigGlobalObject.cpp | |
parent | 80c2da73ef59f0170f1c92551c948a1b285da17c (diff) | |
download | bun-ea2b65d4834d864029299809fb23f40ba2a56f90.tar.gz bun-ea2b65d4834d864029299809fb23f40ba2a56f90.tar.zst bun-ea2b65d4834d864029299809fb23f40ba2a56f90.zip |
Draw the owljarred/pg
Diffstat (limited to 'src/bun.js/bindings/ZigGlobalObject.cpp')
-rw-r--r-- | src/bun.js/bindings/ZigGlobalObject.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
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<const String> bunStreamString(MAKE_STATIC_STRING_IMPL("bun:stream")); static NeverDestroyed<const String> noopString(MAKE_STATIC_STRING_IMPL("noop")); static NeverDestroyed<const String> createImportMeta(MAKE_STATIC_STRING_IMPL("createImportMeta")); + static NeverDestroyed<const String> 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<Zig::GlobalObject*>(globalObject)->JSBufferList(), 0); |