-
-
Notifications
You must be signed in to change notification settings - Fork 110
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)
- column β crsql_changes_column; a39fd29 β 20490c0
- commit β crsql_changes_commit; 34e4462 β 20490c0
- eof β crsql_changes_eof; aafac74 β 20490c0
- next β crsql_changes_next; 6ec4536 β 002f4fb
- rowid β crsql_changes_rowid; a26736f β 20490c0
- update β crsql_changes_update; 34e4462 β 20490c0
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!