Single-Table NoSQL In-Memory Database

DevOps By Rultor.com We recommend RubyMine

rake PDD status Gem Version Test Coverage Yard Docs Hits-of-Code License

This Ruby gem manages an in-memory database of facts.

Here is how you use it (it's thread-safe, by the way):

fb = Factbase.new
f = fb.insert
f.type = 'book'
f.title = 'Object Thinking'
fb.query('(eq type "book")').each do |f|
  f.seen = true
end
fb.insert
fb.query('(not (exists seen))').each do |f|
  f.title = 'Elegant Objects'
end

You can save the factbase to disc and load it back:

file = '/tmp/simple.fb'
f1 = Factbase.new
f1.insert
File.save(file, f1.export)
f2 = Factbase.new
f2.import(File.read(file))

How to contribute

Read these guidelines. Make sure you build is green before you contribute your pull request. You will need to have Ruby 3.2+ and Bundler installed. Then:

bundle update
bundle exec rake

If it's clean and you don't see any error messages, submit your pull request.