Problem
GetRecordFromTypeId (src/reflection.cc:36) looks up the record with operator[]:
auto& meta_struct = instance.records[type_id];
return meta_struct;
std::map::operator[] default-inserts an empty Reflection when the key is absent, so an unregistered or misspelled type returns a record with an empty name and no members instead of signalling an error.
Impact
Operating on an unknown type produces nonsense SQL (empty table name, no columns) that fails downstream with an opaque message, instead of a clear "type not registered" error. This is also inconsistent with Database::GetRecord (src/database.cc), which uses records.at(type_id) and throws on a miss.
Suggested direction
Make the lookup consistent and fail-fast: use .at() (or an explicit find + throw) in GetRecordFromTypeId so an unregistered type raises a clear error.
Problem
GetRecordFromTypeId(src/reflection.cc:36) looks up the record withoperator[]:std::map::operator[]default-inserts an emptyReflectionwhen the key is absent, so an unregistered or misspelled type returns a record with an empty name and no members instead of signalling an error.Impact
Operating on an unknown type produces nonsense SQL (empty table name, no columns) that fails downstream with an opaque message, instead of a clear "type not registered" error. This is also inconsistent with
Database::GetRecord(src/database.cc), which usesrecords.at(type_id)and throws on a miss.Suggested direction
Make the lookup consistent and fail-fast: use
.at()(or an explicitfind+ throw) inGetRecordFromTypeIdso an unregistered type raises a clear error.