Made error messages more relevant and descriptive.
Updated method comments to match their functionality.
General formatting and consistency improvements.
Separated functions which makes the code more readable, and each function does only one thing, following the Single Responsibility Principle.
Made sure my code already parameterized the SQL queries, so it is safe from SQL injections.
For consistent error messages, I have wrapped errors using the format: "action + subject + context".
Organized/cleaned up the imports
Using the provided context now in my database calls. This ensures that my SQL queries respect the timeouts and other settings of the passed-in context.