tursodatabase/turso

Rusqlite support

Open

#2784 aperta il 25 ago 2025

Vedi su GitHub
 (0 commenti) (0 reazioni) (0 assegnatari)Rust (1001 fork)github user discovery
enhancementhelp wanted

Metriche repository

Star
 (19.103 star)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

We're not missing that many symbols to support Rusqlite it seems:

diff --git a/libsqlite3-sys/build.rs b/libsqlite3-sys/build.rs
index 627c1a6..50b6e78 100644
--- a/libsqlite3-sys/build.rs
+++ b/libsqlite3-sys/build.rs
@@ -335,7 +335,7 @@ fn lib_name() -> &'static str {
     if cfg!(any(feature = "sqlcipher", feature = "bundled-sqlcipher")) {
         "sqlcipher"
     } else {
-        "sqlite3"
+        "turso_sqlite3"
     }
 }
penberg@vonneumann rusqlite % export SQLITE3_LIB_DIR=../turso/target/debug/
penberg@vonneumann rusqlite % cargo run --example persons
   Compiling libsqlite3-sys v0.35.0 (/Users/penberg/src/tursodatabase/rusqlite/libsqlite3-sys)
   Compiling rusqlite v0.37.0 (/Users/penberg/src/tursodatabase/rusqlite)
error: linking with `cc` failed: exit status: 1
  |
  = note:  "cc" "/var/folders/0n/v8sb64557vx78c6z4rqb8st40000gn/T/rustc4tePja/symbols.o" "<51 object files omitted>" "/Users/penberg/src/tursodatabase/rusqlite/target/debug/deps/{librusqlite-3619382dbaa76e90.rlib,libbitflags-6d9d4619a30dcce5.rlib,libsmallvec-b55da1ce89612d5e.rlib,libhashlink-88cc16cbbda6a14f.rlib,libhashbrown-81c65f0fe923450f.rlib,libfoldhash-517dccfcc8f370bf.rlib,liblibsqlite3_sys-0d47333ce44c69cc.rlib,libfallible_streaming_iterator-6e402fcc1e853048.rlib,libfallible_iterator-ad3647e065739363.rlib}.rlib" "<sysroot>/lib/rustlib/aarch64-apple-darwin/lib/{libstd-*,libpanic_unwind-*,libobject-*,libmemchr-*,libaddr2line-*,libgimli-*,librustc_demangle-*,libstd_detect-*,libhashbrown-*,librustc_std_workspace_alloc-*,libminiz_oxide-*,libadler2-*,libunwind-*,libcfg_if-*,liblibc-*,liballoc-*,librustc_std_workspace_core-*,libcore-*,libcompiler_builtins-*}.rlib" "-lturso_sqlite3" "-lSystem" "-lc" "-lm" "-arch" "arm64" "-mmacosx-version-min=11.0.0" "-L" "../turso/target/debug/" "-o" "/Users/penberg/src/tursodatabase/rusqlite/target/debug/examples/persons-eab477a7012b1691" "-Wl,-dead_strip" "-nodefaultlibs"
  = note: some arguments are omitted. use `--verbose` to show all linker arguments
  = note: Undefined symbols for architecture arm64:
            "_sqlite3_bind_zeroblob", referenced from:
                rusqlite::statement::Statement::bind_parameter::h88bc0362b412dc0a in persons-eab477a7012b1691.58dnwmnu7q2npucjcz71vp0qw.rcgu.o
            "_sqlite3_extended_result_codes", referenced from:
                rusqlite::inner_connection::InnerConnection::open_with_flags::h764f040cf583a69d in librusqlite-3619382dbaa76e90.rlib[44](rusqlite-3619382dbaa76e90.43enci871f999ob0emjwnjc0f.rcgu.o)
            "_sqlite3_mutex_alloc", referenced from:
                rusqlite::inner_connection::ensure_safe_sqlite_threading_mode::h9bca78143be9393a in librusqlite-3619382dbaa76e90.rlib[44](rusqlite-3619382dbaa76e90.43enci871f999ob0emjwnjc0f.rcgu.o)
            "_sqlite3_mutex_free", referenced from:
                rusqlite::inner_connection::ensure_safe_sqlite_threading_mode::h9bca78143be9393a in librusqlite-3619382dbaa76e90.rlib[44](rusqlite-3619382dbaa76e90.43enci871f999ob0emjwnjc0f.rcgu.o)
          ld: symbol(s) not found for architecture arm64
          clang: error: linker command failed with exit code 1 (use -v to see invocation)


error: could not compile `rusqlite` (example "persons") due to 1 previous error

Guida contributor