Issung / GChan

Scrape boards & threads from 4chan. Download images, videos and HTML if desired.
GNU General Public License v3.0
60 stars 9 forks source link

Migrate data persistence to EFCore #20

Open Issung opened 1 year ago

Issung commented 1 year ago

This application saves data the user inputs like threads/boards to scrape across application closes/opens.

Originally it was done in a .txt file, very nasty.

Sometime mid 2021 I rewrote that to store the data in an sqlite database in a new class DataController.cs. This is okay but the implentation is a bit shit and there's no easy way to do migrations (changes do the database schema) which I would like have for the future.

I want to stick with SQLite but use EFCore over the top, it gives us migration ease "for free" and makes working with the database easier. https://learn.microsoft.com/en-us/ef/core/get-started/overview/first-app?tabs=netcore-cli

Need to decide if we try putting the existing Board/Thread classes into the DB as is, or if we have seperate classes for database storage and map them back and fourth. Needs discussion.

Issung commented 1 year ago

While this is a bit complex its relatively simple because its a seperate class that manages all the data access on its own, all changes will likely be within this class and not affect much outside of it 👍