🔥 Ruby client for Apache Ignite
Add this line to your application’s Gemfile:
gem "ignite-client"
Create a client
client = Ignite::Client.new
See connection options for more info
Create a cache
cache = client.get_or_create_cache("test")
Add data
cache.put("hello", "world")
cache.get("hello")
Supports these methods
cache.get(key)
cache.get_all(keys)
cache.put(key, value)
cache.put_all(objects)
cache.key?(key)
cache.keys?(keys)
cache.get_and_put(key, value)
cache.get_and_replace(key, value)
cache.get_and_remove(key)
cache.put_if_absent(key, value)
cache.get_and_put_if_absent(key, value)
cache.replace(key, value)
cache.replace_if_equals(key, compare, value)
cache.clear
cache.clear_key(key)
cache.clear_keys(keys)
cache.remove_key(key)
cache.remove_if_equals(key, compare)
cache.size
cache.remove_keys(keys)
cache.remove_all
Scan objects
cache.scan do |k, v|
# ...
end
Execute SQL queries
client.query("SELECT * FROM users")
Pass arguments
client.query("SELECT * FROM products WHERE name = ?", ["Ignite"])
Specify the host and port
Ignite::Client.new(host: "localhost", port: 10800)
Specify the connect timeout
Ignite::Client.new(connect_timeout: 3)
For authentication, use:
Ignite::Client.new(username: "ignite", password: "ignite")
SSL is automatically enabled when credentials are supplied. To disable, use:
Ignite::Client.new(username: "ignite", password: "ignite", use_ssl: false)
For SSL/TLS, use:
Ignite::Client.new(
use_ssl: true,
ssl_params: {
ca_file: "ca.pem"
}
)
Supports all OpenSSL params
View the changelog
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/ignite-ruby.git
cd ignite-ruby
bundle install
bundle exec rake test