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 <anton.maminov@gmail.com>
Dependencies
Runtime Dependencies
Development Dependencies
- ameba*github: crystal-ameba/amebadev
README
# Cache::PostgresCacheStore

[](https://github.com/crystal-cache/postgres_cache_store/releases)
A [cache](https://github.com/crystal-cache/cache) store implementation which stores everything in the Postgres database,
using [crystal-pg](https://github.com/will/crystal-pg) as the backend.
`Cache::PostgresCacheStore` is a Crystal cache backed by a Postgres UNLOGGED table and text column.
## Installation
1. Add the dependency to your `shard.yml`:
```yaml
dependencies:
postgres_cache_store:
github: crystal-cache/postgres_cache_store
```
2. Run `shards install`
## Usage
Before using this shard make sure you have created Postgres database. For example `cache_production`:
```console
psql -c 'CREATE DATABASE cache_production;' -U postgres
```
A Postgres database can be opened with:
```crystal
db = DB.open("postgres://postgres@localhost/cache_production")
```
Open and use the new cache instance:
```crystal
require "postgres_cache_store"
cache = Cache::PostgresCacheStore(String).new(1.minute, db)
cache.write("foo", "bar")
cache.read("foo") # => "bar"
```
## Contributing
1. Fork it (<https://github.com/crystal-cache/postgres_cache_store/fork>)
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request
## Contributors
- [Anton Maminov](https://github.com/mamantoha) - 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
- Aug 13, 2026
- Synced
- Aug 13, 2026
- Versions
- 10