refactor: deduplicate persistence, add upsert queries, throttle snake saves #4
Reference in New Issue
Block a user
Delete Branch "refactor/game-efficiency"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
UpsertGameandUpsertSnakeGamequeries usingINSERT ... ON CONFLICT DO UPDATE, cutting the per-save query count from 2-3 to 1saveGame,loadGame,saveGamePlayer, etc.) replacing identical methods duplicated across Store and Instance receiver types in bothgame/andsnake/packagesgenerateID— Snake package now importsgame.GenerateIDinstead of having its own copy*string/*time.Timeinstead ofsql.NullString/sql.NullTime, matchingemit_pointers_for_null_types: trueStats
14 files changed, 312 insertions, 488 deletions (net -176 lines)