What happens if we rename databases and permission groups?

Hi! I'm planning to rename some of the permission groups, databases and the role as well as warehouse used for the database, and I wanted to be sure of the impact of this change in the queries created with the databases that will be renamed.
I understand that if a database is deleted, the queries will be deleted as well, but if the database, or settings of the database are renamed, will it break the queries, or the queries will be automatically updated for the new names?
Thank you!

All will be fine assuming you're talking about the name in Metabase that refers to your database. Internally, it's all done by ID.

If you're talking about the original database, you should be fine unless you've created SQL queries with the database name in them.

Thank you so much for your help!