Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use app_local_data_dir() for database #757

Merged
merged 2 commits into from
Mar 18, 2024
Merged

Conversation

uklotzde
Copy link
Contributor

No description provided.

Copy link
Owner

@martpie martpie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

src-tauri/src/plugins/database.rs Show resolved Hide resolved
@martpie
Copy link
Owner

martpie commented Mar 18, 2024

I just tested it, seems to be working fine, and the race condition is EXTREMELY unlikely.

I have no opinion between dirs vs directories, maybe let's reuse what Tauri uses under the hood? (if any)

I don't really like that Tauri uses the bundle identifier as the path for configs/data, that's not as readable/findable as using the app name. I may change this behavior at some point, but let's stop using the home dir at least (though it's really convenient).

image

*/
// TODO: Replace with PathResolver::app_config_dir().
fn get_app_storage_dir() -> PathBuf {
let path = dirs::home_dir().expect("Get home dir");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, how about using dirs::config_dir();? + museeks as folder.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

directories would be more appropriate than the the low-level dirs crate.

But since this is supposed to be a temporary hack anything that respects the established standards on each platform is better than polluting the home directory.

@martpie martpie merged commit de9e36b into martpie:tauri Mar 18, 2024
3 of 4 checks passed
martpie pushed a commit that referenced this pull request Jun 13, 2024
* Use app_local_data_dir() for database
* Move get_app_storage_dir() into config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants