kodus/db-cache
最新稳定版本:2.1.0
Composer 安装命令:
composer require kodus/db-cache
包简介
PSR-16 cache-implementation for SQL databases
README 文档
README
PSR-16 cache implementation for PostgreSQL (9.5+) and MySQL.
Tuned for fast, precise SQL - all operations (including multiple get/set/delete) are fully transactional and complete in a single round-trip.
No dependencies beyond the PSR-16 interface.
Installation
Install via Composer:
composer require kodus/db-cache Usage
The constructor will automatically detect PostgreSQL or MySQL and use the appropriate adapter - all you need to do is open a PDO connection and specify a table-name and default TTL:
$pdo = new PDO("pgsql:host=localhost;port=5432;dbname=test", "root", "root"); $cache = new DatabaseCache($pdo, "my_cache_table", 24*60*60);
Tables are automatically created with the first database operation.
Please refer to PSR-16 documentation for general usage.
统计信息
- 总下载量: 24.25k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-01-04