How to Integrate Spinify with PostgreSQL
After creating your Spinify Account, you can connect directly to your PostgreSQL database with Spinify and sync changes to tables in PostgreSQL to your leaderboards in Spinify.
Steps to Integrate a PostgreSQL Database
1. Go to the integrations page
- Log into your MySpinify account
- From the top-right menu click "Settings"
- You should automatically land on the Integrations section, but double-check by ensuring the "Integrations" tab is highlighted.
2. Connect PostgreSQL with Spinify
- Choose "Connect" on the PostgreSQL Integration
- Fill in the details on the form
- Name - Description of the query to be used when connecting to leaderboards
-
- Username
- Password
- Host - Database Host (Note: this must be a publicly-accessible URL)
- Port - Optional port to connect to
- Database - Database name to connect
- Query - Select query or stored procedure to run
- Important: The query must return two columns named Email and Score
- Email corresponds to your participants' email addresses and is used to identify which player the score returned by the query belongs to
- Score corresponds to the participants' score that you'd like to appear on the leaderboard
- The column names must match exactly, or the data will not sync to your leaderboards.
- Click 'Activate' to save the connection.
- Spinify will then automatically query this table every 15 minutes and update the scores of any leaderboards running on this integration based on the query response.
Next steps
See How to Create a Competition on SQL data to learn how to use data returned by your PostgreSQL integration on a leaderboard.