Skip to main content

get_default_database_path

Function get_default_database_path 

Source
pub fn get_default_database_path() -> PathBuf
Expand description

Get the default Things 3 database path.

The 4-character suffix on ThingsData-XXXXX varies per install (App Store vs. direct purchase, possibly tied to iCloud account), so this function scans the group container for any ThingsData-* directory containing a real database file. If multiple candidates exist, the one whose main.sqlite was modified most recently wins. When no candidate is found the function falls back to the historical literal ThingsData-0Z0Z2 path — callers downstream surface a clean “file not found” error in that case.

§Examples

use things3_core::get_default_database_path;

let path = get_default_database_path();
assert!(!path.to_string_lossy().is_empty());
assert!(path.to_string_lossy().contains("Library"));