Skip to content
This repository has been archived by the owner on Jan 29, 2022. It is now read-only.

Commit

Permalink
Use SSL for connecting to Postgres
Browse files Browse the repository at this point in the history
This is needed by Heroku
(https://devcenter.heroku.com/articles/heroku-postgresql#heroku-postgres-ssl),
but KnexJS doesn't have support for it. We needed to do a small hack to make it
work while knex/knex#852 isn't fixed.
  • Loading branch information
vitorbaptista committed Oct 25, 2016
1 parent e283912 commit 26bc61d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions knexfile.js
Expand Up @@ -2,6 +2,11 @@

require('dotenv').config();

// FIXME: Needed because Heroku requires SSL-only connections and Knex doesn't
// allow setting it (see https://github.com/tgriesser/knex/issues/852)
const pg = require('pg');
pg.defaults.ssl = true;

const db = {
production: {
client: 'pg',
Expand Down

0 comments on commit 26bc61d

Please sign in to comment.