GithubHelp home page GithubHelp logo

sql-setup's Introduction

PostgreSQL Setup

Heroku

Heroku is a service that offers simple web application hosting with many extra features. We'll use their hosted Postgres service to quickly create a database instance.

https://www.heroku.com

Sign up

On the Heroku website, click the Sign up for free button. After submitting your details you'll be sent a confirmation email. Follow the link found in this email and set your password.

Heroku Home Page Sign Up
Heroku Homepage Heroku Signup

Create an App

On your first visit to the dashboard, click the Create New App button. From there, specify a name (or leave blank and Heroku will generate a name). Click Create App

Create New App Add a Name
Heroku Create App Heroku Add Name

Provision the Heroku Postgres add-on

At this point, you're in the dashboard for the project you just created. Depending on the size of your browser window, you will see either a "Resources" tab or a set of seven icons near the top of the window. Select the resources tab if you see text options. If you see icons, select the icon with three horizontal lines.

Select the "Resources" Tab Or the Resources Icon
Heroku Resources Tab Heroku Resources Icon

On the next screen, type "postgres" in the "Add-ons" search field and select "Heroku Postgres" from the list. Provision the Hobby Dev free tier database.

Select Heroku Postgres Click Provision
Heroku Search For Addon Heroku Povision Database

View database credentials

Select the Heroku Postgres :: Database add-on from the list. On the database page, click the View Credentials button. You will be presented with the credentials necessary to connect to the Postgres instance.

Heroku Postgres :: Database View Credentials Credentials for Connecting
Heroku Go To Postgres Heroku Postgres Dashboard Heroku Postgres Credentials

Way to go! You have your very own Postgres database. Now, you need a client to connect and run queries against it.

SQL Tabs

SQL Tabs is a cross-platform database client that will allow you to execute SQL commands to your hosted Postgres database.

Install

Download the version for your OS from http://www.sqltabs.com and install accordingly

  • Mac: unzip the download and put it in your Applications. Double click. If you get a security warning, open System Preferences > Security and click Open Anyway
  • Windows: unzip the download and place the folder somewhere easy to access, like your desktop. Run sqltabs.exe.
  • Linux: gunzip the tarball and execute ./sqltabs
SQL Tabs Download Mac Warning Mac Preferences
SQL Tabs Download SQL Tabs Download SQL Tabs Security

Connect to Postgres

Copy the URI from your Heroku Postgres credentials. Paste it into the connection string input at the top of SQL Tabs and THIS IS IMPORTANT: append ?ssl=true to the end.

SQL Tabs URI

Test

Run a select 'Hello World'; query against the database to ensure you're connected. Execute the query using โŒ˜-R or Ctrl-R. If the database responds with a column that contains 'hello world', you're good to go.

SQL Tabs Hello World

Finished

Congratulations! You've successfully set up a hosted Postgres database on Heroku. You can now connect to this database using SQL Tabs and write database queries to create and update content on your hosted database. Have fun!

sql-setup's People

Contributors

barrycann avatar statianzo avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.