Skip to content

Invoke-DbaDbDataMasking - Fix StaticValue empty string fallback and FilterQuery in Actions#10281

Open
andreasjordan wants to merge 1 commit intodevelopmentfrom
claude/issue-7942-20260321-1613
Open

Invoke-DbaDbDataMasking - Fix StaticValue empty string fallback and FilterQuery in Actions#10281
andreasjordan wants to merge 1 commit intodevelopmentfrom
claude/issue-7942-20260321-1613

Conversation

@andreasjordan
Copy link
Collaborator

Fix two bugs in Invoke-DbaDbDataMasking:

  • StaticValue = "" falls back to random values: Empty string is falsy in PowerShell, so truthiness checks failed to detect an intentionally empty static value. Replaced with explicit $null -ne checks.
  • FilterQuery not respected for Action-based updates: Action processing generated UPDATE statements without any WHERE clause, updating all rows regardless of FilterQuery. Fixed by extracting the WHERE clause from FilterQuery and appending it to each Action UPDATE query.

Closes #7942

Generated with Claude Code

…ilterQuery in Actions

- Fix StaticValue = "" falling back to random value generation by using
  explicit null checks ($null -ne) instead of PowerShell truthiness checks
- Fix FilterQuery not being respected when Action-based column updates are
  applied by extracting the WHERE clause and appending it to UPDATE queries

(do *Masking*)

Co-authored-by: Andreas Jordan <andreasjordan@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

Invoke-DbaDbDataMasking - setting a static value and point out a an prepopulated randomized file.

1 participant