Skip to content

Commit c9a379d

Browse files
authored
Merge pull request #107 from LowlyDBA/development
Merge development
2 parents 5fed48b + df672e6 commit c9a379d

22 files changed

+1024
-1386
lines changed

.editorconfig

Lines changed: 0 additions & 8 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ Steps to reproduce the behavior
1717
A clear and concise description of what you expected to happen.
1818

1919
**Versions(please complete the following information):**
20-
- OS: [e.g. iOS]
21-
- SQL Server: [e.g. chrome, safari]
22-
- SSMS:
20+
21+
* OS: [e.g. iOS]
22+
* SQL Server: [e.g. chrome, safari]
23+
* SSMS:
2324

2425
**Additional context**
2526
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ assignees: ''
88
---
99

1010
**Is your feature request related to a problem? Please describe.**
11-
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
11+
A clear and concise description of what the problem is.
1212

1313
**Describe the solution you'd like**
1414
A clear and concise description of what you want to happen.
File renamed without changes.

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.markdownlint.json
2-
node_modules/*
2+
node_modules/*
3+
package-lock.json

CODE_OF_CONDUCT.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,7 @@ members of the project's leadership.
6767

6868
## Attribution
6969

70-
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71-
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
71+
[version 1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html).
7272

7373
[homepage]: https://www.contributor-covenant.org
74-
75-
For answers to common questions about this code of conduct, see
76-
https://www.contributor-covenant.org/faq

appveyor/appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ clone_script:
5757

5858
install:
5959
- ps: Install-Module SqlServer -Force -AllowClobber
60-
- npm install
60+
- npm install tsqllint -g
6161
- ps: .\appveyor\start_sqlserver.ps1
6262
- ps: .\appveyor\install_tsqlt.ps1
6363

appveyor/sqlcover/Coverage.opencoverxml

Lines changed: 339 additions & 350 deletions
Large diffs are not rendered by default.

appveyor/sqlcover/Run_SQLCover.ps1

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1-
$LocalTest = $false
2-
$SqlInstance = $env:DB_INSTANCE
3-
$Database = "tSQLt"
4-
$TestCommand = "EXEC tSQLt.RunAll"
5-
$TrustedConnection = "yes"
6-
$ConnString = "server=$SqlInstance;initial catalog=$Database;Trusted_Connection=$TrustedConnection"
1+
using namespace System.IO.Path
2+
3+
param(
4+
[Parameter()]
5+
$LocalTest = $false,
6+
$SqlInstance = $env:DB_INSTANCE,
7+
$Database = $env:TARGET_DB,
8+
$TrustedConnection = "yes",
9+
$ConnString = "server=$SqlInstance;initial catalog=$Database;Trusted_Connection=$TrustedConnection",
10+
$ReportDest = $PSSCriptRoot,
11+
$TestPath = $env:TSQLTTESTPATH
12+
)
713

814
# Setup files
915
$NugetPath = (Get-Package GOEddie.SQLCover).Source | Convert-Path
@@ -17,15 +23,28 @@ Add-Type -Path $SQLCoverDllFullPath
1723
# Start covering
1824
$SQLCover = new-object SQLCover.CodeCoverage($ConnString, $Database)
1925
$IsCoverStarted = $SQLCover.Start()
20-
If ($IsCoverStarted) { Write-Host "Starting SQL Cover" }
2126

22-
# Run Tests
23-
. .\appveyor\run_tsqlt_tests.ps1
27+
If ($IsCoverStarted) {
28+
# Run Tests
29+
. .\appveyor\run_tsqlt_tests.ps1 -FilePath $TestPath -SqlInstance $SqlInstance -Database $Database -SQLAuth $false
2430

25-
# Stop covering
26-
$coverageResults = $SQLCover.Stop()
31+
# Stop covering
32+
$coverageResults = $SQLCover.Stop()
2733

28-
# Export results
29-
$xmlPath = Join-Path -Path $PSSCriptRoot -ChildPath "Coverage.opencoverxml"
30-
$coverageResults.OpenCoverXml() | Out-File $xmlPath -Encoding utf8
31-
$coverageResults.SaveSourceFiles($PSScriptRoot)
34+
# Export results
35+
If (!($LocalTest)) {
36+
$xmlPath = Join-Path -Path $ReportDest -ChildPath "Coverage.opencoverxml"
37+
$coverageResults.OpenCoverXml() | Out-File $xmlPath -Encoding utf8
38+
$coverageResults.SaveSourceFiles($ReportDest)
39+
}
40+
Else { # Don't save any files and bring up html report for review
41+
$tmpFile = Join-Path $env:TEMP "Coverage.html"
42+
Set-Content -Path $tmpFile -Value $coverageResults.Html2() -Force
43+
Invoke-Item $tmpFile
44+
Start-Sleep -Seconds 1
45+
Remove-Item $tmpFile
46+
}
47+
}
48+
Else {
49+
Write-Error "Could not start SQLCover - investigate issue."
50+
}

appveyor/sqlcover/[dbo].[sp_helpme]

Lines changed: 19 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ BEGIN
4848
,@ObjID INT
4949
,@HasParam INT = 0
5050
,@HasDepen BIT = 0
51-
,@HasSparse BIT = 0
5251
,@HasHidden BIT = 0
5352
,@HasMasked BIT = 0
5453
,@SQLString NVARCHAR(MAX) = N''
@@ -73,12 +72,6 @@ BEGIN
7372
RAISERROR(@Msg, 16, 1);
7473
END;
7574

76-
/* Check for Sparse Columns feature */
77-
IF 1 = (SELECT COUNT(*) FROM sys.all_columns AS ac WHERE ac.name = 'is_sparse' AND OBJECT_NAME(ac.object_id) = 'all_columns')
78-
BEGIN
79-
SET @HasSparse = 1;
80-
END;
81-
8275
/* Check for Hidden Columns feature */
8376
IF 1 = (SELECT COUNT(*) FROM sys.all_columns AS ac WHERE ac.name = 'is_hidden' AND OBJECT_NAME(ac.object_id) = 'all_columns')
8477
BEGIN
@@ -214,22 +207,22 @@ BEGIN
214207

215208
-- Data Type help (prec/scale only valid for numerics)
216209
SET @SQLString = N'SELECT
217-
[Type_name] = t.name,
218-
[Storage_type] = type_name(system_type_id),
219-
[Length] = max_length,
220-
[Prec] = [precision],
221-
[Scale] = [scale],
222-
[Nullable] = case when is_nullable=1 then @Yes else @No end,
223-
[Default_name] = isnull(object_name(default_object_id), @None),
224-
[Rule_name] = isnull(object_name(rule_object_id), @None),
225-
[Collation] = collation_name,
226-
[ExtendedProperty] = ep.[value]
227-
FROM [sys].[types] AS [t]
228-
LEFT JOIN [sys].[extended_properties] AS [ep] ON [ep].[major_id] = [t].[user_type_id]
229-
AND [ep].[name] = @epname
230-
AND [ep].[minor_id] = 0
231-
AND [ep].[class] = 6
232-
WHERE [user_type_id] = @ObjID';
210+
[Type_name] = t.name,
211+
[Storage_type] = type_name(system_type_id),
212+
[Length] = max_length,
213+
[Prec] = [precision],
214+
[Scale] = [scale],
215+
[Nullable] = case when is_nullable=1 then @Yes else @No end,
216+
[Default_name] = isnull(object_name(default_object_id), @None),
217+
[Rule_name] = isnull(object_name(rule_object_id), @None),
218+
[Collation] = collation_name,
219+
[ExtendedProperty] = ep.[value]
220+
FROM [sys].[types] AS [t]
221+
LEFT JOIN [sys].[extended_properties] AS [ep] ON [ep].[major_id] = [t].[user_type_id]
222+
AND [ep].[name] = @epname
223+
AND [ep].[minor_id] = 0
224+
AND [ep].[class] = 6
225+
WHERE [user_type_id] = @ObjID';
233226
SET @ParmDefinition = N'@ObjID INT, @Yes VARCHAR(5), @No VARCHAR(5), @None VARCHAR(5), @epname SYSNAME';
234227

235228
EXECUTE sp_executesql @SQLString
@@ -326,10 +319,9 @@ BEGIN
326319
BEGIN
327320
SET @SQLString = @SQLString + N'[Masked] = case when is_masked = 0 then ''no'' else ''yes'' end, ';
328321
END
329-
IF @HasSparse = 1
330-
BEGIN
331-
SET @SQLString = @SQLString + N'[Sparse] = case when is_sparse = 0 then ''no'' else ''yes'' end, ';
332-
END
322+
323+
SET @SQLString = @SQLString + N'[Sparse] = case when is_sparse = 0 then ''no'' else ''yes'' end, ';
324+
333325
IF @HasHidden = 1
334326
BEGIN
335327
SET @SQLString = @SQLString + N'[Hidden] = case when is_hidden = 0 then ''no'' else ''yes'' end, ';
@@ -477,10 +469,6 @@ BEGIN
477469
,@ObjID;
478470
END
479471
END
480-
ELSE IF @SysObj_Type IN ('V ')
481-
BEGIN
482-
EXEC sys.sp_helpindex @objname;
483-
END
484472

485473
RETURN (0); -- sp_helpme
486474
END;

0 commit comments

Comments
 (0)