refactor(synapto): extract repository pattern for all sql operations#2
Merged
ramonlimaramos merged 2 commits intomainfrom Apr 13, 2026
Merged
refactor(synapto): extract repository pattern for all sql operations#2ramonlimaramos merged 2 commits intomainfrom
ramonlimaramos merged 2 commits intomainfrom
Conversation
introduces src/synapto/repositories/ with 4 repository classes: - MemoryRepository: crud, decay, trust, hrr vectors, stats - EntityRepository: upsert, list, memory linking, counts - RelationRepository: upsert, get by direction, counts - BankRepository: upsert, delete, get vector, list types all raw sql moved from business logic into repository classes as named constants. consumers (server.py, graph/, search/, decay/, hrr/) now call repository methods instead of inline sql. result: -313 lines of inline sql removed from business logic, +89 lines of clean method calls. zero sql visible outside repositories/. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
covers architecture, api reference for all 4 repositories, and how the pattern enables read replicas, tenant-based sharding, and per-shard connection pooling without changing business logic. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
src/synapto/repositories/with 4 repository classes (MemoryRepository, EntityRepository, RelationRepository, BankRepository)Changes
Test plan
🤖 Generated with Claude Code