{"id":18000124,"url":"https://github.com/mindreframer/sqlcache","last_synced_at":"2026-05-02T19:32:42.500Z","repository":{"id":152458278,"uuid":"607388249","full_name":"mindreframer/sqlcache","owner":"mindreframer","description":"SQLite based cache with namespacing for Elixir","archived":false,"fork":false,"pushed_at":"2025-07-01T15:02:59.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-01T15:50:51.274Z","etag":null,"topics":["caching","elixir","sqlite"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mindreframer.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-27T21:58:11.000Z","updated_at":"2025-07-01T15:03:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"c6576759-cc0e-4d5e-8990-6eb92cbc77f3","html_url":"https://github.com/mindreframer/sqlcache","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mindreframer/sqlcache","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mindreframer%2Fsqlcache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mindreframer%2Fsqlcache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mindreframer%2Fsqlcache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mindreframer%2Fsqlcache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mindreframer","download_url":"https://codeload.github.com/mindreframer/sqlcache/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mindreframer%2Fsqlcache/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32547645,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T19:18:06.202Z","status":"ssl_error","status_checked_at":"2026-05-02T19:16:21.335Z","response_time":132,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["caching","elixir","sqlite"],"created_at":"2024-10-29T23:09:44.790Z","updated_at":"2026-05-02T19:32:42.495Z","avatar_url":"https://github.com/mindreframer.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sqlcache\n\nVery slim wrapper around `exqlite` to expose a key/value API with namespacing. Useful for local caching\n\n## Usage\n\n1. Add to children in `application.ex`:\n\n```elixir\nchildren = [\n  ...\n  {Sqlcache, []},\n  ...\n]\n```\n\n2. (Optional) - Configure root_dir for Sqlite DB file in `config.exs`\n\n```elixir\nconfig :sqlcache, rootdir: \"/tmp/sqlcache\"\n\n```\n\n3. Start using\n\n```elixir\n:ok == Sqlcache.clear_kind(\"test\")\n:ok == Sqlcache.put(\"test\", \"a\", 1)\n{:ok, 1} == Sqlcache.get(\"test\", \"a\")\n:ok == Sqlcache.put(\"test\", \"a\", %{a: 1, b: 2})\n{:ok, %{a: 1, b: 2}} == Sqlcache.get(\"test\", \"a\")\n:ok == Sqlcache.clear_kind(\"test\")\n{:error, nil} == Sqlcache.get(\"test\", \"a\")\n```\n\n## Sqlcache.Wrapper: Function Caching Macro\n\n`Sqlcache.Wrapper` provides a macro for easy function result caching, with namespace support and cache deletion helpers.\n\n### Example\n\n```elixir\ndefmodule MyApp.UsersCached do\n  use Sqlcache.Wrapper, namespace: \"user\"\n\n  # This function's result will be cached by argument\n  defcached get_user(id) do\n    MyApp.Users.get_user(id)\n  end\n\n  # Remove a specific cached value\n  def remove_from_cache(id) do\n    del(:get_user, [id])\n  end\nend\n\n# Usage:\nMyApp.UsersCached.get_user(123) # Calls and caches\nMyApp.UsersCached.get_user(123) # Returns cached result\nMyApp.UsersCached.remove_from_cache(123) # Removes from cache\n```\n\n- The macro `defcached` wraps your function to cache its result by arguments.\n- Use `del/2` to remove a cached value for specific arguments.\n- Namespace is configurable per module for cache separation.\n\n## Installation\n\nThe package can be installed by adding `sqlcache` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:sqlcache, \"~\u003e 1.1\"}\n  ]\nend\n```\n\nThe docs can be found at \u003chttps://hexdocs.pm/sqlcache\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmindreframer%2Fsqlcache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmindreframer%2Fsqlcache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmindreframer%2Fsqlcache/lists"}