How to authenticate connection with Knex?

1.5k Views Asked by At

So I have something like this setup in my node.js app. I am trying to connect my app to a postgreSQL DB hosted at ElephantSQL (not sure if even this is right):

var knex = require('knex')({
    client: 'pg',
    connection: "postgres://longURLtoElephantSQL.com"
});

What I would like is a way to authenticate the connect. Example: when a connection is established, maybe a console.log message saying 'connection to pg db established".

Sequelize.js has an .authenticate() function to do such a thing. Any way to do this with Knex?

0

There are 0 best solutions below