Skip to content

Sql Connection Optimization#2433

Merged
johlju merged 18 commits intodsccommunity:mainfrom
dan-hughes:sql-connection-optimization
Jan 26, 2026
Merged

Sql Connection Optimization#2433
johlju merged 18 commits intodsccommunity:mainfrom
dan-hughes:sql-connection-optimization

Conversation

@dan-hughes
Copy link
Copy Markdown
Contributor

@dan-hughes dan-hughes commented Jan 23, 2026

Pull Request (PR) description

Create Server and ServerConnection objects as per documentation.
Prevent Invoke-SqlDscQuery from closing the connection which is not recommended.

This Pull Request (PR) fixes the following issues

Task list

  • Added an entry to the change log under the Unreleased section of the
    file CHANGELOG.md. Entry should say what was changed and how that
    affects users (if applicable), and reference the issue being resolved
    (if applicable).
  • Resource documentation updated in the resource's README.md.
  • Resource parameter descriptions updated in schema.mof.
  • Comment-based help updated, including parameter descriptions.
  • Localization strings updated.
  • Examples updated.
  • Unit tests updated. See DSC Community Testing Guidelines.
  • Integration tests updated (where possible). See DSC Community Testing Guidelines.
  • Code changes adheres to DSC Community Style Guidelines.

This change is Reviewable

@dan-hughes dan-hughes requested review from a team and johlju as code owners January 23, 2026 13:59
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jan 23, 2026

Walkthrough

Connect-Sql now constructs a Microsoft.SqlServer.Management.Common.ServerConnection (ApplicationName='SqlServerDsc'), instantiates an SMO.Server with it, and routes Connect/Disconnect via SMO.Server.ConnectionContext. Invoke-SqlDscQuery no longer disconnects server objects. SMO test stubs and unit tests updated to use the Common ServerConnection type; CHANGELOG and CI guidance adjusted.

Changes

Cohort / File(s) Summary
Changelog
CHANGELOG.md
Added unreleased bullets: Connect-Sql creates connection and server objects; Invoke-SqlDscQuery no longer disconnects.
Connect-Sql implementation
source/Modules/SqlServerDsc.Common/Public/Connect-Sql.ps1
Added [OutputType([System.Object])]; create Microsoft.SqlServer.Management.Common.ServerConnection (ApplicationName='SqlServerDsc'), instantiate Microsoft.SqlServer.Management.Smo.Server with it, call Connect() via SMO.Server.ConnectionContext, and route Disconnect() through SMO.Server.ConnectionContext.
Invoke-SqlDscQuery cleanup
source/Public/Invoke-SqlDscQuery.ps1
Removed automatic Disconnect() in the end block for the ByServerName parameter set (end block now empty).
CI guidance
.github/instructions/SqlServerDsc-guidelines.instructions.md
Removed instruction to disconnect from the DB engine after integration test Connect-SqlDscDatabaseEngine.
SMO test stubs
tests/Unit/Stubs/SMO.cs
Added Microsoft.SqlServer.Management.Common.ServerConnection stub (constructors, properties, Connect/Disconnect/ExecuteScalar); updated Microsoft.SqlServer.Management.Smo.Server.ConnectionContext to use the Common.ServerConnection type; added Server(ServerConnection) constructor and Refresh() stub.
Unit tests
tests/Unit/Public/Invoke-SqlDscQuery.Tests.ps1, tests/Unit/Public/Invoke-SqlDscScalarQuery.Tests.ps1, tests/Unit/Public/Disconnect-SqlDscDatabaseEngine.Tests.ps1, tests/Unit/DSC_SqlAGDatabase.Tests.ps1, tests/Unit/SqlServerDsc.Common/Public/Test-ImpersonatePermissions.Tests.ps1, tests/Unit/Public/Connect-Sql.Tests.ps1
Updated mocks to instantiate Microsoft.SqlServer.Management.Common.ServerConnection instead of Microsoft.SqlServer.Management.Smo.ServerConnection; removed mocks/assertions expecting Disconnect-SqlDscDatabaseEngine in several scenarios; adapted Connect-Sql tests to supply ServerConnection via New-Object argument handling; minor formatting adjustments.

Sequence Diagram(s)

sequenceDiagram
  participant Cmdlet as rgba(52,118,172,0.5) Cmdlet (Connect-Sql)
  participant ServerConn as rgba(72,164,82,0.5) ServerConnection
  participant SMOServer as rgba(201,72,72,0.5) SMO.Server
  participant Engine as rgba(120,120,200,0.5) SQL Engine

  Cmdlet->>ServerConn: create ServerConnection (ApplicationName='SqlServerDsc')
  Cmdlet->>SMOServer: instantiate SMO.Server with ServerConnection
  SMOServer->>Engine: Connect() via SMO.Server.ConnectionContext
  Cmdlet->>SMOServer: perform operations via SMO.Server
  Note right of Cmdlet: Invoke-SqlDscQuery no longer auto-disconnects SMO.Server
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 9.09% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Sql Connection Optimization' is vague and generic, using non-descriptive terms that don't clearly convey the specific changes (Server/ServerConnection object refactoring and preventing disconnect in Invoke-SqlDscQuery). Consider a more specific title like 'Connect-Sql: Refactor to use ServerConnection objects as per documentation' or 'Prevent Invoke-SqlDscQuery from closing SQL connections'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly relates to the changeset, explaining the two main changes: creating Server and ServerConnection objects per documentation and preventing connection closure in Invoke-SqlDscQuery.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
source/Modules/SqlServerDsc.Common/Public/Connect-Sql.ps1 (1)

270-281: Guard against $sqlServerObject being $null or not connected before Disconnect.
An exception before $sqlServerObject is created (or before a connection opens) will cause the finally block to throw and mask the original error. Add a null/IsOpen check.

🛠️ Proposed fix
-        $sqlServerObject.ConnectionContext.Disconnect()
+        if ($null -ne $sqlServerObject -and $sqlServerObject.ConnectionContext.IsOpen)
+        {
+            $sqlServerObject.ConnectionContext.Disconnect()
+        }
🤖 Fix all issues with AI agents
In `@CHANGELOG.md`:
- Around line 16-17: Update the two CHANGELOG entries to include issue reference
links and use past-tense, grammatical wording: change the Connect-Sql line to
reference the issue (e.g., #<issue-number>) and rephrase to "Created connection
and server objects as per documentation (see #<issue-number>)", and change the
Invoke-SqlDscQuery line to reference its issue and rephrase to "Removed
disconnect because there was no explicit connect (see #<issue-number>)"; ensure
you replace <issue-number> with the actual issue IDs and keep the function names
Connect-Sql and Invoke-SqlDscQuery intact so reviewers can locate the changes.
🧹 Nitpick comments (1)
source/Public/Invoke-SqlDscQuery.ps1 (1)

274-275: Consider removing the empty end {} block for clarity.
It adds no behavior and can be removed to simplify the function structure.

♻️ Proposed cleanup
-    end
-    {}

Copy link
Copy Markdown
Member

@johlju johlju left a comment

Choose a reason for hiding this comment

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

@johlju reviewed 3 files and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @dan-hughes).


a discussion (no related file):
Could you also please remove this line:

- Use `Disconnect-SqlDscDatabaseEngine` after `Connect-SqlDscDatabaseEngine`

@johlju
Copy link
Copy Markdown
Member

johlju commented Jan 23, 2026

@dan-hughes seems we got HQRM errors.

Copy link
Copy Markdown
Member

@johlju johlju left a comment

Choose a reason for hiding this comment

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

:lgtm:

@johlju reviewed 3 files and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @dan-hughes).

@johlju
Copy link
Copy Markdown
Member

johlju commented Jan 23, 2026

@dan-hughes maybe the unit tests does not have the Add-Type that loads the SMO stub types, or that SMO stub type is missing?

Running tests from 'D:\a\1\s\tests\Unit\SqlServerDsc.Common\Public\Connect-Sql.Tests.ps1'
Describing SqlServerDsc.Common\Connect-SQL
 Context When connecting to the default instance using integrated Windows Authentication
##[error]    [-] Should return the correct service instance 67ms (63ms|4ms)
##[error]     RuntimeException: Unable to find type [Microsoft.SqlServer.Management.Common.ServerConnection].
##[error]     at Connect-Sql, D:\a\1\s\output\builtModule\SqlServerDsc\17.5.0\Modules\SqlServerDsc.Common\SqlServerDsc.Common.psm1:141

@dan-hughes
Copy link
Copy Markdown
Contributor Author

Wrong namespace. Updated but the tests need changing as they expect New-Object to be invoked.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@source/Modules/SqlServerDsc.Common/Public/Connect-Sql.ps1`:
- Around line 273-281: The finally block may call members on null objects and
mask the original exception; update the Connect-Sql.ps1 finally to null-check
$connectTimer and $sqlServerObject before invoking $connectTimer.Stop() and
$sqlServerObject.ConnectionContext.Disconnect() (e.g., only call Stop() if
$connectTimer -ne $null and only call ConnectionContext.Disconnect() if
$sqlServerObject -ne $null and $sqlServerObject.ConnectionContext -ne $null),
preserving existing behavior but avoiding secondary NREs from Connect()
failures.

Comment on lines 273 to +281
$connectTimer.Stop()
<#
Connect will ensure we actually can connect, but we need to disconnect
Connect() will ensure we actually can connect, but we need to disconnect
from the session so we don't have anything hanging. If we need run a
method on the returned $sqlServerObject it will automatically open a
new session and then close, therefore we don't need to keep this
session open.
#>
$sqlConnectionContext.Disconnect()
$sqlServerObject.ConnectionContext.Disconnect()
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Guard against null objects in finally
If Server construction or Connect() throws, Line 281 can throw on $null, masking the original failure. Add null guards (and for $connectTimer) before calling members.

🐛 Proposed fix
 finally
 {
-    $connectTimer.Stop()
+    if ($null -ne $connectTimer)
+    {
+        $connectTimer.Stop()
+    }
     <#
         Connect() will ensure we actually can connect, but we need to disconnect
         from the session so we don't have anything hanging. If we need run a
         method on the returned $sqlServerObject it will automatically open a
         new session and then close, therefore we don't need to keep this
         session open.
     #>
-    $sqlServerObject.ConnectionContext.Disconnect()
+    if ($null -ne $sqlServerObject -and $null -ne $sqlServerObject.ConnectionContext)
+    {
+        $sqlServerObject.ConnectionContext.Disconnect()
+    }
 }
🤖 Prompt for AI Agents
In `@source/Modules/SqlServerDsc.Common/Public/Connect-Sql.ps1` around lines 273 -
281, The finally block may call members on null objects and mask the original
exception; update the Connect-Sql.ps1 finally to null-check $connectTimer and
$sqlServerObject before invoking $connectTimer.Stop() and
$sqlServerObject.ConnectionContext.Disconnect() (e.g., only call Stop() if
$connectTimer -ne $null and only call ConnectionContext.Disconnect() if
$sqlServerObject -ne $null and $sqlServerObject.ConnectionContext -ne $null),
preserving existing behavior but avoiding secondary NREs from Connect()
failures.

@dan-hughes
Copy link
Copy Markdown
Contributor Author

dan-hughes commented Jan 23, 2026

Hmm, which one to use...
Microsoft.SqlServer.Management.Smo.ServerConnection or Microsoft.SqlServer.Management.Common.ServerConnection

UPDATE: It looks like Microsoft.SqlServer.Management.Common.ServerConnection should be used but is missing from the SMOStubs.

@dan-hughes dan-hughes force-pushed the sql-connection-optimization branch from 021b892 to 78dfa00 Compare January 23, 2026 17:57
@codecov
Copy link
Copy Markdown

codecov bot commented Jan 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94%. Comparing base (e971dc1) to head (07f78cd).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #2433   +/-   ##
=====================================
- Coverage     94%     94%   -1%     
=====================================
  Files        225     225           
  Lines      10761   10759    -2     
=====================================
- Hits       10141   10139    -2     
  Misses       620     620           
Flag Coverage Δ
unit 94% <ø> (-1%) ⬇️
Files with missing lines Coverage Δ
source/Public/Invoke-SqlDscQuery.ps1 97% <ø> (-1%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@johlju
Copy link
Copy Markdown
Member

johlju commented Jan 23, 2026

@johlju
Copy link
Copy Markdown
Member

johlju commented Jan 23, 2026

UPDATE: It looks like Microsoft.SqlServer.Management.Common.ServerConnection should be used but is missing from the SMOStubs.

It looks like it is there, but in the wrong namespace (and missing properties):

// TypeName: Microsoft.SqlServer.Management.Common.ServerConnection
// Used by:
// SqlAGDatabase
// Invoke-SqlDscScalarQuery
public class ServerConnection
{
public string TrueLogin;
public int StatementTimeout;
public void Create()
{}
// Method: ExecuteScalar
// Used for testing scalar query execution in Invoke-SqlDscScalarQuery
public object ExecuteScalar(string query)
{
return null;
}
}

There is no such class in the SMO namespace according to docs, so it should be moved.

@dan-hughes
Copy link
Copy Markdown
Contributor Author

This is going to be a change one thing, break 6 others.

I wonder if both namespaces were valid in a previous SMO version and the was a ServerConnection class for both SMO and RMO.

@johlju
Copy link
Copy Markdown
Member

johlju commented Jan 23, 2026

I don't think so, I think the SMO stubs was added in the wrong place and never used so it wasn't discovered. The old unit tests always (mostly) mocked New-Object. New tests are trying to use the stubs instead.

@dan-hughes
Copy link
Copy Markdown
Contributor Author

Is there a list of SMO versions the module supports?

I feel like the stubs need regenerating to see what else gets uncovered. Depending on how that goes will decide what to do next...

@johlju
Copy link
Copy Markdown
Member

johlju commented Jan 24, 2026

Suggest to just add the necessary stubs that you need for the unit tests to work. If there are backward compatibility issues we need to address them as bugs come in. That is what I do, build stubs from Microsoft docs.

But if you want to build stubs from upstream the safest bet is to build from https://github.com/microsoft/sqlmanagementobjects

Is there a list of SMO versions the module supports?

The problem is that it:

  • supports the SMO bundled with SQLPS which is bundle with SQL Server. SQLPS is different between SQL Server versions, but we should support from SQL Server 2019.
  • supports PowerShell module SqlServer which has different SMO bundled, and newer SqlServer module might not support older SQL Server versions.
  • support PowerShell module dbatools which also comes with different SMO depending on version.

The user can choose what SMO they should use depending on the workload for the node. SqlServerDsc will use SqlServer if it is available unless overridden with environment variable.

I would have like to built our own SMO from the SMO GitHub repo an used that, but there are a lot of if and buts with that (backward compatibility, missing assemblies for older SQL Server versions) plus if we load our assembly we block any other module the user wants to use that require a different SMO version. Dbatools has solved that by "hiding it" in it own "runspace" (don't remember what the technique is called) which we also need to do if we go that route. Dbatools has also gotten permission to use assemblies that are not part of SMO but bundled in SQLPS, but the dbatools permission is for "developer" work, and felt like the permission was not doable for production use: https://github.com/dataplat/dbatools.library/blob/aecbec9ece523f77b2f959e5225352d97f1194e6/var/third-party-licenses/sql-server-data-tools-license-terms.txt#L45C111-L45C127

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@tests/Unit/Stubs/SMO.cs`:
- Around line 2784-2815: ServerConnection.ConnectTimeout is typed as string but
should be int, and the Server class needs a constructor that accepts a
ServerConnection to match usage; change the ConnectTimeout field in the
ServerConnection class from string to int (symbol: ConnectTimeout in class
ServerConnection) and add a new constructor in the Server class with signature
Server(ServerConnection connection) (place it alongside the existing Server()
and Server(string name) constructors) that initializes the Server instance from
the provided ServerConnection object.

@dan-hughes
Copy link
Copy Markdown
Contributor Author

Hmm. I wonder if adding the output type to Connect-SQL caused this...

@johlju
Copy link
Copy Markdown
Member

johlju commented Jan 24, 2026

I can't see what is going on, it just feels like Import-SqlDscPreferredModule does not find the module to import and then there are no assemblies, but not sure - guessing. Maybe temporary add -Verbose on the command so we can see what it does? It feels like it happens when a resource using other credentials the the default SYSTEM, because the first install works but not the one "...AsUser...":
When using configuration DSC_SqlSetup_InstallDatabaseEngineDefaultInstanceAsUser_Config

@johlju
Copy link
Copy Markdown
Member

johlju commented Jan 24, 2026

Hmm. I wonder if adding the output type to Connect-SQL caused this...

OutputType is only used by IDE's for determining intellisense etc. it not used by the parser... 🤔

@johlju
Copy link
Copy Markdown
Member

johlju commented Jan 24, 2026

There are other resources faling to, they use PSDscRunAsCredential to login as another user...

Try adding this in Connect-Sql so we can see what assemblies are actually available:

[System.AppDomain]::CurrentDomain.GetAssemblies() | ? Location -like *SqlServer* | % { Write-Verbose ("GAC:{0}`t`tVersion:{1}`t`tLocation:{2}" -f $_.GlobalAssemblyCache,$_.ImageRuntimeVersion,$_.Location) -Verbose }

@johlju johlju added the needs review The pull request needs a code review. label Jan 25, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@source/Modules/SqlServerDsc.Common/Public/Connect-Sql.ps1`:
- Line 96: Replace the forced Write-Verbose assembly dump with a localized,
opt-in debug message: change the pipeline starting at
[System.AppDomain]::CurrentDomain.GetAssemblies() … ForEach-Object {
Write-Verbose ... -Verbose } to use Write-Debug and a localized string (e.g.,
get-string 'SqlServerDsc_AssemblyDump' or 'AssemblyDumpFormat') formatted with
$_.GlobalAssemblyCache,$_.ImageRuntimeVersion,$_.Location; remove the explicit
-Verbose switch so callers control verbosity, and add the new localization
key/value to the module strings file.
♻️ Duplicate comments (1)
source/Modules/SqlServerDsc.Common/Public/Connect-Sql.ps1 (1)

275-283: Null-guard connectTimer and sqlServerObject in finally.

Same concern as prior review: if construction/Connect fails, these can be $null and mask the original error.

🧹 Nitpick comments (1)
source/Modules/SqlServerDsc.Common/Public/Connect-Sql.ps1 (1)

133-133: Prefer ::new() for .NET type construction instead of New-Object.

PowerShell 5.0 (the project minimum) fully supports the ::new() syntax. This aligns with project guidelines and reduces reliance on New-Object for standard .NET types.

♻️ Suggested refactor
-$sqlConnectionContext = New-Object -TypeName Microsoft.SqlServer.Management.Common.ServerConnection
+$sqlConnectionContext = [Microsoft.SqlServer.Management.Common.ServerConnection]::new()
-$sqlServerObject = New-Object -TypeName Microsoft.SqlServer.Management.Smo.Server -ArgumentList $sqlConnectionContext
+$sqlServerObject = [Microsoft.SqlServer.Management.Smo.Server]::new($sqlConnectionContext)

Also applies to: line 184

$Encrypt
)

[System.AppDomain]::CurrentDomain.GetAssemblies() | Where-Object { $_.Location -like '*SqlServer*' } | ForEach-Object { Write-Verbose ("GAC:{0}`t`tVersion:{1}`t`tLocation:{2}" -f $_.GlobalAssemblyCache,$_.ImageRuntimeVersion,$_.Location) -Verbose }
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Localize the assembly dump and avoid forcing verbose output.

This message is hardcoded and uses -Verbose, which bypasses caller preferences. It also reads like internal diagnostics; Write-Debug fits better and still allows opt‑in visibility. Also ensure a localization key is added in the strings file. As per coding guidelines, use localized strings for all diagnostic messages.

🔧 Proposed adjustment
-$assemblies = [System.AppDomain]::CurrentDomain.GetAssemblies() | Where-Object { $_.Location -like '*SqlServer*' } | ForEach-Object { Write-Verbose ("GAC:{0}`t`tVersion:{1}`t`tLocation:{2}" -f $_.GlobalAssemblyCache,$_.ImageRuntimeVersion,$_.Location) -Verbose }
+$assemblies = [System.AppDomain]::CurrentDomain.GetAssemblies() |
+    Where-Object { $_.Location -like '*SqlServer*' }
+
+foreach ($assembly in $assemblies)
+{
+    $message = $script:localizedData.Connect_SqlServerAssemblyLoaded -f @(
+        $assembly.GlobalAssemblyCache,
+        $assembly.ImageRuntimeVersion,
+        $assembly.Location
+    )
+
+    Write-Debug -Message $message
+}
🤖 Prompt for AI Agents
In `@source/Modules/SqlServerDsc.Common/Public/Connect-Sql.ps1` at line 96,
Replace the forced Write-Verbose assembly dump with a localized, opt-in debug
message: change the pipeline starting at
[System.AppDomain]::CurrentDomain.GetAssemblies() … ForEach-Object {
Write-Verbose ... -Verbose } to use Write-Debug and a localized string (e.g.,
get-string 'SqlServerDsc_AssemblyDump' or 'AssemblyDumpFormat') formatted with
$_.GlobalAssemblyCache,$_.ImageRuntimeVersion,$_.Location; remove the explicit
-Verbose switch so callers control verbosity, and add the new localization
key/value to the module strings file.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
source/Modules/SqlServerDsc.Common/Public/Connect-Sql.ps1 (1)

133-137: Set ConnectTimeout to an appropriate value separate from StatementTimeout.

Line 136 sets ConnectTimeout to $StatementTimeout (default 600 seconds). These serve different purposes:

  • StatementTimeout: Query execution duration
  • ConnectTimeout: Connection establishment duration

The SMO default for ConnectTimeout is 30 seconds. Setting it to 600 seconds is excessive for connection establishment and masks real connection/network issues. Use a separate, smaller timeout value (15–30 seconds) or allow it to use the SMO default instead.

♻️ Duplicate comments (2)
source/Modules/SqlServerDsc.Common/Public/Connect-Sql.ps1 (2)

96-97: Localize the assembly diagnostic and use Write-Debug instead of forced verbose.

This line uses a hardcoded string and forces -Verbose output, bypassing caller preferences. Per coding guidelines, all diagnostic messages must use localized strings from $script:localizedData, and internal diagnostics should use Write-Debug.

🔧 Proposed fix
-    [System.AppDomain]::CurrentDomain.GetAssemblies() | Where-Object { $_.Location -like '*SqlServer*' } | ForEach-Object { Write-Verbose ("GAC:{0}`t`tVersion:{1}`t`tLocation:{2}" -f $_.GlobalAssemblyCache, $_.ImageRuntimeVersion, $_.Location) -Verbose }
-
+    $assemblies = [System.AppDomain]::CurrentDomain.GetAssemblies() |
+        Where-Object -FilterScript { $_.Location -like '*SqlServer*' }
+
+    foreach ($assembly in $assemblies)
+    {
+        Write-Debug -Message (
+            $script:localizedData.Connect_SqlServerAssemblyLoaded -f @(
+                $assembly.GlobalAssemblyCache,
+                $assembly.ImageRuntimeVersion,
+                $assembly.Location
+            )
+        )
+    }

Also add the localization key to the strings file:

Connect_SqlServerAssemblyLoaded = GAC: {0}, Version: {1}, Location: {2}. (CS0003)

273-284: Add null guards in the finally block to prevent masking original exceptions.

If the Server constructor (Line 184) or Connect() (Line 192) throws, $sqlServerObject will be null and Line 283 will throw a NullReferenceException, masking the original failure.

🐛 Proposed fix
     finally
     {
-        $connectTimer.Stop()
+        if ($null -ne $connectTimer)
+        {
+            $connectTimer.Stop()
+        }
+
         <#
             Connect() will ensure we actually can connect, but we need to disconnect
             from the session so we don't have anything hanging. If we need run a
             method on the returned $sqlServerObject it will automatically open a
             new session and then close, therefore we don't need to keep this
             session open.
         #>
-        $sqlServerObject.ConnectionContext.Disconnect()
+        if ($null -ne $sqlServerObject -and $null -ne $sqlServerObject.ConnectionContext)
+        {
+            $sqlServerObject.ConnectionContext.Disconnect()
+        }
     }
🧹 Nitpick comments (1)
source/Modules/SqlServerDsc.Common/Public/Connect-Sql.ps1 (1)

1-51: Missing INPUTS and OUTPUTS sections in comment-based help.

As per coding guidelines, comment-based help must include INPUTS and OUTPUTS sections. The OutputType attribute was added, but the corresponding documentation is missing.

📝 Suggested addition before line 33
+    .INPUTS
+        None.
+
+    .OUTPUTS
+        `Microsoft.SqlServer.Management.Smo.Server`
+
+        Returns a SQL Server Management Object (SMO) Server object representing
+        the connected SQL Server Database Engine instance.
+
     .EXAMPLE

@dan-hughes
Copy link
Copy Markdown
Contributor Author

@johlju Is there a way to override the logic to workout which tests to run?

@johlju
Copy link
Copy Markdown
Member

johlju commented Jan 25, 2026

@johlju Is there a way to override the logic to workout which tests to run?

What do you mean? not following you 🙂

@johlju
Copy link
Copy Markdown
Member

johlju commented Jan 25, 2026

It looks like it doesn't find any assemblies when it fails, could you add a debug write-verbose that outputs all the modules (SQLPS, SqlServer) in Connect-Sql:

Write-Verbose -Message (Get-Module -Name *sql*  -ListAvailable | Out-String) -Verbose

This is very, doesn't understand why this happens with the changes in the PR.

@johlju
Copy link
Copy Markdown
Member

johlju commented Jan 25, 2026

You can also make the stage Integration_Test_Resources_SqlServer dependent on Build stage and temporary disable the others to get this to test quicker for now.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@source/Modules/SqlServerDsc.Common/Public/Connect-Sql.ps1`:
- Around line 96-100: Remove the temporary debugging verbose outputs: delete the
Write-Verbose (Get-Module ... | Out-String) call and the assembly enumeration
block that writes verbose lines (the pipeline starting with
[System.AppDomain]::CurrentDomain.GetAssemblies() ... ForEach-Object {
Write-Verbose (...) }) so the function no longer forces verbose output; keep
Import-SqlDscPreferredModule intact, and if persistent diagnostics are required
replace the removed messages with localized Write-Debug calls (or proper
localized logging) tied to the Connect-Sql function's debug logging rather than
unconditional Write-Verbose.
♻️ Duplicate comments (1)
source/Modules/SqlServerDsc.Common/Public/Connect-Sql.ps1 (1)

275-286: Previous feedback not yet addressed: Add null guards in finally block.

The null guard issue flagged in a previous review remains unresolved. If Server construction or Connect() throws, calling $connectTimer.Stop() or $sqlServerObject.ConnectionContext.Disconnect() on $null will throw a NullReferenceException, masking the original failure.

@johlju
Copy link
Copy Markdown
Member

johlju commented Jan 25, 2026

Hmm. I wonder if adding the output type to Connect-SQL caused this...

OutputType is only used by IDE's for determining intellisense etc. it not used by the parser... 🤔

You were correct, it is the output type, I thought it wasn't parsed, but it is. My bad...
The type is not available until we run Import-SqlDscPreferredModule inside Connect-Sql. It is seemingly not imported on module import probably because module is already imported at that point 🤔 Guess we need to change it to System.Object.

Example showing the parse error:

PS> function Connect-Sql
>> {
>>     [OutputType([Microsoft.SqlServer.Management.Smo.Server])]
>>     [CmdletBinding()]
>>     param (
>>         [Parameter()]
>>         [String]
>>         $InstanceName
>>     )
>> 
>>     Write-Verbose -Message "Connecting to SQL Server instance '$InstanceName'..."
>> } 
PS> connect-sql       
InvalidOperation: 
Line |
   4 |      [OutputType([Microsoft.SqlServer.Management.Smo.Server])]
     |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Unable to find type [Microsoft.SqlServer.Management.Smo.Server].

@johlju
Copy link
Copy Markdown
Member

johlju commented Jan 25, 2026

I just realized that we maybe have a flaw in the integration tests.

We are installing the SqlServer module as part of the configuration prior to installing the instances. But at that point Pester has already imported the SqlServerDsc module which might mean SqlServerDsc will not be re-imported after SqlServer module have been installed (so SqlServerDsc imports SqlServer so it loads SMO assemblies). A real scenario would be to install SqlServer module before invoking Pester, like a normal user would do. That would probably make OutputType work with the Server type.

But there is also the scenario where a user can install SqlServerDsc, make use of its public commands to download server media and install an instance. After that install SqlServer module. Then use the Connect-public command to connect to that newly installed instance. Without having import call inside Connect-Sql that would fail because in this scenario SMO would not be available, and the OutputType would fail in this scenario.

Maybe it possible to guard against it the later scenario, and fix the integration tests to handle the former scenario.

@coderabbitai can you investigate this issue and the create a GitHub issue to track it?

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jan 25, 2026

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

@johlju, I'll investigate this issue and create a GitHub issue to track it.


🏁 Script executed:

#!/bin/bash

# Read suffix.ps1 to understand module import logic
echo "=== suffix.ps1 module import logic ==="
cat source/suffix.ps1

echo -e "\n=== Connect-Sql current implementation ==="
cat source/Modules/SqlServerDsc.Common/Public/Connect-Sql.ps1

echo -e "\n=== Search for SqlServer module installation in integration tests ==="
rg -n "SqlServer.*Install-Module|Install-Module.*SqlServer" tests/Integration/ -A3 -B3

echo -e "\n=== Search for integration test configuration setup ==="
fd -e ps1 -e config.ps1 . tests/Integration/ --exec echo "File: {}" \; --exec head -50 {} \; | head -200

Length of output: 21042


🏁 Script executed:

#!/bin/bash

# Look at the Prerequisites integration test to see the sequence
echo "=== Prerequisites integration test - SqlServer module installation ==="
cat tests/Integration/Commands/Prerequisites.Integration.Tests.ps1 | head -250

echo -e "\n=== Search for how integration tests are ordered/invoked ==="
rg -n "Prerequisites" tests/Integration/ --type yaml -A5 -B5

echo -e "\n=== Check build pipeline for integration test execution order ==="
cat .azure-pipelines/jobs/integration-test-resources-sqlserver.yml | head -100

echo -e "\n=== Check if there's a test invocation script ==="
fd -t f "Invoke.*Test|Test.*Runner" . tests/Integration/ --exec echo "File: {}" \; --exec head -30 {} \;

Length of output: 28748


@johlju, I've investigated the issue. Let me create a GitHub issue to track this problem.


🏁 Script executed:

#!/bin/bash

# Create GitHub issue documenting the OutputType/SMO loading problem
gh issue create \
  --title "Integration Test Flaw: OutputType Attribute Causes Parse Errors When SMO Types Not Available" \
  --body "## Problem Description

The \`[OutputType([Microsoft.SqlServer.Management.Smo.Server])]\` attribute on \`Connect-Sql\` causes parse errors in scenarios where SMO types are not available when the SqlServerDsc module is imported.

### Root Cause

PowerShell parses and validates the \`[OutputType()]\` attribute when a function is **invoked/executed**. This means the SMO type must exist in the current session when the command is used, or the function definition will fail.

## Affected Scenarios

### Scenario 1: Integration Tests (Current Issue)

**Current flow:**
1. Pester runs and imports SqlServerDsc module
2. \`suffix.ps1\` attempts to run \`Import-SqlDscPreferredModule\` (may succeed or fail depending on environment)
3. \`Prerequisites.Integration.Tests.ps1\` installs SqlServer module (version 21.1.18256 or 22.2.0)
4. SqlServerDsc is **NOT re-imported** after SqlServer module installation
5. When integration tests call \`Connect-Sql\`, the OutputType validation fails because SMO types weren't loaded when the module was first imported

**Error observed:**
\`\`\`
RuntimeException: Unable to find type [Microsoft.SqlServer.Management.Smo.Server].
\`\`\`

### Scenario 2: User Workflow

**User flow:**
1. User installs SqlServerDsc module
2. User uses public commands (e.g., \`Save-SqlDscSqlServerMediaFile\`) to download SQL Server media
3. User installs SQL Server instance
4. User installs SqlServer PowerShell module
5. User attempts to use \`Connect-Sql\` or other commands
6. Without \`Import-SqlDscPreferredModule\` being called inside \`Connect-Sql\`, SMO types may not be available and OutputType validation fails

## Evidence from Codebase

### suffix.ps1 (lines 11-28)
- Runs \`Import-SqlDscPreferredModule\` on module import
- Only runs if \`\$env:SqlServerDscCI\` is not set (to avoid conflicts with unit test stubs)
- Cannot guarantee SMO types are available at module import time

### Connect-Sql.ps1 (line 58)
- Has \`[OutputType([Microsoft.SqlServer.Management.Smo.Server])]\` attribute
- Also calls \`Import-SqlDscPreferredModule\` inside the function (line 96)
- The internal call happens too late—OutputType is already parsed at function definition time

### Prerequisites.Integration.Tests.ps1 (lines 208-227)
- Installs SqlServer module as part of integration test setup
- Happens **after** SqlServerDsc module is already imported by Pester
- Module is not re-imported after SqlServer is installed

## Potential Solutions

### Option 1: Change OutputType to System.Object (Quickest Fix)
\`\`\`powershell
[OutputType([System.Object])]
\`\`\`
**Pros:** Immediate fix, no breaking changes
**Cons:** Less specific type information for IDEs

### Option 2: Remove OutputType Attribute
**Pros:** Eliminates the problem entirely
**Cons:** Loses IDE intellisense benefits

### Option 3: Restructure Integration Tests
- Install SqlServer module **before** importing SqlServerDsc in integration tests
- Ensure proper module load order

**Pros:** Mirrors real-world usage better
**Cons:** May require significant test refactoring

### Option 4: Force Module Re-import
- After SqlServer module installation in Prerequisites tests, force SqlServerDsc re-import
- Could use \`Import-Module -Name SqlServerDsc -Force\`

**Pros:** Ensures SMO types are loaded
**Cons:** May cause issues with PowerShell class type identities

### Option 5: Conditional OutputType (Advanced)
Guard the OutputType with a runtime check, though this may not be feasible with PowerShell's parsing behavior.

## Related Comments

PR `#2433` discussion starting from comment:
https://github.com/dsccommunity/SqlServerDsc/pull/2433#discussion_r18XXXXXXX

## Recommended Approach

**Short-term:** Change \`[OutputType([Microsoft.SqlServer.Management.Smo.Server])]\` to \`[OutputType([System.Object])]\` to unblock current work.

**Long-term:** Investigate restructuring integration tests to install SqlServer module before importing SqlServerDsc, ensuring the module load order reflects real-world usage patterns.

## Additional Context

- This issue was discovered while working on PR `#2433` (SQL Connection Optimization)
- The problem manifests when using \`PSDscRunAsCredential\` in integration tests
- Related to environment variable \`\$env:SqlServerDscCI\` used to control SMO loading in CI" \
  --label "bug" \
  --label "needs investigation" \
  --assignee "johlju"

Length of output: 88


🏁 Script executed:

#!/bin/bash

# Create GitHub issue documenting the OutputType/SMO loading problem
gh issue create \
  --title "Integration Test Flaw: OutputType Attribute Causes Parse Errors When SMO Types Not Available" \
  --body "## Problem Description

The \`[OutputType([Microsoft.SqlServer.Management.Smo.Server])]\` attribute on \`Connect-Sql\` causes parse errors in scenarios where SMO types are not available when the SqlServerDsc module is imported.

### Root Cause

PowerShell parses and validates the \`[OutputType()]\` attribute when a function is **invoked/executed**. This means the SMO type must exist in the current session when the command is used, or the function definition will fail.

## Affected Scenarios

### Scenario 1: Integration Tests (Current Issue)

**Current flow:**
1. Pester runs and imports SqlServerDsc module
2. \`suffix.ps1\` attempts to run \`Import-SqlDscPreferredModule\` (may succeed or fail depending on environment)
3. \`Prerequisites.Integration.Tests.ps1\` installs SqlServer module (version 21.1.18256 or 22.2.0)
4. SqlServerDsc is **NOT re-imported** after SqlServer module installation
5. When integration tests call \`Connect-Sql\`, the OutputType validation fails because SMO types weren't loaded when the module was first imported

**Error observed:**
\`\`\`
RuntimeException: Unable to find type [Microsoft.SqlServer.Management.Smo.Server].
\`\`\`

### Scenario 2: User Workflow

**User flow:**
1. User installs SqlServerDsc module
2. User uses public commands (e.g., \`Save-SqlDscSqlServerMediaFile\`) to download SQL Server media
3. User installs SQL Server instance
4. User installs SqlServer PowerShell module
5. User attempts to use \`Connect-Sql\` or other commands
6. Without \`Import-SqlDscPreferredModule\` being called inside \`Connect-Sql\`, SMO types may not be available and OutputType validation fails

## Evidence from Codebase

### suffix.ps1 (lines 11-28)
- Runs \`Import-SqlDscPreferredModule\` on module import
- Only runs if \`\$env:SqlServerDscCI\` is not set (to avoid conflicts with unit test stubs)
- Cannot guarantee SMO types are available at module import time

### Connect-Sql.ps1 (line 58)
- Has \`[OutputType([Microsoft.SqlServer.Management.Smo.Server])]\` attribute
- Also calls \`Import-SqlDscPreferredModule\` inside the function (line 96)
- The internal call happens too late—OutputType is already parsed at function definition time

### Prerequisites.Integration.Tests.ps1 (lines 208-227)
- Installs SqlServer module as part of integration test setup
- Happens **after** SqlServerDsc module is already imported by Pester
- Module is not re-imported after SqlServer is installed

## Potential Solutions

### Option 1: Change OutputType to System.Object (Quickest Fix)
\`\`\`powershell
[OutputType([System.Object])]
\`\`\`
**Pros:** Immediate fix, no breaking changes
**Cons:** Less specific type information for IDEs

### Option 2: Remove OutputType Attribute
**Pros:** Eliminates the problem entirely
**Cons:** Loses IDE intellisense benefits

### Option 3: Restructure Integration Tests
- Install SqlServer module **before** importing SqlServerDsc in integration tests
- Ensure proper module load order

**Pros:** Mirrors real-world usage better
**Cons:** May require significant test refactoring

### Option 4: Force Module Re-import
- After SqlServer module installation in Prerequisites tests, force SqlServerDsc re-import
- Could use \`Import-Module -Name SqlServerDsc -Force\`

**Pros:** Ensures SMO types are loaded
**Cons:** May cause issues with PowerShell class type identities

### Option 5: Conditional OutputType (Advanced)
Guard the OutputType with a runtime check, though this may not be feasible with PowerShell's parsing behavior.

## Related Comments

PR `#2433` discussion:
https://github.com/dsccommunity/SqlServerDsc/pull/2433

## Recommended Approach

**Short-term:** Change \`[OutputType([Microsoft.SqlServer.Management.Smo.Server])]\` to \`[OutputType([System.Object])]\` to unblock current work.

**Long-term:** Investigate restructuring integration tests to install SqlServer module before importing SqlServerDsc, ensuring the module load order reflects real-world usage patterns.

## Additional Context

- This issue was discovered while working on PR `#2433` (SQL Connection Optimization)
- The problem manifests when using \`PSDscRunAsCredential\` in integration tests
- Related to environment variable \`\$env:SqlServerDscCI\` used to control SMO loading in CI" \
  --label "bug" \
  --assignee "johlju"

Length of output: 56


@johlju, I've investigated the issue and created GitHub issue #2436 to track it.

Summary of Findings

The root cause is that PowerShell parses and validates the [OutputType()] attribute when a function is invoked/executed. This means the SMO type must exist when the command is used, or the function definition fails.

Two Affected Scenarios:

  1. Integration Tests (Current Issue):

    • Pester imports SqlServerDsc module first
    • Prerequisites.Integration.Tests.ps1 installs SqlServer module afterward
    • SqlServerDsc is NOT re-imported after SqlServer installation
    • When tests call Connect-Sql, the OutputType validation fails
  2. User Workflow:

    • User installs SqlServerDsc → uses it to download media/install instance → installs SqlServer module → tries to use Connect-Sql
    • Without SMO types loaded during module import, OutputType validation fails

Key Evidence:

  • suffix.ps1: Calls Import-SqlDscPreferredModule on module import (unless $env:SqlServerDscCI is set)
  • Connect-Sql.ps1: Has OutputType on line 58, calls Import-SqlDscPreferredModule inside function on line 96 (too late—type already parsed)
  • Prerequisites.Integration.Tests.ps1: Installs SqlServer module after SqlServerDsc import

Recommended Solutions:

Short-term: Change [OutputType([Microsoft.SqlServer.Management.Smo.Server])] to [OutputType([System.Object])] to unblock current work.

Long-term: Restructure integration tests to install SqlServer module before importing SqlServerDsc, mirroring real-world usage patterns.

All details, including five potential solution options, are documented in issue #2436.


🧠 Learnings used
Learnt from: johlju
Repo: dsccommunity/SqlServerDsc PR: 2136
File: source/Public/Remove-SqlDscLogin.ps1:104-108
Timestamp: 2025-08-17T10:13:30.079Z
Learning: In SqlServerDsc unit tests, SMO object stubs (like Login objects) should have properly mocked Parent properties with correct Server stub types and valid InstanceName values, rather than handling null Parent scenarios in production code.

Learnt from: johlju
Repo: dsccommunity/SqlServerDsc PR: 2411
File: tests/Unit/Public/Set-SqlDscRSSmtpConfiguration.Tests.ps1:26-35
Timestamp: 2026-01-16T13:36:18.405Z
Learning: Applies to **/tests/Unit/**/*.ps1: Only suggest loading SMO stub types (via `Add-Type -Path "$PSScriptRoot/../Stubs/SMO.cs"`) in unit test files when the command/function/class being tested actually uses SMO types. Do not suggest loading SMO stubs for commands that use other technologies like CIM, WMI, or other APIs.

Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/SqlServerDsc-guidelines.instructions.md:0-0
Timestamp: 2026-01-01T11:57:15.298Z
Learning: Applies to **/tests/Integration/**/*.ps1 : Integration tests must use `Connect-SqlDscDatabaseEngine` for SQL Server DB session with correct CI credentials

Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/SqlServerDsc-guidelines.instructions.md:0-0
Timestamp: 2026-01-01T11:57:15.298Z
Learning: Applies to **/tests/Unit/**/*.ps1 : Unit tests must use SMO stub types from SMO.cs, never mock SMO types

Learnt from: johlju
Repo: dsccommunity/SqlServerDsc PR: 2411
File: tests/Integration/Commands/Set-SqlDscRSSmtpConfiguration.Integration.Tests.ps1:26-32
Timestamp: 2026-01-16T13:28:32.141Z
Learning: The requirement to use `Connect-SqlDscDatabaseEngine` and `Disconnect-SqlDscDatabaseEngine` in integration tests only applies when the tests actually interact with or require a SQL Server Database Engine instance. Tests that work with other components (like Reporting Services configuration via CIM methods) without database interaction do not require these commands.

Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/SqlServerDsc-guidelines.instructions.md:0-0
Timestamp: 2026-01-01T11:57:15.298Z
Learning: Applies to **/tests/Stubs/SMO.cs : When unit tests test classes or commands containing SMO types, ensure they are properly stubbed in SMO.cs

Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/SqlServerDsc-guidelines.instructions.md:0-0
Timestamp: 2026-01-01T11:57:15.298Z
Learning: After changing SMO stub types, run tests in a new PowerShell session for changes to take effect

Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/SqlServerDsc-guidelines.instructions.md:0-0
Timestamp: 2026-01-01T11:57:15.298Z
Learning: Applies to **/tests/Unit/**/*.ps1 : Load SMO stub types from SMO.cs in unit test files using `Add-Type -Path "$PSScriptRoot/../Stubs/SMO.cs"`

Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/SqlServerDsc-guidelines.instructions.md:0-0
Timestamp: 2026-01-01T11:57:15.298Z
Learning: Applies to **/tests/Integration/**/*.ps1 : Integration tests must use `Disconnect-SqlDscDatabaseEngine` after `Connect-SqlDscDatabaseEngine`

Learnt from: dan-hughes
Repo: dsccommunity/ActiveDirectoryDsc PR: 741
File: azure-pipelines.yml:104-104
Timestamp: 2025-08-10T15:11:52.897Z
Learning: In the ActiveDirectoryDsc project, HQRM (High Quality Resource Module) tests must run in PowerShell 5 (Windows PowerShell) using `pwsh: false` in the Azure Pipelines configuration, while unit tests can run in PowerShell 7 (PowerShell Core) with `pwsh: true`. This differentiation is intentional due to HQRM's specific requirements and dependencies on Windows PowerShell.

@johlju
Copy link
Copy Markdown
Member

johlju commented Jan 25, 2026

Another option would be to move out Inport-* from inside Connect-Sql and let the user or resources/commands always call Import-* prior to calling Connect-*. That would solve OutputType problem as well 🤔

But for now I suggest just switching to System.Object and we look at it in another PRs.

@dan-hughes
Copy link
Copy Markdown
Contributor Author

Changed the OutputType to System.Object.

Fixes everything!

Copy link
Copy Markdown
Member

@johlju johlju left a comment

Choose a reason for hiding this comment

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

:lgtm:

@johlju reviewed 9 files and all commit messages, made 1 comment, and resolved 2 discussions.
Reviewable status: all files reviewed, 6 unresolved discussions (waiting on @dan-hughes).

@johlju
Copy link
Copy Markdown
Member

johlju commented Jan 26, 2026

Great work!

@johlju johlju merged commit 19c7f47 into dsccommunity:main Jan 26, 2026
54 of 55 checks passed
@johlju johlju removed the needs review The pull request needs a code review. label Jan 26, 2026
@dan-hughes dan-hughes deleted the sql-connection-optimization branch January 26, 2026 16:36
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.

3 participants