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.

Database is undefined when using the postgresql driver

See original GitHub issue

When using a postgresql database like this

// config/database.js
development: {
  driver: 'pg',
  username: 'postgres',
  host: '***',
  port: 5432,
  database: 'lux_database',
  password: '****'
},

But the database field is undefined here (src/packages/database/utils/connect.js#L22):

// node_modules/lux-framework/src/packages/database/utils/connect.js
const {
  host,
  socket,
  driver,
  database, // <--- undefined
  username,
  password
} = config;

Knex does then fallback to the current user of the OS which will likely be an incorrect database name.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:14 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
zacharygolbacommented, Aug 12, 2016

Just a heads up @harianus. Since @adampash I were unable to reproduce this, I’m going to close this issue for now. We can help debug and work through this in the Gitter room to find out the database is undefined for you. After debugging we can reopen this issue, or create a new one if necessary.

Thank you! 😃

0reactions
seawattscommented, Dec 30, 2016

Verified that it is fixed in the perf branch

Read more comments on GitHub >

github_iconTop Results From Across the Web

Access postgres in matlab without database toolbox
driver = org.postgresql.Driver;. I'm getting the following error. Undefined variable "org" or function "org.postgresql.
Read more >
Installation error when choose pgsql database driver
When execute the script admin/cli/install.php, and the installation ask: == Choose database driver == type value : I type pgsql and I get...
Read more >
"undefined function pg_pconnect()" when connecting to ...
I just installed Postgresql and pgadmin in my Ubuntu system. I can create a database from the pgadmin interface and everything seems ok, ......
Read more >
Database Connection Error Messages - MATLAB & Simulink
Vendor Error Message Probable Causes Microsoft SQL Server Invalid string or buffer length. 64‑bit ODBC driver error. MySQL Unknown database 'databasename'. Provided database name is...
Read more >
Drupal 8 BC for database driver namespace fails for replicas
... 9.4 to deal with old style database settings fails on database replicas. It triggers a warning: Warning: Undefined array key "driver" in ......
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