System.Data.SQLite

Check-in [d404fc5314]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Enable use of the interop assembly under Mono on Unix.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: d404fc5314ee0d4ec62b5db18329acecada8429f
User & Date: mistachkin 2016-03-22 22:59:33.811
Context
2016-03-22
23:26
More compilation fixes for non-Windows platforms. check-in: f168458919 user: mistachkin tags: trunk
22:59
Enable use of the interop assembly under Mono on Unix. check-in: d404fc5314 user: mistachkin tags: trunk
22:33
More test constraint and portability fixes. check-in: b4365a972b user: mistachkin tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to Setup/build_mono.bat.
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45

%_VECHO% Tools = '%TOOLS%'

SET BUILD_CONFIGURATIONS=DebugManagedOnly ReleaseManagedOnly
SET PLATFORMS="Any CPU"
SET YEARS=2008 2013
SET NOUSER=1
SET MSBUILD_ARGS=/property:UseInteropDll=false
SET MSBUILD_ARGS=%MSBUILD_ARGS% /property:UseSqliteStandard=true
SET MSBUILD_ARGS=%MSBUILD_ARGS% /property:InteropCodec=false

CALL :fn_ResetErrorLevel

%__ECHO3% CALL "%TOOLS%\build_all.bat"

IF ERRORLEVEL 1 (







|
<







30
31
32
33
34
35
36
37

38
39
40
41
42
43
44

%_VECHO% Tools = '%TOOLS%'

SET BUILD_CONFIGURATIONS=DebugManagedOnly ReleaseManagedOnly
SET PLATFORMS="Any CPU"
SET YEARS=2008 2013
SET NOUSER=1
SET MSBUILD_ARGS=/property:UseSqliteStandardLibraryName=true

SET MSBUILD_ARGS=%MSBUILD_ARGS% /property:InteropCodec=false

CALL :fn_ResetErrorLevel

%__ECHO3% CALL "%TOOLS%\build_all.bat"

IF ERRORLEVEL 1 (
Changes to System.Data.SQLite/SQLiteDefineConstants.cs.
135
136
137
138
139
140
141




142
143
144
145
146
147
148
#if RETARGETABLE
            "RETARGETABLE",
#endif

#if SQLITE_STANDARD
            "SQLITE_STANDARD",
#endif





#if THROW_ON_DISPOSED
            "THROW_ON_DISPOSED",
#endif

#if TRACE
            "TRACE",







>
>
>
>







135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
#if RETARGETABLE
            "RETARGETABLE",
#endif

#if SQLITE_STANDARD
            "SQLITE_STANDARD",
#endif

#if SQLITE_STANDARD_LIBRARY_NAME
            "SQLITE_STANDARD_LIBRARY_NAME",
#endif

#if THROW_ON_DISPOSED
            "THROW_ON_DISPOSED",
#endif

#if TRACE
            "TRACE",
Changes to System.Data.SQLite/Targets/System.Data.SQLite.Properties.targets.
148
149
150
151
152
153
154









155
156
157
158
159
160
161
      NOTE: For interaction with the native SQLite implementation, use the
            standard DLL (i.e. "sqlite3.dll")?
  -->
  <PropertyGroup Condition="'$(UseSqliteStandard)' != 'false'">
    <DefineConstants>$(DefineConstants);SQLITE_STANDARD</DefineConstants>
  </PropertyGroup>










  <!--
      NOTE: Is the project being built to support the .NET Compact Framework?
  -->
  <PropertyGroup Condition="'$(IsCompactFramework)' != 'false'">
    <DefineConstants>$(DefineConstants);PLATFORM_COMPACTFRAMEWORK</DefineConstants>
  </PropertyGroup>








>
>
>
>
>
>
>
>
>







148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
      NOTE: For interaction with the native SQLite implementation, use the
            standard DLL (i.e. "sqlite3.dll")?
  -->
  <PropertyGroup Condition="'$(UseSqliteStandard)' != 'false'">
    <DefineConstants>$(DefineConstants);SQLITE_STANDARD</DefineConstants>
  </PropertyGroup>

  <!--
      NOTE: For interaction with the native SQLite implementation, use the
            standard DLL file name (i.e. "sqlite3.dll") even when compiled
            to use the interop DLL?
  -->
  <PropertyGroup Condition="'$(UseSqliteStandardLibraryName)' != 'false'">
    <DefineConstants>$(DefineConstants);SQLITE_STANDARD_LIBRARY_NAME</DefineConstants>
  </PropertyGroup>

  <!--
      NOTE: Is the project being built to support the .NET Compact Framework?
  -->
  <PropertyGroup Condition="'$(IsCompactFramework)' != 'false'">
    <DefineConstants>$(DefineConstants);PLATFORM_COMPACTFRAMEWORK</DefineConstants>
  </PropertyGroup>

Changes to System.Data.SQLite/UnsafeNativeMethods.cs.
1350
1351
1352
1353
1354
1355
1356



1357

1358
1359
1360
1361
1362
1363
1364
1365
1366
1367



1368

1369
1370
1371
1372
1373
1374
1375
    //
    // NOTE: On the .NET Compact Framework, the native interop assembly must
    //       be used because it provides several workarounds to .NET Compact
    //       Framework limitations important for proper operation of the core
    //       System.Data.SQLite functionality (e.g. being able to bind
    //       parameters and handle column values of types Int64 and Double).
    //



    internal const string SQLITE_DLL = "SQLite.Interop.100.dll";

#elif SQLITE_STANDARD
    //
    // NOTE: Otherwise, if the standard SQLite library is enabled, use it.
    //
    internal const string SQLITE_DLL = "sqlite3";
#elif USE_INTEROP_DLL
      //
    // NOTE: Otherwise, if the native SQLite interop assembly is enabled,
    //       use it.
    //



    internal const string SQLITE_DLL = "SQLite.Interop.dll";

#else
    //
    // NOTE: Finally, assume that the mixed-mode assembly is being used.
    //
    internal const string SQLITE_DLL = "System.Data.SQLite.dll";
#endif








>
>
>

>










>
>
>

>







1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
    //
    // NOTE: On the .NET Compact Framework, the native interop assembly must
    //       be used because it provides several workarounds to .NET Compact
    //       Framework limitations important for proper operation of the core
    //       System.Data.SQLite functionality (e.g. being able to bind
    //       parameters and handle column values of types Int64 and Double).
    //
#if SQLITE_STANDARD_LIBRARY_NAME
    internal const string SQLITE_DLL = "sqlite3";
#else
    internal const string SQLITE_DLL = "SQLite.Interop.100.dll";
#endif
#elif SQLITE_STANDARD
    //
    // NOTE: Otherwise, if the standard SQLite library is enabled, use it.
    //
    internal const string SQLITE_DLL = "sqlite3";
#elif USE_INTEROP_DLL
      //
    // NOTE: Otherwise, if the native SQLite interop assembly is enabled,
    //       use it.
    //
#if SQLITE_STANDARD_LIBRARY_NAME
    internal const string SQLITE_DLL = "sqlite3";
#else
    internal const string SQLITE_DLL = "SQLite.Interop.dll";
#endif
#else
    //
    // NOTE: Finally, assume that the mixed-mode assembly is being used.
    //
    internal const string SQLITE_DLL = "System.Data.SQLite.dll";
#endif

Changes to Targets/SQLite.NET.Settings.targets.
338
339
340
341
342
343
344









345
346
347
348
349
350
351
              standard DLL (i.e. "sqlite3.dll")?  By default, this is disabled.
              This property is mutually exclusive with the "UseInteropDll" one,
              above.  This should always be disabled in the project file that
              builds the NetModule target.
    -->
    <UseSqliteStandard Condition="'$(UseSqliteStandard)' == ''">false</UseSqliteStandard>










    <!--
        NOTE: Is the project being built to support the .NET Compact Framework?
    -->
    <IsCompactFramework Condition="'$(IsCompactFramework)' == ''">false</IsCompactFramework>

    <!--
        NOTE: Emit an AssemblyFlags attribute that includes the Retargetable







>
>
>
>
>
>
>
>
>







338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
              standard DLL (i.e. "sqlite3.dll")?  By default, this is disabled.
              This property is mutually exclusive with the "UseInteropDll" one,
              above.  This should always be disabled in the project file that
              builds the NetModule target.
    -->
    <UseSqliteStandard Condition="'$(UseSqliteStandard)' == ''">false</UseSqliteStandard>

    <!--
        NOTE: For interaction with the native SQLite implementation, use the
              standard DLL file name (i.e. "sqlite3.dll") even when compiled
              to use the interop DLL??  By default, this is disabled.  This
              should always be disabled in the project file that builds the
              NetModule target.
    -->
    <UseSqliteStandardLibraryName Condition="'$(UseSqliteStandardLibraryName)' == ''">false</UseSqliteStandardLibraryName>

    <!--
        NOTE: Is the project being built to support the .NET Compact Framework?
    -->
    <IsCompactFramework Condition="'$(IsCompactFramework)' == ''">false</IsCompactFramework>

    <!--
        NOTE: Emit an AssemblyFlags attribute that includes the Retargetable
Changes to lib/System.Data.SQLite/common.eagle.
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
            INTEROP_INCLUDE_CEROD INTEROP_INCLUDE_EXTRA INTEROP_INCLUDE_SEE \
            INTEROP_INCLUDE_ZIPVFS INTEROP_JSON1_EXTENSION \
            INTEROP_LEGACY_CLOSE INTEROP_LOG INTEROP_PERCENTILE_EXTENSION \
            INTEROP_REGEXP_EXTENSION INTEROP_TEST_EXTENSION \
            INTEROP_TOTYPE_EXTENSION INTEROP_VIRTUAL_TABLE NET_20 NET_35 \
            NET_40 NET_45 NET_451 NET_452 NET_46 NET_461 NET_COMPACT_20 \
            PLATFORM_COMPACTFRAMEWORK PRELOAD_NATIVE_LIBRARY RETARGETABLE \
            SQLITE_STANDARD THROW_ON_DISPOSED TRACE TRACE_CONNECTION \
            TRACE_DETECTION TRACE_HANDLE TRACE_PRELOAD TRACE_SHARED \
            TRACE_STATEMENT TRACE_WARNING TRACK_MEMORY_BYTES \
            USE_ENTITY_FRAMEWORK_6 USE_INTEROP_DLL USE_PREPARE_V2 WINDOWS] {
          #
          # NOTE: Check if the compile-time option is listed in the list of
          #       "define constants" kept track of by the managed assembly.
          #
          checkForSQLiteDefineConstant $::test_channel $defineConstant
        }







|
|
|







3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
            INTEROP_INCLUDE_CEROD INTEROP_INCLUDE_EXTRA INTEROP_INCLUDE_SEE \
            INTEROP_INCLUDE_ZIPVFS INTEROP_JSON1_EXTENSION \
            INTEROP_LEGACY_CLOSE INTEROP_LOG INTEROP_PERCENTILE_EXTENSION \
            INTEROP_REGEXP_EXTENSION INTEROP_TEST_EXTENSION \
            INTEROP_TOTYPE_EXTENSION INTEROP_VIRTUAL_TABLE NET_20 NET_35 \
            NET_40 NET_45 NET_451 NET_452 NET_46 NET_461 NET_COMPACT_20 \
            PLATFORM_COMPACTFRAMEWORK PRELOAD_NATIVE_LIBRARY RETARGETABLE \
            SQLITE_STANDARD SQLITE_STANDARD_LIBRARY_NAME THROW_ON_DISPOSED \
            TRACE TRACE_CONNECTION TRACE_DETECTION TRACE_HANDLE TRACE_PRELOAD \
            TRACE_SHARED TRACE_STATEMENT TRACE_WARNING TRACK_MEMORY_BYTES \
            USE_ENTITY_FRAMEWORK_6 USE_INTEROP_DLL USE_PREPARE_V2 WINDOWS] {
          #
          # NOTE: Check if the compile-time option is listed in the list of
          #       "define constants" kept track of by the managed assembly.
          #
          checkForSQLiteDefineConstant $::test_channel $defineConstant
        }