The following special replacement tokens may be recognized and replaced with their associated runtime value, depending on context, when setting values are being read by the native library pre-loading subsystem. Unless otherwise stated explicitly, all of these tokens are case-sensitive and the percent characters must be included in order for them to be recognized.

Name Description
%PreLoadSQLite_AssemblyDirectory% If this token (which is case-sensitive and must include the percent characters) is present within a setting value being returned, it will be replaced with the qualified name of the directory containing the System.Data.SQLite assembly. If the name of the directory is not available, the token will not be replaced.
%PreLoadSQLite_TargetFramework% If this token (which is case-sensitive and must include the percent characters) is present within a setting value being returned, it will be replaced with an abbreviation of the target framework attribute value for the System.Data.SQLite assembly. If the target framework attribute value is not available, the token will not be replaced.
%PreLoadSQLite_XmlConfigDirectory% If this token (which is case-sensitive and must include the percent characters) is present within a setting value being returned, it will be replaced with the qualified name of the directory containing the XML configuration file. If the name of the directory is not available, the token will not be replaced. Generally, this token may only be used within the XML configuration file itself.

These environment variables are used to control several features of the System.Data.SQLite library. All of these environment variables are optional. If a particular environment variable is not present, the XML configuration file "System.Data.SQLite.dll.config" in the directory containing the currently executing assembly (i.e. the one containing all the managed components for System.Data.SQLite) will also be consulted. If present, the XML configuration file should be structured as follows:

        <?xml version="1.0"?>
        <configuration>
          <appSettings>
            <add key="A_Setting" value="String Value" />
            <add key="Another_Setting" value="%ENV_VALUE%" />
          </appSettings>
        </configuration>
        

All references to existing environment variables will be expanded to their corresponding values within the returned settings values unless either the "No_Expand" or "No_Expand_<name>" environment variable is set [to anything].

None of these environment variables are supported by the Compact Framework builds of System.Data.SQLite, due to limitations imposed by the platform itself; however, the XML configuration file mentioned above may be used instead.

Name Description
AppendManifestToken_SQLiteProviderManifest If this environment variable is set [to anything], it will be used by the System.Data.SQLite.Linq.SQLiteProviderManifest class (and the System.Data.SQLite.EF6.SQLiteProviderManifest class) to modify future provider manifest tokens by appending the value of the environment variable to the existing provider manifest token, if any. Typically, in order for the constructed provider manifest token to be syntactically correct, the environment variable value [to be appended] must begin with a semicolon.
DefaultFlags_SQLiteConnection If this environment variable is set [to anything], it will be used by the System.Data.SQLite.SQLiteConnection class as the default flags for all opened connections (i.e. when they are not present in the connection string).
Force_SQLiteLog If this environment variable is set [to anything], the SQLite logging subsystem may be initialized in a non-default application domain. By default, this is not allowed due to the potential for application domain unloading issues.
No_PreLoadSQLite If this environment variable is set [to anything], the native library pre-loading code will be disabled. By default, the native library pre-loading code will attempt to load the native SQLite library from architecture-specific (e.g. "x86", "amd64", "x64") or platform-specific (e.g. "Win32") directories that reside underneath the application base directory.
No_SQLiteConnectionNewParser If this environment variable is set [to anything], the new connection string parsing algorithm will not be used. This environment variable is intended for use with legacy code only.
No_SQLiteFunctions 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.
No_SQLiteGetSettingValue 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.
No_SQLiteXmlConfigFile 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.
PreLoadSQLite_BaseDirectory 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.
PreLoadSQLite_BreakIntoDebugger If this configuration variable is set [to anything], the native library pre-loader subsystem will attempt to give the interactive user an opportunity to attach a debugger to the current process.
PreLoadSQLite_LibraryFileNameOnly 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").
PreLoadSQLite_ProcessorArchitecture If this environment variable is set [to anything], it will be used instead of the processor architecture value contained in the PROCESSOR_ARCHITECTURE environment variable to help build the path of the native library to pre-load.
PreLoadSQLite_NoSearchForDirectory If this environment variable is set [to anything], the native library pre-loading code will skip conducting a search for the native library to pre-load. By default, the search starts in the location of the currently executing assembly (i.e. the assembly containing all the managed components for System.Data.SQLite) and then falls back to the application domain base directory.
PreLoadSQLite_UseAssemblyDirectory If this environment variable is set [to anything], the location of the currently executing assembly (i.e. the one containing all the managed components for System.Data.SQLite) will be used as the basis for locating the the native library to pre-load (i.e. instead of using the application domain base directory).
PROCESSOR_ARCHITECTURE This environment variable is normally set by the operating system itself and should reflect the native processor architecture of the current process (e.g. a 32-bit x86 application running on a 64-bit x64 operating system should have the value "x86").
SQLite_ForceLogPrepare If this environment variable is set [to anything], all calls to prepare a SQL query will be logged, regardless of the flags for the associated connection.
TypeName_SQLiteProviderServices If this environment variable is set [to anything], it will be used by the System.Data.SQLite.SQLiteFactory class as the type name containing the System.Data.Common.DbProviderServices implementation that should be used.
Use_SQLiteConvert_DefaultDbType If this environment variable is set [to anything], it will be used by the System.Data.SQLite.SQLiteConvert class as the default DbType value that should be used when a per-connection value is not available.
Use_SQLiteConvert_DefaultTypeName If this environment variable is set [to anything], it will be used by the System.Data.SQLite.SQLiteConvert class as the default type name that should be used when a per-connection value is not available.