objective categorical abstract machine language personal data server

Use path in addition to since to sort records

futur.blue 20afdee2 f6cddaa7

verified
+5 -5
+1 -1
pegasus/lib/repository.ml
··· 550 550 mst_node_cids 551 551 in 552 552 (* collect record data for insert *) 553 - let since = Tid.now () in 554 553 let record_data, blob_refs = 555 554 List.fold_left 556 555 (fun (acc_data, acc_refs) (path, cid) -> 557 556 match Block_map.get cid all_blocks with 558 557 | Some data -> 558 + let since = Tid.now () in 559 559 let record = Lex.of_cbor data in 560 560 let record_refs = 561 561 Util.find_blob_refs record
+4 -4
pegasus/lib/user_store.ml
··· 155 155 get_many 156 156 {sql| SELECT @string{path}, @CID{cid}, @Blob{data}, @string{since} FROM records 157 157 WHERE path LIKE %string{collection} || '/' || '%' 158 - AND (since < %string{cursor} OR %string{cursor} = '') 159 - ORDER BY since DESC LIMIT %int{limit} 158 + AND (since || path < %string{cursor} OR %string{cursor} = '') 159 + ORDER BY since DESC, path DESC LIMIT %int{limit} 160 160 |sql}] 161 161 162 162 let count_records = ··· 173 173 get_many 174 174 {sql| SELECT @string{path}, @CID{cid}, @Blob{data}, @string{since} FROM records 175 175 WHERE path LIKE %string{collection} || '/' || '%' 176 - AND (since > %string{cursor} OR %string{cursor} = '') 177 - ORDER BY since ASC LIMIT %int{limit} 176 + AND (since || path > %string{cursor} OR %string{cursor} = '') 177 + ORDER BY since ASC, path ASC LIMIT %int{limit} 178 178 |sql}] 179 179 180 180 let put_record =