Problems connecting to database in Node.js

I am trying to connect my database in Node js but I am getting this error


[NODE-LIQUIBASE] Running C:\Users\fabio\OneDrive\Ambiente de Trabalho\LiquibaseNode\node_modules\liquibase\dist\liquibase\liquibase --changeLogFile="db/changelog.xml" --url="jdbc:mysql://localhost:3306/saft-demo-dump?allowMultiQueries=TRUE" --username="root" --password="Benfica1904!" --classpath="C:\Users\fabio\OneDrive\Ambiente de Trabalho\LiquibaseNode\node_modules\liquibase\dist\drivers\postgresql-42.2.8.jar" status  ...
[NODE-LIQUIBASE]

[NODE-LIQUIBASE]
 'C:\Users\fabio\OneDrive\Ambiente' is not recognized as an internal or external command,
operable program or batch file.

(node:11972) UnhandledPromiseRejectionWarning: Error: Command failed: C:\Users\fabio\OneDrive\Ambiente de Trabalho\LiquibaseNode\node_modules\liquibase\dist\liquibase\liquibase --changeLogFile="db/changelog.xml" --url="jdbc:mysql://localhost:3306/saft-demo-dump?allowMultiQueries=TRUE" --username="root" --password="Benfica1904!" --classpath="C:\Users\fabio\OneDrive\Ambiente de Trabalho\LiquibaseNode\node_modules\liquibase\dist\drivers\postgresql-42.2.8.jar" status
'C:\Users\fabio\OneDrive\Ambiente' is not recognized as an internal or external command,
operable program or batch file.

    at ChildProcess.exithandler (child_process.js:308:12)
    at ChildProcess.emit (events.js:315:20)
    at maybeClose (internal/child_process.js:1048:16)
    at Socket.<anonymous> (internal/child_process.js:439:11)
    at Socket.emit (events.js:315:20)
    at Pipe.<anonymous> (net.js:673:12)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:11972) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:11972) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

This is how I am doing the connection

<databaseChangeLog
        xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
      http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd">

    <includeAll path="/db/migrations/"/>

</databaseChangeLog>

I also don’t want the driver to Postgre but the one for MySQL

It looks like your error is related to the folder name that contains spaces “Ambiente de Trabalho”. Can you remove the spaces and try again?

Changed and it worked. Is there anyway I can put the database info in a file?

Great!
Yes, you can put those details into the liquibase.properties files. See here for details:
https://docs.liquibase.com/workflows/liquibase-community/creating-config-properties.html?Highlight=properties

Can I also use a customChange like in Java?
For example in this migration file how would I refer the AddMultiple class?

<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd">
    <changeSet author="fabio" id="791a1ee0-fba2-4904-b859-8274c78e76da">
        <customChange class="com.petapilot.migrations.customChanges.MultipleAdd"
                      suffix="transactions"
                      columnName="NEW_COLUMN_SUFFIX" columnType="varchar(250)" notNull="true" defaultValue="10"/>
    </changeSet>
</databaseChangeLog>

I have faced the similar issue after a ton of analysis. I came to a conclusion that culprit of this bug is a white space character. Let me explain

Url Path of your project i.e
"C:\Users\fabio\OneDrive\Ambiente de Trabalho\LiquibaseNode"

Should not contain any file or folder with space character in it.
In this case there is project name" Ambiente de Trabalho" and it contains two space characters in it.

Just remove those and it will work fine.