diff --git a/src/NexusMods.MneumonicDB.Abstractions/IDb.cs b/src/NexusMods.MneumonicDB.Abstractions/IDb.cs index 95aad8cb..e66171be 100644 --- a/src/NexusMods.MneumonicDB.Abstractions/IDb.cs +++ b/src/NexusMods.MneumonicDB.Abstractions/IDb.cs @@ -64,4 +64,11 @@ public IEnumerable Datoms() /// Create a new iterator for the given index type. /// IDatomSource Iterate(IndexType index); + + /// + /// Gets all values for the given attribute on the given entity. There's no reason to use this + /// on attributes that are not multi-valued. + /// + IEnumerable GetAll(ref ModelHeader model, EntityId modelId) + where TAttribute : IAttribute; } diff --git a/src/NexusMods.MneumonicDB.Abstractions/ScalarAttribute.cs b/src/NexusMods.MneumonicDB.Abstractions/ScalarAttribute.cs index 04046265..9be6dd17 100644 --- a/src/NexusMods.MneumonicDB.Abstractions/ScalarAttribute.cs +++ b/src/NexusMods.MneumonicDB.Abstractions/ScalarAttribute.cs @@ -1,5 +1,6 @@ using System; using System.Buffers; +using System.Collections.Generic; using NexusMods.MneumonicDB.Abstractions.Internals; using NexusMods.MneumonicDB.Abstractions.Models; @@ -21,11 +22,11 @@ public class ScalarAttribute : IAttribute protected ScalarAttribute(string uniqueName = "", bool isIndexed = false, bool keepHistory = true, - bool multiArity = false) + bool multiValued = false) { IsIndexed = isIndexed; KeepHistory = keepHistory; - MultiArity = multiArity; + Multivalued = multiValued; Id = uniqueName == "" ? Symbol.Intern(typeof(TAttribute).FullName!) : Symbol.InternPreSanitized(uniqueName); } @@ -37,7 +38,7 @@ protected ScalarAttribute(Symbol symbol) Id = symbol; } - public bool MultiArity { get; } + public bool Multivalued { get; } public bool KeepHistory { get; } @@ -128,6 +129,11 @@ public static TValueType Get(ref ModelHeader model) return model.Db.Get(ref model, model.Id); } + public static IEnumerable GetAll(ref ModelHeader model) + { + return model.Db.GetAll(ref model, model.Id); + } + /// public static void Add(ref ModelHeader model, TValueType value) { diff --git a/src/NexusMods.MneumonicDB.Storage/DatomStore.cs b/src/NexusMods.MneumonicDB.Storage/DatomStore.cs index 2e0e6a23..e1f5e36c 100644 --- a/src/NexusMods.MneumonicDB.Storage/DatomStore.cs +++ b/src/NexusMods.MneumonicDB.Storage/DatomStore.cs @@ -330,10 +330,7 @@ private unsafe void Log(PendingTransaction pendingTransaction, out StoreResult r foreach (var datom in pendingTransaction.Data) { _writer.Reset(); - unsafe - { - _writer.Advance(sizeof(KeyPrefix)); - } + _writer.Advance(sizeof(KeyPrefix)); var isRemapped = Ids.IsPartition(datom.E.Value, Ids.Partition.Tmp); datom.Explode(_registry, remapFn, out var e, out var a, _writer, out var isRetract); diff --git a/src/NexusMods.MneumonicDB/Db.cs b/src/NexusMods.MneumonicDB/Db.cs index 5dda8d33..6ccbd3c0 100644 --- a/src/NexusMods.MneumonicDB/Db.cs +++ b/src/NexusMods.MneumonicDB/Db.cs @@ -16,7 +16,7 @@ internal class Db : IDb private readonly Connection _connection; private readonly AttributeRegistry _registry; private readonly EntityCache _cache; - private readonly ConcurrentDictionary _reverseCache = new(); + private readonly ConcurrentDictionary<(EntityId, Type), EntityId[]> _reverseCache = new(); internal readonly ISnapshot Snapshot; public Db(ISnapshot snapshot, Connection connection, TxId txId, AttributeRegistry registry) @@ -39,7 +39,6 @@ public IEnumerable Get(IEnumerable ids) { yield return Get(id); } - } public TValue Get(ref ModelHeader header, EntityId id) @@ -65,7 +64,7 @@ public TModel[] GetReverse(EntityId id) where TAttribute : IAttribute where TModel : struct, IEntity { - if (!_reverseCache.TryGetValue(id, out var eIds)) + if (!_reverseCache.TryGetValue((id, typeof(TAttribute)), out var eIds)) { using var attrSource = Snapshot.GetIterator(IndexType.VAETCurrent); var attrId = _registry.GetAttributeId(); @@ -76,7 +75,7 @@ public TModel[] GetReverse(EntityId id) .Select(c => c.CurrentKeyPrefix().E) .ToArray(); - _reverseCache[id] = eIds; + _reverseCache[(id, typeof(TAttribute))] = eIds; } var results = GC.AllocateUninitializedArray(eIds.Length); @@ -121,5 +120,11 @@ public IDatomSource Iterate(IndexType index) return Snapshot.GetIterator(index); } + public IEnumerable GetAll(ref ModelHeader model, EntityId modelId) + where TAttribute : IAttribute + { + return _cache.GetAll(ref model); + } + public void Dispose() { } } diff --git a/src/NexusMods.MneumonicDB/EntityCache.cs b/src/NexusMods.MneumonicDB/EntityCache.cs index f373b220..223f4dc1 100644 --- a/src/NexusMods.MneumonicDB/EntityCache.cs +++ b/src/NexusMods.MneumonicDB/EntityCache.cs @@ -114,4 +114,44 @@ private class Entry public ushort[] Offsets = null!; public byte[] Data = null!; } + + public IEnumerable GetAll(ref ModelHeader header) + where TAttribute : IAttribute + { + Entry entry; + if (header.InlineCache is Entry inline) + entry = inline; + else if (!cache.TryGetValue(header.Id, out entry!)) + entry = Cache(header.Id); + + header.InlineCache = entry; + + return GetAllInner(entry); + } + + private IEnumerable GetAllInner(Entry entry) where TAttribute : IAttribute + { + var localCache = InlineCache.Instance; + if (localCache.Registry != registry) + { + localCache = Recache(); + } + + var attributeIndex = Array.IndexOf(entry.Attributes, localCache.Id); + if (attributeIndex == -1) + yield break; + + while (attributeIndex < entry.Attributes.Length) + { + if (entry.Attributes[attributeIndex] != localCache.Id) + break; + + var offset = entry.Offsets[attributeIndex]; + var length = entry.Offsets[attributeIndex + 1] - offset; + + localCache.Serializer.Read(entry.Data.AsSpan().SliceFast(offset, length), out var value); + yield return value; + attributeIndex++; + } + } } diff --git a/tests/NexusMods.MneumonicDB.Storage.Tests/ABackendTest.cs b/tests/NexusMods.MneumonicDB.Storage.Tests/ABackendTest.cs index f0214bda..0d1a1131 100644 --- a/tests/NexusMods.MneumonicDB.Storage.Tests/ABackendTest.cs +++ b/tests/NexusMods.MneumonicDB.Storage.Tests/ABackendTest.cs @@ -33,6 +33,8 @@ public async Task InsertedDatomsShowUpInTheIndex(IndexType type) var modId1 = NextTempId(); var modId2 = NextTempId(); + var loadoutId = NextTempId(); + var collectionId = NextTempId(); var tx = await DatomStore.Transact([ FileAttributes.Path.Assert(id1, "/foo/bar"), @@ -44,16 +46,26 @@ public async Task InsertedDatomsShowUpInTheIndex(IndexType type) FileAttributes.ModId.Assert(id1, modId1), FileAttributes.ModId.Assert(id2, modId1), ModAttributes.Name.Assert(modId1, "Test Mod 1"), - ModAttributes.Name.Assert(modId2, "Test Mod 2") + ModAttributes.LoadoutId.Assert(modId1, loadoutId), + ModAttributes.Name.Assert(modId2, "Test Mod 2"), + ModAttributes.LoadoutId.Assert(modId2, loadoutId), + LoadoutAttributes.Name.Assert(loadoutId, "Test Loadout 1"), + CollectionAttributes.Name.Assert(collectionId, "Test Collection 1"), + CollectionAttributes.LoadoutId.Assert(collectionId, loadoutId), + CollectionAttributes.Mods.Assert(collectionId, modId1), + CollectionAttributes.Mods.Assert(collectionId, modId2) ]); id1 = tx.Remaps[id1]; id2 = tx.Remaps[id2]; + collectionId = tx.Remaps[collectionId]; tx = await DatomStore.Transact([ // Rename file 1 and move file 1 to mod 2 FileAttributes.Path.Assert(id2, "/foo/qux"), - FileAttributes.ModId.Assert(id1, modId2) + FileAttributes.ModId.Assert(id1, modId2), + // Remove mod2 from collection + CollectionAttributes.Mods.Retract(collectionId, modId2), ]); using var iterator = tx.Snapshot.GetIterator(type); diff --git a/tests/NexusMods.MneumonicDB.Storage.Tests/AStorageTest.cs b/tests/NexusMods.MneumonicDB.Storage.Tests/AStorageTest.cs index b90d8c0b..0e33d906 100644 --- a/tests/NexusMods.MneumonicDB.Storage.Tests/AStorageTest.cs +++ b/tests/NexusMods.MneumonicDB.Storage.Tests/AStorageTest.cs @@ -39,7 +39,17 @@ protected AStorageTest(IServiceProvider provider, Func(), AttributeId.From(23), Symbol.Intern()), new DbAttribute(Symbol.Intern(), AttributeId.From(24), - Symbol.Intern()) + Symbol.Intern()), + new DbAttribute(Symbol.Intern(), AttributeId.From(25), + Symbol.Intern()), + new DbAttribute(Symbol.Intern(), AttributeId.From(26), + Symbol.Intern()), + new DbAttribute(Symbol.Intern(), AttributeId.From(27), + Symbol.Intern()), + new DbAttribute(Symbol.Intern(), AttributeId.From(28), + Symbol.Intern()), + new DbAttribute(Symbol.Intern(), AttributeId.From(29), + Symbol.Intern()) ]); _path = FileSystem.Shared.GetKnownPath(KnownPath.EntryDirectory).Combine("tests_datomstore" + Guid.NewGuid()); diff --git a/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/InMemoryTests.InsertedDatomsShowUpInTheIndex_type=AEVTCurrent.verified.txt b/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/InMemoryTests.InsertedDatomsShowUpInTheIndex_type=AEVTCurrent.verified.txt index 37dd02de..98bfcda6 100644 --- a/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/InMemoryTests.InsertedDatomsShowUpInTheIndex_type=AEVTCurrent.verified.txt +++ b/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/InMemoryTests.InsertedDatomsShowUpInTheIndex_type=AEVTCurrent.verified.txt @@ -8,7 +8,13 @@ + | 0200000000000002 | (0015) Hash | 0x00000000DEADBEAF | 0100000000000002 + | 0200000000000001 | (0016) Size | 42 B | 0100000000000002 + | 0200000000000002 | (0016) Size | 77 B | 0100000000000002 -+ | 0200000000000001 | (0017) ModId | 0200000000000005 | 0100000000000003 ++ | 0200000000000001 | (0017) ModId | 0200000000000007 | 0100000000000003 + | 0200000000000002 | (0017) ModId | 0200000000000003 | 0100000000000002 + | 0200000000000003 | (0018) Name | Test Mod 1 | 0100000000000002 -+ | 0200000000000004 | (0018) Name | Test Mod 2 | 0100000000000002 ++ | 0200000000000005 | (0018) Name | Test Mod 2 | 0100000000000002 ++ | 0200000000000003 | (0019) LoadoutId | 0200000000000004 | 0100000000000002 ++ | 0200000000000005 | (0019) LoadoutId | 0200000000000004 | 0100000000000002 ++ | 0200000000000004 | (001A) Name | Test Loadout 1 | 0100000000000002 ++ | 0200000000000006 | (001B) Name | Test Collection 1 | 0100000000000002 ++ | 0200000000000006 | (001C) LoadoutId | 0200000000000004 | 0100000000000002 ++ | 0200000000000006 | (001D) Mods | 0200000000000005 | 0100000000000002 diff --git a/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/InMemoryTests.InsertedDatomsShowUpInTheIndex_type=AEVTHistory.verified.txt b/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/InMemoryTests.InsertedDatomsShowUpInTheIndex_type=AEVTHistory.verified.txt index b26c4860..aa5db5bc 100644 --- a/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/InMemoryTests.InsertedDatomsShowUpInTheIndex_type=AEVTHistory.verified.txt +++ b/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/InMemoryTests.InsertedDatomsShowUpInTheIndex_type=AEVTHistory.verified.txt @@ -1,2 +1,4 @@ + | 0200000000000002 | (0014) Path | /qix/bar | 0100000000000002 + | 0200000000000001 | (0017) ModId | 0200000000000003 | 0100000000000002 ++ | 0200000000000006 | (001D) Mods | 0200000000000003 | 0100000000000002 +- | 0200000000000006 | (001D) Mods | 0200000000000007 | 0100000000000003 diff --git a/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/InMemoryTests.InsertedDatomsShowUpInTheIndex_type=EAVTCurrent.verified.txt b/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/InMemoryTests.InsertedDatomsShowUpInTheIndex_type=EAVTCurrent.verified.txt index 7697dd73..d02a29a6 100644 --- a/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/InMemoryTests.InsertedDatomsShowUpInTheIndex_type=EAVTCurrent.verified.txt +++ b/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/InMemoryTests.InsertedDatomsShowUpInTheIndex_type=EAVTCurrent.verified.txt @@ -5,10 +5,16 @@ + | 0200000000000001 | (0014) Path | /foo/bar | 0100000000000002 + | 0200000000000001 | (0015) Hash | 0x00000000DEADBEEF | 0100000000000002 + | 0200000000000001 | (0016) Size | 42 B | 0100000000000002 -+ | 0200000000000001 | (0017) ModId | 0200000000000005 | 0100000000000003 ++ | 0200000000000001 | (0017) ModId | 0200000000000007 | 0100000000000003 + | 0200000000000002 | (0014) Path | /foo/qux | 0100000000000003 + | 0200000000000002 | (0015) Hash | 0x00000000DEADBEAF | 0100000000000002 + | 0200000000000002 | (0016) Size | 77 B | 0100000000000002 + | 0200000000000002 | (0017) ModId | 0200000000000003 | 0100000000000002 + | 0200000000000003 | (0018) Name | Test Mod 1 | 0100000000000002 -+ | 0200000000000004 | (0018) Name | Test Mod 2 | 0100000000000002 ++ | 0200000000000003 | (0019) LoadoutId | 0200000000000004 | 0100000000000002 ++ | 0200000000000004 | (001A) Name | Test Loadout 1 | 0100000000000002 ++ | 0200000000000005 | (0018) Name | Test Mod 2 | 0100000000000002 ++ | 0200000000000005 | (0019) LoadoutId | 0200000000000004 | 0100000000000002 ++ | 0200000000000006 | (001B) Name | Test Collection 1 | 0100000000000002 ++ | 0200000000000006 | (001C) LoadoutId | 0200000000000004 | 0100000000000002 ++ | 0200000000000006 | (001D) Mods | 0200000000000005 | 0100000000000002 diff --git a/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/InMemoryTests.InsertedDatomsShowUpInTheIndex_type=EAVTHistory.verified.txt b/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/InMemoryTests.InsertedDatomsShowUpInTheIndex_type=EAVTHistory.verified.txt index 1d8ab626..6f03d654 100644 --- a/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/InMemoryTests.InsertedDatomsShowUpInTheIndex_type=EAVTHistory.verified.txt +++ b/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/InMemoryTests.InsertedDatomsShowUpInTheIndex_type=EAVTHistory.verified.txt @@ -1,2 +1,4 @@ + | 0200000000000001 | (0017) ModId | 0200000000000003 | 0100000000000002 + | 0200000000000002 | (0014) Path | /qix/bar | 0100000000000002 ++ | 0200000000000006 | (001D) Mods | 0200000000000003 | 0100000000000002 +- | 0200000000000006 | (001D) Mods | 0200000000000007 | 0100000000000003 diff --git a/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/InMemoryTests.InsertedDatomsShowUpInTheIndex_type=TxLog.verified.txt b/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/InMemoryTests.InsertedDatomsShowUpInTheIndex_type=TxLog.verified.txt index cd4a6676..da6957b2 100644 --- a/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/InMemoryTests.InsertedDatomsShowUpInTheIndex_type=TxLog.verified.txt +++ b/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/InMemoryTests.InsertedDatomsShowUpInTheIndex_type=TxLog.verified.txt @@ -11,6 +11,14 @@ + | 0200000000000002 | (0016) Size | 77 B | 0100000000000002 + | 0200000000000002 | (0017) ModId | 0200000000000003 | 0100000000000002 + | 0200000000000003 | (0018) Name | Test Mod 1 | 0100000000000002 -+ | 0200000000000004 | (0018) Name | Test Mod 2 | 0100000000000002 -+ | 0200000000000001 | (0017) ModId | 0200000000000005 | 0100000000000003 ++ | 0200000000000003 | (0019) LoadoutId | 0200000000000004 | 0100000000000002 ++ | 0200000000000004 | (001A) Name | Test Loadout 1 | 0100000000000002 ++ | 0200000000000005 | (0018) Name | Test Mod 2 | 0100000000000002 ++ | 0200000000000005 | (0019) LoadoutId | 0200000000000004 | 0100000000000002 ++ | 0200000000000006 | (001B) Name | Test Collection 1 | 0100000000000002 ++ | 0200000000000006 | (001C) LoadoutId | 0200000000000004 | 0100000000000002 ++ | 0200000000000006 | (001D) Mods | 0200000000000003 | 0100000000000002 ++ | 0200000000000006 | (001D) Mods | 0200000000000005 | 0100000000000002 ++ | 0200000000000001 | (0017) ModId | 0200000000000007 | 0100000000000003 + | 0200000000000002 | (0014) Path | /foo/qux | 0100000000000003 +- | 0200000000000006 | (001D) Mods | 0200000000000007 | 0100000000000003 diff --git a/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/InMemoryTests.InsertedDatomsShowUpInTheIndex_type=VAETCurrent.verified.txt b/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/InMemoryTests.InsertedDatomsShowUpInTheIndex_type=VAETCurrent.verified.txt index e4e846a6..fe2ba2cc 100644 --- a/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/InMemoryTests.InsertedDatomsShowUpInTheIndex_type=VAETCurrent.verified.txt +++ b/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/InMemoryTests.InsertedDatomsShowUpInTheIndex_type=VAETCurrent.verified.txt @@ -1,2 +1,6 @@ + | 0200000000000002 | (0017) ModId | 0200000000000003 | 0100000000000002 -+ | 0200000000000001 | (0017) ModId | 0200000000000005 | 0100000000000003 ++ | 0200000000000003 | (0019) LoadoutId | 0200000000000004 | 0100000000000002 ++ | 0200000000000005 | (0019) LoadoutId | 0200000000000004 | 0100000000000002 ++ | 0200000000000006 | (001C) LoadoutId | 0200000000000004 | 0100000000000002 ++ | 0200000000000006 | (001D) Mods | 0200000000000005 | 0100000000000002 ++ | 0200000000000001 | (0017) ModId | 0200000000000007 | 0100000000000003 diff --git a/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/InMemoryTests.InsertedDatomsShowUpInTheIndex_type=VAETHistory.verified.txt b/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/InMemoryTests.InsertedDatomsShowUpInTheIndex_type=VAETHistory.verified.txt index 251d8d2b..9a0c448c 100644 --- a/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/InMemoryTests.InsertedDatomsShowUpInTheIndex_type=VAETHistory.verified.txt +++ b/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/InMemoryTests.InsertedDatomsShowUpInTheIndex_type=VAETHistory.verified.txt @@ -1 +1,3 @@ + | 0200000000000001 | (0017) ModId | 0200000000000003 | 0100000000000002 ++ | 0200000000000006 | (001D) Mods | 0200000000000003 | 0100000000000002 +- | 0200000000000006 | (001D) Mods | 0200000000000007 | 0100000000000003 diff --git a/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/RocksDB.InsertedDatomsShowUpInTheIndex_type=AEVTCurrent.verified.txt b/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/RocksDB.InsertedDatomsShowUpInTheIndex_type=AEVTCurrent.verified.txt index 37dd02de..98bfcda6 100644 --- a/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/RocksDB.InsertedDatomsShowUpInTheIndex_type=AEVTCurrent.verified.txt +++ b/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/RocksDB.InsertedDatomsShowUpInTheIndex_type=AEVTCurrent.verified.txt @@ -8,7 +8,13 @@ + | 0200000000000002 | (0015) Hash | 0x00000000DEADBEAF | 0100000000000002 + | 0200000000000001 | (0016) Size | 42 B | 0100000000000002 + | 0200000000000002 | (0016) Size | 77 B | 0100000000000002 -+ | 0200000000000001 | (0017) ModId | 0200000000000005 | 0100000000000003 ++ | 0200000000000001 | (0017) ModId | 0200000000000007 | 0100000000000003 + | 0200000000000002 | (0017) ModId | 0200000000000003 | 0100000000000002 + | 0200000000000003 | (0018) Name | Test Mod 1 | 0100000000000002 -+ | 0200000000000004 | (0018) Name | Test Mod 2 | 0100000000000002 ++ | 0200000000000005 | (0018) Name | Test Mod 2 | 0100000000000002 ++ | 0200000000000003 | (0019) LoadoutId | 0200000000000004 | 0100000000000002 ++ | 0200000000000005 | (0019) LoadoutId | 0200000000000004 | 0100000000000002 ++ | 0200000000000004 | (001A) Name | Test Loadout 1 | 0100000000000002 ++ | 0200000000000006 | (001B) Name | Test Collection 1 | 0100000000000002 ++ | 0200000000000006 | (001C) LoadoutId | 0200000000000004 | 0100000000000002 ++ | 0200000000000006 | (001D) Mods | 0200000000000005 | 0100000000000002 diff --git a/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/RocksDB.InsertedDatomsShowUpInTheIndex_type=AEVTHistory.verified.txt b/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/RocksDB.InsertedDatomsShowUpInTheIndex_type=AEVTHistory.verified.txt index b26c4860..aa5db5bc 100644 --- a/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/RocksDB.InsertedDatomsShowUpInTheIndex_type=AEVTHistory.verified.txt +++ b/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/RocksDB.InsertedDatomsShowUpInTheIndex_type=AEVTHistory.verified.txt @@ -1,2 +1,4 @@ + | 0200000000000002 | (0014) Path | /qix/bar | 0100000000000002 + | 0200000000000001 | (0017) ModId | 0200000000000003 | 0100000000000002 ++ | 0200000000000006 | (001D) Mods | 0200000000000003 | 0100000000000002 +- | 0200000000000006 | (001D) Mods | 0200000000000007 | 0100000000000003 diff --git a/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/RocksDB.InsertedDatomsShowUpInTheIndex_type=EAVTCurrent.verified.txt b/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/RocksDB.InsertedDatomsShowUpInTheIndex_type=EAVTCurrent.verified.txt index 7697dd73..d02a29a6 100644 --- a/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/RocksDB.InsertedDatomsShowUpInTheIndex_type=EAVTCurrent.verified.txt +++ b/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/RocksDB.InsertedDatomsShowUpInTheIndex_type=EAVTCurrent.verified.txt @@ -5,10 +5,16 @@ + | 0200000000000001 | (0014) Path | /foo/bar | 0100000000000002 + | 0200000000000001 | (0015) Hash | 0x00000000DEADBEEF | 0100000000000002 + | 0200000000000001 | (0016) Size | 42 B | 0100000000000002 -+ | 0200000000000001 | (0017) ModId | 0200000000000005 | 0100000000000003 ++ | 0200000000000001 | (0017) ModId | 0200000000000007 | 0100000000000003 + | 0200000000000002 | (0014) Path | /foo/qux | 0100000000000003 + | 0200000000000002 | (0015) Hash | 0x00000000DEADBEAF | 0100000000000002 + | 0200000000000002 | (0016) Size | 77 B | 0100000000000002 + | 0200000000000002 | (0017) ModId | 0200000000000003 | 0100000000000002 + | 0200000000000003 | (0018) Name | Test Mod 1 | 0100000000000002 -+ | 0200000000000004 | (0018) Name | Test Mod 2 | 0100000000000002 ++ | 0200000000000003 | (0019) LoadoutId | 0200000000000004 | 0100000000000002 ++ | 0200000000000004 | (001A) Name | Test Loadout 1 | 0100000000000002 ++ | 0200000000000005 | (0018) Name | Test Mod 2 | 0100000000000002 ++ | 0200000000000005 | (0019) LoadoutId | 0200000000000004 | 0100000000000002 ++ | 0200000000000006 | (001B) Name | Test Collection 1 | 0100000000000002 ++ | 0200000000000006 | (001C) LoadoutId | 0200000000000004 | 0100000000000002 ++ | 0200000000000006 | (001D) Mods | 0200000000000005 | 0100000000000002 diff --git a/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/RocksDB.InsertedDatomsShowUpInTheIndex_type=EAVTHistory.verified.txt b/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/RocksDB.InsertedDatomsShowUpInTheIndex_type=EAVTHistory.verified.txt index 1d8ab626..6f03d654 100644 --- a/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/RocksDB.InsertedDatomsShowUpInTheIndex_type=EAVTHistory.verified.txt +++ b/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/RocksDB.InsertedDatomsShowUpInTheIndex_type=EAVTHistory.verified.txt @@ -1,2 +1,4 @@ + | 0200000000000001 | (0017) ModId | 0200000000000003 | 0100000000000002 + | 0200000000000002 | (0014) Path | /qix/bar | 0100000000000002 ++ | 0200000000000006 | (001D) Mods | 0200000000000003 | 0100000000000002 +- | 0200000000000006 | (001D) Mods | 0200000000000007 | 0100000000000003 diff --git a/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/RocksDB.InsertedDatomsShowUpInTheIndex_type=TxLog.verified.txt b/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/RocksDB.InsertedDatomsShowUpInTheIndex_type=TxLog.verified.txt index cd4a6676..da6957b2 100644 --- a/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/RocksDB.InsertedDatomsShowUpInTheIndex_type=TxLog.verified.txt +++ b/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/RocksDB.InsertedDatomsShowUpInTheIndex_type=TxLog.verified.txt @@ -11,6 +11,14 @@ + | 0200000000000002 | (0016) Size | 77 B | 0100000000000002 + | 0200000000000002 | (0017) ModId | 0200000000000003 | 0100000000000002 + | 0200000000000003 | (0018) Name | Test Mod 1 | 0100000000000002 -+ | 0200000000000004 | (0018) Name | Test Mod 2 | 0100000000000002 -+ | 0200000000000001 | (0017) ModId | 0200000000000005 | 0100000000000003 ++ | 0200000000000003 | (0019) LoadoutId | 0200000000000004 | 0100000000000002 ++ | 0200000000000004 | (001A) Name | Test Loadout 1 | 0100000000000002 ++ | 0200000000000005 | (0018) Name | Test Mod 2 | 0100000000000002 ++ | 0200000000000005 | (0019) LoadoutId | 0200000000000004 | 0100000000000002 ++ | 0200000000000006 | (001B) Name | Test Collection 1 | 0100000000000002 ++ | 0200000000000006 | (001C) LoadoutId | 0200000000000004 | 0100000000000002 ++ | 0200000000000006 | (001D) Mods | 0200000000000003 | 0100000000000002 ++ | 0200000000000006 | (001D) Mods | 0200000000000005 | 0100000000000002 ++ | 0200000000000001 | (0017) ModId | 0200000000000007 | 0100000000000003 + | 0200000000000002 | (0014) Path | /foo/qux | 0100000000000003 +- | 0200000000000006 | (001D) Mods | 0200000000000007 | 0100000000000003 diff --git a/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/RocksDB.InsertedDatomsShowUpInTheIndex_type=VAETCurrent.verified.txt b/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/RocksDB.InsertedDatomsShowUpInTheIndex_type=VAETCurrent.verified.txt index e4e846a6..fe2ba2cc 100644 --- a/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/RocksDB.InsertedDatomsShowUpInTheIndex_type=VAETCurrent.verified.txt +++ b/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/RocksDB.InsertedDatomsShowUpInTheIndex_type=VAETCurrent.verified.txt @@ -1,2 +1,6 @@ + | 0200000000000002 | (0017) ModId | 0200000000000003 | 0100000000000002 -+ | 0200000000000001 | (0017) ModId | 0200000000000005 | 0100000000000003 ++ | 0200000000000003 | (0019) LoadoutId | 0200000000000004 | 0100000000000002 ++ | 0200000000000005 | (0019) LoadoutId | 0200000000000004 | 0100000000000002 ++ | 0200000000000006 | (001C) LoadoutId | 0200000000000004 | 0100000000000002 ++ | 0200000000000006 | (001D) Mods | 0200000000000005 | 0100000000000002 ++ | 0200000000000001 | (0017) ModId | 0200000000000007 | 0100000000000003 diff --git a/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/RocksDB.InsertedDatomsShowUpInTheIndex_type=VAETHistory.verified.txt b/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/RocksDB.InsertedDatomsShowUpInTheIndex_type=VAETHistory.verified.txt index 251d8d2b..9a0c448c 100644 --- a/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/RocksDB.InsertedDatomsShowUpInTheIndex_type=VAETHistory.verified.txt +++ b/tests/NexusMods.MneumonicDB.Storage.Tests/BackendTestVerifyData/RocksDB.InsertedDatomsShowUpInTheIndex_type=VAETHistory.verified.txt @@ -1 +1,3 @@ + | 0200000000000001 | (0017) ModId | 0200000000000003 | 0100000000000002 ++ | 0200000000000006 | (001D) Mods | 0200000000000003 | 0100000000000002 +- | 0200000000000006 | (001D) Mods | 0200000000000007 | 0100000000000003 diff --git a/tests/NexusMods.MneumonicDB.Storage.Tests/Startup.cs b/tests/NexusMods.MneumonicDB.Storage.Tests/Startup.cs index 42a9b239..6aa0684c 100644 --- a/tests/NexusMods.MneumonicDB.Storage.Tests/Startup.cs +++ b/tests/NexusMods.MneumonicDB.Storage.Tests/Startup.cs @@ -21,6 +21,8 @@ public void ConfigureServices(IServiceCollection services) .AddValueSerializer() .AddValueSerializer() .AddAttributeCollection() - .AddAttributeCollection(); + .AddAttributeCollection() + .AddAttributeCollection() + .AddAttributeCollection(); } } diff --git a/tests/NexusMods.MneumonicDB.TestModel/ComplexModel/Attributes/CollectionAttributes.cs b/tests/NexusMods.MneumonicDB.TestModel/ComplexModel/Attributes/CollectionAttributes.cs new file mode 100644 index 00000000..dd32f2cf --- /dev/null +++ b/tests/NexusMods.MneumonicDB.TestModel/ComplexModel/Attributes/CollectionAttributes.cs @@ -0,0 +1,12 @@ +using NexusMods.MneumonicDB.Abstractions; + +namespace NexusMods.MneumonicDB.TestModel.ComplexModel.Attributes; + +public class CollectionAttributes +{ + public class Name : ScalarAttribute; + + public class Mods() : ScalarAttribute(multiValued: true); + + public class LoadoutId : ScalarAttribute; +} diff --git a/tests/NexusMods.MneumonicDB.TestModel/ComplexModel/ReadModels/Collection.cs b/tests/NexusMods.MneumonicDB.TestModel/ComplexModel/ReadModels/Collection.cs new file mode 100644 index 00000000..42a0f70e --- /dev/null +++ b/tests/NexusMods.MneumonicDB.TestModel/ComplexModel/ReadModels/Collection.cs @@ -0,0 +1,41 @@ +using NexusMods.MneumonicDB.Abstractions; +using NexusMods.MneumonicDB.Abstractions.Models; +using NexusMods.MneumonicDB.TestModel.ComplexModel.Attributes; + +namespace NexusMods.MneumonicDB.TestModel.ComplexModel.ReadModels; + +public struct Collection(ModelHeader header) : IEntity +{ + public Collection(ITransaction tx) : this(tx.New()) { } + public ModelHeader Header { get => header; set => header = value; } + + public string Name + { + get => CollectionAttributes.Name.Get(ref header); + init => CollectionAttributes.Name.Add(ref header, value); + } + + public IEnumerable ModIds => CollectionAttributes.Mods.GetAll(ref header); + + public Collection Attach(Mod mod) + { + CollectionAttributes.Mods.Add(ref header, mod.Header.Id); + return this; + } + + public IEnumerable Mods => header.Db.Get(CollectionAttributes.Mods.GetAll(ref header)); + + public EntityId LoadoutId + { + get => CollectionAttributes.LoadoutId.Get(ref header); + init => CollectionAttributes.LoadoutId.Add(ref header, value); + } + + public Loadout Loadout + { + get => header.Db.Get(LoadoutId); + init => CollectionAttributes.LoadoutId.Add(ref header, value.Id); + } + + +} diff --git a/tests/NexusMods.MneumonicDB.TestModel/ComplexModel/ReadModels/Loadout.cs b/tests/NexusMods.MneumonicDB.TestModel/ComplexModel/ReadModels/Loadout.cs index e340b11d..7722557a 100644 --- a/tests/NexusMods.MneumonicDB.TestModel/ComplexModel/ReadModels/Loadout.cs +++ b/tests/NexusMods.MneumonicDB.TestModel/ComplexModel/ReadModels/Loadout.cs @@ -19,4 +19,6 @@ public string Name } public IEnumerable Mods => header.GetReverse(); + + public IEnumerable Collections => header.GetReverse(); } diff --git a/tests/NexusMods.MneumonicDB.TestModel/Services.cs b/tests/NexusMods.MneumonicDB.TestModel/Services.cs index 4de57446..beac8f11 100644 --- a/tests/NexusMods.MneumonicDB.TestModel/Services.cs +++ b/tests/NexusMods.MneumonicDB.TestModel/Services.cs @@ -13,7 +13,8 @@ public static IServiceCollection AddTestModel(this IServiceCollection services) services.AddAttributeCollection() .AddAttributeCollection() .AddAttributeCollection() - .AddAttributeCollection(); + .AddAttributeCollection() + .AddAttributeCollection(); services.AddValueSerializer() .AddValueSerializer() diff --git a/tests/NexusMods.MneumonicDB.Tests/ComplexModelTests.cs b/tests/NexusMods.MneumonicDB.Tests/ComplexModelTests.cs index 82dfc742..02b93265 100644 --- a/tests/NexusMods.MneumonicDB.Tests/ComplexModelTests.cs +++ b/tests/NexusMods.MneumonicDB.Tests/ComplexModelTests.cs @@ -27,6 +27,18 @@ public async Task CanCreateLoadout(int modCount, int filesPerMod) Name = "My Loadout" }; + var oddCollection = new Collection(tx) + { + Name = "Odd Mods", + Loadout = loadout + }; + + var evenCollection = new Collection(tx) + { + Name = "Even Mods", + Loadout = loadout + }; + var mods = new List(); var files = new List(); @@ -39,6 +51,11 @@ public async Task CanCreateLoadout(int modCount, int filesPerMod) Loadout = loadout }; + if (i % 2 == 0) + evenCollection.Attach(mod); + else + oddCollection.Attach(mod); + mods.Add(mod); for (var j = 0; j < filesPerMod; j++) { @@ -68,6 +85,12 @@ public async Task CanCreateLoadout(int modCount, int filesPerMod) var totalSize = Size.Zero; loadout.Mods.Count().Should().Be(modCount, "all mods should be loaded"); + + loadout.Collections.Count().Should().Be(2, "all collections should be loaded"); + + loadout.Collections.SelectMany(c => c.Mods) + .Count().Should().Be(loadout.Mods.Count(), "all mods should be in a collection"); + sw.Restart(); foreach (var mod in loadout.Mods) //totalSize += mod.Files.Sum(f => f.Size); diff --git a/tests/NexusMods.MneumonicDB.Tests/DbTests.CanGetDatomIterator_AEVTCurrent_False.verified.txt b/tests/NexusMods.MneumonicDB.Tests/DbTests.CanGetDatomIterator_AEVTCurrent_False.verified.txt index 49348d5f..ba439837 100644 --- a/tests/NexusMods.MneumonicDB.Tests/DbTests.CanGetDatomIterator_AEVTCurrent_False.verified.txt +++ b/tests/NexusMods.MneumonicDB.Tests/DbTests.CanGetDatomIterator_AEVTCurrent_False.verified.txt @@ -11,6 +11,9 @@ + | 000000000000000B | (0001) UniqueId | NexusMods.MneumonicDB....tes.ModAttributes/Name | 0100000000000002 + | 000000000000000C | (0001) UniqueId | NexusMods.MneumonicDB....s.ModAttributes/Source | 0100000000000002 + | 000000000000000D | (0001) UniqueId | NexusMods.MneumonicDB....odAttributes/LoadoutId | 0100000000000002 ++ | 000000000000000E | (0001) UniqueId | NexusMods.MneumonicDB....lectionAttributes/Name | 0100000000000002 ++ | 000000000000000F | (0001) UniqueId | NexusMods.MneumonicDB....lectionAttributes/Mods | 0100000000000002 ++ | 0000000000000010 | (0001) UniqueId | NexusMods.MneumonicDB....onAttributes/LoadoutId | 0100000000000002 + | 0000000000000001 | (0002) ValueSerializerId | NexusMods.MneumonicDB....izers/SymbolSerializer | 0100000000000001 + | 0000000000000002 | (0002) ValueSerializerId | NexusMods.MneumonicDB....izers/SymbolSerializer | 0100000000000001 + | 0000000000000003 | (0002) ValueSerializerId | NexusMods.MneumonicDB....RelativePathSerializer | 0100000000000002 @@ -24,6 +27,9 @@ + | 000000000000000B | (0002) ValueSerializerId | NexusMods.MneumonicDB....izers/StringSerializer | 0100000000000002 + | 000000000000000C | (0002) ValueSerializerId | NexusMods.MneumonicDB....ializers/UriSerializer | 0100000000000002 + | 000000000000000D | (0002) ValueSerializerId | NexusMods.MneumonicDB....ers/EntityIdSerializer | 0100000000000002 ++ | 000000000000000E | (0002) ValueSerializerId | NexusMods.MneumonicDB....izers/StringSerializer | 0100000000000002 ++ | 000000000000000F | (0002) ValueSerializerId | NexusMods.MneumonicDB....ers/EntityIdSerializer | 0100000000000002 ++ | 0000000000000010 | (0002) ValueSerializerId | NexusMods.MneumonicDB....ers/EntityIdSerializer | 0100000000000002 + | 0200000000000001 | (0003) Path | File3 | 0100000000000003 + | 0200000000000003 | (0003) Path | File2 | 0100000000000003 + | 0200000000000004 | (0003) Path | File1 | 0100000000000003 diff --git a/tests/NexusMods.MneumonicDB.Tests/DbTests.CanGetDatomIterator_AEVTCurrent_True.verified.txt b/tests/NexusMods.MneumonicDB.Tests/DbTests.CanGetDatomIterator_AEVTCurrent_True.verified.txt index 3fd8d802..e7c49800 100644 --- a/tests/NexusMods.MneumonicDB.Tests/DbTests.CanGetDatomIterator_AEVTCurrent_True.verified.txt +++ b/tests/NexusMods.MneumonicDB.Tests/DbTests.CanGetDatomIterator_AEVTCurrent_True.verified.txt @@ -44,6 +44,9 @@ + | 0200000000000004 | (0003) Path | File1 | 0100000000000003 + | 0200000000000003 | (0003) Path | File2 | 0100000000000003 + | 0200000000000001 | (0003) Path | File3 | 0100000000000003 ++ | 0000000000000010 | (0002) ValueSerializerId | NexusMods.MneumonicDB....ers/EntityIdSerializer | 0100000000000002 ++ | 000000000000000F | (0002) ValueSerializerId | NexusMods.MneumonicDB....ers/EntityIdSerializer | 0100000000000002 ++ | 000000000000000E | (0002) ValueSerializerId | NexusMods.MneumonicDB....izers/StringSerializer | 0100000000000002 + | 000000000000000D | (0002) ValueSerializerId | NexusMods.MneumonicDB....ers/EntityIdSerializer | 0100000000000002 + | 000000000000000C | (0002) ValueSerializerId | NexusMods.MneumonicDB....ializers/UriSerializer | 0100000000000002 + | 000000000000000B | (0002) ValueSerializerId | NexusMods.MneumonicDB....izers/StringSerializer | 0100000000000002 @@ -57,6 +60,9 @@ + | 0000000000000003 | (0002) ValueSerializerId | NexusMods.MneumonicDB....RelativePathSerializer | 0100000000000002 + | 0000000000000002 | (0002) ValueSerializerId | NexusMods.MneumonicDB....izers/SymbolSerializer | 0100000000000001 + | 0000000000000001 | (0002) ValueSerializerId | NexusMods.MneumonicDB....izers/SymbolSerializer | 0100000000000001 ++ | 0000000000000010 | (0001) UniqueId | NexusMods.MneumonicDB....onAttributes/LoadoutId | 0100000000000002 ++ | 000000000000000F | (0001) UniqueId | NexusMods.MneumonicDB....lectionAttributes/Mods | 0100000000000002 ++ | 000000000000000E | (0001) UniqueId | NexusMods.MneumonicDB....lectionAttributes/Name | 0100000000000002 + | 000000000000000D | (0001) UniqueId | NexusMods.MneumonicDB....odAttributes/LoadoutId | 0100000000000002 + | 000000000000000C | (0001) UniqueId | NexusMods.MneumonicDB....s.ModAttributes/Source | 0100000000000002 + | 000000000000000B | (0001) UniqueId | NexusMods.MneumonicDB....tes.ModAttributes/Name | 0100000000000002 diff --git a/tests/NexusMods.MneumonicDB.Tests/DbTests.CanGetDatomIterator_EAVTCurrent_False.verified.txt b/tests/NexusMods.MneumonicDB.Tests/DbTests.CanGetDatomIterator_EAVTCurrent_False.verified.txt index 776f5f59..aea40c7c 100644 --- a/tests/NexusMods.MneumonicDB.Tests/DbTests.CanGetDatomIterator_EAVTCurrent_False.verified.txt +++ b/tests/NexusMods.MneumonicDB.Tests/DbTests.CanGetDatomIterator_EAVTCurrent_False.verified.txt @@ -24,6 +24,12 @@ + | 000000000000000C | (0002) ValueSerializerId | NexusMods.MneumonicDB....ializers/UriSerializer | 0100000000000002 + | 000000000000000D | (0001) UniqueId | NexusMods.MneumonicDB....odAttributes/LoadoutId | 0100000000000002 + | 000000000000000D | (0002) ValueSerializerId | NexusMods.MneumonicDB....ers/EntityIdSerializer | 0100000000000002 ++ | 000000000000000E | (0001) UniqueId | NexusMods.MneumonicDB....lectionAttributes/Name | 0100000000000002 ++ | 000000000000000E | (0002) ValueSerializerId | NexusMods.MneumonicDB....izers/StringSerializer | 0100000000000002 ++ | 000000000000000F | (0001) UniqueId | NexusMods.MneumonicDB....lectionAttributes/Mods | 0100000000000002 ++ | 000000000000000F | (0002) ValueSerializerId | NexusMods.MneumonicDB....ers/EntityIdSerializer | 0100000000000002 ++ | 0000000000000010 | (0001) UniqueId | NexusMods.MneumonicDB....onAttributes/LoadoutId | 0100000000000002 ++ | 0000000000000010 | (0002) ValueSerializerId | NexusMods.MneumonicDB....ers/EntityIdSerializer | 0100000000000002 + | 0200000000000001 | (0003) Path | File3 | 0100000000000003 + | 0200000000000001 | (0004) Size | 2 B | 0100000000000003 + | 0200000000000001 | (0005) Hash | 0x00000000DEADBEF1 | 0100000000000003 diff --git a/tests/NexusMods.MneumonicDB.Tests/DbTests.CanGetDatomIterator_EAVTCurrent_True.verified.txt b/tests/NexusMods.MneumonicDB.Tests/DbTests.CanGetDatomIterator_EAVTCurrent_True.verified.txt index 873d12e5..4499047b 100644 --- a/tests/NexusMods.MneumonicDB.Tests/DbTests.CanGetDatomIterator_EAVTCurrent_True.verified.txt +++ b/tests/NexusMods.MneumonicDB.Tests/DbTests.CanGetDatomIterator_EAVTCurrent_True.verified.txt @@ -44,6 +44,12 @@ + | 0200000000000001 | (0005) Hash | 0x00000000DEADBEF1 | 0100000000000003 + | 0200000000000001 | (0004) Size | 2 B | 0100000000000003 + | 0200000000000001 | (0003) Path | File3 | 0100000000000003 ++ | 0000000000000010 | (0002) ValueSerializerId | NexusMods.MneumonicDB....ers/EntityIdSerializer | 0100000000000002 ++ | 0000000000000010 | (0001) UniqueId | NexusMods.MneumonicDB....onAttributes/LoadoutId | 0100000000000002 ++ | 000000000000000F | (0002) ValueSerializerId | NexusMods.MneumonicDB....ers/EntityIdSerializer | 0100000000000002 ++ | 000000000000000F | (0001) UniqueId | NexusMods.MneumonicDB....lectionAttributes/Mods | 0100000000000002 ++ | 000000000000000E | (0002) ValueSerializerId | NexusMods.MneumonicDB....izers/StringSerializer | 0100000000000002 ++ | 000000000000000E | (0001) UniqueId | NexusMods.MneumonicDB....lectionAttributes/Name | 0100000000000002 + | 000000000000000D | (0002) ValueSerializerId | NexusMods.MneumonicDB....ers/EntityIdSerializer | 0100000000000002 + | 000000000000000D | (0001) UniqueId | NexusMods.MneumonicDB....odAttributes/LoadoutId | 0100000000000002 + | 000000000000000C | (0002) ValueSerializerId | NexusMods.MneumonicDB....ializers/UriSerializer | 0100000000000002 diff --git a/tests/NexusMods.MneumonicDB.Tests/DbTests.CanGetDatomIterator_TxLog_False.verified.txt b/tests/NexusMods.MneumonicDB.Tests/DbTests.CanGetDatomIterator_TxLog_False.verified.txt index 46247dc5..b4fbafa8 100644 --- a/tests/NexusMods.MneumonicDB.Tests/DbTests.CanGetDatomIterator_TxLog_False.verified.txt +++ b/tests/NexusMods.MneumonicDB.Tests/DbTests.CanGetDatomIterator_TxLog_False.verified.txt @@ -24,6 +24,12 @@ + | 000000000000000C | (0002) ValueSerializerId | NexusMods.MneumonicDB....ializers/UriSerializer | 0100000000000002 + | 000000000000000D | (0001) UniqueId | NexusMods.MneumonicDB....odAttributes/LoadoutId | 0100000000000002 + | 000000000000000D | (0002) ValueSerializerId | NexusMods.MneumonicDB....ers/EntityIdSerializer | 0100000000000002 ++ | 000000000000000E | (0001) UniqueId | NexusMods.MneumonicDB....lectionAttributes/Name | 0100000000000002 ++ | 000000000000000E | (0002) ValueSerializerId | NexusMods.MneumonicDB....izers/StringSerializer | 0100000000000002 ++ | 000000000000000F | (0001) UniqueId | NexusMods.MneumonicDB....lectionAttributes/Mods | 0100000000000002 ++ | 000000000000000F | (0002) ValueSerializerId | NexusMods.MneumonicDB....ers/EntityIdSerializer | 0100000000000002 ++ | 0000000000000010 | (0001) UniqueId | NexusMods.MneumonicDB....onAttributes/LoadoutId | 0100000000000002 ++ | 0000000000000010 | (0002) ValueSerializerId | NexusMods.MneumonicDB....ers/EntityIdSerializer | 0100000000000002 + | 0200000000000001 | (0003) Path | File3 | 0100000000000003 + | 0200000000000001 | (0004) Size | 2 B | 0100000000000003 + | 0200000000000001 | (0005) Hash | 0x00000000DEADBEF1 | 0100000000000003 diff --git a/tests/NexusMods.MneumonicDB.Tests/DbTests.CanGetDatomIterator_TxLog_True.verified.txt b/tests/NexusMods.MneumonicDB.Tests/DbTests.CanGetDatomIterator_TxLog_True.verified.txt index 68a8b901..788f4809 100644 --- a/tests/NexusMods.MneumonicDB.Tests/DbTests.CanGetDatomIterator_TxLog_True.verified.txt +++ b/tests/NexusMods.MneumonicDB.Tests/DbTests.CanGetDatomIterator_TxLog_True.verified.txt @@ -47,6 +47,12 @@ + | 0200000000000001 | (0005) Hash | 0x00000000DEADBEF1 | 0100000000000003 + | 0200000000000001 | (0004) Size | 2 B | 0100000000000003 + | 0200000000000001 | (0003) Path | File3 | 0100000000000003 ++ | 0000000000000010 | (0002) ValueSerializerId | NexusMods.MneumonicDB....ers/EntityIdSerializer | 0100000000000002 ++ | 0000000000000010 | (0001) UniqueId | NexusMods.MneumonicDB....onAttributes/LoadoutId | 0100000000000002 ++ | 000000000000000F | (0002) ValueSerializerId | NexusMods.MneumonicDB....ers/EntityIdSerializer | 0100000000000002 ++ | 000000000000000F | (0001) UniqueId | NexusMods.MneumonicDB....lectionAttributes/Mods | 0100000000000002 ++ | 000000000000000E | (0002) ValueSerializerId | NexusMods.MneumonicDB....izers/StringSerializer | 0100000000000002 ++ | 000000000000000E | (0001) UniqueId | NexusMods.MneumonicDB....lectionAttributes/Name | 0100000000000002 + | 000000000000000D | (0002) ValueSerializerId | NexusMods.MneumonicDB....ers/EntityIdSerializer | 0100000000000002 + | 000000000000000D | (0001) UniqueId | NexusMods.MneumonicDB....odAttributes/LoadoutId | 0100000000000002 + | 000000000000000C | (0002) ValueSerializerId | NexusMods.MneumonicDB....ializers/UriSerializer | 0100000000000002