fix(storage): remove routed USE db dependency#187
Merged
mergify[bot] merged 2 commits intomatrixorigin:mainfrom Apr 17, 2026
Merged
fix(storage): remove routed USE db dependency#187mergify[bot] merged 2 commits intomatrixorigin:mainfrom
mergify[bot] merged 2 commits intomatrixorigin:mainfrom
Conversation
Route multi-db queries through fully qualified db.table references instead of session-level USE statements, and add an API regression test for purge paths. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR removes reliance on session-level USE <db> switching for routed (multi-DB) stores by making routed SQL explicitly target db.table via t(), and adds an integration regression test to ensure purge paths work correctly in multi-DB mode.
Changes:
- Remove
USE <db>execution fromSqlMemoryStore::conn()and require qualified table usage for routed stores. - Update several store queries to use
self.t("table")-qualified names (including joins and governance/lock paths). - Add a multi-DB purge API regression test covering purge by
memory_ids,topic, andsession_id.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| memoria/crates/memoria-storage/src/store.rs | Drops session USE switching and qualifies routed SQL via t() for multi-DB correctness. |
| memoria/crates/memoria-storage/src/router.rs | Updates documentation to reflect the fully-qualified-table routing approach. |
| memoria/crates/memoria-storage/src/graph/store.rs | Updates documentation to reflect table qualification by db_name. |
| memoria/crates/memoria-api/tests/api_multi_db_purge.rs | Adds a multi-DB integration test to validate purge endpoints without USE db. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Assert health check success instead of silently proceeding on failure - Decouple JoinHandle type from Axum version (JoinHandle<()> vs std::io::Result) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
XuPeng-SH
approved these changes
Apr 17, 2026
Merge Queue Status
This pull request spent 7 seconds in the queue, including 1 second running CI. Required conditions to merge
|
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
USE dbswitching from routed storesdb.tablenamesValidation