Database Provider Abstraction - Repository Pattern Implementation #912
jlacerte
started this conversation in
Ideas / Feature Requests
Replies: 2 comments
-
|
Quick note: I'm working on this with Claude Code as my coding partner, and I'm relatively new to open source contributions. Any feedback or guidance is welcome! |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
For those who want to see the actual code: Here's the core implementation in my working branch:
Switch providers with one env variable: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
I've implemented a Repository Pattern for Archon that abstracts database operations, making it possible to swap between different database providers (Supabase, PostgreSQL, Neon, etc.) without changing business logic.
Motivation
Currently, Archon is tightly coupled to Supabase. This makes it difficult to:
What I've Built
Interface-based architecture:
Key features:
ISitePagesRepositoryinterface withsearch_similar(),get_by_id(),insert_batch(),delete_by_source()REPOSITORY_TYPEenvironment variableCurrent Status
The core implementation is done on an earlier version of Archon. I've forked the repo and created a branch to adapt this to the new microservices architecture (
python/src/server/).Fork: https://github.com/jlacerte/Archon
Branch:
feature/database-abstractionNext Steps
Before submitting a PR, I'd like feedback on:
Happy to adapt the implementation based on feedback. This could also serve as a foundation for requests like Feature Request: Neon db integration #880 (Neon support).
Beta Was this translation helpful? Give feedback.
All reactions