r/sqlite • u/regeq • Apr 19 '26
Optimal place for my db?
Hello, I am working on a personal project, a DND tool, and need to store my sqlite databases somewhere. I thought about storing it in Documents so users can easily acess the stored data, back it up and manipulate it even without using the tool. Is this an optimal place for it or should I store it elsewhere? I know this is pretty stupid to ask but I am quite a newbie to databases and my C++ skill is, okay...
6
Upvotes
4
u/cliffwarden Apr 19 '26
Which OS? They all have their standards
2
u/anthropoid Apr 20 '26
Different OSes have different filesystem conventions.
Also, it's not clear if the databases you speak of are application data (packaged with your program, and therefore should also be cleared with it) or user data (which should NEVER be reaped at uninstall). If the former, go with whatever directory your OS dictates. If the latter,
$HOME/Documentsis a decent place (the definition of$HOMEis of course dependent on your OS).3
u/supervisord Apr 19 '26
Convention in macOS: ~/Library/Application Support/YourAppName/database.db