aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2022-05-16 19:12:22 -0700
committerGravatar Jarred Sumner <jarred@jarredsumner.com> 2022-05-16 19:12:22 -0700
commit15c40f5ea3ed9bbd1d0d0a2dad804542b7615a5f (patch)
tree6cfb93d0d2747ddeaab08cce975c7bbcc8395ee6
parent5f3256d939926fff730b3bc4dde2bbd2c1b4b613 (diff)
downloadbun-15c40f5ea3ed9bbd1d0d0a2dad804542b7615a5f.tar.gz
bun-15c40f5ea3ed9bbd1d0d0a2dad804542b7615a5f.tar.zst
bun-15c40f5ea3ed9bbd1d0d0a2dad804542b7615a5f.zip
Fix build error on linux
-rw-r--r--README.md3
-rw-r--r--src/javascript/jsc/bindings/sqlite/JSSQLStatement.cpp9
2 files changed, 6 insertions, 6 deletions
diff --git a/README.md b/README.md
index 667754673..9b36560e1 100644
--- a/README.md
+++ b/README.md
@@ -2044,7 +2044,8 @@ If you're on macOS, you will need to first use a custom SQLite install (you can
import { Database } from "bun:sqlite";
// on macOS, this must be run before any other calls to `Database`
-// if called on linux, it will return false and do nothing
+// if called on linux, it will return true and do nothing
+// on linux it will still check that a string was passed
Database.setCustomSQLite("/path/to/sqlite.dylib");
var db = new Database();
diff --git a/src/javascript/jsc/bindings/sqlite/JSSQLStatement.cpp b/src/javascript/jsc/bindings/sqlite/JSSQLStatement.cpp
index c19b736e5..c39e2961e 100644
--- a/src/javascript/jsc/bindings/sqlite/JSSQLStatement.cpp
+++ b/src/javascript/jsc/bindings/sqlite/JSSQLStatement.cpp
@@ -33,8 +33,9 @@
#ifdef LAZY_LOAD_SQLITE
#include "lazy_sqlite3.h"
#else
-static void lazyLoadSQLite()
+static inline int lazyLoadSQLite()
{
+ return 0;
}
#endif
@@ -336,10 +337,7 @@ JSC_DEFINE_HOST_FUNCTION(jsSQLStatementSetCustomSQLite, (JSC::JSGlobalObject * l
return JSValue::encode(JSC::jsUndefined());
}
-#ifndef LAZY_LOAD_SQLITE
- RELEASE_AND_RETURN(scope, JSValue::encode(JSC::jsBoolean(false)));
-#endif
-
+#ifdef LAZY_LOAD_SQLITE
if (sqlite3_handle) {
throwException(lexicalGlobalObject, scope, createError(lexicalGlobalObject, "SQLite already loaded\nThis function can only be called before SQLite has been loaded and exactly once. SQLite auto-loads when the first time you open a Database."_s));
return JSValue::encode(JSC::jsUndefined());
@@ -352,6 +350,7 @@ JSC_DEFINE_HOST_FUNCTION(jsSQLStatementSetCustomSQLite, (JSC::JSGlobalObject * l
throwException(lexicalGlobalObject, scope, createError(lexicalGlobalObject, msg));
return JSValue::encode(JSC::jsUndefined());
}
+#endif
RELEASE_AND_RETURN(scope, JSValue::encode(JSC::jsBoolean(true)));
}