@@ -114,10 +114,18 @@ export const createDurableObjectStoragePersister = ((
114114 > = getContent ( ) as any ,
115115 ) : Promise < void > => {
116116 const keysToSet : IdMap < StoredValue > = mapNew ( ) ;
117+
118+ // Store the root tables metadata (timestamp and hash)
117119 mapSet ( keysToSet , constructKey ( T ) , [ 0 , tablesHlc , tablesHash ] ) ;
120+
121+ // Process each table in the store
118122 objForEach ( tablesObj , ( [ tableObj , tableHlc , tableHash ] , tableId ) => {
123+ // Store table-level metadata
119124 mapSet ( keysToSet , constructKey ( T , tableId ) , [ 0 , tableHlc , tableHash ] ) ;
125+
126+ // Process each row within the table
120127 objForEach ( tableObj , ( [ rowObj , rowHlc , rowHash ] , rowId ) => {
128+ // Store row-level metadata
121129 mapSet ( keysToSet , constructKey ( T , tableId , rowId ) , [
122130 0 ,
123131 rowHlc ,
@@ -128,7 +136,11 @@ export const createDurableObjectStoragePersister = ((
128136 ) ;
129137 } ) ;
130138 } ) ;
139+
140+ // Store the root values metadata (timestamp and hash)
131141 mapSet ( keysToSet , constructKey ( V ) , [ 0 , valuesHlc , valuesHash ] ) ;
142+
143+ // Process each value in the store
132144 objForEach ( valuesObj , ( valueStamp , valueId ) =>
133145 mapSet ( keysToSet , constructKey ( V , valueId ) , valueStamp ) ,
134146 ) ;
0 commit comments