wereii / lemmy-thumbnail-cleaner

MIT License
11 stars 1 forks source link

Consider pulling in database schema from Lemmy #2

Open Nutomic opened 6 months ago

Nutomic commented 6 months ago

Good job on this project, its very helpful that we dont have to handle image cleanup directly in Lemmy, at least not yet :)

One thing you can consider changing is to pull in the Lemmy code as dependency:

lemmy_db_schema = { package = "lemmy_db_schema", git = "https://github.com/LemmyNet/lemmy.git", tag = "0.19.3" }

Then you can write sql queries using diesel ORM, and write queries like Lemmy does, instead of plain strings. Just be careful not to run any db migrations by accident.

In this way it may be possible to integrate your project directly into Lemmy at some point.

wereii commented 5 months ago

Thanks for the nice words (and sorry for the delayed response, life stuff)

I will keep it as it is for now (mainly to avoid adding bugs out of inexperience with diesel) though I can see the benefit once/when the lemmy database changes in a way that affects this tool.

Alas I can't really imagine this little script getting melded into lemmy as is or with little changes except maybe being able to just copy the ORM lines.