0.0
No release in over a year
Kredis plugin for querying keys
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 6.0.0

Runtime

~> 1.0.0
 Project Readme

Kredis Query 🔍🔎

A plugin for Kredis that adds querying functionality.

Installation

Make sure you have a gem "kredis" entry in your Gemfile.

Now add kredis-query to your Gemfile:

gem "kredis-query"

Run bundle install.

Usage

# Returns the search results in batches of *approximately* 1.000 keys
Kredis.search('user_names:*') do |key_batch|
  key_batch == [ 'user_names:1', 'user_names:2', ... ]
end

# Optionally you can change the batch size hint. Since it's a hint,
# there is no guarantee the size of each batch matches the hint.
# Check https://redis.io/commands/scan/#the-count-option for more info.
#
# Returns the search results in batches of *approximately* 750 keys 
Kredis.search('user_names:*', batch_size: 750) { ... }

# Using a different than the default `shared` redis instance, relying on `config/redis/secondary.yml`:
Kredis.search('user_names:*', config: :secondary) { ... }

Development

As you can see, this gem is in its very early stages. Feel free to create an issue or a PR to improve or enhance functionality! 🙂