Repository navigation
feat: 實作 SQLite 持久化與明確 migration - #16
Merged
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.
問題與結果
InviteCodeKt 原先只有儲存模組骨架,Invitation、Qualification、Reward 與稽核資料無法透過 production SQLite backend 跨重啟保存。本 PR 實作 SQLite persistence adapter 與五版明確 schema migration,並以 transaction、unique constraint 及狀態驗證維持領域不變量。
完成後:
CLAIMED寫入;一般 qualification 會把 Qualified Invitation 與相符 Facts 原子保存,管理操作則原子保存狀態與 Audit Record。PENDING建立;Delivery 與 Action 狀態、完整集合、Invitation 歸屬及 idempotency 邊界會在寫入前驗證。PROCESSINGAction 原子轉成UNCERTAIN,只有帶 actor 與 reason 的管理操作可重試或標記已交付。BlockingOperationGuard,避免在 server main thread 執行 blocking I/O。使用
org.xerial:sqlite-jdbc:3.53.4.0作為 SQLite driver。驗證
mise exec -- .\gradlew.bat clean check shadowJar(Java 11)mise exec java@local-8 -- .\gradlew.bat clean check shadowJar(Java 8)verifyJava8Bytecode與verifyPluginJar通過Spec: 0 findings、Standards: 0 findings成品 SHA-256:
DF72A7679E18774B939626809E09603988CD33B0E0B2C262EAB54370648F0941Closes #5