-
-
Notifications
You must be signed in to change notification settings - Fork 822
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
[Feature] Support Postgres as DB backend #3892
Comments
I'd throw bounty cash at this if it also included mysql, I get that postgres is more popular right now. |
@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. Lines 27 to 39 in 7086109
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. It might also require some deep dives into specific sqlite and postgres macros like current date etc. EDIT2:
EDIT3: |
Couldn't this be handled by using an abstraction layer? |
Just happened to me on my Unraid server. Wishing I'd stored in the dbms I'm already running on the same server :( |
I would also throw a small bounty, like maybe 100+ usd, for support for using either MySQL or Postgres as the backend. I wouldn't need those settings exposed in the settings UI, hand-editing config.yml is fine, or automating the setup of the binary service mentioned above, basic instructions (community-sourced maybe?) for how that might be done and user has to set it up themselves. I know it would require abstracting parts of the system that currently aren't abstracted like the regex, phash_distance, etc functions mentioned above, so it wouldn't be trivial... but the performance gains for very large databases would be awesome.. I've never done bounties before so I'm not sure how that works, but I give small amounts to all kinds of things.. $60/mo patreon budget, monthly donations to Wikipedia, Internet Archive... |
I have create some preliminary work on a branch here: TODOS:
There are probably more bugs which i haven't found. |
@NodudeWasTaken I would be very happy to help. Let me know how we can sync! (Discord?) |
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.
The text was updated successfully, but these errors were encountered: