larryhudson / astro-sqlite-tts-feed

astro-sqlite-tts-feed
5 stars 0 forks source link

Chore: clean up duplicated code in db utility functions #14

Closed larryhudson closed 11 months ago

larryhudson commented 11 months ago

Now that we have two database tables (articles and extraction_rules), there is some duplicated code that can be refactored to make it cleaner. As I'm going to be adding another database table for related links (#3), it's a good time to do that refactoring work.

In the src/utils/db.js file, we can clean up the functions for querying, inserting, updating so that they're not table-specific. Then I would just need to change wherever they're used.

I think I have a better example of DB utility functions over in the astro-sqlite-bullmq-starter repo. I could use that as a reference.

larryhudson commented 11 months ago

This is done now.