✅ Preferred method structure when working with databases?
Hey guys, I am creating a library that will work with a local SQLite database. The manager stores a connection and provides the functionality to create SQL commands, but it should also have access to CRUD methods (+ some others) for different tables. It seems impractical to just dump it into a single class file. Is it a good practice to create a class (for each table) with extension methods for the manager class, and these will implement the execution of SQL queries?
6 Replies
what does the program do? i probably wouldn't divide methods per table, i would divide them by how they are used (so how they are actually used together on the code)
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
I don't want to use ORM, the library has to be as simple as possible (the least amount of technologies). It will be used by multiple institutions where the IT staff might not be as proficient - they will most likely know how to read basic C# code, PowerShell and SQL, but adding EF or Dapper might be a bit too much.
So using a more direct approach through Microsoft.Data.SQLite package sounds like the better option to me.
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
I am only familiar with the EF
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View