Skip to content

Commit e25c24a

Browse files
authored
Merge | LocalDBAPI (#3163)
* Move netcore LocalDBAPI.Common into LocalDBAPI.Windows since it is only loaded on Windows * Remove common file so we can just have unix and windows file. I do *not* want to try to decompose stuff in TdsParser to remove LocalDBAPI references on non-windows systems. * Sort the members of LocalDBAPI * Create merge file, merge LocalDBFormatMessage * Merge member variables and delegates * Merge LocalDBCreateInstanceDelegate (and update to use locks over monitors) * Merge UserInstanceDLLHandle * Fixing issue with Kernel32 reference * Removing old files and adding merged file to projects * Patching things up after rebase * Move Unix code to common project * Add braces for if statements * Fixing hardcoded func name in LoadProcAddress
1 parent 083ae33 commit e25c24a

File tree

8 files changed

+290
-465
lines changed

8 files changed

+290
-465
lines changed

src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,6 @@
633633
<Compile Include="Common\System\NotImplemented.cs" />
634634
<Compile Include="Common\System\Threading\Tasks\TaskToApm.cs" />
635635
<Compile Include="Microsoft\Data\Common\DbConnectionOptions.cs" />
636-
<Compile Include="Microsoft\Data\SqlClient\LocalDBAPI.cs" />
637636
<Compile Include="Microsoft\Data\SqlClient\Reliability\SqlConfigurableRetryLogicManager.NetCoreApp.cs" />
638637
<Compile Include="Microsoft\Data\SqlClient\SNI\ConcurrentQueueSemaphore.cs" />
639638
<Compile Include="Microsoft\Data\SqlClient\SNI\SNIError.cs" />
@@ -787,6 +786,9 @@
787786
<Compile Include="$(CommonSourceRoot)Microsoft\Data\Sql\SqlDataSourceEnumerator.Windows.cs">
788787
<Link>Microsoft\Data\Sql\SqlDataSourceEnumerator.Windows.cs</Link>
789788
</Compile>
789+
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlClient\LocalDBAPI.Windows.cs">
790+
<Link>Microsoft\Data\SqlClient\LocalDBAPI.Windows.cs</Link>
791+
</Compile>
790792
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlClient\SqlColumnEncryptionCngProvider.Windows.cs">
791793
<Link>Microsoft\Data\SqlClient\SqlColumnEncryptionCngProvider.Windows.cs</Link>
792794
</Compile>
@@ -805,9 +807,7 @@
805807
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlTypes\SqlFileStream.Windows.cs">
806808
<Link>Microsoft\Data\SqlTypes\SqlFileStream.Windows.cs</Link>
807809
</Compile>
808-
809-
<Compile Include="Microsoft\Data\SqlClient\LocalDBAPI.Common.cs" />
810-
<Compile Include="Microsoft\Data\SqlClient\LocalDBAPI.Windows.cs" />
810+
811811
<Compile Include="Microsoft\Data\SqlClient\PacketHandle.Windows.cs" />
812812
<Compile Include="Microsoft\Data\SqlClient\SessionHandle.Windows.cs" />
813813
<Compile Include="Microsoft\Data\SqlClient\SNI\LocalDB.Windows.cs" />
@@ -824,9 +824,11 @@
824824
<Compile Include="$(CommonSourceRoot)Microsoft\Data\ProviderBase\DbConnectionPoolIdentity.Unix.cs">
825825
<Link>Microsoft\Data\ProviderBase\DbConnectionPoolIdentity.Unix.cs</Link>
826826
</Compile>
827+
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlClient\LocalDBAPI.Unix.cs">
828+
<Link>Microsoft\Data\SqlClient\LocalDBAPI.Unix.cs</Link>
829+
</Compile>
827830

828831
<Compile Include="Microsoft\Data\Sql\SqlDataSourceEnumerator.Unix.cs" />
829-
<Compile Include="Microsoft\Data\SqlClient\LocalDBAPI.Unix.cs" />
830832
<Compile Include="Microsoft\Data\SqlClient\PacketHandle.Unix.cs" />
831833
<Compile Include="Microsoft\Data\SqlClient\SessionHandle.Unix.cs" />
832834
<Compile Include="Microsoft\Data\SqlClient\SNI\LocalDB.Unix.cs" />

src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/LocalDBAPI.Common.cs

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

src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/LocalDBAPI.Windows.cs

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

src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/LocalDBAPI.cs

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

src/Microsoft.Data.SqlClient/netfx/src/Microsoft.Data.SqlClient.csproj

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -298,12 +298,30 @@
298298
<Compile Include="$(CommonSourceRoot)Microsoft\Data\ProviderBase\DbMetaDataFactory.cs">
299299
<Link>Microsoft\Data\ProviderBase\DbMetaDataFactory.cs</Link>
300300
</Compile>
301+
<Compile Include="$(CommonSourceRoot)\Microsoft\Data\ProviderBase\DbReferenceCollection.cs">
302+
<Link>Microsoft\Data\ProviderBase\DbReferenceCollection.cs</Link>
303+
</Compile>
301304
<Compile Include="$(CommonSourceRoot)Microsoft\Data\ProviderBase\FieldNameLookup.cs">
302305
<Link>Microsoft\Data\ProviderBase\FieldNameLookup.cs</Link>
303306
</Compile>
304307
<Compile Include="$(CommonSourceRoot)Microsoft\Data\ProviderBase\TimeoutTimer.cs">
305308
<Link>Microsoft\Data\ProviderBase\TimeoutTimer.cs</Link>
306309
</Compile>
310+
<Compile Include="$(CommonSourceRoot)Microsoft\Data\Sql\SqlDataSourceEnumerator.Windows.cs">
311+
<Link>Microsoft\Data\Sql\SqlDataSourceEnumerator.Windows.cs</Link>
312+
</Compile>
313+
<Compile Include="$(CommonSourceRoot)Microsoft\Data\Sql\SqlDataSourceEnumeratorNativeHelper.cs">
314+
<Link>Microsoft\Data\Sql\SqlDataSourceEnumeratorNativeHelper.cs</Link>
315+
</Compile>
316+
<Compile Include="$(CommonSourceRoot)Microsoft\Data\Sql\SqlDataSourceEnumeratorUtil.cs">
317+
<Link>Microsoft\Data\Sql\SqlDataSourceEnumeratorUtil.cs</Link>
318+
</Compile>
319+
<Compile Include="$(CommonSourceRoot)Microsoft\Data\Sql\SqlNotificationRequest.cs">
320+
<Link>Microsoft\Data\Sql\SqlNotificationRequest.cs</Link>
321+
</Compile>
322+
<Compile Include="$(CommonSourceRoot)Resources\ResCategoryAttribute.cs">
323+
<Link>Resources\ResCategoryAttribute.cs</Link>
324+
</Compile>
307325
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlClient\SSPI\NativeSSPIContextProvider.cs">
308326
<Link>Microsoft\Data\SqlClient\SSPI\NativeSSPIContextProvider.cs</Link>
309327
</Compile>
@@ -319,18 +337,6 @@
319337
<Compile Include="$(CommonSourceRoot)Microsoft\Data\Sql\SqlDataSourceEnumerator.cs">
320338
<Link>Microsoft\Data\Sql\SqlDataSourceEnumerator.cs</Link>
321339
</Compile>
322-
<Compile Include="$(CommonSourceRoot)Microsoft\Data\Sql\SqlDataSourceEnumerator.Windows.cs">
323-
<Link>Microsoft\Data\Sql\SqlDataSourceEnumerator.Windows.cs</Link>
324-
</Compile>
325-
<Compile Include="$(CommonSourceRoot)Microsoft\Data\Sql\SqlDataSourceEnumeratorNativeHelper.cs">
326-
<Link>Microsoft\Data\Sql\SqlDataSourceEnumeratorNativeHelper.cs</Link>
327-
</Compile>
328-
<Compile Include="$(CommonSourceRoot)Microsoft\Data\Sql\SqlDataSourceEnumeratorUtil.cs">
329-
<Link>Microsoft\Data\Sql\SqlDataSourceEnumeratorUtil.cs</Link>
330-
</Compile>
331-
<Compile Include="$(CommonSourceRoot)Microsoft\Data\Sql\SqlNotificationRequest.cs">
332-
<Link>Microsoft\Data\Sql\SqlNotificationRequest.cs</Link>
333-
</Compile>
334340
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlClient\AAsyncCallContext.cs">
335341
<Link>Microsoft\Data\SqlClient\AAsyncCallContext.cs</Link>
336342
</Compile>
@@ -382,6 +388,9 @@
382388
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlClient\EnclaveSessionCache.cs">
383389
<Link>Microsoft\Data\SqlClient\EnclaveSessionCache.cs</Link>
384390
</Compile>
391+
<Compile Include="$(CommonSourceROot)Microsoft\Data\SqlClient\LocalDBAPI.Windows.cs">
392+
<Link>Microsoft\Data\SqlClient\LocalDBAPI.Windows.cs</Link>
393+
</Compile>
385394
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlClient\LocalAppContextSwitches.cs">
386395
<Link>Microsoft\Data\SqlClient\LocalAppContextSwitches.cs</Link>
387396
</Compile>
@@ -802,6 +811,9 @@
802811
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlClient\VirtualSecureModeEnclaveProviderBase.cs">
803812
<Link>Microsoft\Data\SqlClient\VirtualSecureModeEnclaveProviderBase.cs</Link>
804813
</Compile>
814+
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlDbTypeExtensions.cs">
815+
<Link>Microsoft\Data\SqlDbTypeExtensions.cs</Link>
816+
</Compile>
805817
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlTypes\SqlFileStream.Windows.cs">
806818
<Link>Microsoft\Data\SqlTypes\SqlFileStream.cs</Link>
807819
</Compile>
@@ -814,18 +826,9 @@
814826
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlTypes\SqlJson.cs">
815827
<Link>Microsoft\Data\SqlTypes\SqlJson.cs</Link>
816828
</Compile>
817-
<Compile Include="$(CommonSourceRoot)Resources\ResCategoryAttribute.cs">
818-
<Link>Resources\ResCategoryAttribute.cs</Link>
819-
</Compile>
820829
<Compile Include="$(CommonSourceRoot)Resources\ResDescriptionAttribute.cs">
821830
<Link>Resources\ResDescriptionAttribute.cs</Link>
822831
</Compile>
823-
<Compile Include="$(CommonSourceRoot)\Microsoft\Data\ProviderBase\DbReferenceCollection.cs">
824-
<Link>Microsoft\Data\ProviderBase\DbReferenceCollection.cs</Link>
825-
</Compile>
826-
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlDbTypeExtensions.cs">
827-
<Link>Microsoft\Data\SqlDbTypeExtensions.cs</Link>
828-
</Compile>
829832
<Compile Include="$(CommonSourceRoot)System\IO\StreamExtensions.netfx.cs">
830833
<Link>System\IO\StreamExtensions.netfx.cs</Link>
831834
</Compile>
@@ -836,7 +839,6 @@
836839
<Compile Include="Microsoft\Data\Common\DbConnectionString.cs" />
837840
<Compile Include="Microsoft\Data\Common\GreenMethods.cs" />
838841
<Compile Include="Microsoft\Data\SqlClient\assemblycache.cs" />
839-
<Compile Include="Microsoft\Data\SqlClient\LocalDBAPI.cs" />
840842
<Compile Include="Microsoft\Data\SqlClient\LocalDBConfig.cs" />
841843
<Compile Include="Microsoft\Data\SqlClient\Reliability\SqlConfigurableRetryLogicManager.LoadType.cs" />
842844
<Compile Include="Microsoft\Data\SqlClient\Server\SmiConnection.cs" />

src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9+
<Reference Include="System.Configuration" Condition="'$(TargetFramework)' == 'net462'" />
910
<Reference Include="System.Transactions" Condition="'$(TargetFramework)' == 'net462'" />
1011
</ItemGroup>
1112
<ItemGroup>

src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/LocalDBAPI.Unix.cs renamed to src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/LocalDBAPI.Unix.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ namespace Microsoft.Data
88
{
99
internal static partial class LocalDBAPI
1010
{
11+
internal static string GetLocalDbInstanceNameFromServerName(string serverName) =>
12+
null;
13+
1114
internal static string GetLocalDBMessage(int hrCode) =>
1215
throw new PlatformNotSupportedException(Strings.LocalDBNotSupported); // LocalDB is not available for Unix and hence it cannot be supported.
1316
}

0 commit comments

Comments
 (0)