SQLean Ruby
Precompiled SQLean extensions for SQLite, packaged for the Ruby ecosystem. Compatible with SQLite3, Extralite, and any other sqlite-based library that exposes sqlite3_load_extension
.
Usage
Please read the upstream documentation at https://antonz.org/sqlean/ or https://github.com/nalgeon/sqlean for details on what is provided by the SQLean extensions.
The available extensions are:
- SQLean::Crypto: Hashing, encoding and decoding data
- SQLean::Define: User-defined functions and dynamic SQL
- SQLean::FileIO: Reading and writing files
- SQLean::Fuzzy: Fuzzy string matching and phonetics
- SQLean::IPAddr: IP address manipulation (not supported on Windows)
- SQLean::Math: Math functions
- SQLean::Regexp: Regular expressions
- SQLean::Stats: Math statistics
- SQLean::Text: String functions
- SQLean::Unicode: Unicode support
- SQLean::UUID: Universally Unique IDentifiers
- SQLean::VSV: CSV files as virtual tables
with SQLite3
Extend a SQLite3 database with SQLean extensions:
require "sqlite3"
require "sqlean"
db = SQLite3::Database.new("path/to/db.sqlite")
db.enable_load_extension(true)
db.load_extension(SQLean.to_path) # load every extension in SQLean
db.load_extension(SQLean::Crypto.to_path) # or load individual extensions
with Extralite
Extend an Extralite database with SQLean extensions:
require "extralite"
require "sqlean"
db = Extralite::Database.new("path/to/db.sqlite")
db.load_extension(SQLean.to_path) # load every extension in SQLean
db.load_extension(SQLean::Crypto.to_path) # or load individual extensions
Installation
Install the gem and add to the application's Gemfile by executing:
bundle add sqlean
If bundler is not being used to manage dependencies, install the gem by executing:
gem install sqlean
Note that right now, the only platforms supported are:
- MacOS / Darwin:
- x86_64
- arm64
- Linux
- x86_64 gnu
- x86_64 musl
- aarch64 gnu
- Windows
- mingw (64-bit)
Specifically what's missing is support for:
- Linux aarch64 musl
- Windows mingw32 (32-bit)
If you need support for one of these platforms, please open an issue. I would also gladly welcome folks who are willing to help add support.
Development
After checking out the repo, run bin/setup
to install dependencies. Then, run rake test
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/flavorjones/sqlean-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
License
The gem is available as open source under the terms of the MIT License.
Code of Conduct
Everyone interacting in the sqlean-ruby project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.