sqlite3-ruby-ffi
🎉 A drop-in replacement for the sqlite3 gem for JRuby
- Passes the full sqlite3 test suite
- Works with Active Record without a custom adapter
Installation
Add this line to your Gemfile:
gem "sqlite3-ffi"
And use it the same way as the sqlite3 gem.
Why FFI for JRuby?
I tried JDBC, JNI, and FFI. Since SQLite is written in C, all three approaches eventually call C, and FFI provides the most compatibility.
Credits
This library uses code from the sqlite3 gem and is available under the same license.
The code in lib
and test
is an exact copy, plus some additional files:
-
lib/sqlite3/ffi/*
(port ofext
) lib/sqlite3/ffi.rb
lib/sqlite3/sqlite3_native.rb
test/ffi_helper.rb
History
View the changelog
Contributing
Everyone is encouraged to help improve this project. Here are a few ways you can help:
- Report bugs
- Fix bugs and submit pull requests
- Write, clarify, or fix documentation
- Suggest or add new features
To get started with development:
git clone https://github.com/ankane/sqlite3-ruby-ffi.git
cd sqlite3-ruby-ffi
bundle install
bundle exec rake test