Whenever I have a disconnection from the internet I can't upload any of my edits to the database. I then have to restart my QGIS to get connected again and enter my credentials. Is there a way to do so without having to restart my QGIS and lose all of my unsaved edits?
I am presuming you are connecting to a PostGIS database?
If so when you are setting up your connection make sure that you tick the save boxes at the end of the username and password fields. Then you won't have to enter your credentials again.
If you are connecting to another database, there are similar save options in the screens when setting up your connection to the database.
If you are connected and making edits online and you are making edits then save often.
Otherwise as user30184 says you may be better off using the
offline editing plugin. This would also speed up your workflow.