Skip to content

Return all PowerShell query rows by default - #227

Merged
PrzemyslawKlys merged 2 commits into
masterfrom
fix/powershell-query-all-rows
Aug 14, 2026
Merged

Return all PowerShell query rows by default#227
PrzemyslawKlys merged 2 commits into
masterfrom
fix/powershell-query-all-rows

Conversation

@PrzemyslawKlys

@PrzemyslawKlys PrzemyslawKlys commented Aug 14, 2026

Copy link
Copy Markdown
Member

Summary

  • make the SQL Server, PostgreSQL, Oracle, MySQL, SQLite, streaming, and stored-procedure PowerShell query commands default to PSObject
  • return one normal PowerShell object per row for ordinary query invocations
  • keep explicit -ReturnType DataRow, DataTable, and reader modes available
  • canonicalize PowerShell-reserved PS* column aliases as Column_<name> and add numeric suffixes when needed, so unusual schemas do not drop query results
  • refresh generated command documentation and MAML help to describe the default

Compatibility

This intentionally changes the default output shape from DataRow to PSObject. Scripts that require the legacy object type can continue to use -ReturnType DataRow (or -As DataRow) explicitly.

Ordinary SQL aliases are preserved. Because PowerShell reserves the PS* member namespace, a source alias such as PSObject is exposed as Column_PSObject; if that name already exists, DbaClientX selects the next numeric suffix without hiding either value.

Validation

  • full .NET 8 suite: 1,225 passed
  • focused converter contracts: 5/5 on .NET 8 and 5/5 on .NET 10
  • full PowerShell 7 suite: 228 passed
  • full Windows PowerShell 5.1 suite: 219 passed, 9 expected platform skips
  • packaged SQLite query returned both rows as PSCustomObject values in PowerShell 7 and Windows PowerShell 5.1
  • generated Markdown and MAML help are synchronized with the public default

@codecov

codecov Bot commented Aug 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.93939% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 53.27%. Comparing base (796b3f8) to head (273c65d).

Files with missing lines Patch % Lines
DbaClientX.PowerShell/PSObjectConverter.cs 92.30% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #227      +/-   ##
==========================================
+ Coverage   53.08%   53.27%   +0.18%     
==========================================
  Files         261      261              
  Lines       19727    19740      +13     
  Branches     3414     3415       +1     
==========================================
+ Hits        10472    10516      +44     
+ Misses       8239     8209      -30     
+ Partials     1016     1015       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b42a310b74

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread DbaClientX.PowerShell/CmdletIInvokeDbaXQuery.cs
@PrzemyslawKlys
PrzemyslawKlys merged commit 1358f5c into master Aug 14, 2026
17 checks passed
@PrzemyslawKlys
PrzemyslawKlys deleted the fix/powershell-query-all-rows branch August 14, 2026 11:53
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.

1 participant