dataplat / dbaclone

👯 Clone SQL Server databases using PowerShell previously named PSDatabaseClone
https://github.com/sqlcollaborative/dbaclone/wiki
MIT License
134 stars 29 forks source link

New-DcnClone: use dbatools for db enumeration #217

Closed lowlydba closed 2 years ago

lowlydba commented 2 years ago

Fixes #216

lowlydba commented 2 years ago

I wonder if that is something we want to do. We already have the server object which already contains all the database objects. Using Get-DbaDatabase opens another connection to the database server which in theory isn't needed

Could definitely to it custom, but the DBA tools function does a lot of heavy lifting to ensure it doesn't error out, so re-doing that work might not be worth it.

sanderstad commented 2 years ago

I wonder if that is something we want to do. We already have the server object which already contains all the database objects. Using Get-DbaDatabase opens another connection to the database server which in theory isn't needed

Could definitely to it custom, but the DBA tools function does a lot of heavy lifting to ensure it doesn't error out, so re-doing that work might not be worth it.

Good call. If I write my script and already have a connections I try to refrain from having multiple connections because when you're iterating lots and lots of objects, then those connections can really add up.

In this case I think it could be benefitial.

sanderstad commented 2 years ago

Thank you for putting in the effort