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

[DAT-15648] Disable Rows affected: 0 message as it is not applicable for NoSql #425

Merged
merged 1 commit into from
Aug 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/main/java/liquibase/nosql/executor/NoSqlExecutor.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@

import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;

import static java.util.Collections.emptyList;
import static java.util.Optional.ofNullable;
Expand Down Expand Up @@ -180,6 +181,7 @@ public void execute(final UpdateStatement updateStatement) throws DatabaseExcept

@Override
public void execute(final SqlStatement sql) throws DatabaseException {
disableRowAffectedMessage();
this.execute(sql, emptyList());
}

Expand Down Expand Up @@ -230,6 +232,13 @@ public int update(final SqlStatement sql, final List<SqlVisitor> sqlVisitors) th
}
}

private void disableRowAffectedMessage() {
AtomicInteger rowsAffected = Scope.getCurrentScope().get("rowsAffected", AtomicInteger.class);
if (rowsAffected != null) {
rowsAffected.set(-1);
}
}

@Override
public void comment(final String message) {
log.info(message);
Expand Down