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 E331/E340: rename internal helpers, extract error functions

Renames: find_vds_info → vds_info, make_unique_indexes → unique_indexes,
create_new → new_db. Extract err_userinfo_http, err_userinfo_parse,
err_userinfo_empty_uid helpers for consistent error formatting (E340).

+4 -4
+4 -4
lib/sqlite.ml
··· 167 167 else Some (Btree.Record.encode key_values) 168 168 169 169 (* Create persistent unique indexes for a table *) 170 - let make_unique_indexes pager ~tbl_name constraints = 170 + let unique_indexes pager ~tbl_name constraints = 171 171 List.mapi 172 172 (fun i (indices, col_name) -> 173 173 let idx_name = Fmt.str "sqlite_autoindex_%s_%d" tbl_name (i + 1) in ··· 345 345 try Eio.Path.mkdirs ~exists_ok:true ~perm:0o755 Eio.Path.(fs / dir) 346 346 with Eio.Io _ -> ()) 347 347 348 - let create_new ~sw path = 348 + let init ~sw path = 349 349 mkdirs_for path; 350 350 let file = 351 351 Eio.Path.open_out ~sw ~create:(`If_missing 0o644) path |> fun f -> ··· 522 522 all_tables; 523 523 insert_rowids = Hashtbl.create 8; 524 524 } 525 - with Eio.Io _ when create -> create_new ~sw path 525 + with Eio.Io _ when create -> init ~sw path 526 526 527 527 (* Get the kv_table, raising if no kv table exists *) 528 528 let kv t = ··· 658 658 let btree = Btree.Table.v t.pager in 659 659 let schema = { tbl_name = name; columns; sql } in 660 660 let constraints = parse_unique_constraints sql columns in 661 - let indexes = make_unique_indexes t.pager ~tbl_name:name constraints in 661 + let indexes = unique_indexes t.pager ~tbl_name:name constraints in 662 662 let gt = { g_btree = btree; g_schema = schema; g_unique_indexes = indexes } in 663 663 t.all_tables <- t.all_tables @ [ gt ] 664 664