question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Heroku DATABASE_URL

See original GitHub issue

We cannot use pg native functionality. We’ve tried changing this in the module but aren’t having any luck. We’re able to get the DATABASE_URL read and show this through console.log in pg db-migrate module, but SSL is always undefined and off. None of the other answers here are of use, all look to lead to commits that are changed or code that has been modified and as such are deprecated 😦 Please help!

database.json: have tried many iterations of this

{ "default": "pg", "pg": { "ENV": "DATABASE_URL", "addIfNotExists": { "ssl": true }, "overwrite": { "native": true } } }

error: [ERROR] error: no pg_hba.conf entry for host "204.14.239.17", user "user", database "database", SSL off at Connection.parseE (/Users/mmowris/Workspace/csa-portal/node_modules/db-migrate-pg/node_modules/pg/lib/connection.js:539:11) at Connection.parseMessage (/Users/mmowris/Workspace/csa-portal/node_modules/db-migrate-pg/node_modules/pg/lib/connection.js:366:17) at Socket.<anonymous> (/Users/mmowris/Workspace/csa-portal/node_modules/db-migrate-pg/node_modules/pg/lib/connection.js:105:22) at emitOne (events.js:115:13) at Socket.emit (events.js:210:7) at addChunk (_stream_readable.js:252:12) at readableAddChunk (_stream_readable.js:239:11) at Socket.Readable.push (_stream_readable.js:197:10) at TCP.onread (net.js:589:20) mmowris-ltm2:csa-portal mmowris$ sub

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
wzrdtalescommented, Aug 13, 2017

Ok, you’re lucky wasn’t that a big deal.

Release under

  • db-migrate@0.10.0-beta.22
0reactions
kasongoyocommented, Jun 25, 2021

Inorder to overwrite or modify DATABASE_URL then you need to write it like this

{
    "default": "pg",
    "pg": {
        "url":{"ENV": "DATABASE_URL"},
        "addIfNotExists": {
            "ssl": true
        },
        "overwrite": {
            "native": true
        }
    }
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Heroku Postgres
The DATABASE_URL config var designates the URL of an app's primary Heroku Postgres database. For apps with a single database, its URL is...
Read more >
heroku DATABASE_URL - Stack Overflow
In the heroku toolbelt v2.28.15 I don't have it, but simply running 'heroku config' shows the entire value for all of my config...
Read more >
Connect to PostgreSQL on Heroku Using ODBC and JDBC ...
You can get your Database URL using either Heroku CLI or from your Heroku dashboard. Using Heroku CLI. If you have Heroku CLI...
Read more >
heroku-database-url-to-jdbc/core.clj at master - GitHub
Converts Heroku-style DATABASE_URLs to JDBC-friendly maps or strings - heroku-database-url-to-jdbc/core.clj at master ...
Read more >
Cloud: Heroku database integration | Hasura GraphQL Docs
Automatically sync database URL of a Heroku Postgres into a Hasura Cloud project.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found