This add-on is operated by Sidebored.io,Inc.
Simplifying Heroku's PostgreSQL Integration
Schema To Go
Last updated August 14, 2024
Table of Contents
Schema To Go is a robust PostgreSQL database service tailored for Heroku applications. It offers reliable, secure, and scalable database solutions to enhance the data handling capabilities of your applications.
Features
- High Performance: Powered by PostgreSQL, Schema To Go ensures efficient data management.
- Easy Integration: Easily integrates with Heroku apps.
- Automated Backups: Regular backups for data safety.
- Data Security: High priority on data encryption and security.
- Monitoring and Analytics: Detailed insights into database performance and usage.
Provisioning the Add-On
Add Schema To Go to your application via the CLI:
Reference the Schema To Go Elements Page for a list of available plans and regions.
heroku addons:create schematogo --app example-app
Local Setup
Environment Setup
After provisioning the add-on, replicate its config vars locally for development environments that need the service.
Use the local
Heroku CLI command to configure, run, and manage process types specified in your app’s Procfile. Heroku Local reads configuration variables from a .env
file. Use heroku config
to view an app’s configuration variables in a terminal. Use the following command to add a configuration variable to a local .env
file:
$ heroku config:get SCHEMATOGO_URL -s >> .env
Don’t commit credentials and other sensitive configuration variables to source control. In Git exclude the .env
file with: echo .env >> .gitignore
.
For more information, see the Heroku Local article.
Configuring Your Application
After provisioning, Schema To Go sets the SCHEMATOGO_URL
environment variable. Configure your application to use this variable:
Using PostgreSQL from Ruby
To configure your application with Ruby:
require 'pg'
if ENV['SCHEMATOGO_URL']
conn = PG.connect(ENV['SCHEMATOGO_URL'])
# Your code here
end
Using PostgreSQL from Java
To configure your application with Java:
import java.sql.Connection;
import java.sql.DriverManager;
public class PostgresExample {
public static void main(String[] args) {
String dbUrl = System.getenv("SCHEMATOGO_URL");
try {
Connection connection = DriverManager.getConnection(dbUrl);
// Your code here
} catch (Exception e) {
e.printStackTrace();
}
}
}
Using PostgreSQL from Python
To configure your application with Python:
import os
import psycopg2
database_url = os.getenv('SCHEMATOGO_URL')
conn = psycopg2.connect(database_url)
# Your code here
Using PostgreSQL from Node.js
To configure your application with Node.js:
const { Pool } = require('pg');
const pool = new Pool({
connectionString: process.env.SCHEMATOGO_URL
});
// Your code here
Using PostgreSQL from PHP
To configure your application with PHP:
<?php
$dbUrl = getenv('SCHEMATOGO_URL');
if ($dbUrl) {
$pdo = new PDO($dbUrl);
// Your code here
}
?>
Using PostgreSQL from Go
To configure your application with Go:
package main
import (
"database/sql"
"os"
_ "github.com/lib/pq"
)
func main() {
databaseURL := os.Getenv("SCHEMATOGO_URL")
db, err := sql.Open("postgres", databaseURL)
if err != nil {
panic(err)
}
defer db.Close()
// Your code here
}
These snippets provide basic guidance for integrating Schema To Go with various applications. Include additional details specific to your add-on’s capabilities and configurations.
Migrating Between Plans
Application owners must carefully manage the migration timing to ensure proper application function during the migration process.
To migrate to a new plan, use the heroku addons:upgrade
command:
heroku addons:upgrade schematogo:new-plan
Removing the Add-On
Before removing Schema To Go from your application, ensure to download a recent copy of your database to prevent any data loss. You can download the latest backup directly from the Backups
section of the Schema To Go dashboard.
To download your data:
- Navigate to the Schema To Go dashboard.
- Scroll to the
Backups
section. - Click the most recent backup in the list.
- Follow the prompts to download the backup file to your local machine.
If you encounter any issues or need assistance, contact our support team at support@schematogo.com.
After securing your data, you can remove Schema To Go from your application with the following command:
This action destroys all associated data and you can’t undo it!
heroku addons:destroy schematogo
Support
For any questions or issues, contact our support team at support@schematogo.com.