Skip to main content

parse_k_range

Function parse_k_range 

Source
pub fn parse_k_range(s: &str) -> Result<usize, String>
Expand description

Validates -k/--k on every retrieval command.

The upper bound matches the historical sqlite-vec knn limit; values above it used to surface a leaky engine error such as k value in knn query too large, provided 10000 and the limit is 4096. Validating at parse time turns the failure into a clean Clap error before any database work.