pub fn resolve_namespace(explicit: Option<&str>) -> Result<String, AppError>Expand description
Resolves the active namespace, returning only the final name.
Shortcut over detect_namespace when the source does not matter.
With a valid explicit flag, the returned namespace is exactly the passed value.
Without a flag, the final fallback is "global".
§Errors
Returns AppError::Validation if explicit contains invalid characters
or exceeds 80 characters.
§Examples
use sqlite_graphrag::namespace::resolve_namespace;
// A valid explicit flag is accepted and reflected in the result.
let ns = resolve_namespace(Some("meu-projeto")).unwrap();
assert_eq!(ns, "meu-projeto");use sqlite_graphrag::namespace::resolve_namespace;
use sqlite_graphrag::errors::AppError;
// Namespace with invalid characters causes a validation error (exit 1).
let err = resolve_namespace(Some("ns with space")).unwrap_err();
assert_eq!(err.exit_code(), 1);