Skip to content

Commit

Permalink
Merge pull request #425 from liquibase/DAT-15648
Browse files Browse the repository at this point in the history
[DAT-15648] Disable Rows affected: 0 message as it is not applicable for NoSql
  • Loading branch information
vitaliimak authored Aug 25, 2023
2 parents a15e42a + f8151f4 commit 1efb832
Showing 1 changed file with 9 additions and 0 deletions.
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

0 comments on commit 1efb832

Please sign in to comment.