I want to be able to list all databases with ActiveRecord.
So I need an ActiveRecord equivalent of the following command in the terminal:
psql --host 192.168.0.100 --port 5432 --username postgres --list
I don't know PostgreSQL, but if there is a SQL query which return this information you can do this:
sql = "select * from ... your sql query here" records_array = ActiveRecord::Base.connection.execute(sql)
Looks like this is the SQL you need:
SELECT datname FROM pg_database WHERE datistemplate = false;