To query the current warehouse, database, and schema name you can just use the following snippet:

select current_warehouse(), current_database(), current_schema();