Skip to content

Comments

Import-DbaCsv - Preserve user-provided SQL connections#10063

Merged
potatoqualitee merged 3 commits intodevelopmentfrom
csvee
Dec 25, 2025
Merged

Import-DbaCsv - Preserve user-provided SQL connections#10063
potatoqualitee merged 3 commits intodevelopmentfrom
csvee

Conversation

@potatoqualitee
Copy link
Member

When users pass an already-open connection (Server SMO object), the cmdlet now preserves it instead of unconditionally closing it at the end of execution. This enables connection reuse scenarios where users want to perform multiple operations on the same connection.

Follows the same pattern used by Invoke-DbaQuery.ps1, detecting if the user passed a Server SMO object and only closing connections the cmdlet created itself.

Fixes #10062

(do Import-DbaCsv)

🤖 Generated with Claude Code

potatoqualitee and others added 3 commits December 25, 2025 14:10
When users pass an already-open connection (Server SMO object), the cmdlet
now preserves it instead of unconditionally closing it at the end of execution.
This enables connection reuse scenarios where users want to perform multiple
operations on the same connection.

Follows the same pattern used by Invoke-DbaQuery.ps1, detecting if the user
passed a Server SMO object and only closing connections the cmdlet created
itself.

Fixes #10062

(do Import-DbaCsv)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Bump dbatools.library version in dbatools-library-version.json to 2025.12.25-preview-sqlservermodule-20251225191938 for use in CI/CD and development.
Bumped the dbatools.library version in both CI/CD configuration and module manifest to 2025.12.25 for consistency and to use the latest release.

(do Import-DbaCsv)
@potatoqualitee potatoqualitee merged commit 591cb80 into development Dec 25, 2025
14 checks passed
@potatoqualitee potatoqualitee deleted the csvee branch December 25, 2025 20:37
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.

Import-DbaCsv close SQL connection

1 participant