Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'await' has no effect on the type of this expression.ts(80007) #38

Open
rastitalabani opened this issue Jun 25, 2021 · 3 comments
Open
Assignees

Comments

@rastitalabani
Copy link

Context

Hello,
I'm using nodejs and typescript, await doesn't to have effect on neither of
await liquibase.update({});
await liquibase.status();

Node-Liquibase Version

4.1.1

Liquibase Version (if not bundled)

Description

[Description of the bug or feature]

Steps to Reproduce

use your example code with nodejs and typscript you should see a warning in vscode on the following line

await instance.status();

Expected behavior: [What you expected to happen]

without await I wont be able to control the sequence of commands execution

Actual behavior: [What actually happened]

@tabuckner tabuckner self-assigned this Nov 9, 2021
@tabuckner
Copy link

Hey @rastitalabani, I see your expected behavior in the issue that you've opened, but I don't see what actually happens. Can you let us know what the current behavior is when using await with .update() and .status(), and what you'd expect to see happe?

Thanks! 🚀

@mikonsaari-yepzon
Copy link

mikonsaari-yepzon commented Apr 6, 2022

Hi,

I believe I have the same issue and can provide some context.

First of all, the example in the readme contains await update, giving the impression that it is supported/required.

As for the behaviour, I want to stop the script executing until Liquibase has completed, and this is done in Typescript with async/await. We run liquibase on server start and dont serve requests until it has completed to avoid running queries that require an updated schema.

UPDATE:
It seems since the update call returns the Liquibase instance, instead of the child-process Promise, await can not be used.
As a workaround, I just call whatever update does manually, and it seems to work:

await (instance as any).run(LiquibaseCommands.Update, {});

@Mr-Duda
Copy link

Mr-Duda commented Apr 9, 2024

Is the fix for this in 7b7f72b?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants