se1exin / Cleanarr

A simple UI to help find and delete duplicate and sample files from your Plex server
https://hub.docker.com/r/selexin/cleanarr
MIT License
218 stars 18 forks source link

add database interface for wider db support #142

Open robertlestak opened 4 months ago

robertlestak commented 4 months ago

this PR adds a database interface to enable the use of a remote DB as opposed to the embedded tinydb.

this change is backwards compatible and opt-in. existing installations will continue to work as expected, and new installs will default to use embedded tinydb.

setting DATABASE_URL env var will switch to SQLAlchemy interface, which has much wider DB support. I've only tested with postgres, and I would imagine support for other DBs would require adding those drivers in the requirements.txt, but i've left that as-is for now.

this does not handle any data migrations, so if you have an existing TinyDB install and switch to SqlAlchemy backend, it will start fresh.