{"repo":"yegor256/factbase","free":true,"listed":false,"github":"https://github.com/yegor256/factbase","clone":"git clone https://github.com/yegor256/factbase.git","description":"In-memory database of facts (records with attributes) with a predicative searching facility","language":"Ruby","stars":20,"topics":["ruby","ruby-gem","database","nosql"],"license":"MIT","category":"databases-storage","readme_excerpt":"Single-Table NoSQL-ish In-Memory Database WARNING: Factbase is NOT thread-safe. Use Factbase::SyncFactbase for concurrent access from multiple threads. This Ruby gem manages an in-memory database of facts. A fact is simply an associative array of properties and their values. The values are either atomic literals or non-empty sets of literals. It is possible to delete a fact, but impossible to delete a property from a fact. Here is how you use it (wrap it with Factbase::SyncFactbase for thread-safe access): You can save the factbase to the disk and then load it back: You can check the presence of an attribute by name and then set it, also by name: You can make a factbase log all operations: You can also count the amount of changes made to a factbase: Properties are accumulative. Setting a property again adds a value instead of overwriting: Deleting while iterating is unsafe and may cause elements to be skipped: To safely delete, use a snapshot: Query Parameters You can use $name variables in queries and pass values at runtime: Variables are passed as keyword arguments to each or one . The value must be an array (even for a single value). This works with any term: Terms There are some boolean terms available in a query (they return either true or false ): (always) and (never) are true and false (nil v) is true if v is nil (not b) is the inverse of b (or b1 b2 ...) is true if at least one argument is true (and b1 b2 ...) — if all arguments are true (when b1 b2) — true if b1 is f","default_branch":null,"files":null,"tree":[],"storefront":"/r/yegor256","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/yegor256/factbase/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}