Skip to content

Commit 99bd7e3

Browse files
committed
Fixed
1 parent f112fde commit 99bd7e3

File tree

5 files changed

+14
-10
lines changed

5 files changed

+14
-10
lines changed

.config/dotnet-tools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
]
1010
}
1111
}
12-
}
12+
}

DbProject/dbo/Tables/DimCustomer.sql

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ CREATE TABLE [dbo].[DimCustomer]
55
[LastName] VARCHAR (50) NOT NULL,
66
[AddressLine1] VARCHAR (200) NOT NULL,
77
[City] VARCHAR (50) NOT NULL,
8-
[PostalCode] VARCHAR (20) NOT NULL,
9-
[SurrogateKey] INT NOT NULL
8+
[PostalCode] VARCHAR (20) NOT NULL
109
);
1110
GO
1211

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ build:
99
dotnet outdated --upgrade
1010
dotnet build
1111

12+
test:
13+
#dotnet test
14+
./tests/test.sh
15+
1216
clean:
1317
dotnet clean
1418
docker compose down --remove-orphans --volumes

SQL/dw-seed.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
MERGE INTO DimCustomer AS target
33
USING (VALUES
44
(1, 'John', 'Doe', '123 Main St', 'Springfield', '12345'),
5-
(2, 'Jane', 'Smith', '456 Elm St', 'Springfield', '12345'),
6-
(3, 'Bob', 'Jones', '789 Oak St', 'Springfield', '12345')
5+
(2, 'Jane', 'Doe', '456 Elm St', 'Springfield', '12345'),
6+
(3, 'Alice', 'Smith', '789 Oak St', 'Springfield', '12345')
77
) AS source (CustomerKey, FirstName, LastName, AddressLine1, City, PostalCode)
88
ON target.CustomerKey = source.CustomerKey
99
WHEN NOT MATCHED BY TARGET THEN

tests/test.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
#!/bin/bash
12

2-
# select all tables and views from sql server:
3+
set -e
34

4-
QUERY="
5-
SELECT * FROM INFORMATION_SCHEMA.TABLES
6-
"
5+
DB="demo"
6+
QUERY="SELECT * FROM vSalesByCityAndCategory"
77

8-
docker exec -it --env-file .env db /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P "$MSSQL_SA_PASSWORD" -Q "$QUERY" -b
8+
docker exec -it --env-file .env db /opt/mssql-tools/bin/sqlcmd \
9+
-S localhost -U sa -P "$MSSQL_SA_PASSWORD" -d "$DB" -Q "$QUERY" -b

0 commit comments

Comments
 (0)