{"id":13482515,"url":"https://github.com/CodeSteak/Nuummite","last_synced_at":"2025-03-27T13:32:03.805Z","repository":{"id":10293816,"uuid":"65244479","full_name":"CodeSteak/Nuummite","owner":"CodeSteak","description":"Nuummite is a tiny persistent embedded key-value store for Crystal!","archived":false,"fork":false,"pushed_at":"2022-05-15T15:14:43.000Z","size":293,"stargazers_count":25,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-01T17:32:29.217Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Crystal","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CodeSteak.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-08T22:38:05.000Z","updated_at":"2023-12-26T08:24:14.000Z","dependencies_parsed_at":"2022-08-09T07:19:37.185Z","dependency_job_id":null,"html_url":"https://github.com/CodeSteak/Nuummite","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeSteak%2FNuummite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeSteak%2FNuummite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeSteak%2FNuummite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeSteak%2FNuummite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CodeSteak","download_url":"https://codeload.github.com/CodeSteak/Nuummite/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222262335,"owners_count":16957560,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T17:01:02.838Z","updated_at":"2024-10-30T16:31:14.152Z","avatar_url":"https://github.com/CodeSteak.png","language":"Crystal","funding_links":[],"categories":["Caching"],"sub_categories":[],"readme":"\u003cimg src=\"https://raw.githubusercontent.com/codesteak/nuummite/master/docs/nuummite.png\" width=\"25%\" align=\"right\"\u003e\n\n# Nuummite [![Build Status](https://travis-ci.org/CodeSteak/Nuummite.svg?branch=master)](https://travis-ci.org/CodeSteak/Nuummite)\n\nNuummite is a tiny persistent embedded key-value store. All data is kept\nin RAM (in a Crystal Hash) and is also written to disk.\nSo don't use Nuummite to handle big chunks of data.\nKeys and Values are always Strings.\nIt just comes with the most basic operations.\n\n\n## Installation\n\nAdd this to your application's `shard.yml`:\n\n```yaml\ndependencies:\n  nuummite:\n    github: codesteak/nuummite\n    version: ~\u003e 0.1.5\n```\n\n\n## Usage\n\n```crystal\nrequire \"nuummite\"\n```\n\n#### Open the database\n```crystal\ndb = Nuummite.new(\"path/to/folder\", \"optional-filename.db\")\n\n# You can also have multiple:\nflowers  = Nuummite.new(\"flowers\")\nminerals = Nuummite.new(\"minerals\")\n```\n\n#### Put some values in\n```crystal\ndb[\"hello\"] = \"world\"\ndb[\"42\"] = \"Answer to the Ultimate Question of Life, The Universe, and Everything\"\ndb[\"whitespace\"] = \"Hey\\n\\t\\t :D\"\n```\n\n#### Read values\n```crystal\ndb[\"hello\"]? # =\u003e \"world\"\ndb[\"ehhhh\"]? # =\u003e nil\n\n#Note: db is locked while reading, so don't write to db!\ndb.each do |key,value|\n  # reads everything\nend\n\ndb[\"crystals/ruby\"] = \"9.0\"\ndb[\"crystals/quartz\"] = \"~ 7.0\"\ndb[\"crystals/nuummite\"] = \"5.5 - 6.0\"\n\ndb.each(\"crystals/\") do |key,value|\n  # only crystals in here\nend\n```\n\n#### Delete\n```crystal\ndb.delete \"hello\"\n```\n\n#### Garbage collect\nSince values are saved to disk in a log style, file sizes grow,\nyour key-value store needs to rewrite all data at some point:\n```crystal\ndb.garbage_collect\n```\nBy default it auto garbage collects after 10_000_000 writes.\nTo modify this behavior you can:\n```crystal\n# garbage collects after 1000 writes or deletes\ndb.auto_garbage_collect_after_writes = 1000\n\n# does not auto garbage collect\ndb.auto_garbage_collect_after_writes = nil  \n```\n\n#### Shutdown\nYou can also shutdown Nuummite by\n```crystal\ndb.shutdown\n```\n\nThat's all you need to know :smile:\n\n## Contributing\n\n1. Fork it ( https://github.com/codesteak/nuummite/fork )\n2. Create your feature branch (git checkout -b my-new-feature)\n3. Commit your changes (git commit -am 'Add some feature')\n4. Push to the branch (git push origin my-new-feature)\n5. Create a new Pull Request\n\n## Contributors\n\n- [CodeSteak](https://github.com/CodeSteak) - creator, maintainer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCodeSteak%2FNuummite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCodeSteak%2FNuummite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCodeSteak%2FNuummite/lists"}