INNER CODE UNIT · Rust
Some
slothflowlabs/duckle · apps/desktop/src/lib.rs:136
if let Some(dir) = std::env::current_exe().ok().and_then(|e| e.parent().map(PathBuf::from)) {
std::thread::spawn(move || self_update::sweep_leftovers(&dir));
}
// Resolve where the downloaded DuckDB CLI lives, so the
// engine can shell out to it. The binary may not exist yet
// (first run installs it via the setup screen); the engine
// just errors clearly until then.
//
// Resolve the engine binary, honoring an externally-set
// DUCKLE_DUCKDB_BIN first (issue #179) so a user-supplied DuckDB
// wins over the bundled one, then publish the resolved path back to
// DUCKLE_DUCKDB_BIN. The engine's primary execution path takes the
// binary as a constructor arg, but rest_source_apply (used by
// REST-shaped sources: Oracle, SQL Server, Snowflake, Databricks,
// Synapse, BigQuery, and the various SaaS aliases that materialize
// their inline result set) is a free helper that reads the env var
// directly. Without this set, those sources fail with
// "DUCKLE_DUCKDB_BIN not set" while plain file flows work fine. See