-
-
Notifications
You must be signed in to change notification settings - Fork 111
Description
Hi!
Your project is impressively complete and has clearly evolved a lot over time. Some folks think it’s dead already 😂.I noticed the core implements a C-to-Rust FFI layer, so I pulled together a quick summary of API changes. Hopefully this helps with a review or gives users a heads-up!The full set of collected API changes is available in my repo: https://github.com/Attacker23/rust-ffis-changes.
Overview highlights
- Return type unification and 64-bit adoption:
- Several APIs move to wider or pointer returns (e.g., sqlite_int64, void*).
- Naming normalization:
- C and Rust functions consistently renamed to snake_case with a crsql_ prefix; many C vtab hooks moved from static int to exported int.
- Parameter updates:
- Added out-parameter for error messages, added context pointers (sqlite3, crsql_ExtData), module-qualified sqlite types on Rust side.
A) VTab: changes module (C and Rust)
Files
- C: E:\rust_projects\c\cr-sqlite\core\src\changes-vtab.c
- Rust FFI: E:\rust_projects\c\cr-sqlite\core\rs\core\src\changes_vtab.rs
Rename timelines and changes
- Begin
- BestIndex chain (C)
- Filter chain (C)
- Other vtab hooks (Rust)
B) Compact/alter helpers
Files
- C: E:\rust_projects\c\cr-sqlite\core\src\crsqlite.c
Changes
- crsql_compactPostAlter
C) Bootstrap/schema and migration flows
Files
- C header: E:\rust_projects\c\cr-sqlite\core\src\rust.h
- Rust: E:\rust_projects\c\cr-sqlite\core\rs\core\src\bootstrap.rs
Changes
- Rust: crsql_create_schema_table_if_not_exists
- Rust: init_peer_tracking_table → crsql_init_peer_tracking_table
- Maybe-update DB chain
D) Table info utilities and types
Files
- Rust: E:\rust_projects\c\cr-sqlite\core\rs\core\src\tableinfo.rs
Changes
- into_raw_parts → crsql_drop_table_info_vec; 518121e → 4ee44bd
-
- param 0: ext_data: *mut crsql_ExtData
-
- crsql_ensure_table_infos_are_up_to_date
E) DB version utility
Files
- C header: E:\rust_projects\c\cr-sqlite\core\src\rust.h
Changes
F) Bundle/init entrypoint
Files
- C: E:\rust_projects\c\cr-sqlite\core\src\crsqlite.c
- Rust: E:\rust_projects\c\cr-sqlite\core\rs\bundle\src\lib.rs
Changes (timeline)
- Rust: sqlite3_crsqlrustbundle_init param rename: _err_msg → err_msg; 50d64f2 → cb9b2b4
- Rust: sqlite3_crsqlrustbundle_init return: u32 → c_int; cb9b2b4 → e59866e
- C/Rust: sqlite3_crsqlrustbundle_init return: int/c_int → void*/c_void*
Note
Sorry to bother you—I'm currently learning Rust, especially around calling Rust from C. If you don’t mind, could I ask a couple of quick questions?
- Do you think the data I collected is useful? If so, what kind of help is there?
- What led you to choose Rust for the core? Memory safety, concurrency, performance—or something else?
- Did you run into notable challenges when bridging Rust with other languages (FFI)? Any lessons learned or patterns you’d recommend?
If this issue is noisy or off-topic, feel free to delete it.
Thanks and have a great day!