@flight-framework/cache-sqlite
v0.0.6
Published
SQLite cache adapter for Flight Framework - persistent local cache
Maintainers
Readme
@flight-framework/cache-sqlite
SQLite cache adapter for Flight Framework. Persistent local caching with SQLite.
Installation
npm install @flight-framework/cache-sqlite better-sqlite3Quick Start
import { createCache } from '@flight-framework/core/cache';
import { sqlite } from '@flight-framework/cache-sqlite';
const cache = createCache(sqlite({
path: './cache.db',
}));
await cache.set('key', 'value', { ttl: 3600 });
const value = await cache.get('key');Configuration
sqlite({
// Database file path
path: './cache.db',
// Use in-memory database
memory: false,
// Table name
table: 'cache',
// Default TTL in seconds
ttl: 3600,
// Cleanup interval (remove expired entries)
cleanupInterval: 60 * 1000,
});Features
- Persistent storage
- Automatic expiration cleanup
- Full-text search on keys
- Zero network latency
- Works offline
License
MIT
