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.

Programmable API createDatabase arguments are overridden

See original GitHub issue

I’m submitting a…

  • Bug report
  • Feature request
  • Question

Current behavior

Command line parameters override createDatabase parameters in Programable API.

$ DATABASE_URL=postgres://localhost/postgres node index.js
[INFO] Created database "expected"
$ DATABASE_URL=postgres://localhost/postgres node index.js unexpected
[INFO] Created database "unexpected"

Expected behavior

I would expect parameters provided to createDatabase always override possible command line arguments.

$ DATABASE_URL=postgres://localhost/postgres node index.js
[INFO] Created database "expected"
$ DATABASE_URL=postgres://localhost/postgres node index.js unexpected
[INFO] Created database "expected"

Minimal reproduction of the problem with instructions

$ cat index.js
var dbmigrate = require('db-migrate');
var dbm = dbmigrate.getInstance(true);
dbm.createDatabase('expected')
.then(function() {
  process.exit(0);
});

What is the motivation / use case for changing the behavior?

Using createDatabase through Programable API in an program that has command line args is not possible at the moment.

Environment

db-migrate version: 0.11.1
db-migrate-pg version: 0.4.0

Additional information:
- Node version: v10.6.0
- Platform:  Mac
<bountysource-plugin>

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource. </bountysource-plugin>

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
trubachevcommented, Jul 12, 2019
1reaction
wzrdtalescommented, Oct 18, 2018

I will check this, probably conflicting with the general config hirarchy.

Read more comments on GitHub >

github_iconTop Results From Across the Web

sqlite3 — DB-API 2.0 interface for SQLite databases — Python ...
The sqlite3 module supports qmark , numeric , and named DB-API parameter styles, because that is what the underlying SQLite library supports.
Read more >
Database Engine events and errors - SQL Server
4165, 16, No, The score override argument, if present in one of the subqueries, must be present in all subqueries and must be...
Read more >
SQLiteOpenHelper | Android Developers
Sets configuration parameters that are used for opening SQLiteDatabase . ... If not overridden, default implementation will reject downgrade and throws ...
Read more >
Glue — Boto3 Docs 1.26.38 documentation - Amazon AWS
Although this parameter is not required by the SDK, you must specify this parameter for a valid ... This overrides the timeout value...
Read more >
4. HiveQL: Data Definition - Programming Hive [Book] - O'Reilly
You can override this default location for the new directory as shown in this example: hive > CREATE DATABASE financials > LOCATION ...
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