[DiscordArchive] how do you find the primary key using just the DBRecord pointer?
[DiscordArchive] how do you find the primary key using just the DBRecord pointer?
Archived author: Azarchius • Posted: 2023-08-06T20:12:53.060000+00:00
Original source
how do you find the primary key using just the DBRecord pointer?
Archived author: Azarchius • Posted: 2023-08-06T20:13:53.063000+00:00
Original source
sure, I fetched the record, but no inclination or hint at what the key is, unless the DBRecord pointer + index were instantiated together such as that ptr offset can be used to calc id and vice versa
Archived author: MaxWilson • Posted: 2023-08-06T20:18:29.367000+00:00
Original source
```uint32 DB2Record::GetId() const
{
return _db2.RecordGetId(_recordData, _recordIndex);
}```
```uint32 DB2FileLoaderRegularImpl::RecordGetId(uint8 const* record, uint32 recordIndex) const
{
if (_loadInfo->Meta->HasIndexFieldInData())
return RecordGetVarInt<uint32>(record, _loadInfo->Meta->GetIndexField(), 0);
return _idTable[recordIndex];
}```
Archived author: Azarchius • Posted: 2023-08-06T20:20:16.788000+00:00
Original source
<:blobsweat:585563802792099861>
Archived author: Azarchius • Posted: 2023-08-06T20:21:28.878000+00:00
Original source
but you still need the index?
Archived author: Titi • Posted: 2023-08-06T20:21:46.627000+00:00
Original source
quit retail and become a wrath chad
Archived author: Azarchius • Posted: 2023-08-06T20:21:56.621000+00:00
Original source
I've quit retail
Archived author: Azarchius • Posted: 2023-08-06T20:22:03.217000+00:00
Original source
third time's the charm, _this time_ I'm sticking to 927 and not budging
Archived author: Titi • Posted: 2023-08-06T20:22:17.824000+00:00
Original source
retail = any version after wrath
Archived author: MaxWilson • Posted: 2023-08-06T20:23:25.396000+00:00
Original source
recordIndex?
is just a record number xD