Skip to content

Commit 2ddf3a3

Browse files
Upload source code for Microsoft.Data.SqlClient (#166)
1 parent 9048729 commit 2ddf3a3

File tree

1,161 files changed

+493137
-20
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,161 files changed

+493137
-20
lines changed

.gitattributes

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
###############################################################################
2+
# Set default behavior to automatically normalize line endings.
3+
###############################################################################
4+
* text=auto
5+
6+
###############################################################################
7+
# Set default behavior for command prompt diff.
8+
#
9+
# This is need for earlier builds of msysgit that does not have it on by
10+
# default for csharp files.
11+
# Note: This is only used by command line
12+
###############################################################################
13+
#*.cs diff=csharp
14+
15+
###############################################################################
16+
# Set the merge driver for project and solution files
17+
#
18+
# Merging from the command prompt will add diff markers to the files if there
19+
# are conflicts (Merging from VS is not affected by the settings below, in VS
20+
# the diff markers are never inserted). Diff markers may cause the following
21+
# file extensions to fail to load in VS. An alternative would be to treat
22+
# these files as binary and thus will always conflict and require user
23+
# intervention with every merge. To do so, just uncomment the entries below
24+
###############################################################################
25+
#*.sln merge=binary
26+
#*.csproj merge=binary
27+
#*.vbproj merge=binary
28+
#*.vcxproj merge=binary
29+
#*.vcproj merge=binary
30+
#*.dbproj merge=binary
31+
#*.fsproj merge=binary
32+
#*.lsproj merge=binary
33+
#*.wixproj merge=binary
34+
#*.modelproj merge=binary
35+
#*.sqlproj merge=binary
36+
#*.wwaproj merge=binary
37+
38+
###############################################################################
39+
# behavior for image files
40+
#
41+
# image files are treated as binary by default.
42+
###############################################################################
43+
#*.jpg binary
44+
#*.png binary
45+
#*.gif binary
46+
47+
###############################################################################
48+
# diff behavior for common document formats
49+
#
50+
# Convert binary document formats to text before diffing them. This feature
51+
# is only available from the command line. Turn it on by uncommenting the
52+
# entries below.
53+
###############################################################################
54+
#*.doc diff=astextplain
55+
#*.DOC diff=astextplain
56+
#*.docx diff=astextplain
57+
#*.DOCX diff=astextplain
58+
#*.dot diff=astextplain
59+
#*.DOT diff=astextplain
60+
#*.pdf diff=astextplain
61+
#*.PDF diff=astextplain
62+
#*.rtf diff=astextplain
63+
#*.RTF diff=astextplain

.gitignore

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
55

66
# User-specific files
7+
*.rsuser
78
*.suo
89
*.user
910
*.userosscache
@@ -12,13 +13,18 @@
1213
# User-specific files (MonoDevelop/Xamarin Studio)
1314
*.userprefs
1415

16+
# Mono auto generated files
17+
mono_crash.*
18+
1519
# Build results
1620
[Dd]ebug/
1721
[Dd]ebugPublic/
1822
[Rr]elease/
1923
[Rr]eleases/
2024
x64/
2125
x86/
26+
[Aa][Rr][Mm]/
27+
[Aa][Rr][Mm]64/
2228
bld/
2329
[Bb]in/
2430
[Oo]bj/
@@ -36,9 +42,10 @@ Generated\ Files/
3642
[Tt]est[Rr]esult*/
3743
[Bb]uild[Ll]og.*
3844

39-
# NUNIT
45+
# NUnit
4046
*.VisualState.xml
4147
TestResult.xml
48+
nunit-*.xml
4249

4350
# Build Results of an ATL Project
4451
[Dd]ebugPS/
@@ -52,15 +59,14 @@ BenchmarkDotNet.Artifacts/
5259
project.lock.json
5360
project.fragment.lock.json
5461
artifacts/
55-
**/Properties/launchSettings.json
5662

5763
# StyleCop
5864
StyleCopReport.xml
5965

6066
# Files built by Visual Studio
6167
*_i.c
6268
*_p.c
63-
*_i.h
69+
*_h.h
6470
*.ilk
6571
*.meta
6672
*.obj
@@ -77,6 +83,7 @@ StyleCopReport.xml
7783
*.tlh
7884
*.tmp
7985
*.tmp_proj
86+
*_wpftmp.csproj
8087
*.log
8188
*.vspscc
8289
*.vssscc
@@ -179,6 +186,8 @@ PublishScripts/
179186

180187
# NuGet Packages
181188
*.nupkg
189+
# NuGet Symbol Packages
190+
*.snupkg
182191
# The packages folder can be ignored because of Package Restore
183192
**/[Pp]ackages/*
184193
# except build/, which is used as an MSBuild target.
@@ -203,12 +212,14 @@ BundleArtifacts/
203212
Package.StoreAssociation.xml
204213
_pkginfo.txt
205214
*.appx
215+
*.appxbundle
216+
*.appxupload
206217

207218
# Visual Studio cache files
208219
# files ending in .cache can be ignored
209220
*.[Cc]ache
210221
# but keep track of directories ending in .cache
211-
!*.[Cc]ache/
222+
!?*.[Cc]ache/
212223

213224
# Others
214225
ClientBin/
@@ -221,7 +232,7 @@ ClientBin/
221232
*.publishsettings
222233
orleans.codegen.cs
223234

224-
# Including strong name files can present a security risk
235+
# Including strong name files can present a security risk
225236
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
226237
#*.snk
227238

@@ -252,6 +263,9 @@ ServiceFabricBackup/
252263
*.bim.layout
253264
*.bim_*.settings
254265
*.rptproj.rsuser
266+
*- [Bb]ackup.rdl
267+
*- [Bb]ackup ([0-9]).rdl
268+
*- [Bb]ackup ([0-9][0-9]).rdl
255269

256270
# Microsoft Fakes
257271
FakesAssemblies/
@@ -287,12 +301,8 @@ paket-files/
287301
# FAKE - F# Make
288302
.fake/
289303

290-
# JetBrains Rider
291-
.idea/
292-
*.sln.iml
293-
294-
# CodeRush
295-
.cr/
304+
# CodeRush personal settings
305+
.cr/personal
296306

297307
# Python Tools for Visual Studio (PTVS)
298308
__pycache__/
@@ -317,7 +327,7 @@ __pycache__/
317327
# OpenCover UI analysis results
318328
OpenCover/
319329

320-
# Azure Stream Analytics local run output
330+
# Azure Stream Analytics local run output
321331
ASALocalRun/
322332

323333
# MSBuild Binary and Structured Log
@@ -326,5 +336,17 @@ ASALocalRun/
326336
# NVidia Nsight GPU debugger configuration file
327337
*.nvuser
328338

329-
# MFractors (Xamarin productivity tool) working folder
339+
# MFractors (Xamarin productivity tool) working folder
330340
.mfractor/
341+
342+
# Local History for Visual Studio
343+
.localhistory/
344+
345+
# BeatPulse healthcheck temp database
346+
healthchecksdb
347+
348+
# Backup folder for Package Reference Convert tool in Visual Studio 2017
349+
MigrationBackup/
350+
351+
# Ionide (cross platform F# VS Code tools) working folder
352+
.ionide/

BUILDGUIDE.md

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
# Guidelines for Building Microsoft.Data.SqlClient
2+
3+
This document provides all the necessary details to build the driver and run tests present in the repository.
4+
5+
## Visual Studio Pre-Requisites
6+
7+
This project should be ideally built with Visual Studio 2017+ for the best compatibility. Use either of the two environments with their required set of compoenents as mentioned below:
8+
- **Visual Studio 2017** with imported components: [VS17Components](/tools/vsconfig/VS17Components.vsconfig)
9+
- **Visual Studio 2019** with imported components: [VS19Components](/tools/vsconfig/VS19Components.vsconfig)
10+
11+
Once the environment is setup properly, execute the desired set of commands below from the _root_ folder to perform the respective operations:
12+
13+
## Building the driver
14+
15+
```bash
16+
# Default Build Configuration:
17+
18+
> msbuild
19+
# Builds the driver for the Client OS in 'Debug' Configuration for 'AnyCPU' platform.
20+
# Both .Net Framework (NetFx) and .Net Core drivers are built by default (as supported by Client OS).
21+
```
22+
23+
```bash
24+
> msbuild /p:Configuration=Release
25+
# Builds the driver in 'Release' Configuration.
26+
```
27+
28+
```bash
29+
> msbuild /p:Platform=x86
30+
# Builds the .Net Framework (NetFx) driver for Win32 (x86) platform on Windows.
31+
```
32+
33+
```bash
34+
> msbuild /t:clean
35+
# Cleans all build directories.
36+
```
37+
38+
```bash
39+
> msbuild /t:restore
40+
# Restores Nuget Packages.
41+
```
42+
43+
```bash
44+
> msbuild /t:BuildAllConfigurations
45+
# Builds the driver for all target OSes and supported platforms.
46+
```
47+
48+
```bash
49+
> msbuild /p:BuildNetFx=false
50+
# Skips building the .Net Framework (NetFx) Driver on Windows.
51+
# On Unix the netfx driver build is automatically skipped.
52+
```
53+
54+
```bash
55+
> msbuild /p:OSGroup=Unix
56+
# Builds the driver for the Unix platform.
57+
```
58+
59+
```bash
60+
> msbuild /t:BuildAllOSes
61+
# Builds the driver for all Operating Systems.
62+
```
63+
64+
## Building Tests
65+
66+
```bash
67+
> msbuild /t:BuildTestsNetCore
68+
# Build tests for the .Net Core driver.
69+
```
70+
71+
```bash
72+
> msbuild /t:BuildTestsNetFx
73+
# Build tests for the .Net Framework (NetFx) driver.
74+
```
75+
76+
## Run Functional Tests
77+
78+
Windows (`netcoreapp2.1`):
79+
```bash
80+
> dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" /p:Platform="AnyCPU" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests"
81+
```
82+
83+
Windows (`net46 x86`):
84+
```bash
85+
> dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" /p:Platform="Win32" /p:Configuration="Release" /p:TestTargetOS="Windowsnetfx" --no-build -v n --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests"
86+
```
87+
88+
Windows (`net46 x64`):
89+
```bash
90+
> dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" /p:Platform="x64" /p:Configuration="Release" /p:TestTargetOS="Windowsnetfx" --no-build -v n --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests"
91+
```
92+
93+
Unix (`netcoreapp2.1`):
94+
```bash
95+
> dotnet test "src/Microsoft.Data.SqlClient/tests/FunctionalTests/Microsoft.Data.SqlClient.Tests.csproj" /p:Platform="AnyCPU" /p:Configuration="Release" /p:TestTargetOS="Unixnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonlinuxtests&category!=nonuaptests"
96+
```
97+
98+
## Run Manual Tests
99+
100+
### Pre-Requisites for running Manual tests:
101+
Manual Tests require the below setup to run:
102+
* SQL Server with enabled Shared Memory, TCP and Named Pipes Protocols and access to the Client OS.
103+
* Databases "NORTHWIND" and "UdtTestDb" present in SQL Server, created using SQL scripts [createNorthwindDb.sql](tools\testsql\createNorthwindDb.sql) and [createUdtTestDb.sql](tools\testsql\createUdtTestDb.sql).
104+
* Environment variables configured on the Client OS:
105+
106+
|Env Variable|Description|Value|
107+
|------|--------|-------------------|
108+
|TEST_NP_CONN_STR | Connection String for Named Pipes enabled SQL Server instance.| `Server=\\{servername}\pipe\sql\query;Database={Database_Name};Trusted_Connection=True;` <br/> OR <br/> `Data Source=np:{servername};Initial Catalog={Database_Name};Integrated Security=True;`|
109+
|TEST_TCP_CONN_STR | Connection String for TCP enabled SQL Server instance. | `Server={servername};Database={Database_Name};Trusted_Connection=True;` <br/> OR `Data Source={servername};Initial Catalog={Database_Name};Integrated Security=True;`|
110+
|AAD_PASSWORD_CONN_STR | (Optional) Connection String for testing Azure Active Directory Password Authentication. | `Data Source={server.database.windows.net}; Initial Catalog={Azure_DB_Name};Authentication=Active Directory Password; User ID={AAD_User}; Password={AAD_User_Password};`|
111+
|TEST_ACCESSTOKEN_SETUP| (Optional) Contains the Access Token to be used for tests.| _<OAuth 2.0 Access Token>_ |
112+
|TEST_LOCALDB_INSTALLED| (Optional) Whether or not a LocalDb instance of SQL Server is installed on the machine running the tests. |`1` OR `0`|
113+
|TEST_INTEGRATEDSECURITY_SETUP| (Optional) Whether or not the USER running tests has integrated security access to the target SQL Server.| `1` OR `0`|
114+
|TEST_FILESTREAM_SETUP| (Optional) Whether or not FileStream is enabled on SQL Server| `1` OR `0`|
115+
116+
Commands to run tests:
117+
118+
Windows (`netcoreapp2.1`):
119+
```bash
120+
> dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" /p:Platform="AnyCPU" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests"
121+
```
122+
123+
Windows (`net46 x86`):
124+
```bash
125+
> dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" /p:Platform="Win32" /p:Configuration="Release" /p:TestTargetOS="Windowsnetfx" --no-build -v n --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests"
126+
```
127+
128+
Windows (`net46 x64`):
129+
```bash
130+
> dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" /p:Platform="x64" /p:Configuration="Release" /p:TestTargetOS="Windowsnetfx" --no-build -v n --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests"
131+
```
132+
133+
Unix (`netcoreapp2.1`):
134+
```bash
135+
> dotnet test "src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" /p:Platform="AnyCPU" /p:Configuration="Release" /p:TestTargetOS="Unixnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonlinuxtests&category!=nonuaptests"
136+
```

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changelog
2+
All notable changes to this project will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
5+
6+
## [Stable Release 1.0.19239.1] - 2019-08-27
7+
8+
Initial release. Release Notes uploaded in [1.0.md](release-notes\1.0\1.0.md)

Localize/LocProject.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"Projects": [
3+
{
4+
"LanguageSet": "AzureKatal_Languages",
5+
"LocItems": [
6+
{
7+
"SourceFile": "src\\Microsoft.Data.SqlClient\\netfx\\src\\Resources\\Strings.resx",
8+
"CopyOption": "LangIDOnName",
9+
"OutputPath": "src\\Microsoft.Data.SqlClient\\netfx\\src\\Resources"
10+
}
11+
]
12+
}
13+
]
14+
}

0 commit comments

Comments
 (0)