All Articles

Setup a Free PostgreSQL Database

This article is the first part of the Free Full-Stack development in your Browser trilogy, learn how to build a modern PWA using your browser and some unbelievable free tools!

PostgreSQL is a great tool, it offers:

  • relational database paradigm (SQL)
  • document database paradigm
  • stored procedures
  • table inheritance and data partitioning
  • lot of extensions
  • event emitter!!!

In the Free Full-Stack development in your Browser tutorial you are going to use just one simple “todos” table and all the SQL work is going to be handled by a data modeling library called Sequelize.

In this part of the tutorial you will create an account in ElephantSQL and set up a new database.

Go to the ElephantSQL Website

Open your browser and go to www.elephantsql.com. Once there you can follow the steps in this video to login with Google or GitHub and create your first free Postgres database:

Later in the tutorial you will need the Postgres Connection String for your app to establish a successful connection with the database.

ElephantSQL provides this information for you as a URL:

ElephantSQL - Connection String

Play with your Database

Before you dig into back-end code I’d like you to play around with your database and spend some time to get familiar with simple opertions such creating tables, inserting, changind and deleting data.

This is often refferred to as CRUD Operations and it is exactly what you will do in your backend. If you have a direct experience with it is going to be easier.

Use Postico on MacOS

I’m a MacOS user and the client I suggest you to use is Postico which works fine and it is free of charge for most of its functionalities.

In the next screenshot you can see my connection setup screen:

Postico - Connection Setup

And once you establish a succesfull connection, you can use the app to perform all the operations that you may think about.

Postico - Dashboard

Or use the SQL Browser in ElephantDB

In case you can’t use a Postgres client app, you can navigate to the BROWSER menu and use the console to run SQL queries against your database.

ElephantSQL - The Broswer

If you are going the “browser” way you need to write plain SQL queries, here is a nice introduction to the subject that will get you up to speed with CRUD operations in SQL for Postgres.

The Next Step

👉 Move to the backend!