liquibase / node-liquibase

Node.js wrap for Liquibase
MIT License
32 stars 14 forks source link

Tag function adds additional command parameter including command/parameter value #22

Closed RajarsiGit closed 3 years ago

tabuckner commented 3 years ago

hey @RajarsiGit Could you provide an example of how you're using node-liquibase and the version you're using?

RajarsiGit commented 3 years ago

hey @RajarsiGit Could you provide an example of how you're using node-liquibase and the version you're using?

Hi, @tabuckner, thanks for the quick reply, here's all you've asked for:

node-liquibase version: 4.3.7

Example code: import { LiquibaseConfig, Liquibase, } from 'liquibase';

const myConfig: LiquibaseConfig = { url: 'jdbc:mysql://localhost:3306/node_liquibase_testing', username: 'root', password: 'toor', classpath: 'node_modules/liquibase/dist/drivers/mysql-connector-java-8.0.24.jar', changeLogFile: 'changelog.sql' }; const instance = new Liquibase(myConfig);

async function doEet() { await instance.status(); await instance.tag({ tag: 'v1.0' }); // await instance.dropAll(); }

doEet() .then((data) => { console.log(data); }) .catch((err) => { console.log(err); });

The above code will help you reproduce the problem.

Error generated: Errors: unexpected command parameters: [--tag=v1.0]

tabuckner commented 3 years ago

Seems to be a similar issue to: https://github.com/liquibase/node-liquibase/issues/21

RajarsiGit commented 3 years ago

Seems to be a similar issue to: #21

@tabuckner seems like so. It is adding a parameter with the command

tabuckner commented 3 years ago

@RajarsiGit I'll take a deeper look at this soon. It looks like we made an assumption that was wrong, or mingled a top-level command param interface in a command/sub-command implementation

tabuckner commented 3 years ago

hey @RajarsiGit just talked to @nvoxland and it looks like v4.4 of liquibase will help resolve the issue we're seeing here in node-liquibase. You can join that discussion here.

The basic gist is:

In 4.4 we're going to support the flag (i.e. --) syntax for all commands. Currently, some commands (e.g. tag) accept positional arguments.

So as of 4.3 liquibase expects something like:

liquibase tag my-awesome-tag

But node-liquibase actually outputs something like:

bash tag --tag="my-awesome-tag"

Here's a potentially non-comprehensive list of other commands that also accept/expect positional arguments:

I'll work on a fix to help all node-liquibase users using a version of liquibase at or under v4.3. No need for us to wait for that release, as others might be bound to a version <4.4.

🎉 Thank you for reporting this!!! 🎉

🚀

RajarsiGit commented 3 years ago

@tabuckner Hi, so any deadline you guys have for the upcoming v4.4 release?

RajarsiGit commented 3 years ago

Hi @tabuckner, the problem still remains I think, has there been an update in the package version?

tabuckner commented 3 years ago

@RajarsiGit had some issues with git but have resolved that and the new latest tag should have the fix in it:

https://www.npmjs.com/package/liquibase/v/4.3.9

RajarsiGit commented 3 years ago

Thanks a lot @tabuckner

@RajarsiGit had some issues with git but have resolved that and the new latest tag should have the fix in it:

https://www.npmjs.com/package/liquibase/v/4.3.9

Thanks a lot @tabuckner, it is working now. Been a great help!

tabuckner commented 3 years ago

@RajarsiGit AWESOME! 🚀

Love to hear it! 😄

Thanks for using it :)