Open its-josh4 opened 1 year ago
I'd throw bounty cash at this if it also included mysql, I get that postgres is more popular right now.
IRT Backups, why not a giant JSON dump? JSON would be SQL agnostic.
@trollboy you mean like the Export task?
@MrX292 yeah. Exporting/backing up to JSON would be RDMS agnostic.
After investigating the main hindrance seems to be the custom functions registered to sqlite. https://github.com/stashapp/stash/blob/7086109d7879b64529578e3e16dcafbb8b57e842/pkg/sqlite/driver.go#L27-L39 To do this in postgres you would need to register a binary to the service with said functions, which could be possible but would require some careful considerations about how to do it.
Couldn't this be handled by using an abstraction layer?
Stash stores all data in a SQLite database. Although SQLite is great and is the best option for 90% or more of Stash users, supporting external DB servers such as Postgres would be great.
Postgres:
At a quick glance, it appears that supporting Postgres shouldn't be too complex in stash. We should be able to add that as an option (alternative to SQLite).
Only thing that is an open question is what to do with the built-in backup feature of stash, since it's currently implemented so it does a VACUUM into a separate SQLite database. This is obviously not an option. My suggestion would be to disable built-in backups when using a DB server, since backups should be performed in the server.