Is there a standard place to store databases
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 77
- Joined: Thu May 21, 2015 2:41 am
Is there a standard place to store databases
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
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!
It is available on Mac, Windows, *Nix, iOS and Android and, much more important,
we have WRITE permissions there on all platforms!
-
- Posts: 77
- Joined: Thu May 21, 2015 2:41 am
Re: Is there a standard place to store databases
Ok. Cool. Thanks. Is that a safe location from inadvertent deletion or tampering? Just curious.
Re: Is there a standard place to store databases
You never can prevent users from doing dumb things!
Re: Is there a standard place to store databases
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.