-
Notifications
You must be signed in to change notification settings - Fork 661
Add ruby bindings #4281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add ruby bindings #4281
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please review @pereman2
dd735fd to
b74850b
Compare
|
@Pavan-Nambi, looks good! I recently spent some time with SDK code and I tried to structure them in a way that they either purely depend on sdk-kit and don't have extra Rust layer at all (like Go) or they have very thin layer which basically serves the only purpose of types marshaling and some basic integration (Python). In ruby case as we use (for example, right now you implemented Another note is that you can try to use sdk-kit from |
| self.statement.parameters_count() | ||
| } | ||
| /// returns number of changes made by the statement | ||
| pub fn n_change(&self) -> u64 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Pavan-Nambi , can you also add this method to the capi?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do.
a72c6e7 to
16fc94d
Compare
Add Ruby bindings using Magnus FFI library with turso_sdk_kit integration: - errors.rs: Exception class hierarchy (Error, BusyError, ConstraintError, etc.) with map_turso_error() for TursoError -> Ruby exception conversion - database.rs: RbDatabase with open() and connect() - connection.rs: RbConnection with execute(), prepare(), transaction(), changes(), last_insert_row_id(), in_transaction?(), close() - statement.rs: RbStatement with bind(), step(), execute(), columns(), reset!(), finalize!() and AtomicBool lifecycle tracking - value.rs: Ruby <-> Turso type conversions (nil, bool, int, float, string, blob) Known limitation: changes() returns 0 as sdk-kit doesn't expose n_change() on TursoStatement after stepping. Python/Go use execute() return value.
- Add cross-platform CI (Ubuntu/macOS/Windows × Ruby 3.1-3.3) - Fix deprecated magnus API calls - Add Ruby patterns to .gitignore
…windows them we don't want that. fix
- ResultSet as a GC-safe, enumerable hybrid result set. ...exposed changes() for same reason - fix ruby exception maps
add --workspace
initial boiler plate is fully ai, other than yml - to get this working on ci for windows
Note - 2k lines are just cargo.lock
also have to add tests