package ppx_minidebug

  1. Overview
  2. Docs

Module Minidebug_client.QuerySource

Query layer for database access

Sourcetype entry = {
  1. scope_id : int;
  2. seq_id : int;
  3. child_scope_id : int option;
  4. depth : int;
  5. message : string;
  6. location : string option;
  7. data : string option;
  8. elapsed_start_ns : int;
  9. elapsed_end_ns : int option;
  10. is_result : bool;
  11. log_level : int;
  12. entry_type : string;
}
Sourcetype run_info = {
  1. run_id : int;
  2. timestamp : string;
  3. elapsed_ns : int;
  4. command_line : string;
  5. run_name : string option;
}
Sourcetype stats = {
  1. total_entries : int;
  2. total_values : int;
  3. unique_values : int;
  4. dedup_percentage : float;
  5. database_size_kb : int;
}
Sourceval get_runs : string -> run_info list

Get all runs from metadata database (schema v3+), given the versioned DB path. Automatically finds the corresponding <name>_meta.db file.

Sourceval get_latest_run_id : string -> int option

Get the ID of the most recent run from metadata DB, given the versioned DB path

Sourceval get_entries : Sqlite3.db -> ?parent_id:int -> ?max_depth:int -> unit -> entry list

Get entries for a specific run, optionally filtered by parent_id and max_depth

Sourceval get_stats : Sqlite3.db -> string -> stats

Get database statistics including deduplication metrics

Sourceval search_entries : Sqlite3.db -> pattern:string -> entry list

Search entries by regex pattern matching message, location, or data

Sourceval get_root_entries : Sqlite3.db -> with_values:bool -> entry list

Get only root-level entries efficiently. When with_values is true, includes immediate children values. Fast for large databases.