Skip to content

Commit 5263d10

Browse files
authored
Merge pull request #113 from sqlcollaborative/development
0.6.3
2 parents ca573c5 + f5cfb42 commit 5263d10

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

docs/changelog.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Release notes for v0.6.3:
2+
- ### Adding hyphen to the variable token symbols (#112) by @nvarscar
13
# Release notes for v0.6.2:
24
- ### Ensuring deploy.ps1 only uses public functions (#108) by @nvarscar
35
# Release notes for v0.6.1:

internal/functions/Resolve-VariableToken.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
foreach ($obj in $InputObject) {
2525
if ($obj -is [string]) {
2626
$output = $obj
27-
foreach ($token in (Get-VariableToken -InputString $obj -RegexString $TokenRegex.Replace('token', '[a-zA-Z0-9\.]+'))) {
27+
foreach ($token in (Get-VariableToken -InputString $obj -RegexString $TokenRegex.Replace('token', '[a-zA-Z0-9\-.]+'))) {
2828
#Replace variables found in the config
2929
$tokenRegExString = $TokenRegex.Replace('token', [Regex]::Escape($token))
3030
if ($Runtime) {

tests/Invoke-DBOQuery.Tests.ps1

+8-4
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,14 @@ Describe "Invoke-DBOQuery tests" -Tag $commandName, IntegrationTests {
147147
(Get-PSFConfig -FullName dbops.config.variabletoken).ResetValue()
148148
}
149149
It "should connect to the server from a custom variable" {
150-
$query = "SELECT 1 AS A, 2 AS B UNION ALL SELECT 3 AS A, 4 AS B"
151-
$result = Invoke-DBOQuery -Query $query -SqlInstance '#{srv}' -Credential $script:mssqlCredential -As DataTable -Variables @{ Srv = $script:mssqlInstance }
152-
$result.A | Should -Be '1', '3'
153-
$result.B | Should -Be '2', '4'
150+
$query = "SELECT 1 AS A, 2 AS B UNION ALL SELECT '#{tst}' AS A, #{a.b-c} AS B"
151+
$result = Invoke-DBOQuery -Query $query -SqlInstance '#{srv}' -Credential $script:mssqlCredential -As DataTable -Variables @{
152+
Srv = $script:mssqlInstance
153+
tst = 3
154+
"a.b-c" = 4
155+
}
156+
$result.A | Should -Be 1, '3'
157+
$result.B | Should -Be 2, 4
154158
}
155159
It "should run the query with custom parameters" {
156160
$query = "SELECT @p1 AS A, @p2 AS B"

0 commit comments

Comments
 (0)