Postico: How to install and use Postico to connect to a database
The basics of using Postico
When carrying out a piece of development it helps to be able to visualise the database. We are Ruby on Rails developers here at Tosbourn Ltd. and the database we tend to use is PostgreSQL.
You can visualise the database using your terminal but this looks pretty ugly and you need to learn another DSL to enable you to use it. That’s where Postico comes in! Postico is a PostgreSQL client for the Mac, so a GUI for visualising your database easily.
If you go to the Postico website you will see a big download button at the top of the page. Just click on this and follow the instructions like you would when installing any app to you Mac. It may mention payment but feel free to ignore Postico is free to use (within limits) with the option of paying for it if you want.
Accessing your database
You will need to launch the app and then click on
New Favorite in the bottom left hand corner. Then you will have the ability to connect to a new database. If it’s a local development database you just need to enter the name of the database i.e.
cats_dating_development, you can give it a nickname if you like which will remain in your list of databases on the launch screen for easy access later. Then click
Connect and you should be connected to your database.
When you click connect you will see a list of the tables in your database.
Simply double click on the table you wish to view and it will open. Now you should be able to see the content of the table including the column names. From here you can manipulate data by double clicking on individual cells. When dealing with data be extremely careful especially if connecting to a production database as you could very easily overwrite or delete important data.
As the article title suggests this is only the basics so the last thing I’m going to look at is table structure. If you click on
Structure as shown on the above screenshot you will be able to see the structure of each row in your database and any indexes which may exist on the table.