New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using a connection string fails knex-cli #1103

Closed
fl0w opened this Issue Dec 20, 2015 · 1 comment

Comments

Projects
None yet
2 participants
@fl0w

fl0w commented Dec 20, 2015

I might be completely off here; but I'm scratching my head concluding that there's something wrong in the library here.

Using following knexfile does not work for me, prompting Error: There is no pool defined on the current client when running any cli knex command, e.g. knex migrate:latest, or knex seed:run:

exports.development = {
  client: 'pg',
  debug: true,
  connection: process.env.DATABASE_URL,
  pool: {
    min: 0,
    max: 2
  }
}

However, the following works as expected:

exports.development = {
  client: 'pg',
  debug: true,
  connection: {
    host: process.env.DATABASE_HOST,
    user: process.env.DATABASE_USER,
    password: process.env.DATABASE_PASSWORD,
    database: process.env.DATABASE_DATABASE
  },
  pool: {
    min: 0,
    max: 2
  }
}

I haven't had time to investigate this yet.
Tried with knex@0.9.0, and the patched version at git+https://github.com/myndzi/knex#double-release by myndzi.

Maybe I'm doing something stupid that I'm not realising but to me, the docs clearly indicates support for connection urls having following example in the docs:

var pg = require('knex')({
  client: 'pg',
  connection: process.env.PG_CONNECTION_STRING,
  searchPath: 'knex,public'
});
@fl0w

This comment has been minimized.

fl0w commented Dec 20, 2015

addendum; This might be tied into #1101?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment