System.Data.SQLite
Check-in [dc631206c0]
Not logged in

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

Overview
Comment:Add support for the 'No_SQLiteGetSettingValue' and 'No_SQLiteXmlConfigFile' environment variables.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: dc631206c0559782b57e341b2f173b0cdd0a4b7f
User & Date: mistachkin 2016-07-01 21:23:36
Context
2016-07-01
21:30
Pedantic: update the XML configuration file with the new settings as well, despite the fact that they cannot be effectively set from there. check-in: 8571817993 user: mistachkin tags: trunk
21:23
Add support for the 'No_SQLiteGetSettingValue' and 'No_SQLiteXmlConfigFile' environment variables. check-in: dc631206c0 user: mistachkin tags: trunk
21:05
Add experimental support for incremental blob I/O. check-in: 717bc31b47 user: mistachkin tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to Doc/Extra/Provider/environment.html.

126
127
128
129
130
131
132
















133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
          <td>If this environment variable is set [to anything], the initial
          search for types in all loaded assemblies that are tagged with the
          SQLiteFunction attribute will be skipped.  Normally, this search is
          conducted only once per application domain by the static constructor
          of the SQLiteFunction class; however, these implementation details
          are subject to change.</td>
        </tr>
















        <tr valign="top">
          <td>PreLoadSQLite_BaseDirectory</td>
          <td>If this environment variable is set [to anything], it will be
          used instead of the application base directory by the native
          library pre-loader.  This environment variable can be especially
          useful in ASP.NET and other hosted environments where direct control
          of the location of the managed assemblies is not under the control
          of the application.</td>
        </tr>
        <tr valign="top">
          <td>PreLoadSQLite_LibraryFileNameOnly</td>
          <td>If this configuration variable is set [to anything], it will be
          used as the base file name (without directory information) for the
          native SQLite library to be pre-loaded (e.g. "sqlite3.dll" or
          "libsqlite3.so.0").</td>
        </tr>
        <tr valign="top">
          <td>PreLoadSQLite_ProcessorArchitecture</td>
          <td>If this environment variable is set [to anything], it will be







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>











|







126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
          <td>If this environment variable is set [to anything], the initial
          search for types in all loaded assemblies that are tagged with the
          SQLiteFunction attribute will be skipped.  Normally, this search is
          conducted only once per application domain by the static constructor
          of the SQLiteFunction class; however, these implementation details
          are subject to change.</td>
        </tr>
        <tr valign="top">
          <td>No_SQLiteGetSettingValue</td>
          <td>If this environment variable is set [to anything], all calls to
          the GetSettingValue method will return the default value.  This will
          effectively prevent all other setting values from having any effect,
          including those specified via other supported environment variables
          or in the associated XML configuration file.</td>
        </tr>
        <tr valign="top">
          <td>No_SQLiteXmlConfigFile</td>
          <td>If this environment variable is set [to anything], calls to the
          GetSettingValue method will never result in the XML configuration
          file being read; instead, the default value will be returned.  This
          will effectively prevent any setting values specified via the XML
          configuration file from having any effect.</td>
        </tr>
        <tr valign="top">
          <td>PreLoadSQLite_BaseDirectory</td>
          <td>If this environment variable is set [to anything], it will be
          used instead of the application base directory by the native
          library pre-loader.  This environment variable can be especially
          useful in ASP.NET and other hosted environments where direct control
          of the location of the managed assemblies is not under the control
          of the application.</td>
        </tr>
        <tr valign="top">
          <td>PreLoadSQLite_LibraryFileNameOnly</td>
          <td>If this environment variable is set [to anything], it will be
          used as the base file name (without directory information) for the
          native SQLite library to be pre-loaded (e.g. "sqlite3.dll" or
          "libsqlite3.so.0").</td>
        </tr>
        <tr valign="top">
          <td>PreLoadSQLite_ProcessorArchitecture</td>
          <td>If this environment variable is set [to anything], it will be

Changes to System.Data.SQLite/UnsafeNativeMethods.cs.

756
757
758
759
760
761
762















763
764
765
766
767
768
769
...
792
793
794
795
796
797
798











799
800
801
802
803
804
805
      /// anything].
      /// </returns>
      internal static string GetSettingValue(
          string name,    /* in */
          string @default /* in */
          )
      {















          if (name == null)
              return @default;

          /////////////////////////////////////////////////////////////////////

          #region Debug Build Only
#if DEBUG
................................................................................
          value = Environment.GetEnvironmentVariable(name);

          if (expand && !String.IsNullOrEmpty(value))
              value = Environment.ExpandEnvironmentVariables(value);

          if (value != null)
              return value;











#endif

          try
          {
              string fileName = GetXmlConfigFileName();

              if (fileName == null)







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>







756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
...
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
      /// anything].
      /// </returns>
      internal static string GetSettingValue(
          string name,    /* in */
          string @default /* in */
          )
      {
#if !PLATFORM_COMPACTFRAMEWORK
          //
          // NOTE: If the special "No_SQLiteGetSettingValue" environment
          //       variable is set [to anything], this method will always
          //       return the default value.
          //
          if (Environment.GetEnvironmentVariable(
                "No_SQLiteGetSettingValue") != null)
          {
              return @default;
          }
#endif

          /////////////////////////////////////////////////////////////////////

          if (name == null)
              return @default;

          /////////////////////////////////////////////////////////////////////

          #region Debug Build Only
#if DEBUG
................................................................................
          value = Environment.GetEnvironmentVariable(name);

          if (expand && !String.IsNullOrEmpty(value))
              value = Environment.ExpandEnvironmentVariables(value);

          if (value != null)
              return value;

          //
          // NOTE: If the "No_SQLiteXmlConfigFile" environment variable is
          //       set [to anything], this method will NEVER read from the
          //       XML configuration file.
          //
          if (Environment.GetEnvironmentVariable(
                "No_SQLiteXmlConfigFile") != null)
          {
              return @default;
          }
#endif

          try
          {
              string fileName = GetXmlConfigFileName();

              if (fileName == null)