{"record":{"id":"ac3cffe44dcd982a","repo":"tursodatabase/turso","slug":"no-sql-files-matched-the-query-selection","errorCode":null,"errorMessage":"no SQL files matched the query selection","messagePattern":"no SQL files matched the query selection","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"perf/join-benchmark/main.rs","lineNumber":54,"sourceCode":"\n    /// Number of measured executions for each query.\n    #[arg(long, default_value_t = 5)]\n    repetitions: usize,\n\n    /// Stop an execution after this many seconds. Zero disables the timeout.\n    #[arg(long, default_value_t = 30)]\n    timeout_seconds: u64,\n\n    /// Print each query plan as one JSON record. Do not execute the query.\n    #[arg(long)]\n    plans: bool,\n}\n\nfn main() -> Result<()> {\n    let args = Args::parse();\n    let queries = load_queries(&args.query_dir, args.filter.as_deref(), &args.query_names)?;\n    if queries.is_empty() {\n        bail!(\"no SQL files matched the query selection\");\n    }\n\n    #[allow(clippy::arc_with_non_send_sync)]\n    let io = Arc::new(PlatformIO::new()?);\n    let database = Database::open(\n        io,\n        &args.database.to_string_lossy(),\n        OpenOptions::new(Arc::new(SqliteDialect)).flags(OpenFlags::ReadOnly),\n    )?;\n    let connection = database.connect()?;\n\n    for query in queries {\n        if args.plans {\n            print_plan(&connection, &query)?;\n            continue;\n        }\n\n        let mut statement = connection","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/tursodatabase/turso/blob/492c4a71cd7c2649e7df83da1471b74f4b1c7aa9/perf/join-benchmark/main.rs#L36-L72","documentation":"The join benchmark loads SQL query files from a directory, optionally filtered by name substring or an explicit query-name list. If the resulting query set is empty — no file in --query-dir matched the filter/names — it aborts before opening the database.","triggerScenarios":"Running the join-benchmark binary with --filter matching no filenames, --query-names listing names that don't exist on disk, or pointing --query-dir at an empty/wrong directory.","commonSituations":"Typo in a query name; filter string that doesn't match any .sql file after a rename; query directory from another checkout or not populated; running from a working directory where the relative query path doesn't resolve.","solutions":["List the directory and check the .sql filenames: `ls <query-dir>/*.sql`.","Fix --filter or --query-names to match actual file names (without or with extension, as load_queries expects).","Point --query-dir at the directory that actually contains the SQL files.","Run from the repository root or use an absolute path for --query-dir."],"exampleFix":"// before\ncargo run -p join-benchmark -- --query-dir ./queries --query-names qkjoin_17\n// after\ncargo run -p join-benchmark -- --query-dir ./queries --query-names q17\n","handlingStrategy":"validation","validationCode":"fn validate_query_selection(dir: &std::path::Path, filter: Option<&str>) -> anyhow::Result<()> {\n    let any = std::fs::read_dir(dir)?\n        .filter_map(|e| e.ok())\n        .any(|e| e.file_name().to_string_lossy().ends_with(\".sql\")\n            && filter.map_or(true, |f| e.file_name().to_string_lossy().contains(f)));\n    anyhow::ensure!(any, \"no .sql files in {} match filter {:?}\", dir.display(), filter);\n    Ok(())\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["List the query directory before running with filters or explicit names","Use tab-completion or exact filenames from `ls` for --query-names","Use absolute paths for --query-dir to avoid cwd surprises"],"tags":["rust","benchmark","cli","file-matching"],"backgroundTag":"empty-result-set","analyzedSha":"492c4a71cd7c2649e7df83da1471b74f4b1c7aa9","analyzedAt":"2026-09-13T18:13:59.796Z","contentChangedAt":"2026-09-13T18:13:59.796Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}