feat(server): multi-DB backends with durable reactions/read receipts/channel state#83
Merged
Cod-e-Codes merged 6 commits intomainfrom Apr 3, 2026
Merged
Conversation
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.
Pull Request
Description
This PR delivers multi-database support and durable server-side state for reactions, read receipts, and channel membership (last channel), plus diagnostics, tests, and documentation updates.
Motivation
MARCHAT_DB_PATH).-doctor/-doctor-json(dialect, DSN shape, connectivity).What changed
Database runtime
postgres:///postgresql://)mysql:/mysql://)setDBDialect,getDBDialectrebindQuery,dbExec,dbQuery,dbQueryRowDurable message state
general)Diagnostics (
internal/doctor)-doctor/-doctor-jsonnow aligns with multi-DB configuration:db_dialectcheck).pgconn.ParseConfig, MySQL viamysql.ParseDSN, SQLite non-empty path) (db_connection_stringcheck).db_pingcheck; replaces the previous SQLite-onlysqlite_pingcheck ID).sql.Openworks for doctor pings.Tests
server/db_dialect_test.go— DSN detection and Postgres placeholder rebinding.server/message_state_test.go— reaction target ID and removal path (IsRemoval: true); empty-table / first-boot behavior for reactions, read receipts, and user channel loaders.internal/doctor/db_checks_test.go—detectDBTargetandvalidateConnectionStringcoverage.Documentation
README.md— multi-backend setup, DSN examples, troubleshooting; Diagnostics (-doctor) section updated for server dialect validation and DB ping.ARCHITECTURE.md— Diagnostics (internal/doctor) section updated to describe dialect, connection-string validation, and DB/TLS ping checks.ROADMAP.md— completion tracking updates (as applicable on this branch).TESTING.md— backend coverage and testing notes (as applicable on this branch).Notes for reviewers / operators
-doctor-jsonand keyed offsqlite_ping, update todb_ping(and optionally readdb_dialect/db_connection_string).go test ./...still uses SQLite (in-memory/temp); Postgres/MySQL remain manual or separate CI jobs unless you add them.Type of change
Checklist