Skip to content

Port number isnt passed through #10

Description

Hi guys

Noticed that the port number isnt passed through to Knex in your connection.js

e.g. if I change code to add port I can now connect to my non-standard mysql (1441) otherwise I get ECONNREFUSED as it uses default port (3306)

      if (protocol === 'sqlite3') {
        connection_info = {
          filename: database_url.host || ':memory:'
        };
      } else {
        connection_info = _.extend({
          host: database_url.hostname,

This is the line I added

          port: database_url.port,
          database: database_url.database,
          charset: 'utf8'
        }, database_url.parseAuth() || {});
      }

Could be dangerous for those hoping to reach a dev DB with a dev connection string!

Let me know if you want a pull request as would be nice to contribute something small to this great project, but looks like something simple for you guys, and Im not sure how to test

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions