# How to find the current database?

**URL:** <https://www.ruby-forum.com/t/how-to-find-the-current-database/178777>\
**Category:** Rails\
**Created:** [November 11, 2009, 7:06am UTC](https://www.ruby-forum.com/t/how-to-find-the-current-database/178777 "2009-11-11T07:06:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![martin\_mercy2001](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d2c977/32.png) [@martin\_mercy2001](https://www.ruby-forum.com/u/martin_mercy2001)\
**Post date:** [November 11, 2009, 7:06am UTC](https://www.ruby-forum.com/t/how-to-find-the-current-database/178777/1 "2009-11-11T07:06:12Z")

</div>

Dear Frienz,

Iam using two databases in my application and how to find the current  
database name? Also how to find the existance of a database?

I have option to change the database? so if a user gives a database name  
how do i can check whether the database already exists or not?

Thanks in advance

Regards,  
Jose Marin

---

<div class="post-metadata">

**Author:** ![martin\_mercy2001](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d2c977/32.png) [@martin\_mercy2001](https://www.ruby-forum.com/u/martin_mercy2001)\
**Post date:** [November 11, 2009, 7:11am UTC](https://www.ruby-forum.com/t/how-to-find-the-current-database/178777/2 "2009-11-11T07:11:06Z")

</div>

Hi

Watch this post  
[http://www.ruby-forum.com/topic/198981](http://www.ruby-forum.com/topic/198981)

Sijo
