mirror of
https://github.com/benbjohnson/litestream.git
synced 2026-01-25 05:06:30 +00:00
2.4 KiB
2.4 KiB
GEMINI.md - Gemini Code Assist Configuration for Litestream
This file provides Gemini-specific configuration and notes. For comprehensive project documentation, see AGENTS.md.
Primary Documentation
See AGENTS.md for complete architectural guidance, patterns, and anti-patterns for working with Litestream.
Gemini-Specific Configuration
File Exclusions
Check .aiexclude file for patterns of files that should not be shared with Gemini (similar to .gitignore).
Strengths for This Project
- Test Generation: Excellent at creating comprehensive test suites
- Documentation: Strong at generating and updating documentation
- Code Review: Good at identifying potential issues and security concerns
- Local Codebase Awareness: Enable for full repository understanding
Key Project Concepts
SQLite Lock Page
- Must skip page at 1GB boundary (0x40000000)
- Page number varies by page size (262145 for 4KB pages)
- See docs/SQLITE_INTERNALS.md for details
LTX Format
- Immutable replication files
- Named by transaction ID ranges
- See docs/LTX_FORMAT.md for specification
Architectural Boundaries
- DB layer (db.go): Database state and restoration
- Replica layer (replica.go): Replication only
- Storage layer: ReplicaClient implementations
Testing Focus
When generating tests:
- Include >1GB database tests for lock page verification
- Add race condition tests with -race flag
- Test various page sizes (4KB, 8KB, 16KB, 32KB)
- Include eventual consistency scenarios
Common Tasks
Adding Storage Backend
- Implement ReplicaClient interface
- Follow existing patterns (s3/, gs/, abs/)
- Handle eventual consistency
- Generate comprehensive tests
Refactoring
- Respect layer boundaries (DB vs Replica)
- Maintain current constraints (single replica authority, LTX-only restores)
- Use atomic file operations
- Return errors properly (don't just log)
Build and Test Commands
# Build without CGO
go build -o bin/litestream ./cmd/litestream
# Test with race detection
go test -race -v ./...
# Test specific backend
go test -v ./replica_client_test.go -integration s3
Configuration Reference
See etc/litestream.yml for configuration examples. Remember: each database replicates to exactly one remote destination.
Additional Resources
- llms.txt: Quick navigation index
- docs/: Deep technical documentation
- .claude/commands/: Task-specific commands (if using with Claude Code)