postgres_cache_store
Version, currently 1.0.010 versions
github.com/crystal-cache/postgres_cache_store
Cache::Store implementation backed by a database via crystal-pg.
8 stars
0 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
postgres_cache_store:
github: crystal-cache/postgres_cache_store
version: ~> 1.0.0Then run:
shards installshard.yml
- Crystal
>= 1.0.0- License
- MIT
- Author
- Anton Maminov
Dependencies
Runtime Dependencies
Development Dependencies
- ameba*github: crystal-ameba/amebadev
README
Cache::PostgresCacheStore
A cache store implementation which stores everything in the Postgres database, using crystal-pg as the backend.
Cache::PostgresCacheStore is a Crystal cache backed by a Postgres UNLOGGED table and text column.
Installation
-
Add the dependency to your
shard.yml:dependencies: postgres_cache_store: github: crystal-cache/postgres_cache_store -
Run
shards install
Usage
Before using this shard make sure you have created Postgres database. For example cache_production:
psql -c 'CREATE DATABASE cache_production;' -U postgres
A Postgres database can be opened with:
db = DB.open("postgres://postgres@localhost/cache_production")
Open and use the new cache instance:
require "postgres_cache_store"
cache = Cache::PostgresCacheStore(String).new(1.minute, db)
cache.write("foo", "bar")
cache.read("foo") # => "bar"
Contributing
- Fork it (https://github.com/crystal-cache/postgres_cache_store/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- Anton Maminov - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
1.0.0- Tagged
- Sep 2, 2025
- Commit
2f1db2102634- Crystal
>= 1.0.0- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/crystal-cache/postgres_cache_store
Metadata
- Created
- Aug 12, 2026
- Updated
- Nov 10, 2026
- Synced
- Nov 4, 2026
- Versions
- 10