Page 1 of 1
Is there a standard place to store databases
Posted: Sun Sep 27, 2015 12:26 pm
by Not a lot of thought
I'm creating an application that I want to deploy initially on a PC that will install/create a SQLite local database on the machine. Eventually I want to deploy all of this on different devices, MAC, and mobile devices. I was wondering where you guys typically store the database for these machines and how you test for each one in order for the application to put the DB in the correct location based on what OS it is being installed on...or is this even a problem? Are there APIs for this if so Im couldn't locate them on Google, may not be using the right terminology.
Re: Is there a standard place to store databases
Posted: Sun Sep 27, 2015 1:07 pm
by Klaus
The best place is probably -> specialfolderpath("documents")!
It is available on Mac, Windows, *Nix, iOS and Android and, much more important,
we have WRITE permissions there on all platforms!
Re: Is there a standard place to store databases
Posted: Sun Sep 27, 2015 1:41 pm
by Not a lot of thought
Ok. Cool. Thanks. Is that a safe location from inadvertent deletion or tampering? Just curious.
Re: Is there a standard place to store databases
Posted: Sun Sep 27, 2015 1:46 pm
by Klaus
You never can prevent users from doing dumb things!

Re: Is there a standard place to store databases
Posted: Sun Sep 27, 2015 3:06 pm
by SparkOut
Certainly on android (possibly on iOS too?) specialFolderPath ("documents") is inaccessible to casual browsing without root. The app has its own permission to read and write this folder, so sqlite databases created or moved here by the app will work, but dumb user action is reasonably prevented. Determined interference could still cause problems, but that is always the case. On desktop computers, the documents folder is readily accessible for read/write as ever by normal, by stupid and by malicious users.