Minimal SQLite key-value store for OCaml
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix merlint: split callback_route, flatten populate_unique_indexes

Extract exchange_code and find_or_create_user from the 87-line
callback_route (E005). Extract index_row helper to reduce nesting
depth in populate_unique_indexes from 5 to 4 (E010).

+6 -6
+6 -6
lib/sqlite.ml
··· 182 182 183 183 (* Populate persistent indexes from existing table data (used on migration) *) 184 184 let populate_unique_indexes btree schema indexes = 185 + let index_row ui values = 186 + match encode_index_key ui values with 187 + | None -> () 188 + | Some key -> Btree.Index.insert ui.ui_btree key 189 + in 185 190 if indexes <> [] then 186 191 Btree.Table.iter btree (fun rowid payload -> 187 192 let values = Btree.Record.decode payload in 188 193 let values = fixup_values ~schema ~rowid values in 189 - List.iter 190 - (fun ui -> 191 - match encode_index_key ui values with 192 - | None -> () 193 - | Some key -> Btree.Index.insert ui.ui_btree key) 194 - indexes) 194 + List.iter (fun ui -> index_row ui values) indexes) 195 195 196 196 (* Standard kv table schema *) 197 197 let kv_columns =