Persist user units from unit archive#25
Conversation
|
TLDR:
|
| #include <vector> | ||
|
|
||
| /*! | ||
| * Packet-to-database bridge for packet structs backed by a SQL table. |
There was a problem hiding this comment.
Some thoughts on why I think this is the simplest approach:
-
Schema consistency matters; it is the reason we use the packet generator. Reusing generated packet structs prevents separate database models and network packet models from drifting apart as the codebase evolves.
-
Most database operations are triggered by fields received from the client or used to build a response. Mapping packets directly to database columns lets us read and write those fields without repeatedly implementing fragile conversion logic.
-
Adding new fields to existing databases/new databases is painless: we just define the packet that interacts with the new fields, add the strict compile-time mapping, and the API will handle the rest.

Summary
Packet-generator schema PR: decompfrontier/packet-generator#26
Testing