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.
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.