-
-
Notifications
You must be signed in to change notification settings - Fork 842
Get-DbaDatabase - Add wildcard support for Database and ExcludeDatabase #9815
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
Conversation
#9814 this should probably be standardized to all commands
I like the idea. But... for all the commands? For all the parameters? Can we move the functionality to an internal function? Or have a code block that is exactly the same for all commands to fix bugs "one fix for all"? This would break in environments with wildcards in names. Do we add a switch like in Connect-DbaInstance some time ago when I changed the code? I would not implement this without deep consideration. |
No no, sorry I wasn't clear. It would be all commands with -Database, -ExcludeDatabase, -Login, -Job and perhaps others. Not a bad idea to make it an internal command! |
We had a similar discussion about "job". The end if I recall correctly was
"Get-" should always use literal matches (also to avoid breaking change),
if in need of wildcards/globs/whatever, put them in "Find-"
Il lun 25 ago 2025, 21:26 Chrissy LeMaire ***@***.***> ha
scritto:
… *potatoqualitee* left a comment (dataplat/dbatools#9815)
<#9815 (comment)>
No no, sorry I wasn't clear. It would be all commands with -Database,
-ExcludeDatabase, -Login, -Job and perhaps others. Not a bad idea to make
it an internal command!
—
Reply to this email directly, view it on GitHub
<#9815 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAA52B5JC33C23AQPK4BYK33PNPNLAVCNFSM6AAAAACEW3COKKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTEMRRGQ4DANJZGQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
thank you @niphlod ! i may have agreed at the time, but i'd like to change my position 😅 I think if someone does a *, it's very intentional and they want a wildcard. that does remind me, that we'd have to ensure brackets on the outside arent processed. or maybe its okay if they are, i'd have to check. whatcha think? |
Imho supporting -database and -excludedatabase just in get-dbadatabase
differently from all the other functions is a big no-no.
Another (not so big) no-no is backward compatibility.
Another (no so big) no-no is that if this gets added in Get-'s, what's the
point with Find-'s?
Then we get to what people intend by "wildcards"... Given we're in a
SQLServer world, [ and ] in t-sql and PowerShell "patterns" mean very
different things, and I don't know of they'll be clearer or not.
Users with "special filtering needs" can use a pretty simple "where-object"
already, so we're not leaving a big wide hole in functionality if we don't
implement patterns.
If all the above points can't sway "the Need to implement" we should
refactor pattern matching in a separate function, create a botload of
unittests, and then insert the relative function in ALL functions that have
a -database (and/or -excludedatabase). Then probably on -job and -login as
well, but the point could really be made for everything filtering out
things.
Il mar 26 ago 2025, 14:57 Chrissy LeMaire ***@***.***> ha
scritto:
… *potatoqualitee* left a comment (dataplat/dbatools#9815)
<#9815 (comment)>
thank you @niphlod <https://github.com/niphlod> ! i may have agreed at
the time, but i'd like to change my position 😅 I think if someone does a
*, it's very intentional and they want a wildcard. that does remind me,
that we'd have to ensure brackets on the outside arent processed. or maybe
its okay if they are, i'd have to check. whatcha think?
—
Reply to this email directly, view it on GitHub
<#9815 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAA52B6SQSF4FJB5YA24T7D3PRKUFAVCNFSM6AAAAACEW3COKKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTEMRUGA3TENBTGM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I would love |
Fixes #9814 this should probably be standardized to all commands
@niphlod / @andreasjordan tell me if you like this pattern. if so, i can add repo-wide wildcard support and update the help.