How to Use Phantdom

Discover How Phantdom Can Improve Your Ruby on Rails & PostgreSQL Workflow



Connect with Default Settings

Connecting to default is as simple as checking for the Default settings work notifier and clicking Connect Now with all form fields empty after starting up Phantdom.

connecting to default




 





Phantdom Dashboard

Once you have connected you will be greeted with the database dashboard screen. This displays currently available databases within Phantdom. As shown in the screenshot below, databases are sorted by Rails (databases that have schema_migrations) and non-Rails datbases.

Phantdom dashboard




 





Connect to a Local Database

Connecting to a specific database is as easy as filling out the form presented to you when you start up Phantdom.

You will need your PostgreSQL Username, password, host (for example: localhost) and port, and finally the Database Name

connect to specific local database




 





Connect to a Remotely Hosted Database

Connecting to a remotely hosted database is largely the same as connecting to a locally hosted one. Simply fill out the form presented to you when you start up Phantdom with your database information.

Just like connecting to a local database, you will need your PostgreSQL Username, password, host (for this instance, it will be an IP address) and port, and finally the Database Name.

However, you will need to make sure your database allows you to connect to it. For details on how to properly set this up, we recommend you checkout the PostgreSQL Documentation and Support Pages.

connect to remote database




 





Switching Databases

Switching databases can be done by clicking the root path shown in the top bar and selecting from the main list of currently available databases (1) or using the drop-down select menu under the Database heading in the left sidebar (2).

switching databases




 





Viewing Database Tables

To view your database tables, simple click the name of the table you wish to view from either the sidebar (1) or double-click its name (2) from the main table you see by default after selecting your database.

viewing database tables




 





Viewing Columns & Table Structure

To view the columns and table structure for your currently selected database table, simply click on the button labeled Columns in the toolbar at the bottom of the application window.

viewing columns and table structure




 






Preferences Window

To access your Phantdom Preferences at any time, click the gear ⚙️ icon in the bottom-left of the application window.

preferences window

preferences window 2




 





Search in Phantdom

Searching is as easy as clicking the Search input in the bottom-right corner and typing what you are looking for and Phantdom will find results as you type.

Searching in Phantdom




 





Editing Table Data

Editing table data cells is as easy as double-clicking the cell you wish to edit. Once you do, you will notice buttons to either Confirm or Cancel your changes will appear in the lower bottom-right of the application window. Clicking Confirm Changes will update and save to your database.

Editing Table Data




 




Datatype Icon Legend

legend-integer

The INTEGER data type accepts numeric values.

legend-string

The VARCHAR data type accepts character strings, including Unicode, of a variable length up to the maximum length specifiied in the data type declaration.

legend-text

The TEXT data type accepts large multi-line character strings.

legend-date

The TIMESTAMP data type accepts timestamp values, which are a combination of a DATE value and a TIME value. DATE and TIME data types will also be displayed with this icon.

legend-boolean

The BOOLEAN data type accepts the storage of two values: TRUE or FALSE.




 





Adding a Rails folder to a Rails Database

Adding the Rails app folder to its database in Phantdom can be done by clicking the folder icon highlighted in the screenshot below, navigating to the proper directory and opening the file.

adding rails folder to rails db




 





Ruby on Rails Checklist

The Ruby on Rails checklist, which can be accessed by clicking the button shown in the first screenshot below, is where you can go to quickly see what you need to get your Rails app running and use Rails commands. You will see what version you currently have and the path to it on your machine listed here.

adding rails folder to rails db adding rails folder to rails db




 





Opening Gemfile Table

Viewing the Gemfile is as easy as clicking Gemfile in the left sidebar to view a table listing out gems, along with its version number (if it has one), currently installed in your Rails app folder.

opening gemfile table




 





Open Schema Migration Table

Much like viewing the Gemfile table, to open the Schema Migration table simply click the link in the left hand sidebar to view schema migrations and their status.

open schema migration table




 





Open Terminal

Open Terminal inside of Phantdom, simply click the button highlighted in the below screenshot in the top-right of the application window or you can use the tilde hotkey ~ for quick access.

Open Terminal - 1

Open Terminal - 2




 





Search and Install Gems

Searching for new gems from rubygems.org can be done by clicking the Gems button in top-right hand of the application window, then typing in the name of the gem you are looking for. If search finds something you will then see a list of results directly beneath.

search and install gems - 1

search and install gems - 2

Double-clicking on any gem in the list will then take you to the Terminal window to install your selected gem.

search and installing gems - 3




 





Running Rake Commands

To run rake commands inside of Phantdom, simply click the Rake button highlighted in the screenshot below and choose the command you wish to run.

running rake commands




 





New Migrations

You can create new database migrations by clicking the New Migration button highlighted in the screenshot below, filling out the information you desire (depending on the type of migration you choose) for your new migration and then clicking Run Migration when you are finished.

Once you have completed your migration, you will want to run the db:migrate command. To do this, click on the Rake button and select the command from the drop-down menu.

new migrations




 





Up and Down Migration Status

When viewing the schema_migrations table, look to the Status column to see what method of migration it is. A status of up is for transformations to your schema, such as adding new tables and/or columns, and a status of down is for reverting previous transformations done with up-status migrations.

up and down status migration table

Did we miss anything?

Let us know in the comments