Skip to content

Commit 7f654bf

Browse files
committed
Merge branch 'release/1.7.0'
2 parents 252b527 + 0e9ea60 commit 7f654bf

16 files changed

Lines changed: 255 additions & 129 deletions

.github/workflows/build-validation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
on:
22
push:
3-
branches: [ develop, bugfix/*, feature/*, release/* ]
3+
branches: [ develop, bugfix/*, feature/*, release/*, hotfix/* ]
44
pull_request:
55
branches: [ develop ]
66

.github/workflows/pre-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
on:
22
push:
3-
branches: [ release/* ]
3+
branches: [ release/*, hotfix/* ]
44
workflow_dispatch:
55

66
jobs:

.vscode/settings.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
"cSpell.words": [
44
"dacpac",
55
"Filegroups",
6+
"Hashtable",
7+
"Nocheck",
68
"sqlproj",
79
"Ssdt",
810
"testdb"

.vscode/tasks.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,5 +89,20 @@
8989
},
9090
"dependsOn": ["Build", "Create Testdata"]
9191
},
92+
{
93+
"label": "Test exclude AzureSql",
94+
"group": "test",
95+
"type": "shell",
96+
"command": "Invoke-Pester -Configuration @{ Filter = @{ ExcludeTag = 'AzureSql' }}",
97+
"options": {
98+
"cwd": "test"
99+
},
100+
"problemMatcher": "$msCompile",
101+
"presentation": {
102+
"echo": false,
103+
"showReuseMessage": false
104+
},
105+
"dependsOn": ["Build"]
106+
},
92107
]
93108
}

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [1.7.0] - 2024-08-13
11+
12+
### Changed
13+
14+
- Added support for views to `Get-DacColumn` command.
15+
- Updated Microsoft.SqlServer.DacFx to 162.1.167.
16+
- Updated System.Management.Automation to 7.2.16 and PowerShell 7.2.16.
17+
18+
### Added
19+
20+
- Added `Install-Package` parameter for IgnoreWithNocheckOnCheckConstraints, IgnoreWithNocheckOnForeignKeys and ScriptNewConstraintValidation.
21+
1022
## [1.6.0] - 2023-08-24
1123

1224
### Changed

PsDac.sln

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.5.002.0
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{E3CF8094-3455-46A9-B9D3-FBBCA943E40A}"
7+
EndProject
8+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PsDac", "src\PsDac\PsDac.csproj", "{1E0D293B-B68C-401E-988D-4B8CD72F5CB4}"
9+
EndProject
10+
Global
11+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12+
Debug|Any CPU = Debug|Any CPU
13+
Release|Any CPU = Release|Any CPU
14+
EndGlobalSection
15+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
16+
{1E0D293B-B68C-401E-988D-4B8CD72F5CB4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17+
{1E0D293B-B68C-401E-988D-4B8CD72F5CB4}.Debug|Any CPU.Build.0 = Debug|Any CPU
18+
{1E0D293B-B68C-401E-988D-4B8CD72F5CB4}.Release|Any CPU.ActiveCfg = Release|Any CPU
19+
{1E0D293B-B68C-401E-988D-4B8CD72F5CB4}.Release|Any CPU.Build.0 = Release|Any CPU
20+
EndGlobalSection
21+
GlobalSection(SolutionProperties) = preSolution
22+
HideSolutionNode = FALSE
23+
EndGlobalSection
24+
GlobalSection(NestedProjects) = preSolution
25+
{1E0D293B-B68C-401E-988D-4B8CD72F5CB4} = {E3CF8094-3455-46A9-B9D3-FBBCA943E40A}
26+
EndGlobalSection
27+
GlobalSection(ExtensibilityGlobals) = postSolution
28+
SolutionGuid = {2D4E4A93-6CA1-487D-96A9-267F1FF4B072}
29+
EndGlobalSection
30+
EndGlobal

docs/Get-DacColumn.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ schema: 2.0.0
88
# Get-DacColumn
99

1010
## SYNOPSIS
11-
Returns columns of a table.
11+
Returns columns of a table or view.
1212

1313
## SYNTAX
1414

1515
```
16-
Get-DacColumn [-Table] <TSqlObject> [[-Name] <String>] [<CommonParameters>]
16+
Get-DacColumn -Object <TSqlObject> [[-Name] <String>] [<CommonParameters>]
1717
```
1818

1919
## DESCRIPTION
@@ -30,6 +30,15 @@ Schema Name ObjectType
3030
Application [Application].[Cities].[CityID] Microsoft.SqlServer.Dac.Model.ModelTypeClass
3131
```
3232

33+
### Example 2
34+
```
35+
PS C:\> Import-DacModel -Path ./WideWorldImporters.dacpac | Get-DacView -Name '[Website].[Customers]' | Get-DacColumn -Name '[Website].[Customers].[CustomerID]'
36+
37+
Schema Name ObjectType
38+
------ ---- ----------
39+
Website [Website].[Customers].[CustomerID] Microsoft.SqlServer.Dac.Model.ModelTypeClass
40+
```
41+
3342
## PARAMETERS
3443

3544
### -Name
@@ -47,17 +56,17 @@ Accept pipeline input: False
4756
Accept wildcard characters: False
4857
```
4958
50-
### -Table
51-
Specifies the table to get the columns from.
52-
The ObjectType must be Table.
59+
### -Object
60+
Specifies the table or view to get the columns from.
61+
The ObjectType must be Table or View.
5362
5463
```yaml
5564
Type: TSqlObject
5665
Parameter Sets: (All)
57-
Aliases:
66+
Aliases: Table
5867

5968
Required: True
60-
Position: 0
69+
Position: Named
6170
Default value: None
6271
Accept pipeline input: True (ByPropertyName, ByValue)
6372
Accept wildcard characters: False

docs/Install-DacPackage.md

Lines changed: 66 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -37,29 +37,13 @@ Installs the content of myDb.dacpac into database myDb on localdb and creates th
3737

3838
## PARAMETERS
3939

40-
### -DatabaseName
41-
Specifies the database to install the package into.
42-
43-
```yaml
44-
Type: String
45-
Parameter Sets: (All)
46-
Aliases:
47-
48-
Required: True
49-
Position: Named
50-
Default value: None
51-
Accept pipeline input: True (ByPropertyName)
52-
Accept wildcard characters: False
53-
```
54-
55-
### -ExcludeObjectTypes
56-
List of ObjectType, that must not be installed.
40+
### -AcceptPossibleDataLoss
41+
{{ Fill AcceptPossibleDataLoss Description }}
5742

5843
```yaml
59-
Type: ObjectType[]
44+
Type: SwitchParameter
6045
Parameter Sets: (All)
6146
Aliases:
62-
Accepted values: Aggregates, ApplicationRoles, Assemblies, AssemblyFiles, AsymmetricKeys, BrokerPriorities, Certificates, ColumnEncryptionKeys, ColumnMasterKeys, Contracts, DatabaseOptions, DatabaseRoles, DatabaseTriggers, Defaults, ExtendedProperties, ExternalDataSources, ExternalFileFormats, ExternalTables, Filegroups, Files, FileTables, FullTextCatalogs, FullTextStoplists, MessageTypes, PartitionFunctions, PartitionSchemes, Permissions, Queues, RemoteServiceBindings, RoleMembership, Rules, ScalarValuedFunctions, SearchPropertyLists, SecurityPolicies, Sequences, Services, Signatures, StoredProcedures, SymmetricKeys, Synonyms, Tables, TableValuedFunctions, UserDefinedDataTypes, UserDefinedTableTypes, ClrUserDefinedTypes, Users, Views, XmlSchemaCollections, Audits, Credentials, CryptographicProviders, DatabaseAuditSpecifications, DatabaseEncryptionKeys, DatabaseScopedCredentials, Endpoints, ErrorMessages, EventNotifications, EventSessions, LinkedServerLogins, LinkedServers, Logins, MasterKeys, Routes, ServerAuditSpecifications, ServerRoleMembership, ServerRoles, ServerTriggers, ExternalStreams, ExternalStreamingJobs, DatabaseWorkloadGroups, WorkloadClassifiers, ExternalLibraries, ExternalLanguages
6347

6448
Required: False
6549
Position: Named
@@ -68,27 +52,11 @@ Accept pipeline input: False
6852
Accept wildcard characters: False
6953
```
7054
71-
### -Package
72-
Specifies the package to install into the database.
73-
74-
```yaml
75-
Type: DacPackage
76-
Parameter Sets: (All)
77-
Aliases:
78-
79-
Required: True
80-
Position: 0
81-
Default value: None
82-
Accept pipeline input: True (ByPropertyName, ByValue)
83-
Accept wildcard characters: False
84-
```
85-
86-
### -Service
87-
Specifies the server to install the package to.
88-
Default is the latest connected service.
55+
### -CommandTimeout
56+
{{ Fill CommandTimeout Description }}
8957
9058
```yaml
91-
Type: DacServices
59+
Type: Int32
9260
Parameter Sets: (All)
9361
Aliases:
9462

@@ -99,23 +67,8 @@ Accept pipeline input: False
9967
Accept wildcard characters: False
10068
```
10169
102-
### -UpgradeExisting
103-
{{ Fill upgradeExisting Description }}
104-
105-
```yaml
106-
Type: SwitchParameter
107-
Parameter Sets: (All)
108-
Aliases:
109-
110-
Required: False
111-
Position: Named
112-
Default value: False
113-
Accept pipeline input: False
114-
Accept wildcard characters: False
115-
```
116-
117-
### -CommandTimeout
118-
{{ Fill CommandTimeout Description }}
70+
### -DatabaseLockTimeout
71+
{{ Fill DatabaseLockTimeout Description }}
11972
12073
```yaml
12174
Type: Int32
@@ -129,18 +82,18 @@ Accept pipeline input: False
12982
Accept wildcard characters: False
13083
```
13184
132-
### -DatabaseLockTimeout
133-
{{ Fill DatabaseLockTimeout Description }}
85+
### -DatabaseName
86+
Specifies the database to install the package into.
13487
13588
```yaml
136-
Type: Int32
89+
Type: String
13790
Parameter Sets: (All)
13891
Aliases:
13992

140-
Required: False
93+
Required: True
14194
Position: Named
14295
Default value: None
143-
Accept pipeline input: False
96+
Accept pipeline input: True (ByPropertyName)
14497
Accept wildcard characters: False
14598
```
14699
@@ -151,6 +104,7 @@ Accept wildcard characters: False
151104
Type: ObjectType[]
152105
Parameter Sets: (All)
153106
Aliases:
107+
Accepted values: Aggregates, ApplicationRoles, Assemblies, AssemblyFiles, AsymmetricKeys, BrokerPriorities, Certificates, ColumnEncryptionKeys, ColumnMasterKeys, Contracts, DatabaseOptions, DatabaseRoles, DatabaseTriggers, Defaults, ExtendedProperties, ExternalDataSources, ExternalFileFormats, ExternalTables, Filegroups, Files, FileTables, FullTextCatalogs, FullTextStoplists, MessageTypes, PartitionFunctions, PartitionSchemes, Permissions, Queues, RemoteServiceBindings, RoleMembership, Rules, ScalarValuedFunctions, SearchPropertyLists, SecurityPolicies, Sequences, Services, Signatures, StoredProcedures, SymmetricKeys, Synonyms, Tables, TableValuedFunctions, UserDefinedDataTypes, UserDefinedTableTypes, ClrUserDefinedTypes, Users, Views, XmlSchemaCollections, Audits, Credentials, CryptographicProviders, DatabaseAuditSpecifications, DatabaseEncryptionKeys, DatabaseScopedCredentials, Endpoints, ErrorMessages, EventNotifications, EventSessions, LinkedServerLogins, LinkedServers, Logins, MasterKeys, Routes, ServerAuditSpecifications, ServerRoleMembership, ServerRoles, ServerTriggers, ExternalStreams, ExternalStreamingJobs, DatabaseWorkloadGroups, WorkloadClassifiers, ExternalLibraries, ExternalLanguages
154108

155109
Required: False
156110
Position: Named
@@ -279,6 +233,22 @@ Accept pipeline input: False
279233
Accept wildcard characters: False
280234
```
281235
236+
### -ExcludeObjectTypes
237+
List of ObjectType, that must not be installed.
238+
239+
```yaml
240+
Type: ObjectType[]
241+
Parameter Sets: (All)
242+
Aliases:
243+
Accepted values: Aggregates, ApplicationRoles, Assemblies, AssemblyFiles, AsymmetricKeys, BrokerPriorities, Certificates, ColumnEncryptionKeys, ColumnMasterKeys, Contracts, DatabaseOptions, DatabaseRoles, DatabaseTriggers, Defaults, ExtendedProperties, ExternalDataSources, ExternalFileFormats, ExternalTables, Filegroups, Files, FileTables, FullTextCatalogs, FullTextStoplists, MessageTypes, PartitionFunctions, PartitionSchemes, Permissions, Queues, RemoteServiceBindings, RoleMembership, Rules, ScalarValuedFunctions, SearchPropertyLists, SecurityPolicies, Sequences, Services, Signatures, StoredProcedures, SymmetricKeys, Synonyms, Tables, TableValuedFunctions, UserDefinedDataTypes, UserDefinedTableTypes, ClrUserDefinedTypes, Users, Views, XmlSchemaCollections, Audits, Credentials, CryptographicProviders, DatabaseAuditSpecifications, DatabaseEncryptionKeys, DatabaseScopedCredentials, Endpoints, ErrorMessages, EventNotifications, EventSessions, LinkedServerLogins, LinkedServers, Logins, MasterKeys, Routes, ServerAuditSpecifications, ServerRoleMembership, ServerRoles, ServerTriggers, ExternalStreams, ExternalStreamingJobs, DatabaseWorkloadGroups, WorkloadClassifiers, ExternalLibraries, ExternalLanguages
244+
245+
Required: False
246+
Position: Named
247+
Default value: None
248+
Accept pipeline input: False
249+
Accept wildcard characters: False
250+
```
251+
282252
### -LongRunningCommandTimeout
283253
{{ Fill LongRunningCommandTimeout Description }}
284254
@@ -294,11 +264,27 @@ Accept pipeline input: False
294264
Accept wildcard characters: False
295265
```
296266
297-
### -Variables
298-
{{ Fill Variables Description }}
267+
### -Package
268+
Specifies the package to install into the database.
299269
300270
```yaml
301-
Type: Hashtable
271+
Type: DacPackage
272+
Parameter Sets: (All)
273+
Aliases:
274+
275+
Required: True
276+
Position: 0
277+
Default value: None
278+
Accept pipeline input: True (ByPropertyName, ByValue)
279+
Accept wildcard characters: False
280+
```
281+
282+
### -Service
283+
Specifies the server to install the package to.
284+
Default is the latest connected service.
285+
286+
```yaml
287+
Type: DacServices
302288
Parameter Sets: (All)
303289
Aliases:
304290

@@ -309,14 +295,29 @@ Accept pipeline input: False
309295
Accept wildcard characters: False
310296
```
311297
312-
### -AcceptPossibleDataLoss
313-
{{ Fill AcceptPossibleDataLoss Description }}
298+
### -UpgradeExisting
299+
{{ Fill upgradeExisting Description }}
314300
315301
```yaml
316302
Type: SwitchParameter
317303
Parameter Sets: (All)
318304
Aliases:
319305

306+
Required: False
307+
Position: Named
308+
Default value: False
309+
Accept pipeline input: False
310+
Accept wildcard characters: False
311+
```
312+
313+
### -Variables
314+
{{ Fill Variables Description }}
315+
316+
```yaml
317+
Type: Hashtable
318+
Parameter Sets: (All)
319+
Aliases:
320+
320321
Required: False
321322
Position: Named
322323
Default value: None

src/PsDac/GetColumnCommand.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@ namespace PsDac
77
[OutputType(typeof(TSqlObject))]
88
public class GetColumnCommand : PSCmdlet
99
{
10+
[Alias("Table")]
1011
[Parameter(
1112
Position = 0,
1213
Mandatory = true,
1314
ValueFromPipeline = true,
1415
ValueFromPipelineByPropertyName = true)]
1516
[ValidateNotNullOrEmpty()]
16-
public TSqlObject Table { get; set; }
17+
public TSqlObject Object { get; set; }
1718

1819
[Parameter(
1920
Position = 1,
@@ -25,16 +26,18 @@ protected override void ProcessRecord()
2526
{
2627
base.ProcessRecord();
2728

28-
if (Table.ObjectType.Name != "Table") {
29-
throw new System.ArgumentException("Invalid Table type", Table.ObjectType.Name);
29+
if (Object.ObjectType.Name != "Table" && Object.ObjectType.Name != "View") {
30+
throw new System.ArgumentException("Invalid Table or View type", Object.ObjectType.Name);
3031
}
3132

3233
bool hasNameFilter = Name != null;
3334
if ( hasNameFilter ) {
3435
WriteVerbose($"Filter columns on name '{Name}'");
3536
}
3637

37-
foreach (var item in Table.GetReferencedRelationshipInstances(Microsoft.SqlServer.Dac.Model.Table.Columns, DacQueryScopes.Default)) {
38+
var relationship = Object.ObjectType.Name == "Table" ? Microsoft.SqlServer.Dac.Model.Table.Columns : Microsoft.SqlServer.Dac.Model.View.Columns;
39+
40+
foreach (var item in Object.GetReferencedRelationshipInstances(relationship, DacQueryScopes.Default)) {
3841
if ( ( !hasNameFilter || item.ObjectName.ToString() == Name ))
3942
{
4043
var result = new PSObject(item.Object);

0 commit comments

Comments
 (0)