I almost fucked up with company's production database

The other day I was assigned a task to create a library to provide common methods for database operations, so we could change configurations and use any database without changing any code. I decided to test it with the production database, and there was a bug in the update function that I wrote which updated all the values of the column. After I ran the function, I saw in the terminal that it had updated all the values of the column. I felt like I was about to have a heart attack.

But I managed to calm myself, and thankfully we had another copy of the database. My heart was pounding. I wrote a query to update the values of that column from the copy table where the primary keys matched. The query took minutes to update that column completely. All this happened within 3-4 minutes and it did not affect production at all. Now I'm going to keep myself miles away from production setups.

And I haven't told my seniors about it.