diff --git a/src/Libraries/Sqlite/README.txt b/src/Libraries/Sqlite/README.txt new file mode 100644 index 000000000..29af7f54e --- /dev/null +++ b/src/Libraries/Sqlite/README.txt @@ -0,0 +1,10 @@ +Windows sqlite3.dll binary from here: +https://www.sqlite.org/2019/sqlite-dll-win32-x86-3280000.zip + +MacOS libsqlite3.0.dylib from azure pipeline here: +https://dev.azure.com/Lidarr/Lidarr/_build?definitionId=4&_a=summary + +System.Data.SQLite netstandard2.0 dll compiled in same pipeline with: +/p:Configuration=ReleaseManagedOnly /p:UseInteropDll=false /p:UseSqliteStandard=true + +Both MacOS and System.Data.SQLite from revision 40e714a of https://github.com/lidarr/SQLite.Build diff --git a/src/Libraries/Sqlite/System.Data.SQLite.dll b/src/Libraries/Sqlite/System.Data.SQLite.dll index 1e7145a8d..f27c9cd70 100644 Binary files a/src/Libraries/Sqlite/System.Data.SQLite.dll and b/src/Libraries/Sqlite/System.Data.SQLite.dll differ diff --git a/src/Libraries/Sqlite/System.Data.SQLite.xml b/src/Libraries/Sqlite/System.Data.SQLite.xml index 6e533f0a6..1dea1eccf 100644 --- a/src/Libraries/Sqlite/System.Data.SQLite.xml +++ b/src/Libraries/Sqlite/System.Data.SQLite.xml @@ -67,709 +67,842 @@ This class implements SQLiteBase completely, and is the guts of the code that interop's SQLite with .NET - + - This internal class provides the foundation of SQLite support. It defines all the abstract members needed to implement - a SQLite data provider, and inherits from SQLiteConvert which allows for simple translations of string to and from SQLite. + This field is used to refer to memory allocated for the + SQLITE_DBCONFIG_MAINDBNAME value used with the native + "sqlite3_db_config" API. If allocated, the associated + memeory will be freed when the underlying connection is + closed. - + - This base class provides datatype conversion services for the SQLite provider. + The opaque pointer returned to us by the sqlite provider - + - The fallback default database type when one cannot be obtained from an - existing connection instance. + The user-defined functions registered on this connection - + - The format string for DateTime values when using the InvariantCulture or CurrentCulture formats. + This is the name of the native library file that contains the + "vtshim" extension [wrapper]. - + - The fallback default database type name when one cannot be obtained from - an existing connection instance. + This is the flag indicate whether the native library file that + contains the "vtshim" extension must be dynamically loaded by + this class prior to use. - + - The value for the Unix epoch (e.g. January 1, 1970 at midnight, in UTC). + This is the name of the native entry point for the "vtshim" + extension [wrapper]. - + - The value of the OLE Automation epoch represented as a Julian day. + The modules created using this connection. - + - An array of ISO-8601 DateTime formats that we support parsing. + Constructs the object used to interact with the SQLite core library + using the UTF-8 text encoding. + + The DateTime format to be used when converting string values to a + DateTime and binding DateTime parameters. + + + The to be used when creating DateTime + values. + + + The format string to be used when parsing and formatting DateTime + values. + + + The native handle to be associated with the database connection. + + + The fully qualified file name associated with . + + + Non-zero if the newly created object instance will need to dispose + of when it is no longer needed. + - + - The internal default format for UTC DateTime values when converting - to a string. + This method attempts to dispose of all the derived + object instances currently associated with the native database connection. - + - The internal default format for local DateTime values when converting - to a string. + Returns the number of times the method has been + called. - + - An UTF-8 Encoding instance, so we can convert strings to and from UTF-8 + This method determines whether or not a + with a return code of should + be thrown after making a call into the SQLite core library. + + Non-zero if a to be thrown. This method + will only return non-zero if the method was called + one or more times during a call into the SQLite core library (e.g. when + the sqlite3_prepare*() or sqlite3_step() APIs are used). + - + - The default DateTime format for this instance. + Resets the value of the field. - + - The default DateTimeKind for this instance. + Attempts to interrupt the query currently executing on the associated + native database connection. - + - The default DateTime format string for this instance. + This function binds a user-defined function to the connection. + + The object instance containing + the metadata for the function to be bound. + + + The object instance that implements the + function to be bound. + + + The flags associated with the parent connection object. + - + - Initializes the conversion class + This function binds a user-defined function to the connection. - The default date/time format to use for this instance - The DateTimeKind to use. - The DateTime format string to use. + + The object instance containing + the metadata for the function to be unbound. + + + The flags associated with the parent connection object. + + Non-zero if the function was unbound and removed. - + - Converts a string to a UTF-8 encoded byte array sized to include a null-terminating character. + Returns non-zero if the underlying native connection handle is owned + by this instance. - The string to convert to UTF-8 - A byte array containing the converted string plus an extra 0 terminating byte at the end of the array. - + - Convert a DateTime to a UTF-8 encoded, zero-terminated byte array. + Returns the logical list of functions associated with this connection. - - This function is a convenience function, which first calls ToString() on the DateTime, and then calls ToUTF8() with the - string result. - - The DateTime to convert. - The UTF-8 encoded string, including a 0 terminating byte at the end of the array. - + - Converts a UTF-8 encoded IntPtr of the specified length into a .NET string + Attempts to free as much heap memory as possible for the database connection. - The pointer to the memory where the UTF-8 string is encoded - The number of bytes to decode - A string containing the translated character(s) + A standard SQLite return code (i.e. zero for success and non-zero for failure). - + - Converts a UTF-8 encoded IntPtr of the specified length into a .NET string + Attempts to free N bytes of heap memory by deallocating non-essential memory + allocations held by the database library. Memory used to cache database pages + to improve performance is an example of non-essential memory. This is a no-op + returning zero if the SQLite core library was not compiled with the compile-time + option SQLITE_ENABLE_MEMORY_MANAGEMENT. Optionally, attempts to reset and/or + compact the Win32 native heap, if applicable. - The pointer to the memory where the UTF-8 string is encoded - The number of bytes to decode - A string containing the translated character(s) + + The requested number of bytes to free. + + + Non-zero to attempt a heap reset. + + + Non-zero to attempt heap compaction. + + + The number of bytes actually freed. This value may be zero. + + + This value will be non-zero if the heap reset was successful. + + + The size of the largest committed free block in the heap, in bytes. + This value will be zero unless heap compaction is enabled. + + + A standard SQLite return code (i.e. zero for success and non-zero + for failure). + - + - Converts a string into a DateTime, using the DateTimeFormat, DateTimeKind, - and DateTimeFormatString specified for the connection when it was opened. + Shutdown the SQLite engine so that it can be restarted with different + configuration options. We depend on auto initialization to recover. - - Acceptable ISO8601 DateTime formats are: - - THHmmssK - THHmmK - HH:mm:ss.FFFFFFFK - HH:mm:ssK - HH:mmK - yyyy-MM-dd HH:mm:ss.FFFFFFFK - yyyy-MM-dd HH:mm:ssK - yyyy-MM-dd HH:mmK - yyyy-MM-ddTHH:mm:ss.FFFFFFFK - yyyy-MM-ddTHH:mmK - yyyy-MM-ddTHH:mm:ssK - yyyyMMddHHmmssK - yyyyMMddHHmmK - yyyyMMddTHHmmssFFFFFFFK - THHmmss - THHmm - HH:mm:ss.FFFFFFF - HH:mm:ss - HH:mm - yyyy-MM-dd HH:mm:ss.FFFFFFF - yyyy-MM-dd HH:mm:ss - yyyy-MM-dd HH:mm - yyyy-MM-ddTHH:mm:ss.FFFFFFF - yyyy-MM-ddTHH:mm - yyyy-MM-ddTHH:mm:ss - yyyyMMddHHmmss - yyyyMMddHHmm - yyyyMMddTHHmmssFFFFFFF - yyyy-MM-dd - yyyyMMdd - yy-MM-dd - - If the string cannot be matched to one of the above formats -OR- - the DateTimeFormatString if one was provided, an exception will - be thrown. - - The string containing either a long integer number of 100-nanosecond units since - System.DateTime.MinValue, a Julian day double, an integer number of seconds since the Unix epoch, a - culture-independent formatted date and time string, a formatted date and time string in the current - culture, or an ISO8601-format string. - A DateTime value + Returns a standard SQLite result code. - + - Converts a string into a DateTime, using the specified DateTimeFormat, - DateTimeKind and DateTimeFormatString. + Shutdown the SQLite engine so that it can be restarted with different + configuration options. We depend on auto initialization to recover. - - Acceptable ISO8601 DateTime formats are: - - THHmmssK - THHmmK - HH:mm:ss.FFFFFFFK - HH:mm:ssK - HH:mmK - yyyy-MM-dd HH:mm:ss.FFFFFFFK - yyyy-MM-dd HH:mm:ssK - yyyy-MM-dd HH:mmK - yyyy-MM-ddTHH:mm:ss.FFFFFFFK - yyyy-MM-ddTHH:mmK - yyyy-MM-ddTHH:mm:ssK - yyyyMMddHHmmssK - yyyyMMddHHmmK - yyyyMMddTHHmmssFFFFFFFK - THHmmss - THHmm - HH:mm:ss.FFFFFFF - HH:mm:ss - HH:mm - yyyy-MM-dd HH:mm:ss.FFFFFFF - yyyy-MM-dd HH:mm:ss - yyyy-MM-dd HH:mm - yyyy-MM-ddTHH:mm:ss.FFFFFFF - yyyy-MM-ddTHH:mm - yyyy-MM-ddTHH:mm:ss - yyyyMMddHHmmss - yyyyMMddHHmm - yyyyMMddTHHmmssFFFFFFF - yyyy-MM-dd - yyyyMMdd - yy-MM-dd - - If the string cannot be matched to one of the above formats -OR- - the DateTimeFormatString if one was provided, an exception will - be thrown. - - The string containing either a long integer number of 100-nanosecond units since - System.DateTime.MinValue, a Julian day double, an integer number of seconds since the Unix epoch, a - culture-independent formatted date and time string, a formatted date and time string in the current - culture, or an ISO8601-format string. - The SQLiteDateFormats to use. - The DateTimeKind to use. - The DateTime format string to use. - A DateTime value - - - - Converts a julianday value into a DateTime - - The value to convert - A .NET DateTime + + Non-zero to reset the database and temporary directories to their + default values, which should be null for both. This parameter has no + effect on non-Windows operating systems. + + Returns a standard SQLite result code. - + - Converts a julianday value into a DateTime + Determines if the associated native connection handle is open. - The value to convert - The DateTimeKind to use. - A .NET DateTime + + Non-zero if the associated native connection handle is open. + - + - Converts the specified number of seconds from the Unix epoch into a - value. + Returns the fully qualified path and file name for the currently open + database, if any. - - The number of whole seconds since the Unix epoch. - - - Either Utc or Local time. + + The name of the attached database to query. - The new value. + The fully qualified path and file name for the currently open database, + if any. - + - Converts the specified number of ticks since the epoch into a - value. + This method attempts to determine if a database connection opened + with the specified should be + allowed into the connection pool. - - The number of whole ticks since the epoch. - - - Either Utc or Local time. + + The that were specified when the + connection was opened. - The new value. + Non-zero if the connection should (eventually) be allowed into the + connection pool; otherwise, zero. - + - Converts a DateTime struct to a JulianDay double + Has the sqlite3_errstr() core library API been checked for yet? + If so, is it present? - The DateTime to convert - The JulianDay value the Datetime represents - - - Converts a DateTime struct to the whole number of seconds since the - Unix epoch. - - The DateTime to convert - The whole number of seconds since the Unix epoch + + + Returns the error message for the specified SQLite return code using + the sqlite3_errstr() function, falling back to the internal lookup + table if necessary. + + WARNING: Do not remove this method, it is used via reflection. + + The SQLite return code. + The error message or null if it cannot be found. - + - Returns the DateTime format string to use for the specified DateTimeKind. - If is not null, it will be returned verbatim. + Has the sqlite3_stmt_readonly() core library API been checked for yet? + If so, is it present? - The DateTimeKind to use. - The DateTime format string to use. - - The DateTime format string to use for the specified DateTimeKind. - - + - Converts a string into a DateTime, using the DateTimeFormat, DateTimeKind, - and DateTimeFormatString specified for the connection when it was opened. + Returns non-zero if the specified statement is read-only in nature. - The DateTime value to convert - Either a string containing the long integer number of 100-nanosecond units since System.DateTime.MinValue, a - Julian day double, an integer number of seconds since the Unix epoch, a culture-independent formatted date and time - string, a formatted date and time string in the current culture, or an ISO8601-format date/time string. + The statement to check. + True if the outer query is read-only. - + - Converts a string into a DateTime, using the DateTimeFormat, DateTimeKind, - and DateTimeFormatString specified for the connection when it was opened. + This field is used to keep track of whether or not the + "SQLite_ForceLogPrepare" environment variable has been queried. If so, + it will only be non-zero if the environment variable was present. - The DateTime value to convert - The SQLiteDateFormats to use. - The DateTimeKind to use. - The DateTime format string to use. - Either a string containing the long integer number of 100-nanosecond units since System.DateTime.MinValue, a - Julian day double, an integer number of seconds since the Unix epoch, a culture-independent formatted date and time - string, a formatted date and time string in the current culture, or an ISO8601-format date/time string. - + - Internal function to convert a UTF-8 encoded IntPtr of the specified length to a DateTime. + Determines if all calls to prepare a SQL query will be logged, + regardless of the flags for the associated connection. - - This is a convenience function, which first calls ToString() on the IntPtr to convert it to a string, then calls - ToDateTime() on the string to return a DateTime. - - A pointer to the UTF-8 encoded string - The length in bytes of the string - The parsed DateTime value + + Non-zero to log all calls to prepare a SQL query. + - + - Smart method of splitting a string. Skips quoted elements, removes the quotes. + Determines the file name of the native library containing the native + "vtshim" extension -AND- whether it should be dynamically loaded by + this class. - - This split function works somewhat like the String.Split() function in that it breaks apart a string into - pieces and returns the pieces as an array. The primary differences are: - - Only one character can be provided as a separator character - Quoted text inside the string is skipped over when searching for the separator, and the quotes are removed. - - Thus, if splitting the following string looking for a comma:
- One,Two, "Three, Four", Five
-
- The resulting array would contain
- [0] One
- [1] Two
- [2] Three, Four
- [3] Five
-
- Note that the leading and trailing spaces were removed from each item during the split. -
- Source string to split apart - Separator character - A string array of the split up elements + + This output parameter will be set to non-zero if the returned native + library file name should be dynamically loaded prior to attempting + the creation of native disposable extension modules. + + + The file name of the native library containing the native "vtshim" + extension -OR- null if it cannot be determined. +
- + - Splits the specified string into multiple strings based on a separator - and returns the result as an array of strings. + Calls the native SQLite core library in order to create a disposable + module containing the implementation of a virtual table. - - The string to split into pieces based on the separator character. If - this string is null, null will always be returned. If this string is - empty, an array of zero strings will always be returned. + + The module object to be used when creating the native disposable module. - - The character used to divide the original string into sub-strings. - This character cannot be a backslash or a double-quote; otherwise, no - work will be performed and null will be returned. + + The flags for the associated object instance. - - If this parameter is non-zero, all double-quote characters will be - retained in the returned list of strings; otherwise, they will be - dropped. + + + + Calls the native SQLite core library in order to cleanup the resources + associated with a module containing the implementation of a virtual table. + + + The module object previously passed to the + method. - - Upon failure, this parameter will be modified to contain an appropriate - error message. + + The flags for the associated object instance. - - The new array of strings or null if the input string is null -OR- the - separator character is a backslash or a double-quote -OR- the string - contains an unbalanced backslash or double-quote character. - - + - Queries and returns the string representation for an object, using the - specified (or current) format provider. + Calls the native SQLite core library in order to declare a virtual table + in response to a call into the + or virtual table methods. - - The object instance to return the string representation for. + + The virtual table module that is to be responsible for the virtual table + being declared. - - The format provider to use -OR- null if the current format provider for - the thread should be used instead. + + The string containing the SQL statement describing the virtual table to + be declared. + + + Upon success, the contents of this parameter are undefined. Upon failure, + it should contain an appropriate error message. - The string representation for the object instance -OR- null if the - object instance is also null. + A standard SQLite return code. - + - Attempts to convert an arbitrary object to the Boolean data type. - Null object values are converted to false. Throws an exception - upon failure. + Calls the native SQLite core library in order to declare a virtual table + function in response to a call into the + or virtual table methods. - - The object value to convert. + + The virtual table module that is to be responsible for the virtual table + function being declared. - - The format provider to use. + + The number of arguments to the function being declared. - - If non-zero, a string value will be converted using the - - method; otherwise, the - method will be used. + + The name of the function being declared. + + + Upon success, the contents of this parameter are undefined. Upon failure, + it should contain an appropriate error message. - The converted boolean value. + A standard SQLite return code. - - - Convert a value to true or false. - - A string or number representing true or false - - - - - Convert a string to true or false. - - A string representing true or false - - - "yes", "no", "y", "n", "0", "1", "on", "off" as well as Boolean.FalseString and Boolean.TrueString will all be - converted to a proper boolean value. - - - + - Converts a SQLiteType to a .NET Type object + Builds an error message string fragment containing the + defined values of the + enumeration. - The SQLiteType to convert - Returns a .NET Type object + + The built string fragment. + - + - For a given intrinsic type, return a DbType + Builds an error message string fragment containing the + defined values of the + enumeration. - The native type to convert - The corresponding (closest match) DbType + + The built string fragment. + - + - Returns the ColumnSize for the given DbType + Returns the current and/or highwater values for the specified + database status parameter. - The DbType to get the size of - + + The database status parameter to query. + + + Non-zero to reset the highwater value to the current value. + + + If applicable, receives the current value. + + + If applicable, receives the highwater value. + + + A standard SQLite return code. + - + - Determines the default database type name to be used when a - per-connection value is not available. + Change a configuration option value for the database. + connection. - - The connection context for type mappings, if any. + + The database configuration option to change. + + + The new value for the specified configuration option. - The default database type name to use. + A standard SQLite return code. - + - If applicable, issues a trace log message warning about falling back to - the default database type name. + Enables or disables extension loading by SQLite. - - The database value type. - - - The flags associated with the parent connection object. - - - The textual name of the database type. + + True to enable loading of extensions, false to disable. - + - If applicable, issues a trace log message warning about falling back to - the default database value type. + Loads a SQLite extension library from the named file. - - The textual name of the database type. - - - The flags associated with the parent connection object. + + The name of the dynamic link library file containing the extension. - - The database value type. + + The name of the exported function used to initialize the extension. + If null, the default "sqlite3_extension_init" will be used. - - - For a given database value type, return the "closest-match" textual database type name. - - The connection context for custom type mappings, if any. - The database value type. - The flags associated with the parent connection object. - The type name or an empty string if it cannot be determined. + + Enables or disables extended result codes returned by SQLite - + + Gets the last SQLite error code + + + Gets the last SQLite extended error code + + + Add a log message via the SQLite sqlite3_log interface. + + + Add a log message via the SQLite sqlite3_log interface. + + - Convert a DbType to a Type + Allows the setting of a logging callback invoked by SQLite when a + log event occurs. Only one callback may be set. If NULL is passed, + the logging callback is unregistered. - The DbType to convert from - The closest-match .NET type + The callback function to invoke. + Returns a result code - + - For a given type, return the closest-match SQLite TypeAffinity, which only understands a very limited subset of types. + Appends an error message and an appropriate line-ending to a + instance. This is useful because the .NET Compact Framework has a slightly different set + of supported methods for the class. - The type to evaluate - The SQLite type affinity for that type. + + The instance to append to. + + + The message to append. It will be followed by an appropriate line-ending. + - + - Builds and returns a map containing the database column types - recognized by this provider. + This method attempts to cause the SQLite native library to invalidate + its function pointers that refer to this instance. This is necessary + to prevent calls from native code into delegates that may have been + garbage collected. Normally, these types of issues can only arise for + connections that are added to the pool; howver, it is good practice to + unconditionally invalidate function pointers that may refer to objects + being disposed. + + Non-zero to also invalidate global function pointers (i.e. those that + are not directly associated with this connection on the native side). + + + Non-zero if this method is being executed within a context where it can + throw an exception in the event of failure; otherwise, zero. + - A map containing the database column types recognized by this - provider. + Non-zero if this method was successful; otherwise, zero. - + - Determines if a database type is considered to be a string. + This method attempts to free the cached database name used with the + method. - - The database type to check. + + Non-zero if this method is being executed within a context where it can + throw an exception in the event of failure; otherwise, zero. - Non-zero if the database type is considered to be a string, zero - otherwise. + Non-zero if this method was successful; otherwise, zero. - + - Determines and returns the runtime configuration setting string that - should be used in place of the specified object value. + Creates a new SQLite backup object based on the provided destination + database connection. The source database connection is the one + associated with this object. The source and destination database + connections cannot be the same. - - The object value to convert to a string. - - - Either the string to use in place of the object value -OR- null if it - cannot be determined. - + The destination database connection. + The destination database name. + The source database name. + The newly created backup object. - + - Determines the default value to be used when a - per-connection value is not available. + Copies up to N pages from the source database to the destination + database associated with the specified backup object. - - The connection context for type mappings, if any. + The backup object to use. + + The number of pages to copy, negative to copy all remaining pages. + + + Set to true if the operation needs to be retried due to database + locking issues; otherwise, set to false. - The default value to use. + True if there are more pages to be copied, false otherwise. - + - Determines if the specified textual value appears to be a - value. + Returns the number of pages remaining to be copied from the source + database to the destination database associated with the specified + backup object. - - The textual value to inspect. - - - Non-zero if the text looks like a value, - zero otherwise. - + The backup object to check. + The number of pages remaining to be copied. - + - Determines if the specified textual value appears to be an - value. + Returns the total number of pages in the source database associated + with the specified backup object. - - The textual value to inspect. - - - Non-zero if the text looks like an value, - zero otherwise. - + The backup object to check. + The total number of pages in the source database. - + - Determines if the specified textual value appears to be a - value. + Destroys the backup object, rolling back any backup that may be in + progess. + + The backup object to destroy. + + + + Determines if the SQLite core library has been initialized for the + current process. - - The textual value to inspect. - - Non-zero if the text looks like a value, - zero otherwise. + A boolean indicating whether or not the SQLite core library has been + initialized for the current process. - + - Determines if the specified textual value appears to be a - value. + Determines if the SQLite core library has been initialized for the + current process. - - The object instance configured with - the chosen format. - - - The textual value to inspect. - - Non-zero if the text looks like a in the - configured format, zero otherwise. + A boolean indicating whether or not the SQLite core library has been + initialized for the current process. - + - For a given textual database type name, return the "closest-match" database type. - This method is called during query result processing; therefore, its performance - is critical. + Helper function to retrieve a column of data from an active statement. - The connection context for custom type mappings, if any. - The textual name of the database type to match. - The flags associated with the parent connection object. - The .NET DBType the text evaluates to. + The statement being step()'d through + The flags associated with the connection. + The column index to retrieve + The type of data contained in the column. If Uninitialized, this function will retrieve the datatype information. + Returns the data in the column - + - The error code used for logging exceptions caught in user-provided - code. + Alternate SQLite3 object, overriding many text behaviors to support UTF-16 (Unicode) - + - Sets the status of the memory usage tracking subsystem in the SQLite core library. By default, this is enabled. - If this is disabled, memory usage tracking will not be performed. This is not really a per-connection value, it is - global to the process. + Constructs the object used to interact with the SQLite core library + using the UTF-8 text encoding. - Non-zero to enable memory usage tracking, zero otherwise. - A standard SQLite return code (i.e. zero for success and non-zero for failure). + + The DateTime format to be used when converting string values to a + DateTime and binding DateTime parameters. + + + The to be used when creating DateTime + values. + + + The format string to be used when parsing and formatting DateTime + values. + + + The native handle to be associated with the database connection. + + + The fully qualified file name associated with . + + + Non-zero if the newly created object instance will need to dispose + of when it is no longer needed. + - + - Attempts to free as much heap memory as possible for the database connection. + Overrides SQLiteConvert.ToString() to marshal UTF-16 strings instead of UTF-8 - A standard SQLite return code (i.e. zero for success and non-zero for failure). + A pointer to a UTF-16 string + The length (IN BYTES) of the string + A .NET string - + - Shutdown the SQLite engine so that it can be restarted with different config options. - We depend on auto initialization to recover. + Represents a single SQL backup in SQLite. - + - Determines if the associated native connection handle is open. + The underlying SQLite object this backup is bound to. - - Non-zero if a database connection is open. - - + - Opens a database. + The actual backup handle. - - Implementers should call SQLiteFunction.BindFunctions() and save the array after opening a connection - to bind all attributed user-defined functions and collating sequences to the new connection. - - The filename of the database to open. SQLite automatically creates it if it doesn't exist. - The flags associated with the parent connection object - The open flags to use when creating the connection - The maximum size of the pool for the given filename - If true, the connection can be pulled from the connection pool - + - Closes the currently-open database. + The destination database for the backup. - - After the database has been closed implemeters should call SQLiteFunction.UnbindFunctions() to deallocate all interop allocated - memory associated with the user-defined functions and collating sequences tied to the closed connection. - - Non-zero if the operation is allowed to throw exceptions, zero otherwise. - + - Sets the busy timeout on the connection. SQLiteCommand will call this before executing any command. + The destination database name for the backup. - The number of milliseconds to wait before returning SQLITE_BUSY + + + + The source database for the backup. + + + + + The source database name for the backup. + + + + + The last result from the StepBackup method of the SQLite3 class. + This is used to determine if the call to the FinishBackup method of + the SQLite3 class should throw an exception when it receives a non-Ok + return code from the core SQLite library. + + + + + Initializes the backup. + + The base SQLite object. + The backup handle. + The destination database for the backup. + The destination database name for the backup. + The source database for the backup. + The source database name for the backup. + + + + Disposes and finalizes the backup. + + + + + This internal class provides the foundation of SQLite support. It defines all the abstract members needed to implement + a SQLite data provider, and inherits from SQLiteConvert which allows for simple translations of string to and from SQLite. + + + + + The error code used for logging exceptions caught in user-provided + code. + + + + + Returns a string representing the active version of SQLite + + + + + Returns an integer representing the active version of SQLite + + + + + Returns non-zero if this connection to the database is read-only. + + + + + Returns the rowid of the most recent successful INSERT into the database from this connection. + + + + + Returns the number of changes the last executing insert/update caused. + + + + + Returns the amount of memory (in bytes) currently in use by the SQLite core library. This is not really a per-connection + value, it is global to the process. + + + + + Returns the maximum amount of memory (in bytes) used by the SQLite core library since the high-water mark was last reset. + This is not really a per-connection value, it is global to the process. + + + + + Returns non-zero if the underlying native connection handle is owned by this instance. + + + + + Returns the logical list of functions associated with this connection. + + + + + Sets the status of the memory usage tracking subsystem in the SQLite core library. By default, this is enabled. + If this is disabled, memory usage tracking will not be performed. This is not really a per-connection value, it is + global to the process. + + Non-zero to enable memory usage tracking, zero otherwise. + A standard SQLite return code (i.e. zero for success and non-zero for failure). + + + + Attempts to free as much heap memory as possible for the database connection. + + A standard SQLite return code (i.e. zero for success and non-zero for failure). + + + + Shutdown the SQLite engine so that it can be restarted with different config options. + We depend on auto initialization to recover. + + + + + Determines if the associated native connection handle is open. + + + Non-zero if a database connection is open. + + + + + Returns the fully qualified path and file name for the currently open + database, if any. + + + The name of the attached database to query. + + + The fully qualified path and file name for the currently open database, + if any. + + + + + Opens a database. + + + Implementers should call SQLiteFunction.BindFunctions() and save the array after opening a connection + to bind all attributed user-defined functions and collating sequences to the new connection. + + The filename of the database to open. SQLite automatically creates it if it doesn't exist. + The name of the VFS to use -OR- null to use the default VFS. + The flags associated with the parent connection object + The open flags to use when creating the connection + The maximum size of the pool for the given filename + If true, the connection can be pulled from the connection pool + + + + Closes the currently-open database. + + + After the database has been closed implemeters should call SQLiteFunction.UnbindFunctions() to deallocate all interop allocated + memory associated with the user-defined functions and collating sequences tied to the closed connection. + + Non-zero if connection is being disposed, zero otherwise. + + + + Sets the busy timeout on the connection. SQLiteCommand will call this before executing any command. + + The number of milliseconds to wait before returning SQLITE_BUSY @@ -820,6 +953,13 @@ The SQLiteStatement to step through True if a row was returned, False if not. + + + Returns non-zero if the specified statement is read-only in nature. + + The statement to check. + True if the outer query is read-only. + Resets a prepared statement so it can be executed again. If the error returned is SQLITE_SCHEMA, @@ -836,7 +976,7 @@ - This function binds a user-defined functions to the connection. + This function binds a user-defined function to the connection. The object instance containing @@ -850,6 +990,19 @@ The flags associated with the parent connection object. + + + This function unbinds a user-defined function from the connection. + + + The object instance containing + the metadata for the function to be unbound. + + + The flags associated with the parent connection object. + + Non-zero if the function was unbound. + Calls the native SQLite core library in order to create a disposable @@ -859,7 +1012,7 @@ The module object to be used when creating the native disposable module. - The flags for the associated object instance. + The flags for the associated object instance. @@ -868,18 +1021,18 @@ associated with a module containing the implementation of a virtual table. - The module object previously passed to the + The module object previously passed to the method. - The flags for the associated object instance. + The flags for the associated object instance. Calls the native SQLite core library in order to declare a virtual table - in response to a call into the - or virtual table methods. + in response to a call into the + or virtual table methods. The virtual table module that is to be responsible for the virtual table @@ -900,8 +1053,8 @@ Calls the native SQLite core library in order to declare a virtual table - function in response to a call into the - or virtual table methods. + function in response to a call into the + or virtual table methods. The virtual table module that is to be responsible for the virtual table @@ -921,9 +1074,43 @@ A standard SQLite return code. + + + Returns the current and/or highwater values for the specified database status parameter. + + + The database status parameter to query. + + + Non-zero to reset the highwater value to the current value. + + + If applicable, receives the current value. + + + If applicable, receives the highwater value. + + + A standard SQLite return code. + + + + + Change a configuration option value for the database. + + + The database configuration option to change. + + + The new value for the specified configuration option. + + + A standard SQLite return code. + + - Enables or disabled extension loading by SQLite. + Enables or disables extension loading by SQLite. True to enable loading of extensions, false to disable. @@ -943,7 +1130,7 @@ - Enables or disabled extened result codes returned by SQLite + Enables or disables extened result codes returned by SQLite true to enable extended result codes, false to disable. @@ -981,6 +1168,13 @@ zero otherwise. + + + Returns non-zero if the given database connection is in autocommit mode. + Autocommit mode is on by default. Autocommit mode is disabled by a BEGIN + statement. Autocommit mode is re-enabled by a COMMIT or ROLLBACK. + + Creates a new SQLite backup object based on the provided destination @@ -1042,768 +1236,801 @@ The SQLite return code. The error message or null if it cannot be found. - - - Returns the error message for the specified SQLite return code using - the sqlite3_errstr() function, falling back to the internal lookup - table if necessary. - - The SQLite return code. - The error message or null if it cannot be found. + + + + - + - Returns a string representing the active version of SQLite + Creates temporary tables on the connection so schema information can be queried. + + The connection upon which to build the schema tables. + - + - Returns an integer representing the active version of SQLite + The extra behavioral flags that can be applied to a connection. - + - Returns the rowid of the most recent successful INSERT into the database from this connection. + No extra flags. - + - Returns the number of changes the last executing insert/update caused. + Enable logging of all SQL statements to be prepared. - + - Returns the amount of memory (in bytes) currently in use by the SQLite core library. This is not really a per-connection - value, it is global to the process. + Enable logging of all bound parameter types and raw values. - + - Returns the maximum amount of memory (in bytes) used by the SQLite core library since the high-water mark was last reset. - This is not really a per-connection value, it is global to the process. + Enable logging of all bound parameter strongly typed values. - + - Returns non-zero if the underlying native connection handle is owned by this instance. + Enable logging of all exceptions caught from user-provided + managed code called from native code via delegates. - + - Returns non-zero if the given database connection is in autocommit mode. - Autocommit mode is on by default. Autocommit mode is disabled by a BEGIN - statement. Autocommit mode is re-enabled by a COMMIT or ROLLBACK. + Enable logging of backup API errors. - + - The opaque pointer returned to us by the sqlite provider + Skip adding the extension functions provided by the native + interop assembly. - + - The user-defined functions registered on this connection + When binding parameter values with the + type, use the interop method that accepts an + value. - + - The modules created using this connection. + When binding parameter values, always bind them as though they were + plain text (i.e. no numeric, date/time, or other conversions should + be attempted). - + - Constructs the object used to interact with the SQLite core library - using the UTF-8 text encoding. + When returning column values, always return them as though they were + plain text (i.e. no numeric, date/time, or other conversions should + be attempted). - - The DateTime format to be used when converting string values to a - DateTime and binding DateTime parameters. - - - The to be used when creating DateTime - values. - - - The format string to be used when parsing and formatting DateTime - values. - - - The native handle to be associated with the database connection. - - - The fully qualified file name associated with . - - - Non-zero if the newly created object instance will need to dispose - of when it is no longer needed. - - + - This method attempts to dispose of all the derived - object instances currently associated with the native database connection. + Prevent this object instance from + loading extensions. - + - Attempts to interrupt the query currently executing on the associated - native database connection. + Prevent this object instance from + creating virtual table modules. - + - This function binds a user-defined function to the connection. + Skip binding any functions provided by other managed assemblies when + opening the connection. - - The object instance containing - the metadata for the function to be bound. - - - The object instance that implements the - function to be bound. - - - The flags associated with the parent connection object. - - + - Attempts to free as much heap memory as possible for the database connection. + Skip setting the logging related properties of the + object instance that was passed to + the method. - A standard SQLite return code (i.e. zero for success and non-zero for failure). - + - Attempts to free N bytes of heap memory by deallocating non-essential memory - allocations held by the database library. Memory used to cache database pages - to improve performance is an example of non-essential memory. This is a no-op - returning zero if the SQLite core library was not compiled with the compile-time - option SQLITE_ENABLE_MEMORY_MANAGEMENT. Optionally, attempts to reset and/or - compact the Win32 native heap, if applicable. + Enable logging of all virtual table module errors seen by the + method. - - The requested number of bytes to free. - - - Non-zero to attempt a heap reset. - - - Non-zero to attempt heap compaction. - - - The number of bytes actually freed. This value may be zero. - - - This value will be non-zero if the heap reset was successful. - - - The size of the largest committed free block in the heap, in bytes. - This value will be zero unless heap compaction is enabled. - - - A standard SQLite return code (i.e. zero for success and non-zero - for failure). - - + - Shutdown the SQLite engine so that it can be restarted with different - configuration options. We depend on auto initialization to recover. + Enable logging of certain virtual table module exceptions that cannot + be easily discovered via other means. - Returns a standard SQLite result code. - + - Shutdown the SQLite engine so that it can be restarted with different - configuration options. We depend on auto initialization to recover. + Enable tracing of potentially important [non-fatal] error conditions + that cannot be easily reported through other means. - - Non-zero to reset the database and temporary directories to their - default values, which should be null for both. This parameter has no - effect on non-Windows operating systems. - - Returns a standard SQLite result code. - + - Determines if the associated native connection handle is open. + When binding parameter values, always use the invariant culture when + converting their values from strings. - - Non-zero if the associated native connection handle is open. - - + - Calls the native SQLite core library in order to create a disposable - module containing the implementation of a virtual table. + When binding parameter values, always use the invariant culture when + converting their values to strings. - - The module object to be used when creating the native disposable module. - - - The flags for the associated object instance. - - + - Calls the native SQLite core library in order to cleanup the resources - associated with a module containing the implementation of a virtual table. + Disable using the connection pool by default. If the "Pooling" + connection string property is specified, its value will override + this flag. The precise outcome of combining this flag with the + flag is unspecified; however, + one of the flags will be in effect. - - The module object previously passed to the - method. - - - The flags for the associated object instance. - - + - Calls the native SQLite core library in order to declare a virtual table - in response to a call into the - or virtual table methods. + Enable using the connection pool by default. If the "Pooling" + connection string property is specified, its value will override + this flag. The precise outcome of combining this flag with the + flag is unspecified; however, + one of the flags will be in effect. - - The virtual table module that is to be responsible for the virtual table - being declared. - - - The string containing the SQL statement describing the virtual table to - be declared. - - - Upon success, the contents of this parameter are undefined. Upon failure, - it should contain an appropriate error message. - - - A standard SQLite return code. - - + - Calls the native SQLite core library in order to declare a virtual table - function in response to a call into the - or virtual table methods. + Enable using per-connection mappings between type names and + values. Also see the + , + , and + methods. These + per-connection mappings, when present, override the corresponding + global mappings. - - The virtual table module that is to be responsible for the virtual table - function being declared. - - - The number of arguments to the function being declared. - - - The name of the function being declared. - - - Upon success, the contents of this parameter are undefined. Upon failure, - it should contain an appropriate error message. - - - A standard SQLite return code. - - + - Enables or disabled extension loading by SQLite. + Disable using global mappings between type names and + values. This may be useful in some very narrow + cases; however, if there are no per-connection type mappings, the + fallback defaults will be used for both type names and their + associated values. Therefore, use of this flag + is not recommended. - - True to enable loading of extensions, false to disable. - - + - Loads a SQLite extension library from the named file. + When the property is used, it + should return non-zero if there were ever any rows in the associated + result sets. - - The name of the dynamic link library file containing the extension. - - - The name of the exported function used to initialize the extension. - If null, the default "sqlite3_extension_init" will be used. - - - - Enables or disabled extended result codes returned by SQLite - - Gets the last SQLite error code - - - Gets the last SQLite extended error code - - - Add a log message via the SQLite sqlite3_log interface. - - - Add a log message via the SQLite sqlite3_log interface. + + + Enable "strict" transaction enlistment semantics. Setting this flag + will cause an exception to be thrown if an attempt is made to enlist + in a transaction with an unavailable or unsupported isolation level. + In the future, more extensive checks may be enabled by this flag as + well. + - + - Allows the setting of a logging callback invoked by SQLite when a - log event occurs. Only one callback may be set. If NULL is passed, - the logging callback is unregistered. + Enable mapping of unsupported transaction isolation levels to the + closest supported transaction isolation level. - The callback function to invoke. - Returns a result code - + - Creates a new SQLite backup object based on the provided destination - database connection. The source database connection is the one - associated with this object. The source and destination database - connections cannot be the same. + When returning column values, attempt to detect the affinity of + textual values by checking if they fully conform to those of the + , + , + , + or types. - The destination database connection. - The destination database name. - The source database name. - The newly created backup object. - + - Copies up to N pages from the source database to the destination - database associated with the specified backup object. + When returning column values, attempt to detect the type of + string values by checking if they fully conform to those of + the , + , + , + or types. - The backup object to use. - - The number of pages to copy, negative to copy all remaining pages. - - - Set to true if the operation needs to be retried due to database - locking issues; otherwise, set to false. - - - True if there are more pages to be copied, false otherwise. - - + - Returns the number of pages remaining to be copied from the source - database to the destination database associated with the specified - backup object. + Skip querying runtime configuration settings for use by the + class, including the default + value and default database type name. + NOTE: If the + and/or + properties are not set explicitly nor set via their connection + string properties and repeated calls to determine these runtime + configuration settings are seen to be a problem, this flag + should be set. - The backup object to check. - The number of pages remaining to be copied. - + - Returns the total number of pages in the source database associated - with the specified backup object. + When binding parameter values with the + type, take their into account as + well as that of the associated . - The backup object to check. - The total number of pages in the source database. - + - Destroys the backup object, rolling back any backup that may be in - progess. + If an exception is caught when raising the + event, the transaction + should be rolled back. If this is not specified, the transaction + will continue the commit process instead. - The backup object to destroy. - + - Determines if the SQLite core library has been initialized for the - current process. + If an exception is caught when raising the + event, the action should + should be denied. If this is not specified, the action will be + allowed instead. - - A boolean indicating whether or not the SQLite core library has been - initialized for the current process. - - + - Determines if the SQLite core library has been initialized for the - current process. + If an exception is caught when raising the + event, the operation + should be interrupted. If this is not specified, the operation + will simply continue. - - A boolean indicating whether or not the SQLite core library has been - initialized for the current process. - - + - Helper function to retrieve a column of data from an active statement. + Attempt to unbind all functions provided by other managed assemblies + when closing the connection. - The statement being step()'d through - The flags associated with the connection. - The column index to retrieve - The type of data contained in the column. If Uninitialized, this function will retrieve the datatype information. - Returns the data in the column - + - Returns non-zero if the underlying native connection handle is owned - by this instance. + When returning column values as a , skip + verifying their affinity. - + - Alternate SQLite3 object, overriding many text behaviors to support UTF-16 (Unicode) + Enable using per-connection mappings between type names and + values. Also see the + , + , and + methods. - + - Constructs the object used to interact with the SQLite core library - using the UTF-8 text encoding. + Enable using per-connection mappings between type names and + values. Also see the + , + , and + methods. - - The DateTime format to be used when converting string values to a - DateTime and binding DateTime parameters. - - - The to be used when creating DateTime - values. - - - The format string to be used when parsing and formatting DateTime - values. - - - The native handle to be associated with the database connection. - - - The fully qualified file name associated with . - - - Non-zero if the newly created object instance will need to dispose - of when it is no longer needed. - - + - Overrides SQLiteConvert.ToString() to marshal UTF-16 strings instead of UTF-8 + If the database type name has not been explicitly set for the + parameter specified, fallback to using the parameter name. - A pointer to a UTF-16 string - The length (IN BYTES) of the string - A .NET string - + - Represents a single SQL backup in SQLite. + If the database type name has not been explicitly set for the + parameter specified, fallback to using the database type name + associated with the value. - + - The underlying SQLite object this backup is bound to. + When returning column values, skip verifying their affinity. - + - The actual backup handle. + Allow transactions to be nested. The outermost transaction still + controls whether or not any changes are ultimately committed or + rolled back. All non-outermost transactions are implemented using + the SAVEPOINT construct. - + - The destination database for the backup. + When binding parameter values, always bind + values as though they were plain text (i.e. not , + which is the legacy behavior). - + - The destination database name for the backup. + When returning column values, always return + values as though they were plain text (i.e. not , + which is the legacy behavior). - + - The source database for the backup. + When binding parameter values, always use + the invariant culture when converting their values to strings. - + - The source database name for the backup. + When returning column values, always use + the invariant culture when converting their values from strings. - + - The last result from the StepBackup method of the SQLite3 class. - This is used to determine if the call to the FinishBackup method of - the SQLite3 class should throw an exception when it receives a non-Ok - return code from the core SQLite library. + EXPERIMENTAL -- + Enable waiting for the enlistment to be reset prior to attempting + to create a new enlistment. This may be necessary due to the + semantics used by distributed transactions, which complete + asynchronously. - + - Initializes the backup. + When returning column values, always use + the invariant culture when converting their values from strings. - The base SQLite object. - The backup handle. - The destination database for the backup. - The destination database name for the backup. - The source database for the backup. - The source database name for the backup. - + - Disposes and finalizes the backup. + When returning column values, always use + the invariant culture when converting their values from strings. - + - + EXPERIMENTAL -- + Enable strict conformance to the ADO.NET standard, e.g. use of + thrown exceptions to indicate common error conditions. - + - Creates temporary tables on the connection so schema information can be queried. + EXPERIMENTAL -- + When opening a connection, attempt to hide the password from the + connection string, etc. Given the memory architecture of the CLR, + (and P/Invoke) this is not 100% reliable and should not be relied + upon for security critical uses or applications. - - The connection upon which to build the schema tables. - - + - The extra behavioral flags that can be applied to a connection. + When binding parameter values or returning column values, always + treat them as though they were plain text (i.e. no numeric, + date/time, or other conversions should be attempted). - + - No extra flags. + When binding parameter values, always use the invariant culture when + converting their values to strings or from strings. - + - Enable logging of all SQL statements to be prepared. + When binding parameter values or returning column values, always + treat them as though they were plain text (i.e. no numeric, + date/time, or other conversions should be attempted) and always + use the invariant culture when converting their values to strings. - + - Enable logging of all bound parameter types and raw values. + When binding parameter values or returning column values, always + treat them as though they were plain text (i.e. no numeric, + date/time, or other conversions should be attempted) and always + use the invariant culture when converting their values to strings + or from strings. - + - Enable logging of all bound parameter strongly typed values. + Enables use of all per-connection value handling callbacks. - + - Enable logging of all exceptions caught from user-provided - managed code called from native code via delegates. + Enables use of all applicable + properties as fallbacks for the database type name. - + - Enable logging of backup API errors. + Enable all logging. - + - Skip adding the extension functions provided by the native - interop assembly. + The default logging related flags for new connections. - + - When binding parameter values with the - type, use the interop method that accepts an - value. + The default extra flags for new connections. - + - When binding parameter values, always bind them as though they were - plain text (i.e. no numeric, date/time, or other conversions should - be attempted). + The default extra flags for new connections with all logging enabled. - + - When returning column values, always return them as though they were - plain text (i.e. no numeric, date/time, or other conversions should - be attempted). + These are the supported status parameters for use with the native + SQLite library. - + - Prevent this object instance from - loading extensions. + This parameter returns the number of lookaside memory slots + currently checked out. - + - Prevent this object instance from - creating virtual table modules. + This parameter returns the approximate number of bytes of + heap memory used by all pager caches associated with the + database connection. The highwater mark associated with + SQLITE_DBSTATUS_CACHE_USED is always 0. - + - Skip binding any functions provided by other managed assemblies when - opening the connection. + This parameter returns the approximate number of bytes of + heap memory used to store the schema for all databases + associated with the connection - main, temp, and any ATTACH-ed + databases. The full amount of memory used by the schemas is + reported, even if the schema memory is shared with other + database connections due to shared cache mode being enabled. + The highwater mark associated with SQLITE_DBSTATUS_SCHEMA_USED + is always 0. - + - Skip setting the logging related properties of the - object instance that was passed to - the method. + This parameter returns the number malloc attempts that might + have been satisfied using lookaside memory but failed due to + all lookaside memory already being in use. Only the high-water + value is meaningful; the current value is always zero. - + - Enable logging of all virtual table module errors seen by the - method. + This parameter returns the number malloc attempts that were + satisfied using lookaside memory. Only the high-water value + is meaningful; the current value is always zero. - + - Enable logging of certain virtual table module exceptions that cannot - be easily discovered via other means. + This parameter returns the number malloc attempts that might + have been satisfied using lookaside memory but failed due to + the amount of memory requested being larger than the lookaside + slot size. Only the high-water value is meaningful; the current + value is always zero. - + - Enable tracing of potentially important [non-fatal] error conditions - that cannot be easily reported through other means. + This parameter returns the number malloc attempts that might + have been satisfied using lookaside memory but failed due to + the amount of memory requested being larger than the lookaside + slot size. Only the high-water value is meaningful; the current + value is always zero. - + - When binding parameter values, always use the invariant culture when - converting their values from strings. + This parameter returns the number of pager cache hits that + have occurred. The highwater mark associated with + SQLITE_DBSTATUS_CACHE_HIT is always 0. - + - When binding parameter values, always use the invariant culture when - converting their values to strings. + This parameter returns the number of pager cache misses that + have occurred. The highwater mark associated with + SQLITE_DBSTATUS_CACHE_MISS is always 0. - + - Disable using the connection pool by default. If the "Pooling" - connection string property is specified, its value will override - this flag. The precise outcome of combining this flag with the - flag is unspecified; however, - one of the flags will be in effect. + This parameter returns the number of dirty cache entries that + have been written to disk. Specifically, the number of pages + written to the wal file in wal mode databases, or the number + of pages written to the database file in rollback mode + databases. Any pages written as part of transaction rollback + or database recovery operations are not included. If an IO or + other error occurs while writing a page to disk, the effect + on subsequent SQLITE_DBSTATUS_CACHE_WRITE requests is + undefined. The highwater mark associated with + SQLITE_DBSTATUS_CACHE_WRITE is always 0. - + - Enable using the connection pool by default. If the "Pooling" - connection string property is specified, its value will override - this flag. The precise outcome of combining this flag with the - flag is unspecified; however, - one of the flags will be in effect. + This parameter returns zero for the current value if and only + if all foreign key constraints (deferred or immediate) have + been resolved. The highwater mark is always 0. - + - Enable using per-connection mappings between type names and - values. Also see the - , - , and - methods. These - per-connection mappings, when present, override the corresponding - global mappings. + This parameter is similar to DBSTATUS_CACHE_USED, except that + if a pager cache is shared between two or more connections the + bytes of heap memory used by that pager cache is divided evenly + between the attached connections. In other words, if none of + the pager caches associated with the database connection are + shared, this request returns the same value as DBSTATUS_CACHE_USED. + Or, if one or more or the pager caches are shared, the value + returned by this call will be smaller than that returned by + DBSTATUS_CACHE_USED. The highwater mark associated with + SQLITE_DBSTATUS_CACHE_USED_SHARED is always 0. - + - Disable using global mappings between type names and - values. This may be useful in some very narrow - cases; however, if there are no per-connection type mappings, the - fallback defaults will be used for both type names and their - associated values. Therefore, use of this flag - is not recommended. + These are the supported configuration verbs for use with the native + SQLite library. They are used with the + method. - + - When the property is used, it - should return non-zero if there were ever any rows in the associated - result sets. + This value represents an unknown (or invalid) option, do not use it. - + - Enable "strict" transaction enlistment semantics. Setting this flag - will cause an exception to be thrown if an attempt is made to enlist - in a transaction with an unavailable or unsupported isolation level. - In the future, more extensive checks may be enabled by this flag as - well. + This option is used to change the name of the "main" database + schema. The sole argument is a pointer to a constant UTF8 string + which will become the new schema name in place of "main". - + - Enable mapping of unsupported transaction isolation levels to the - closest supported transaction isolation level. + This option is used to configure the lookaside memory allocator. + The value must be an array with three elements. The second element + must be an containing the size of each buffer + slot. The third element must be an containing + the number of slots. The first element must be an + that points to a native memory buffer of bytes equal to or greater + than the product of the second and third element values. - + - When returning column values, attempt to detect the affinity of - textual values by checking if they fully conform to those of the - , - , - , - or types. + This option is used to enable or disable the enforcement of + foreign key constraints. - + - When returning column values, attempt to detect the type of - string values by checking if they fully conform to those of - the , - , - , - or types. + This option is used to enable or disable triggers. - + - Skip querying runtime configuration settings for use by the - class, including the default - value and default database type name. - NOTE: If the - and/or - properties are not set explicitly nor set via their connection - string properties and repeated calls to determine these runtime - configuration settings are seen to be a problem, this flag - should be set. + This option is used to enable or disable the two-argument version + of the fts3_tokenizer() function which is part of the FTS3 full-text + search engine extension. - + - When binding parameter values or returning column values, always - treat them as though they were plain text (i.e. no numeric, - date/time, or other conversions should be attempted). + This option is used to enable or disable the loading of extensions. - + - When binding parameter values, always use the invariant culture when - converting their values to strings or from strings. + This option is used to enable or disable the automatic checkpointing + when a WAL database is closed. - + - When binding parameter values or returning column values, always - treat them as though they were plain text (i.e. no numeric, - date/time, or other conversions should be attempted) and always - use the invariant culture when converting their values to strings. + This option is used to enable or disable the query planner stability + guarantee (QPSG). - + - When binding parameter values or returning column values, always - treat them as though they were plain text (i.e. no numeric, - date/time, or other conversions should be attempted) and always - use the invariant culture when converting their values to strings - or from strings. + This option is used to enable or disable the extra EXPLAIN QUERY PLAN + output for trigger programs. - + - Enable all logging. + This option is used as part of the process to reset a database back + to an empty state. Because resetting a database is destructive and + irreversible, the process requires the use of this obscure flag and + multiple steps to help ensure that it does not happen by accident. - + - The default extra flags for new connections. + These constants are used with the sqlite3_trace_v2() API and the + callbacks registered by it. - + - The default extra flags for new connections with all logging enabled. + Represents a single SQL blob in SQLite. + + + + + The underlying SQLite object this blob is bound to. + + + + + The actual blob handle. + + + + + Initializes the blob. + + The base SQLite object. + The blob handle. + + + + Creates a object. This will not work + for tables that were created WITHOUT ROWID -OR- if the query + does not include the "rowid" column or one of its aliases -OR- + if the was not created with the + flag. + + + The instance with a result set + containing the desired blob column. + + + The index of the blob column. + + + Non-zero to open the blob object for read-only access. + + + The newly created instance -OR- null + if an error occurs. + + + + + Creates a object. This will not work + for tables that were created WITHOUT ROWID. + + + The connection to use when opening the blob object. + + + The name of the database containing the blob object. + + + The name of the table containing the blob object. + + + The name of the column containing the blob object. + + + The integer identifier for the row associated with the desired + blob object. + + + Non-zero to open the blob object for read-only access. + + + The newly created instance -OR- null + if an error occurs. + + + + + Throws an exception if the blob object does not appear to be open. + + + + + Throws an exception if an invalid read/write parameter is detected. + + + When reading, this array will be populated with the bytes read from + the underlying database blob. When writing, this array contains new + values for the specified portion of the underlying database blob. + + + The number of bytes to read or write. + + + The byte offset, relative to the start of the underlying database + blob, where the read or write operation will begin. + + + + + Retargets this object to an underlying database blob for a + different row; the database, table, and column remain exactly + the same. If this operation fails for any reason, this blob + object is automatically disposed. + + + The integer identifier for the new row. + + + + + Queries the total number of bytes for the underlying database blob. + + + The total number of bytes for the underlying database blob. + + + + + Reads data from the underlying database blob. + + + This array will be populated with the bytes read from the + underlying database blob. + + + The number of bytes to read. + + + The byte offset, relative to the start of the underlying + database blob, where the read operation will begin. + + + + + Writes data into the underlying database blob. + + + This array contains the new values for the specified portion of + the underlying database blob. + + + The number of bytes to write. + + + The byte offset, relative to the start of the underlying + database blob, where the write operation will begin. + + + + + Closes the blob, freeing the associated resources. + + + + + Disposes and finalizes the blob. + + + + + The destructor. @@ -1815,8 +2042,8 @@ The default connection string to be used when creating a temporary connection to execute a command via the static - or - + or + methods. @@ -1945,6 +2172,21 @@ Not implemented + + + The SQL command text associated with the command + + + + + The amount of time to wait for the connection to become available before erroring out + + + + + The type of the command. SQLite only supports CommandType.Text + + Forwards to the local CreateParameter() function @@ -1957,6 +2199,44 @@ + + + The connection associated with this command + + + + + Forwards to the local Connection property + + + + + Returns the SQLiteParameterCollection for the given command + + + + + Forwards to the local Parameters property + + + + + The transaction associated with this command. SQLite only supports one transaction per connection, so this property forwards to the + command's underlying connection. + + + + + Forwards to the local Transaction property + + + + + Verifies that all SQL queries associated with the current command text + can be successfully compiled. A will be + raised if any errors occur. + + This function ensures there are no active readers, that we have a valid connection, @@ -2002,9 +2282,9 @@ This method creates a new connection, executes the query using the given - execution type and command behavior, closes the connection, and returns - the results. If the connection string is null, a temporary in-memory - database connection will be used. + execution type and command behavior, closes the connection unless a data + reader is created, and returns the results. If the connection string is + null, a temporary in-memory database connection will be used. The text of the command to be executed. @@ -2043,7 +2323,7 @@ A SQLiteDataReader - + Called by the SQLiteDataReader when the data reader is closed. @@ -2076,61 +2356,30 @@ The flags to be associated with the reader. The first column of the first row of the first resultset from the query. - - - Does nothing. Commands are prepared as they are executed the first time, and kept in prepared state afterwards. - - - - - Clones a command, including all its parameters - - A new SQLiteCommand with the same commandtext, connection and parameters - - - - The SQL command text associated with the command - - - - - The amount of time to wait for the connection to become available before erroring out - - - - - The type of the command. SQLite only supports CommandType.Text - - - - - The connection associated with this command - - - - - Forwards to the local Connection property - - - - - Returns the SQLiteParameterCollection for the given command - - - + - Forwards to the local Parameters property + This method resets all the prepared statements held by this instance + back to their initial states, ready to be re-executed. - + - The transaction associated with this command. SQLite only supports one transaction per connection, so this property forwards to the - command's underlying connection. + This method resets all the prepared statements held by this instance + back to their initial states, ready to be re-executed. + + Non-zero if the parameter bindings should be cleared as well. + + + If this is zero, a may be thrown for + any unsuccessful return codes from the native library; otherwise, a + will only be thrown if the connection + or its state is invalid. + - + - Forwards to the local Transaction property + Does nothing. Commands are prepared as they are executed the first time, and kept in prepared state afterwards. @@ -2143,6 +2392,12 @@ Determines if the command is visible at design time. Defaults to True. + + + Clones a command, including all its parameters + + A new SQLiteCommand with the same commandtext, connection and parameters + SQLite implementation of DbCommandBuilder. @@ -2159,6 +2414,14 @@ + + + Cleans up resources (native and managed) associated with the current instance. + + + Zero when being disposed via garbage collection; otherwise, non-zero. + + Minimal amount of parameter processing. Primarily sets the DbType for the parameter equal to the provider type in the schema @@ -2196,6 +2459,11 @@ A data adapter to receive events on. + + + Gets/sets the DataAdapter for this CommandBuilder + + Returns the automatically-generated SQLite command to delete rows from the database @@ -2235,6 +2503,26 @@ + + + Overridden to hide its property from the designer + + + + + Overridden to hide its property from the designer + + + + + Overridden to hide its property from the designer + + + + + Overridden to hide its property from the designer + + Places brackets around an identifier @@ -2249,6 +2537,11 @@ The quoted (bracketed) identifier The undecorated identifier + + + Overridden to hide its property from the designer + + Override helper, which can help the base command builder choose the right keys for the given query @@ -2256,7519 +2549,14454 @@ - - - Gets/sets the DataAdapter for this CommandBuilder + + + This class represents a single value to be returned + from the class via + its , + , + , + , + , + , + , + , + , + , + , + , + , + , + , or + method. If the value of the + associated public field of this class is null upon returning from the + callback, the null value will only be used if the return type for the + method called is not a value type. + If the value to be returned from the + method is unsuitable (e.g. null with a value type), an exception will + be thrown. - + - Overridden to hide its property from the designer + The value to be returned from the + method -OR- null to + indicate an error. - + - Overridden to hide its property from the designer + The value to be returned from the + method -OR- null to + indicate an error. - + - Overridden to hide its property from the designer + The value to be returned from the + method -OR- null to + indicate an error. - + - Overridden to hide its property from the designer + The value to be returned from the + method. - + - Overridden to hide its property from the designer + The value to be returned from the + method -OR- null to + indicate an error. - + - Event data for connection event handlers. + The value to be returned from the + method. - + - The type of event being raised. + The value to be returned from the + method -OR- null to + indicate an error. - + - The associated with this event, if any. + The value to be returned from the + method -OR- null to + indicate an error. - + - The transaction associated with this event, if any. + The value to be returned from the + method -OR- null to + indicate an error. - + - The command associated with this event, if any. + The value to be returned from the + method -OR- null to + indicate an error. - + - The data reader associated with this event, if any. + The value to be returned from the + method -OR- null to + indicate an error. - + - The critical handle associated with this event, if any. + The value to be returned from the + method -OR- null to + indicate an error. - + - Command or message text associated with this event, if any. + The value to be returned from the + method -OR- null to + indicate an error. - + - Extra data associated with this event, if any. + The value to be returned from the + method -OR- null to + indicate an error. - + - Constructs the object. + The value to be returned from the + method. - The type of event being raised. - The base associated - with this event, if any. - The transaction associated with this event, if any. - The command associated with this event, if any. - The data reader associated with this event, if any. - The critical handle associated with this event, if any. - The command or message text, if any. - The extra data, if any. - + - Raised when an event pertaining to a connection occurs. + The value to be returned from the + method. - The connection involved. - Extra information about the event. - + - SQLite implentation of DbConnection. + This class represents the parameters that are provided + to the methods, with + the exception of the column index (provided separately). - - The property can contain the following parameter(s), delimited with a semi-colon: - - - Parameter - Values - Required - Default - - - Data Source - - This may be a file name, the string ":memory:", or any supported URI (starting with SQLite 3.7.7). - Starting with release 1.0.86.0, in order to use more than one consecutive backslash (e.g. for a - UNC path), each of the adjoining backslash characters must be doubled (e.g. "\\Network\Share\test.db" - would become "\\\\Network\Share\test.db"). - - Y - - - - Version - 3 - N - 3 - - - UseUTF16Encoding - True
False
- N - False -
- - DateTimeFormat - - Ticks - Use the value of DateTime.Ticks.
- ISO8601 - Use the ISO-8601 format. Uses the "yyyy-MM-dd HH:mm:ss.FFFFFFFK" format for UTC - DateTime values and "yyyy-MM-dd HH:mm:ss.FFFFFFF" format for local DateTime values).
- JulianDay - The interval of time in days and fractions of a day since January 1, 4713 BC.
- UnixEpoch - The whole number of seconds since the Unix epoch (January 1, 1970).
- InvariantCulture - Any culture-independent string value that the .NET Framework can interpret as a valid DateTime.
- CurrentCulture - Any string value that the .NET Framework can interpret as a valid DateTime using the current culture.
- N - ISO8601 -
- - DateTimeKind - Unspecified - Not specified as either UTC or local time.
Utc - The time represented is UTC.
Local - The time represented is local time.
- N - Unspecified -
- - DateTimeFormatString - The exact DateTime format string to use for all formatting and parsing of all DateTime - values for this connection. - N - null - - - BaseSchemaName - Some base data classes in the framework (e.g. those that build SQL queries dynamically) - assume that an ADO.NET provider cannot support an alternate catalog (i.e. database) without supporting - alternate schemas as well; however, SQLite does not fit into this model. Therefore, this value is used - as a placeholder and removed prior to preparing any SQL statements that may contain it. - N - sqlite_default_schema - - - BinaryGUID - True - Store GUID columns in binary form
False - Store GUID columns as text
- N - True -
- - Cache Size - {size in bytes} - N - 2000 - - - Synchronous - Normal - Normal file flushing behavior
Full - Full flushing after all writes
Off - Underlying OS flushes I/O's
- N - Full -
- - Page Size - {size in bytes} - N - 1024 - - - Password - {password} - Using this parameter requires that the CryptoAPI based codec be enabled at compile-time for both the native interop assembly and the core managed assemblies; otherwise, using this parameter may result in an exception being thrown when attempting to open the connection. - N - - - - HexPassword - {hexPassword} - Must contain a sequence of zero or more hexadecimal encoded byte values without a leading "0x" prefix. Using this parameter requires that the CryptoAPI based codec be enabled at compile-time for both the native interop assembly and the core managed assemblies; otherwise, using this parameter may result in an exception being thrown when attempting to open the connection. - N - - - - Enlist - Y - Automatically enlist in distributed transactions
N - No automatic enlistment
- N - Y -
- - Pooling - - True - Use connection pooling.
- False - Do not use connection pooling.

- WARNING: When using the default connection pool implementation, - setting this property to True should be avoided by applications that make - use of COM (either directly or indirectly) due to possible deadlocks that - can occur during the finalization of some COM objects. -
- N - False -
- - FailIfMissing - True - Don't create the database if it does not exist, throw an error instead
False - Automatically create the database if it does not exist
- N - False -
- - Max Page Count - {size in pages} - Limits the maximum number of pages (limits the size) of the database - N - 0 - - - Legacy Format - True - Use the more compatible legacy 3.x database format
False - Use the newer 3.3x database format which compresses numbers more effectively
- N - False -
- - Default Timeout - {time in seconds}
The default command timeout
- N - 30 -
- - Journal Mode - Delete - Delete the journal file after a commit
Persist - Zero out and leave the journal file on disk after a commit
Off - Disable the rollback journal entirely
- N - Delete -
- - Read Only - True - Open the database for read only access
False - Open the database for normal read/write access
- N - False -
- - Max Pool Size - The maximum number of connections for the given connection string that can be in the connection pool - N - 100 - - - Default IsolationLevel - The default transaciton isolation level - N - Serializable - - - Foreign Keys - Enable foreign key constraints - N - False - - - Flags - Extra behavioral flags for the connection. See the enumeration for possible values. - N - Default - - - SetDefaults - - True - Apply the default connection settings to the opened database.
- False - Skip applying the default connection settings to the opened database. -
- N - True -
- - ToFullPath - - True - Attempt to expand the data source file name to a fully qualified path before opening.
- False - Skip attempting to expand the data source file name to a fully qualified path before opening. -
- N - True -
-
-
- + - The "invalid value" for the enumeration used - by the property. This constant is shared - by this class and the SQLiteConnectionStringBuilder class. + This class represents the parameters that are provided to + the method, with + the exception of the column index (provided separately). - + - The default "stub" (i.e. placeholder) base schema name to use when - returning column schema information. Used as the initial value of - the BaseSchemaName property. This should start with "sqlite_*" - because those names are reserved for use by SQLite (i.e. they cannot - be confused with the names of user objects). + Provides the underlying storage for the + property. - + - The managed assembly containing this type. + Constructs an instance of this class to pass into a user-defined + callback associated with the + method. + + The value that was originally specified for the "readOnly" + parameter to the method. + - + - Object used to synchronize access to the static instance data - for this class. + The value that was originally specified for the "readOnly" + parameter to the method. - + - The extra connection flags to be used for all opened connections. + This class represents the parameters that are provided + to the and + methods, with + the exception of the column index (provided separately). - + - Used to hold the active library version number of SQLite. + Provides the underlying storage for the + property. - + - State of the current connection + Provides the underlying storage for the + property. - + - The connection string + Provides the underlying storage for the + property. - + - Nesting level of the transactions open on the connection + Provides the underlying storage for the + property. - + - If set, then the connection is currently being disposed. + Provides the underlying storage for the + property. - + - The default isolation level for new transactions + Constructs an instance of this class to pass into a user-defined + callback associated with the + method. + + The value that was originally specified for the "dataOffset" + parameter to the or + methods. + + + The value that was originally specified for the "buffer" + parameter to the + method. + + + The value that was originally specified for the "bufferOffset" + parameter to the or + methods. + + + The value that was originally specified for the "length" + parameter to the or + methods. + - + - Whether or not the connection is enlisted in a distrubuted transaction + Constructs an instance of this class to pass into a user-defined + callback associated with the + method. + + The value that was originally specified for the "dataOffset" + parameter to the or + methods. + + + The value that was originally specified for the "buffer" + parameter to the + method. + + + The value that was originally specified for the "bufferOffset" + parameter to the or + methods. + + + The value that was originally specified for the "length" + parameter to the or + methods. + - + - The per-connection mappings between type names and - values. These mappings override the corresponding global mappings. + The value that was originally specified for the "dataOffset" + parameter to the or + methods. - + - The base SQLite object to interop with + The value that was originally specified for the "buffer" + parameter to the + method. - + - The database filename minus path and extension + The value that was originally specified for the "buffer" + parameter to the + method. - + - Temporary password storage, emptied after the database has been opened + The value that was originally specified for the "bufferOffset" + parameter to the or + methods. - + - The "stub" (i.e. placeholder) base schema name to use when returning - column schema information. + The value that was originally specified for the "length" + parameter to the or + methods. - + - The extra behavioral flags for this connection, if any. See the - enumeration for a list of - possible values. + This class represents the parameters and return values for the + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , and + methods. - + - The cached values for all settings that have been fetched on behalf - of this connection. This cache may be cleared by calling the - method. + Provides the underlying storage for the + property. - + - The default databse type for this connection. This value will only - be used if the - flag is set. + Provides the underlying storage for the + property. - + - The default databse type name for this connection. This value will only - be used if the - flag is set. + Provides the underlying storage for the + property. - + - Default command timeout + Constructs a new instance of this class. Depending on the method + being called, the and/or + parameters may be null. + + The name of the method that was + responsible for invoking this callback. + + + If the or + method is being called, + this object will contain the array related parameters for that + method. If the method is + being called, this object will contain the blob related parameters + for that method. + + + This may be used by the callback to set the return value for the + called method. + - + - Non-zero if the built-in (i.e. framework provided) connection string - parser should be used when opening the connection. + The name of the method that was + responsible for invoking this callback. - - - Constructs a new SQLiteConnection object - - - Default constructor - + + + If the or + method is being called, + this object will contain the array related parameters for that + method. If the method is + being called, this object will contain the blob related parameters + for that method. + - + - Initializes the connection with the specified connection string. + This may be used by the callback to set the return value for the + called method. - The connection string to use. - + - Initializes the connection with a pre-existing native connection handle. - This constructor overload is intended to be used only by the private - method. + This represents a method that will be called in response to a request to + bind a parameter to a command. If an exception is thrown, it will cause + the parameter binding operation to fail -AND- it will continue to unwind + the call stack. - - The native connection handle to use. + + The instance in use. - - The file name corresponding to the native connection handle. + + The instance in use. - - Non-zero if this instance owns the native connection handle and - should dispose of it when it is no longer needed. + + The flags associated with the instance + in use. + + + The instance being bound to the command. + + + The database type name associated with this callback. + + + The ordinal of the parameter being bound to the command. + + + The data originally used when registering this callback. + + + Non-zero if the default handling for the parameter binding call should + be skipped (i.e. the parameter should not be bound at all). Great care + should be used when setting this to non-zero. - + - Initializes the connection with the specified connection string. + This represents a method that will be called in response to a request + to read a value from a data reader. If an exception is thrown, it will + cause the data reader operation to fail -AND- it will continue to unwind + the call stack. - - The connection string to use. + + The instance in use. - - Non-zero to parse the connection string using the built-in (i.e. - framework provided) parser when opening the connection. + + The instance in use. + + + The flags associated with the instance + in use. + + + The parameter and return type data for the column being read from the + data reader. + + + The database type name associated with this callback. + + + The zero based index of the column being read from the data reader. + + + The data originally used when registering this callback. + + + Non-zero if the default handling for the data reader call should be + skipped. If this is set to non-zero and the necessary return value + is unavailable or unsuitable, an exception will be thrown. - + - Clones the settings and connection string from an existing connection. If the existing connection is already open, this - function will open its own connection, enumerate any attached databases of the original connection, and automatically - attach to them. + This class represents the custom data type handling callbacks + for a single type name. - The connection to copy the settings from. - + - Raises the event. + Provides the underlying storage for the + property. - - The connection associated with this event. If this parameter is not - null and the specified connection cannot raise events, then the - registered event handlers will not be invoked. - - - A that contains the event data. - - + - Creates and returns a new managed database connection handle. This - method is intended to be used by implementations of the - interface only. In theory, it - could be used by other classes; however, that usage is not supported. + Provides the underlying storage for the + property. - - This must be a native database connection handle returned by the - SQLite core library and it must remain valid and open during the - entire duration of the calling method. - - - The new managed database connection handle or null if it cannot be - created. - - + - Backs up the database, using the specified database connection as the - destination. + Provides the underlying storage for the + property. - The destination database connection. - The destination database name. - The source database name. - - The number of pages to copy or negative to copy all remaining pages. - - - The method to invoke between each step of the backup process. This - parameter may be null (i.e. no callbacks will be performed). - - - The number of milliseconds to sleep after encountering a locking error - during the backup process. A value less than zero means that no sleep - should be performed. - - + - Clears the per-connection cached settings. + Provides the underlying storage for the + property. - - The total number of per-connection settings cleared. - - + - Queries and returns the value of the specified setting, using the - cached setting names and values for this connection, when available. + Provides the underlying storage for the + property. - - The name of the setting. + + + + Constructs an instance of this class. + + + The custom paramater binding callback. This parameter may be null. - - The value to be returned if the setting has not been set explicitly - or cannot be determined. + + The custom data reader value callback. This parameter may be null. - - The value of the cached setting is stored here if found; otherwise, - the value of is stored here. + + The extra data to pass into the parameter binding callback. This + parameter may be null. + + + The extra data to pass into the data reader value callback. This + parameter may be null. - - Non-zero if the cached setting was found; otherwise, zero. - - + - Adds or sets the cached setting specified by - to the value specified by . + Creates an instance of the class. - - The name of the cached setting to add or replace. + + The custom paramater binding callback. This parameter may be null. - - The new value of the cached setting. + + The custom data reader value callback. This parameter may be null. + + + The extra data to pass into the parameter binding callback. This + parameter may be null. + + + The extra data to pass into the data reader value callback. This + parameter may be null. - + - Clears the per-connection type mappings. + The database type name that the callbacks contained in this class + will apply to. This value may not be null. - - The total number of per-connection type mappings cleared. - - + - Returns the per-connection type mappings. + The custom paramater binding callback. This value may be null. - - The per-connection type mappings -OR- null if they are unavailable. - - + - Adds a per-connection type mapping, possibly replacing one or more - that already exist. + The custom data reader value callback. This value may be null. - - The case-insensitive database type name (e.g. "MYDATE"). The value - of this parameter cannot be null. Using an empty string value (or - a string value consisting entirely of whitespace) for this parameter - is not recommended. - - - The value that should be associated with the - specified type name. - - - Non-zero if this mapping should be considered to be the primary one - for the specified . - - - A negative value if nothing was done. Zero if no per-connection type - mappings were replaced (i.e. it was a pure add operation). More than - zero if some per-connection type mappings were replaced. - - + - Attempts to bind the specified object - instance to this connection. + The extra data to pass into the parameter binding callback. This + value may be null. - - The object instance containing - the metadata for the function to be bound. - - - The object instance that implements the - function to be bound. - - + - Creates a clone of the connection. All attached databases and user-defined functions are cloned. If the existing connection is open, the cloned connection - will also be opened. + The extra data to pass into the data reader value callback. This + value may be null. - - + - Creates a database file. This just creates a zero-byte file which SQLite - will turn into a database when the file is opened properly. + This class represents the mappings between database type names + and their associated custom data type handling callbacks. - The file to create - + - Raises the state change event when the state of the connection changes + Constructs an (empty) instance of this class. - The new connection state. If this is different - from the previous state, the event is - raised. - The event data created for the raised event, if - it was actually raised. - + - Determines and returns the fallback default isolation level when one cannot be - obtained from an existing connection instance. + Event data for connection event handlers. - - The fallback default isolation level for this connection instance -OR- - if it cannot be determined. - - + - Determines and returns the default isolation level for this connection instance. + The type of event being raised. - - The default isolation level for this connection instance -OR- - if it cannot be determined. - - + - OBSOLETE. Creates a new SQLiteTransaction if one isn't already active on the connection. + The associated with this event, if any. - This parameter is ignored. - When TRUE, SQLite defers obtaining a write lock until a write operation is requested. - When FALSE, a writelock is obtained immediately. The default is TRUE, but in a multi-threaded multi-writer - environment, one may instead choose to lock the database immediately to avoid any possible writer deadlock. - Returns a SQLiteTransaction object. - + - OBSOLETE. Creates a new SQLiteTransaction if one isn't already active on the connection. + The transaction associated with this event, if any. - When TRUE, SQLite defers obtaining a write lock until a write operation is requested. - When FALSE, a writelock is obtained immediately. The default is false, but in a multi-threaded multi-writer - environment, one may instead choose to lock the database immediately to avoid any possible writer deadlock. - Returns a SQLiteTransaction object. - + - Creates a new if one isn't already active on the connection. + The command associated with this event, if any. - Supported isolation levels are Serializable, ReadCommitted and Unspecified. - - Unspecified will use the default isolation level specified in the connection string. If no isolation level is specified in the - connection string, Serializable is used. - Serializable transactions are the default. In this mode, the engine gets an immediate lock on the database, and no other threads - may begin a transaction. Other threads may read from the database, but not write. - With a ReadCommitted isolation level, locks are deferred and elevated as needed. It is possible for multiple threads to start - a transaction in ReadCommitted mode, but if a thread attempts to commit a transaction while another thread - has a ReadCommitted lock, it may timeout or cause a deadlock on both threads until both threads' CommandTimeout's are reached. - - Returns a SQLiteTransaction object. - + - Creates a new if one isn't already - active on the connection. + The data reader associated with this event, if any. - Returns the new transaction object. - + - Forwards to the local function + The critical handle associated with this event, if any. - Supported isolation levels are Unspecified, Serializable, and ReadCommitted - - + - This method is not implemented; however, the - event will still be raised. + Command or message text associated with this event, if any. - + + + + Extra data associated with this event, if any. + + + + + Constructs the object. + + The type of event being raised. + The base associated + with this event, if any. + The transaction associated with this event, if any. + The command associated with this event, if any. + The data reader associated with this event, if any. + The critical handle associated with this event, if any. + The command or message text, if any. + The extra data, if any. + + + + Raised when an event pertaining to a connection occurs. + + The connection involved. + Extra information about the event. + + + + SQLite implentation of DbConnection. + + + The property can contain the following parameter(s), delimited with a semi-colon: + + + Parameter + Values + Required + Default + + + Data Source + + This may be a file name, the string ":memory:", or any supported URI (starting with SQLite 3.7.7). + Starting with release 1.0.86.0, in order to use more than one consecutive backslash (e.g. for a + UNC path), each of the adjoining backslash characters must be doubled (e.g. "\\Network\Share\test.db" + would become "\\\\Network\Share\test.db"). + + Y + + + + Uri + + If specified, this must be a file name that starts with "file://", "file:", or "/". Any leading + "file://" or "file:" prefix will be stripped off and the resulting file name will be used to open + the database. + + N + null + + + FullUri + + If specified, this must be a URI in a format recognized by the SQLite core library (starting with + SQLite 3.7.7). It will be passed verbatim to the SQLite core library. + + N + null + + + Version + 3 + N + 3 + + + UseUTF16Encoding + + True - The UTF-16 encoding should be used. +
+ False - The UTF-8 encoding should be used. +
+ N + False +
+ + DefaultDbType + + This is the default to use when one cannot be determined based on the + column metadata and the configured type mappings. + + N + null + + + DefaultTypeName + + This is the default type name to use when one cannot be determined based on the column metadata + and the configured type mappings. + + N + null + + + NoDefaultFlags + + True - Do not combine the specified (or existing) connection flags with the value of the + property. +
+ False - Combine the specified (or existing) connection flags with the value of the + property. +
+ N + False +
+ + NoSharedFlags + + True - Do not combine the specified (or existing) connection flags with the value of the + property. +
+ False - Combine the specified (or existing) connection flags with the value of the + property. +
+ N + False +
+ + VfsName + + The name of the VFS to use when opening the database connection. + If this is not specified, the default VFS will be used. + + N + null + + + ZipVfsVersion + + If non-null, this is the "version" of ZipVFS to use. This requires + the System.Data.SQLite interop assembly -AND- primary managed assembly + to be compiled with the INTEROP_INCLUDE_ZIPVFS option; otherwise, this + property does nothing. The valid values are "v2" and "v3". Using + anyother value will cause an exception to be thrown. Please see the + ZipVFS documentation for more information on how to use this parameter. + + N + null + + + DateTimeFormat + + Ticks - Use the value of DateTime.Ticks.
+ ISO8601 - Use the ISO-8601 format. Uses the "yyyy-MM-dd HH:mm:ss.FFFFFFFK" format for UTC + DateTime values and "yyyy-MM-dd HH:mm:ss.FFFFFFF" format for local DateTime values).
+ JulianDay - The interval of time in days and fractions of a day since January 1, 4713 BC.
+ UnixEpoch - The whole number of seconds since the Unix epoch (January 1, 1970).
+ InvariantCulture - Any culture-independent string value that the .NET Framework can interpret as a valid DateTime.
+ CurrentCulture - Any string value that the .NET Framework can interpret as a valid DateTime using the current culture.
+ N + ISO8601 +
+ + DateTimeKind + + Unspecified - Not specified as either UTC or local time. +
+ Utc - The time represented is UTC. +
+ Local - The time represented is local time. +
+ N + Unspecified +
+ + DateTimeFormatString + + The exact DateTime format string to use for all formatting and parsing of all DateTime + values for this connection. + + N + null + + + BaseSchemaName + + Some base data classes in the framework (e.g. those that build SQL queries dynamically) + assume that an ADO.NET provider cannot support an alternate catalog (i.e. database) without supporting + alternate schemas as well; however, SQLite does not fit into this model. Therefore, this value is used + as a placeholder and removed prior to preparing any SQL statements that may contain it. + + N + sqlite_default_schema + + + BinaryGUID + + True - Store GUID columns in binary form +
+ False - Store GUID columns as text +
+ N + True +
+ + Cache Size + + If the argument N is positive then the suggested cache size is set to N. + If the argument N is negative, then the number of cache pages is adjusted + to use approximately abs(N*4096) bytes of memory. Backwards compatibility + note: The behavior of cache_size with a negative N was different in SQLite + versions prior to 3.7.10. In version 3.7.9 and earlier, the number of + pages in the cache was set to the absolute value of N. + + N + -2000 + + + Synchronous + + Normal - Normal file flushing behavior +
+ Full - Full flushing after all writes +
+ Off - Underlying OS flushes I/O's +
+ N + Full +
+ + Page Size + {size in bytes} + N + 4096 + + + Password + + {password} - Using this parameter requires that the legacy CryptoAPI based + codec (or the SQLite Encryption Extension) be enabled at compile-time for + both the native interop assembly and the core managed assemblies; otherwise, + using this parameter may result in an exception being thrown when attempting + to open the connection. + + N + + + + HexPassword + + {hexPassword} - Must contain a sequence of zero or more hexadecimal encoded + byte values without a leading "0x" prefix. Using this parameter requires + that the legacy CryptoAPI based codec (or the SQLite Encryption Extension) + be enabled at compile-time for both the native interop assembly and the + core managed assemblies; otherwise, using this parameter may result in an + exception being thrown when attempting to open the connection. + + N + + + + Enlist + + Y - Automatically enlist in distributed transactions +
+ N - No automatic enlistment +
+ N + Y +
+ + Pooling + + True - Use connection pooling.
+ False - Do not use connection pooling.

+ WARNING: When using the default connection pool implementation, + setting this property to True should be avoided by applications that make + use of COM (either directly or indirectly) due to possible deadlocks that + can occur during the finalization of some COM objects. +
+ N + False +
+ + FailIfMissing + + True - Don't create the database if it does not exist, throw an error instead +
+ False - Automatically create the database if it does not exist +
+ N + False +
+ + Max Page Count + {size in pages} - Limits the maximum number of pages (limits the size) of the database + N + 0 + + + Legacy Format + + True - Use the more compatible legacy 3.x database format +
+ False - Use the newer 3.3x database format which compresses numbers more effectively +
+ N + False +
+ + Default Timeout + {time in seconds}
The default command timeout
+ N + 30 +
+ + BusyTimeout + {time in milliseconds}
Sets the busy timeout for the core library.
+ N + 0 +
+ + WaitTimeout + {time in milliseconds}
+ EXPERIMENTAL -- The wait timeout to use with + method. This is only used when + waiting for the enlistment to be reset prior to enlisting in a transaction, + and then only when the appropriate connection flag is set.
+ N + 30000 +
+ + Journal Mode + + Delete - Delete the journal file after a commit. +
+ Persist - Zero out and leave the journal file on disk after a + commit. +
+ Off - Disable the rollback journal entirely. This saves disk I/O + but at the expense of database safety and integrity. If the application + using SQLite crashes in the middle of a transaction when this journaling + mode is set, then the database file will very likely go corrupt. +
+ Truncate - Truncate the journal file to zero-length instead of + deleting it. +
+ Memory - Store the journal in volatile RAM. This saves disk I/O + but at the expense of database safety and integrity. If the application + using SQLite crashes in the middle of a transaction when this journaling + mode is set, then the database file will very likely go corrupt. +
+ Wal - Use a write-ahead log instead of a rollback journal. +
+ N + Delete +
+ + Read Only + + True - Open the database for read only access +
+ False - Open the database for normal read/write access +
+ N + False +
+ + Max Pool Size + The maximum number of connections for the given connection string that can be in the connection pool + N + 100 + + + Default IsolationLevel + The default transaciton isolation level + N + Serializable + + + Foreign Keys + Enable foreign key constraints + N + False + + + Flags + Extra behavioral flags for the connection. See the enumeration for possible values. + N + Default + + + SetDefaults + + True - Apply the default connection settings to the opened database.
+ False - Skip applying the default connection settings to the opened database. +
+ N + True +
+ + ToFullPath + + True - Attempt to expand the data source file name to a fully qualified path before opening. +
+ False - Skip attempting to expand the data source file name to a fully qualified path before opening. +
+ N + True +
+ + PrepareRetries + + The maximum number of retries when preparing SQL to be executed. This + normally only applies to preparation errors resulting from the database + schema being changed. + + N + 3 + + + ProgressOps + + The approximate number of virtual machine instructions between progress + events. In order for progress events to actually fire, the event handler + must be added to the event as well. + + N + 0 + + + Recursive Triggers + + True - Enable the recursive trigger capability. + False - Disable the recursive trigger capability. + + N + False + +
+
+
+ + + The "invalid value" for the enumeration used + by the property. This constant is shared + by this class and the SQLiteConnectionStringBuilder class. + + + + + The default "stub" (i.e. placeholder) base schema name to use when + returning column schema information. Used as the initial value of + the BaseSchemaName property. This should start with "sqlite_*" + because those names are reserved for use by SQLite (i.e. they cannot + be confused with the names of user objects). + + + + + The managed assembly containing this type. + + + + + Object used to synchronize access to the static instance data + for this class. + + + + + Static variable to store the connection event handlers to call. + + + + + The extra connection flags to be used for all opened connections. + + + + + The instance (for this thread) that + had the most recent call to . + + + + + Used to hold the active library version number of SQLite. + + + + + State of the current connection + + + + + The connection string + + + + + Nesting level of the transactions open on the connection + + + + + Transaction counter for the connection. Currently, this is only used + to build SAVEPOINT names. + + + + + If this flag is non-zero, the method will have + no effect; however, the method will continue to + behave as normal. + + + + + If set, then the connection is currently being disposed. + + + + + The default isolation level for new transactions + + + + + This object is used with lock statements to synchronize access to the + field, below. + + + + + Whether or not the connection is enlisted in a distrubuted transaction + + + + + The per-connection mappings between type names and + values. These mappings override the corresponding global mappings. + + + + + The per-connection mappings between type names and optional callbacks + for parameter binding and value reading. + + + + + The base SQLite object to interop with + + + + + The database filename minus path and extension + + + + + The "stub" (i.e. placeholder) base schema name to use when returning + column schema information. + + + + + The extra behavioral flags for this connection, if any. See the + enumeration for a list of + possible values. + + + + + The cached values for all settings that have been fetched on behalf + of this connection. This cache may be cleared by calling the + method. + + + + + The default databse type for this connection. This value will only + be used if the + flag is set. + + + + + The default databse type name for this connection. This value will only + be used if the + flag is set. + + + + + The name of the VFS to be used when opening the database connection. + + + + + Default command timeout + + + + + The default busy timeout to use with the SQLite core library. This is + only used when opening a connection. + + + + + The default wait timeout to use with + method. This is only used when waiting for the enlistment to be reset + prior to enlisting in a transaction, and then only when the appropriate + connection flag is set. + + + + + The maximum number of retries when preparing SQL to be executed. This + normally only applies to preparation errors resulting from the database + schema being changed. + + + + + The approximate number of virtual machine instructions between progress + events. In order for progress events to actually fire, the event handler + must be added to the event as + well. This value will only be used when opening the database. + + + + + Non-zero if the built-in (i.e. framework provided) connection string + parser should be used when opening the connection. + + + + + This event is raised whenever the database is opened or closed. + + + + + Constructs a new SQLiteConnection object + + + Default constructor + + + + + Initializes the connection with the specified connection string. + + The connection string to use. + + + + Initializes the connection with a pre-existing native connection handle. + This constructor overload is intended to be used only by the private + method. + + + The native connection handle to use. + + + The file name corresponding to the native connection handle. + + + Non-zero if this instance owns the native connection handle and + should dispose of it when it is no longer needed. + + + + + Initializes the connection with the specified connection string. + + + The connection string to use. + + + Non-zero to parse the connection string using the built-in (i.e. + framework provided) parser when opening the connection. + + + + + Clones the settings and connection string from an existing connection. If the existing connection is already open, this + function will open its own connection, enumerate any attached databases of the original connection, and automatically + attach to them. + + The connection to copy the settings from. + + + + Attempts to lookup the native handle associated with the connection. An exception will + be thrown if this cannot be accomplished. + + + The connection associated with the desired native handle. + + + The native handle associated with the connection or if it + cannot be determined. + + + + + Raises the event. + + + The connection associated with this event. If this parameter is not + null and the specified connection cannot raise events, then the + registered event handlers will not be invoked. + + + A that contains the event data. + + + + + This event is raised when events related to the lifecycle of a + SQLiteConnection object occur. + + + + + This property is used to obtain or set the custom connection pool + implementation to use, if any. Setting this property to null will + cause the default connection pool implementation to be used. + + + + + Creates and returns a new managed database connection handle. This + method is intended to be used by implementations of the + interface only. In theory, it + could be used by other classes; however, that usage is not supported. + + + This must be a native database connection handle returned by the + SQLite core library and it must remain valid and open during the + entire duration of the calling method. + + + The new managed database connection handle or null if it cannot be + created. + + + + + Backs up the database, using the specified database connection as the + destination. + + The destination database connection. + The destination database name. + The source database name. + + The number of pages to copy at a time -OR- a negative value to copy all + pages. When a negative value is used, the + may never be invoked. + + + The method to invoke between each step of the backup process. This + parameter may be null (i.e. no callbacks will be performed). If the + callback returns false -OR- throws an exception, the backup is canceled. + + + The number of milliseconds to sleep after encountering a locking error + during the backup process. A value less than zero means that no sleep + should be performed. + + + + + Clears the per-connection cached settings. + + + The total number of per-connection settings cleared. + + + + + Queries and returns the value of the specified setting, using the + cached setting names and values for this connection, when available. + + + The name of the setting. + + + The value to be returned if the setting has not been set explicitly + or cannot be determined. + + + The value of the cached setting is stored here if found; otherwise, + the value of is stored here. + + + Non-zero if the cached setting was found; otherwise, zero. + + + + + Adds or sets the cached setting specified by + to the value specified by . + + + The name of the cached setting to add or replace. + + + The new value of the cached setting. + + + + + Clears the per-connection type mappings. + + + The total number of per-connection type mappings cleared. + + + + + Returns the per-connection type mappings. + + + The per-connection type mappings -OR- null if they are unavailable. + + + + + Adds a per-connection type mapping, possibly replacing one or more + that already exist. + + + The case-insensitive database type name (e.g. "MYDATE"). The value + of this parameter cannot be null. Using an empty string value (or + a string value consisting entirely of whitespace) for this parameter + is not recommended. + + + The value that should be associated with the + specified type name. + + + Non-zero if this mapping should be considered to be the primary one + for the specified . + + + A negative value if nothing was done. Zero if no per-connection type + mappings were replaced (i.e. it was a pure add operation). More than + zero if some per-connection type mappings were replaced. + + + + + Clears the per-connection type callbacks. + + + The total number of per-connection type callbacks cleared. + + + + + Attempts to get the per-connection type callbacks for the specified + database type name. + + + The database type name. + + + Upon success, this parameter will contain the object holding the + callbacks for the database type name. Upon failure, this parameter + will be null. + + + Non-zero upon success; otherwise, zero. + + + + + Sets, resets, or clears the per-connection type callbacks for the + specified database type name. + + + The database type name. + + + The object holding the callbacks for the database type name. If + this parameter is null, any callbacks for the database type name + will be removed if they are present. + + + Non-zero if callbacks were set or removed; otherwise, zero. + + + + + Attempts to bind the specified object + instance to this connection. + + + The object instance containing + the metadata for the function to be bound. + + + The object instance that implements the + function to be bound. + + + + + Attempts to bind the specified object + instance to this connection. + + + The object instance containing + the metadata for the function to be bound. + + + A object instance that helps implement the + function to be bound. For scalar functions, this corresponds to the + type. For aggregate functions, + this corresponds to the type. For + collation functions, this corresponds to the + type. + + + A object instance that helps implement the + function to be bound. For aggregate functions, this corresponds to the + type. For other callback types, it + is not used and must be null. + + + + + Attempts to unbind the specified object + instance to this connection. + + + The object instance containing + the metadata for the function to be unbound. + + Non-zero if the function was unbound. + + + + This method unbinds all registered (known) functions -OR- all previously + bound user-defined functions from this connection. + + + Non-zero to unbind all registered (known) functions -OR- zero to unbind + all functions currently bound to the connection. + + + Non-zero if all the specified user-defined functions were unbound. + + + + + Parses a connection string into component parts using the custom + connection string parser. An exception may be thrown if the syntax + of the connection string is incorrect. + + + The connection string to parse. + + + Non-zero to parse the connection string using the algorithm provided + by the framework itself. This is not applicable when running on the + .NET Compact Framework. + + + Non-zero if names are allowed without values. + + + The list of key/value pairs corresponding to the parameters specified + within the connection string. + + + + + Parses a connection string into component parts using the custom + connection string parser. An exception may be thrown if the syntax + of the connection string is incorrect. + + + The connection that will be using the parsed connection string. + + + The connection string to parse. + + + Non-zero to parse the connection string using the algorithm provided + by the framework itself. This is not applicable when running on the + .NET Compact Framework. + + + Non-zero if names are allowed without values. + + + The list of key/value pairs corresponding to the parameters specified + within the connection string. + + + + + Disposes and finalizes the connection, if applicable. + + + + + Cleans up resources (native and managed) associated with the current instance. + + + Zero when being disposed via garbage collection; otherwise, non-zero. + + + + + Creates a clone of the connection. All attached databases and user-defined functions are cloned. If the existing connection is open, the cloned connection + will also be opened. + + + + + + Creates a database file. This just creates a zero-byte file which SQLite + will turn into a database when the file is opened properly. + + The file to create + + + + Raises the state change event when the state of the connection changes + + The new connection state. If this is different + from the previous state, the event is + raised. + The event data created for the raised event, if + it was actually raised. + + + + Determines and returns the fallback default isolation level when one cannot be + obtained from an existing connection instance. + + + The fallback default isolation level for this connection instance -OR- + if it cannot be determined. + + + + + Determines and returns the default isolation level for this connection instance. + + + The default isolation level for this connection instance -OR- + if it cannot be determined. + + + + + OBSOLETE. Creates a new SQLiteTransaction if one isn't already active on the connection. + + This parameter is ignored. + When TRUE, SQLite defers obtaining a write lock until a write operation is requested. + When FALSE, a writelock is obtained immediately. The default is TRUE, but in a multi-threaded multi-writer + environment, one may instead choose to lock the database immediately to avoid any possible writer deadlock. + Returns a SQLiteTransaction object. + + + + OBSOLETE. Creates a new SQLiteTransaction if one isn't already active on the connection. + + When TRUE, SQLite defers obtaining a write lock until a write operation is requested. + When FALSE, a writelock is obtained immediately. The default is false, but in a multi-threaded multi-writer + environment, one may instead choose to lock the database immediately to avoid any possible writer deadlock. + Returns a SQLiteTransaction object. + + + + Creates a new if one isn't already active on the connection. + + Supported isolation levels are Serializable, ReadCommitted and Unspecified. + + Unspecified will use the default isolation level specified in the connection string. If no isolation level is specified in the + connection string, Serializable is used. + Serializable transactions are the default. In this mode, the engine gets an immediate lock on the database, and no other threads + may begin a transaction. Other threads may read from the database, but not write. + With a ReadCommitted isolation level, locks are deferred and elevated as needed. It is possible for multiple threads to start + a transaction in ReadCommitted mode, but if a thread attempts to commit a transaction while another thread + has a ReadCommitted lock, it may timeout or cause a deadlock on both threads until both threads' CommandTimeout's are reached. + + Returns a SQLiteTransaction object. + + + + Creates a new if one isn't already + active on the connection. + + Returns the new transaction object. + + + + Forwards to the local function + + Supported isolation levels are Unspecified, Serializable, and ReadCommitted + + + + + This method is not implemented; however, the + event will still be raised. + + - When the database connection is closed, all commands linked to this connection are automatically reset. + When the database connection is closed, all commands linked to this connection are automatically reset. + + + + + Returns the number of pool entries for the file name associated with this connection. + + + + + Clears the connection pool associated with the connection. Any other active connections using the same database file + will be discarded instead of returned to the pool when they are closed. + + + + + + Clears all connection pools. Any active connections will be discarded instead of sent to the pool when they are closed. + + + + + The connection string containing the parameters for the connection + + + For the complete list of supported connection string properties, + please see . + + + + + Create a new and associate it with this connection. + + Returns a new command object already assigned to this connection. + + + + Forwards to the local function. + + + + + + Attempts to create a new object instance + using this connection and the specified database name. + + + The name of the database for the newly created session. + + + The newly created session -OR- null if it cannot be created. + + + + + Attempts to create a new object instance + using this connection and the specified raw data. + + + The raw data that contains a change set (or patch set). + + + The newly created change set -OR- null if it cannot be created. + + + + + Attempts to create a new object instance + using this connection and the specified raw data. + + + The raw data that contains a change set (or patch set). + + + The flags used to create the change set iterator. + + + The newly created change set -OR- null if it cannot be created. + + + + + Attempts to create a new object instance + using this connection and the specified stream. + + + The stream where the raw data that contains a change set (or patch set) + may be read. + + + The stream where the raw data that contains a change set (or patch set) + may be written. + + + The newly created change set -OR- null if it cannot be created. + + + + + Attempts to create a new object instance + using this connection and the specified stream. + + + The stream where the raw data that contains a change set (or patch set) + may be read. + + + The stream where the raw data that contains a change set (or patch set) + may be written. + + + The flags used to create the change set iterator. + + + The newly created change set -OR- null if it cannot be created. + + + + + Attempts to create a new object + instance using this connection. + + + The newly created change group -OR- null if it cannot be created. + + + + + Returns the data source file name without extension or path. + + + + + Returns the fully qualified path and file name for the currently open + database, if any. + + + + + Returns the string "main". + + + + + Determines if the legacy connection string parser should be used. + + + The connection that will be using the parsed connection string. + + + Non-zero if the legacy connection string parser should be used. + + + + + Parses a connection string into component parts using the custom + connection string parser. An exception may be thrown if the syntax + of the connection string is incorrect. + + + The connection string to parse. + + + Non-zero if names are allowed without values. + + + The list of key/value pairs corresponding to the parameters specified + within the connection string. + + + + + Parses a connection string into component parts using the custom + connection string parser. An exception may be thrown if the syntax + of the connection string is incorrect. + + + The connection that will be using the parsed connection string. + + + The connection string to parse. + + + Non-zero if names are allowed without values. + + + The list of key/value pairs corresponding to the parameters specified + within the connection string. + + + + + Parses a connection string using the built-in (i.e. framework provided) + connection string parser class and returns the key/value pairs. An + exception may be thrown if the connection string is invalid or cannot be + parsed. When compiled for the .NET Compact Framework, the custom + connection string parser is always used instead because the framework + provided one is unavailable there. + + + The connection that will be using the parsed connection string. + + + The connection string to parse. + + + Non-zero to throw an exception if any connection string values are not of + the type. This is not applicable when running on + the .NET Compact Framework. + + The list of key/value pairs. + + + + Manual distributed transaction enlistment support + + The distributed transaction to enlist in + + + + EXPERIMENTAL -- + Waits for the enlistment associated with this connection to be reset. + This method always throws when + running on the .NET Compact Framework. + + + The approximate maximum number of milliseconds to wait before timing + out the wait operation. + + + The return value to use if the connection has been disposed; if this + value is null, will be raised + if the connection has been disposed. + + + Non-zero if the enlistment assciated with this connection was reset; + otherwise, zero. It should be noted that this method returning a + non-zero value does not necessarily guarantee that the connection + can enlist in a new transaction (i.e. due to potentical race with + other threads); therefore, callers should generally use try/catch + when calling the method. + + + + + Looks for a key in the array of key/values of the parameter string. If not found, return the specified default value + + The list to look in + The key to find + The default value to return if the key is not found + The value corresponding to the specified key, or the default value if not found. + + + + Attempts to convert the string value to an enumerated value of the specified type. + + The enumerated type to convert the string value to. + The string value to be converted. + Non-zero to make the conversion case-insensitive. + The enumerated value upon success or null upon error. + + + + Attempts to convert an input string into a byte value. + + + The string value to be converted. + + + The number styles to use for the conversion. + + + Upon sucess, this will contain the parsed byte value. + Upon failure, the value of this parameter is undefined. + + + Non-zero upon success; zero on failure. + + + + + Change a configuration option value for the database. + + + The database configuration option to change. + + + The new value for the specified configuration option. + + + + + Enables or disables extension loading. + + + True to enable loading of extensions, false to disable. + + + + + Loads a SQLite extension library from the named dynamic link library file. + + + The name of the dynamic link library file containing the extension. + + + + + Loads a SQLite extension library from the named dynamic link library file. + + + The name of the dynamic link library file containing the extension. + + + The name of the exported function used to initialize the extension. + If null, the default "sqlite3_extension_init" will be used. + + + + + Creates a disposable module containing the implementation of a virtual + table. + + + The module object to be used when creating the disposable module. + + + + + Parses a string containing a sequence of zero or more hexadecimal + encoded byte values and returns the resulting byte array. The + "0x" prefix is not allowed on the input string. + + + The input string containing zero or more hexadecimal encoded byte + values. + + + A byte array containing the parsed byte values or null if an error + was encountered. + + + + + Creates and returns a string containing the hexadecimal encoded byte + values from the input array. + + + The input array of bytes. + + + The resulting string or null upon failure. + + + + + Parses a string containing a sequence of zero or more hexadecimal + encoded byte values and returns the resulting byte array. The + "0x" prefix is not allowed on the input string. + + + The input string containing zero or more hexadecimal encoded byte + values. + + + Upon failure, this will contain an appropriate error message. + + + A byte array containing the parsed byte values or null if an error + was encountered. + + + + + This method figures out what the default connection pool setting should + be based on the connection flags. When present, the "Pooling" connection + string property value always overrides the value returned by this method. + + + Non-zero if the connection pool should be enabled by default; otherwise, + zero. + + + + + Determines the transaction isolation level that should be used by + the caller, primarily based upon the one specified by the caller. + If mapping of transaction isolation levels is enabled, the returned + transaction isolation level may be significantly different than the + originally specified one. + + + The originally specified transaction isolation level. + + + The transaction isolation level that should be used. + + + + + Opens the connection using the parameters found in the . + + + + + Opens the connection using the parameters found in the and then returns it. + + The current connection object. + + + + Gets/sets the default command timeout for newly-created commands. This is especially useful for + commands used internally such as inside a SQLiteTransaction, where setting the timeout is not possible. + This can also be set in the ConnectionString with "Default Timeout" + + + + + Gets/sets the default busy timeout to use with the SQLite core library. This is only used when + opening a connection. + + + + + EXPERIMENTAL -- + The wait timeout to use with method. + This is only used when waiting for the enlistment to be reset prior to + enlisting in a transaction, and then only when the appropriate connection + flag is set. + + + + + The maximum number of retries when preparing SQL to be executed. This + normally only applies to preparation errors resulting from the database + schema being changed. + + + + + The approximate number of virtual machine instructions between progress + events. In order for progress events to actually fire, the event handler + must be added to the event as + well. This value will only be used when the underlying native progress + callback needs to be changed. + + + + + Non-zero if the built-in (i.e. framework provided) connection string + parser should be used when opening the connection. + + + + + Gets/sets the extra behavioral flags for this connection. See the + enumeration for a list of + possible values. + + + + + Gets/sets the default database type for this connection. This value + will only be used when not null. + + + + + Gets/sets the default database type name for this connection. This + value will only be used when not null. + + + + + Gets/sets the VFS name for this connection. This value will only be + used when opening the database. + + + + + Returns non-zero if the underlying native connection handle is + owned by this instance. + + + + + Returns the version of the underlying SQLite database engine + + + + + Returns the rowid of the most recent successful INSERT into the database from this connection. + + + + + This method causes any pending database operation to abort and return at + its earliest opportunity. This routine is typically called in response + to a user action such as pressing "Cancel" or Ctrl-C where the user wants + a long query operation to halt immediately. It is safe to call this + routine from any thread. However, it is not safe to call this routine + with a database connection that is closed or might close before this method + returns. + + + + + Returns the number of rows changed by the last INSERT, UPDATE, or DELETE statement executed on + this connection. + + + + + Checks if this connection to the specified database should be considered + read-only. An exception will be thrown if the database name specified + via cannot be found. + + + The name of a database associated with this connection -OR- null for the + main database. + + + Non-zero if this connection to the specified database should be considered + read-only. + + + + + Returns non-zero if the given database connection is in autocommit mode. + Autocommit mode is on by default. Autocommit mode is disabled by a BEGIN + statement. Autocommit mode is re-enabled by a COMMIT or ROLLBACK. + + + + + Returns the amount of memory (in bytes) currently in use by the SQLite core library. + + + + + Returns the maximum amount of memory (in bytes) used by the SQLite core library since the high-water mark was last reset. + + + + + Returns various global memory statistics for the SQLite core library via + a dictionary of key/value pairs. Currently, only the "MemoryUsed" and + "MemoryHighwater" keys are returned and they have values that correspond + to the values that could be obtained via the + and connection properties. + + + This dictionary will be populated with the global memory statistics. It + will be created if necessary. + + + + + Attempts to free as much heap memory as possible for this database connection. + + + + + Attempts to free N bytes of heap memory by deallocating non-essential memory + allocations held by the database library. Memory used to cache database pages + to improve performance is an example of non-essential memory. This is a no-op + returning zero if the SQLite core library was not compiled with the compile-time + option SQLITE_ENABLE_MEMORY_MANAGEMENT. Optionally, attempts to reset and/or + compact the Win32 native heap, if applicable. + + + The requested number of bytes to free. + + + Non-zero to attempt a heap reset. + + + Non-zero to attempt heap compaction. + + + The number of bytes actually freed. This value may be zero. + + + This value will be non-zero if the heap reset was successful. + + + The size of the largest committed free block in the heap, in bytes. + This value will be zero unless heap compaction is enabled. + + + A standard SQLite return code (i.e. zero for success and non-zero + for failure). + + + + + Sets the status of the memory usage tracking subsystem in the SQLite core library. By default, this is enabled. + If this is disabled, memory usage tracking will not be performed. This is not really a per-connection value, it is + global to the process. + + Non-zero to enable memory usage tracking, zero otherwise. + A standard SQLite return code (i.e. zero for success and non-zero for failure). + + + + Returns a string containing the define constants (i.e. compile-time + options) used to compile the core managed assembly, delimited with + spaces. + + + + + Returns the version of the underlying SQLite core library. + + + + + This method returns the string whose value is the same as the + SQLITE_SOURCE_ID C preprocessor macro used when compiling the + SQLite core library. + + + + + Returns a string containing the compile-time options used to + compile the SQLite core native library, delimited with spaces. + + + + + This method returns the version of the interop SQLite assembly + used. If the SQLite interop assembly is not in use or the + necessary information cannot be obtained for any reason, a null + value may be returned. + + + + + This method returns the string whose value contains the unique + identifier for the source checkout used to build the interop + assembly. If the SQLite interop assembly is not in use or the + necessary information cannot be obtained for any reason, a null + value may be returned. + + + + + Returns a string containing the compile-time options used to + compile the SQLite interop assembly, delimited with spaces. + + + + + This method returns the version of the managed components used + to interact with the SQLite core library. If the necessary + information cannot be obtained for any reason, a null value may + be returned. + + + + + This method returns the string whose value contains the unique + identifier for the source checkout used to build the managed + components currently executing. If the necessary information + cannot be obtained for any reason, a null value may be returned. + + + + + Queries and returns the value of the specified setting, using the + cached setting names and values for the last connection that used + the method, when available. + + + The name of the setting. + + + The value to be returned if the setting has not been set explicitly + or cannot be determined. + + + The value of the cached setting is stored here if found; otherwise, + the value of is stored here. + + + Non-zero if the cached setting was found; otherwise, zero. + + + + + Adds or sets the cached setting specified by + to the value specified by using the cached + setting names and values for the last connection that used the + method, when available. + + + The name of the cached setting to add or replace. + + + The new value of the cached setting. + + + + + The default connection flags to be used for all opened connections + when they are not present in the connection string. + + + + + The extra connection flags to be used for all opened connections. + + + + + Returns the state of the connection. + + + + + Passes a shutdown request to the SQLite core library. Does not throw + an exception if the shutdown request fails. + + + A standard SQLite return code (i.e. zero for success and non-zero for + failure). + + + + + Passes a shutdown request to the SQLite core library. Throws an + exception if the shutdown request fails and the no-throw parameter + is non-zero. + + + Non-zero to reset the database and temporary directories to their + default values, which should be null for both. + + + When non-zero, throw an exception if the shutdown request fails. + + + + Enables or disables extended result codes returned by SQLite + + + Enables or disables extended result codes returned by SQLite + + + Enables or disables extended result codes returned by SQLite + + + Add a log message via the SQLite sqlite3_log interface. + + + Add a log message via the SQLite sqlite3_log interface. + + + + Queries or modifies the number of retries or the retry interval (in milliseconds) for + certain I/O operations that may fail due to anti-virus software. + + The number of times to retry the I/O operation. A negative value + will cause the current count to be queried and replace that negative value. + The number of milliseconds to wait before retrying the I/O + operation. This number is multiplied by the number of retry attempts so far to come + up with the final number of milliseconds to wait. A negative value will cause the + current interval to be queried and replace that negative value. + Zero for success, non-zero for error. + + + + Sets the chunk size for the primary file associated with this database + connection. + + + The new chunk size for the main database, in bytes. + + + Zero for success, non-zero for error. + + + + + Removes one set of surrounding single -OR- double quotes from the string + value and returns the resulting string value. If the string is null, empty, + or contains quotes that are not balanced, nothing is done and the original + string value will be returned. + + The string value to process. + + The string value, modified to remove one set of surrounding single -OR- + double quotes, if applicable. + + + + + Determines the directory to be used when dealing with the "|DataDirectory|" + macro in a database file name. + + + The directory to use in place of the "|DataDirectory|" macro -OR- null if it + cannot be determined. + + + + + Expand the filename of the data source, resolving the |DataDirectory| + macro as appropriate. + + The database filename to expand + + Non-zero if the returned file name should be converted to a full path + (except when using the .NET Compact Framework). + + The expanded path and filename of the filename + + + + The following commands are used to extract schema information out of the database. Valid schema types are: + + + MetaDataCollections + + + DataSourceInformation + + + Catalogs + + + Columns + + + ForeignKeys + + + Indexes + + + IndexColumns + + + Tables + + + Views + + + ViewColumns + + + + + Returns the MetaDataCollections schema + + A DataTable of the MetaDataCollections schema + + + + Returns schema information of the specified collection + + The schema collection to retrieve + A DataTable of the specified collection + + + + Retrieves schema information using the specified constraint(s) for the specified collection + + The collection to retrieve. + + The restrictions to impose. Typically, this may include: + + + restrictionValues element index + usage + + + 0 + The database (or catalog) name, if applicable. + + + 1 + The schema name. This is not used by this provider. + + + 2 + The table name, if applicable. + + + 3 + + Depends on . + When "IndexColumns", it is the index name; otherwise, it is the column name. + + + + 4 + + Depends on . + When "IndexColumns", it is the column name; otherwise, it is not used. + + + + + A DataTable of the specified collection + + + + Builds a MetaDataCollections schema datatable + + DataTable + + + + Builds a DataSourceInformation datatable + + DataTable + + + + Build a Columns schema + + The catalog (attached database) to query, can be null + The table to retrieve schema information for, can be null + The column to retrieve schema information for, can be null + DataTable + + + + Returns index information for the given database and catalog + + The catalog (attached database) to query, can be null + The name of the index to retrieve information for, can be null + The table to retrieve index information for, can be null + DataTable + + + + Retrieves table schema information for the database and catalog + + The catalog (attached database) to retrieve tables on + The table to retrieve, can be null + The table type, can be null + DataTable + + + + Retrieves view schema information for the database + + The catalog (attached database) to retrieve views on + The view name, can be null + DataTable + + + + Retrieves catalog (attached databases) schema information for the database + + The catalog to retrieve, can be null + DataTable + + + + Returns the base column information for indexes in a database + + The catalog to retrieve indexes for (can be null) + The table to restrict index information by (can be null) + The index to restrict index information by (can be null) + The source column to restrict index information by (can be null) + A DataTable containing the results + + + + Returns detailed column information for a specified view + + The catalog to retrieve columns for (can be null) + The view to restrict column information by (can be null) + The source column to restrict column information by (can be null) + A DataTable containing the results + + + + Retrieves foreign key information from the specified set of filters + + An optional catalog to restrict results on + An optional table to restrict results on + An optional foreign key name to restrict results on + A DataTable with the results of the query + + + + This event is raised periodically during long running queries. Changing + the value of the property will + determine if the operation in progress will continue or be interrupted. + For the entire duration of the event, the associated connection and + statement objects must not be modified, either directly or indirectly, by + the called code. + + + + + This event is raised whenever SQLite encounters an action covered by the + authorizer during query preparation. Changing the value of the + property will determine if + the specific action will be allowed, ignored, or denied. For the entire + duration of the event, the associated connection and statement objects + must not be modified, either directly or indirectly, by the called code. + + + + + This event is raised whenever SQLite makes an update/delete/insert into the database on + this connection. It only applies to the given connection. + + + + + This event is raised whenever SQLite is committing a transaction. + Return non-zero to trigger a rollback. + + + + + This event is raised whenever SQLite statement first begins executing on + this connection. It only applies to the given connection. + + + + + This event is raised whenever SQLite is rolling back a transaction. + + + + + Returns the instance. + + + + + The I/O file cache flushing behavior for the connection + + + + + Normal file flushing at critical sections of the code + + + + + Full file flushing after every write operation + + + + + Use the default operating system's file flushing, SQLite does not explicitly flush the file buffers after writing + + + + + Raised each time the number of virtual machine instructions is + approximately equal to the value of the + property. + + The connection performing the operation. + A that contains the + event data. + + + + Raised when authorization is required to perform an action contained + within a SQL query. + + The connection performing the action. + A that contains the + event data. + + + + Raised when a transaction is about to be committed. To roll back a transaction, set the + rollbackTrans boolean value to true. + + The connection committing the transaction + Event arguments on the transaction + + + + Raised when data is inserted, updated and deleted on a given connection + + The connection committing the transaction + The event parameters which triggered the event + + + + Raised when a statement first begins executing on a given connection + + The connection executing the statement + Event arguments of the trace + + + + Raised between each backup step. + + + The source database connection. + + + The source database name. + + + The destination database connection. + + + The destination database name. + + + The number of pages copied with each step. + + + The number of pages remaining to be copied. + + + The total number of pages in the source database. + + + Set to true if the operation needs to be retried due to database + locking issues; otherwise, set to false. + + + True to continue with the backup process or false to halt the backup + process, rolling back any changes that have been made so far. + + + + + The event data associated with progress reporting events. + + + + + The user-defined native data associated with this event. Currently, + this will always contain the value of . + + + + + The return code for the current call into the progress callback. + + + + + Constructs an instance of this class with default property values. + + + + + Constructs an instance of this class with specific property values. + + + The user-defined native data associated with this event. + + + The progress return code. + + + + + The data associated with a call into the authorizer. + + + + + The user-defined native data associated with this event. Currently, + this will always contain the value of . + + + + + The action code responsible for the current call into the authorizer. + + + + + The first string argument for the current call into the authorizer. + The exact value will vary based on the action code, see the + enumeration for possible + values. + + + + + The second string argument for the current call into the authorizer. + The exact value will vary based on the action code, see the + enumeration for possible + values. + + + + + The database name for the current call into the authorizer, if + applicable. + + + + + The name of the inner-most trigger or view that is responsible for + the access attempt or a null value if this access attempt is directly + from top-level SQL code. + + + + + The return code for the current call into the authorizer. + + + + + Constructs an instance of this class with default property values. + + + + + Constructs an instance of this class with specific property values. + + + The user-defined native data associated with this event. + + + The authorizer action code. + + + The first authorizer argument. + + + The second authorizer argument. + + + The database name, if applicable. + + + The name of the inner-most trigger or view that is responsible for + the access attempt or a null value if this access attempt is directly + from top-level SQL code. + + + The authorizer return code. + + + + + Whenever an update event is triggered on a connection, this enum will indicate + exactly what type of operation is being performed. + + + + + A row is being deleted from the given database and table + + + + + A row is being inserted into the table. + + + + + A row is being updated in the table. + + + + + Passed during an Update callback, these event arguments detail the type of update operation being performed + on the given connection. + + + + + The name of the database being updated (usually "main" but can be any attached or temporary database) + + + + + The name of the table being updated + + + + + The type of update being performed (insert/update/delete) + + + + + The RowId affected by this update. + + + + + Event arguments raised when a transaction is being committed + + + + + Set to true to abort the transaction and trigger a rollback + + + + + Passed during an Trace callback, these event arguments contain the UTF-8 rendering of the SQL statement text + + + + + SQL statement text as the statement first begins executing + + + + + This interface represents a custom connection pool implementation + usable by System.Data.SQLite. + + + + + Counts the number of pool entries matching the specified file name. + + + The file name to match or null to match all files. + + + The pool entry counts for each matching file. + + + The total number of connections successfully opened from any pool. + + + The total number of connections successfully closed from any pool. + + + The total number of pool entries for all matching files. + + + + + Disposes of all pooled connections associated with the specified + database file name. + + + The database file name. + + + + + Disposes of all pooled connections. + + + + + Adds a connection to the pool of those associated with the + specified database file name. + + + The database file name. + + + The database connection handle. + + + The connection pool version at the point the database connection + handle was received from the connection pool. This is also the + connection pool version that the database connection handle was + created under. + + + + + Removes a connection from the pool of those associated with the + specified database file name with the intent of using it to + interact with the database. + + + The database file name. + + + The new maximum size of the connection pool for the specified + database file name. + + + The connection pool version associated with the returned database + connection handle, if any. + + + The database connection handle associated with the specified + database file name or null if it cannot be obtained. + + + + + This default method implementations in this class should not be used by + applications that make use of COM (either directly or indirectly) due + to possible deadlocks that can occur during finalization of some COM + objects. + + + + + Keeps track of connections made on a specified file. The PoolVersion + dictates whether old objects get returned to the pool or discarded + when no longer in use. + + + + + The queue of weak references to the actual database connection + handles. + + + + + This pool version associated with the database connection + handles in this pool queue. + + + + + The maximum size of this pool queue. + + + + + Constructs a connection pool queue using the specified version + and maximum size. Normally, all the database connection + handles in this pool are associated with a single database file + name. + + + The initial pool version for this connection pool queue. + + + The initial maximum size for this connection pool queue. + + + + + This field is used to synchronize access to the private static data + in this class. + + + + + When this field is non-null, it will be used to provide the + implementation of all the connection pool methods; otherwise, + the default method implementations will be used. + + + + + The dictionary of connection pools, based on the normalized file + name of the SQLite database. + + + + + The default version number new pools will get. + + + + + The number of connections successfully opened from any pool. + This value is incremented by the Remove method. + + + + + The number of connections successfully closed from any pool. + This value is incremented by the Add method. + + + + + Counts the number of pool entries matching the specified file name. + + + The file name to match or null to match all files. + + + The pool entry counts for each matching file. + + + The total number of connections successfully opened from any pool. + + + The total number of connections successfully closed from any pool. + + + The total number of pool entries for all matching files. + + + + + Disposes of all pooled connections associated with the specified + database file name. + + + The database file name. + + + + + Disposes of all pooled connections. + + + + + Adds a connection to the pool of those associated with the + specified database file name. + + + The database file name. + + + The database connection handle. + + + The connection pool version at the point the database connection + handle was received from the connection pool. This is also the + connection pool version that the database connection handle was + created under. + + + + + Removes a connection from the pool of those associated with the + specified database file name with the intent of using it to + interact with the database. + + + The database file name. + + + The new maximum size of the connection pool for the specified + database file name. + + + The connection pool version associated with the returned database + connection handle, if any. + + + The database connection handle associated with the specified + database file name or null if it cannot be obtained. + + + + + This method is used to obtain a reference to the custom connection + pool implementation currently in use, if any. + + + The custom connection pool implementation or null if the default + connection pool implementation should be used. + + + + + This method is used to set the reference to the custom connection + pool implementation to use, if any. + + + The custom connection pool implementation to use or null if the + default connection pool implementation should be used. + + + + + We do not have to thread-lock anything in this function, because it + is only called by other functions above which already take the lock. + + + The pool queue to resize. + + + If a function intends to add to the pool, this is true, which + forces the resize to take one more than it needs from the pool. + + + + + SQLite implementation of DbConnectionStringBuilder. + + + + + Properties of this class + + + + + Constructs a new instance of the class + + + Default constructor + + + + + Constructs a new instance of the class using the specified connection string. + + The connection string to parse + + + + Private initializer, which assigns the connection string and resets the builder + + The connection string to assign + + + + Gets/Sets the default version of the SQLite engine to instantiate. Currently the only valid value is 3, indicating version 3 of the sqlite library. + + + + + Gets/Sets the synchronization mode (file flushing) of the connection string. Default is "Normal". + + + + + Gets/Sets the encoding for the connection string. The default is "False" which indicates UTF-8 encoding. + + + + + Gets/Sets whether or not to use connection pooling. The default is "False" + + + + + Gets/Sets whethor not to store GUID's in binary format. The default is True + which saves space in the database. + + + + + Gets/Sets the filename to open on the connection string. + + + + + An alternate to the data source property + + + + + An alternate to the data source property that uses the SQLite URI syntax. + + + + + Gets/sets the default command timeout for newly-created commands. This is especially useful for + commands used internally such as inside a SQLiteTransaction, where setting the timeout is not possible. + + + + + Gets/sets the busy timeout to use with the SQLite core library. + + + + + EXPERIMENTAL -- + The wait timeout to use with + method. + This is only used when waiting for the enlistment to be reset + prior to enlisting in a transaction, and then only when the + appropriate connection flag is set. + + + + + Gets/sets the maximum number of retries when preparing SQL to be executed. + This normally only applies to preparation errors resulting from the database + schema being changed. + + + + + Gets/sets the approximate number of virtual machine instructions between + progress events. In order for progress events to actually fire, the event + handler must be added to the event + as well. + + + + + Determines whether or not the connection will automatically participate + in the current distributed transaction (if one exists) + + + + + If set to true, will throw an exception if the database specified in the connection + string does not exist. If false, the database will be created automatically. + + + + + If enabled, uses the legacy 3.xx format for maximum compatibility, but results in larger + database sizes. + + + + + When enabled, the database will be opened for read-only access and writing will be disabled. + + + + + Gets/sets the database encryption password + + + + + Gets/sets the database encryption hexadecimal password + + + + + Gets/Sets the page size for the connection. + + + + + Gets/Sets the maximum number of pages the database may hold + + + + + Gets/Sets the cache size for the connection. + + + + + Gets/Sets the DateTime format for the connection. + + + + + Gets/Sets the DateTime kind for the connection. + + + + + Gets/sets the DateTime format string used for formatting + and parsing purposes. + + + + + Gets/Sets the placeholder base schema name used for + .NET Framework compatibility purposes. + + + + + Determines how SQLite handles the transaction journal file. + + + + + Sets the default isolation level for transactions on the connection. + + + + + Gets/sets the default database type for the connection. + + + + + Gets/sets the default type name for the connection. + + + + + Gets/sets the VFS name for the connection. + + + + + If enabled, use foreign key constraints + + + + + Enable or disable the recursive trigger capability. + + + + + If non-null, this is the version of ZipVFS to use. This requires the + System.Data.SQLite interop assembly -AND- primary managed assembly to + be compiled with the INTEROP_INCLUDE_ZIPVFS option; otherwise, this + property does nothing. + + + + + Gets/Sets the extra behavioral flags. + + + + + If enabled, apply the default connection settings to opened databases. + + + + + If enabled, attempt to resolve the provided data source file name to a + full path before opening. + + + + + If enabled, skip using the configured default connection flags. + + + + + If enabled, skip using the configured shared connection flags. + + + + + Helper function for retrieving values from the connectionstring + + The keyword to retrieve settings for + The resulting parameter value + Returns true if the value was found and returned + + + + Fallback method for MONO, which doesn't implement DbConnectionStringBuilder.GetProperties() + + The hashtable to fill with property descriptors + + + + This base class provides datatype conversion services for the SQLite provider. + + + + + This character is used to escape other characters, including itself, in + connection string property names and values. + + + + + This character can be used to wrap connection string property names and + values. Normally, it is optional; however, when used, it must be the + first -AND- last character of that connection string property name -OR- + value. + + + + + This character can be used to wrap connection string property names and + values. Normally, it is optional; however, when used, it must be the + first -AND- last character of that connection string property name -OR- + value. + + + + + The character is used to separate the name and value for a connection + string property. This character cannot be present in any connection + string property name. This character can be present in a connection + string property value; however, this should be avoided unless deemed + absolutely necessary. + + + + + This character is used to separate connection string properties. When + the "No_SQLiteConnectionNewParser" setting is enabled, this character + may not appear in connection string property names -OR- values. + + + + + These are the characters that are special to the connection string + parser. + + + + + The fallback default database type when one cannot be obtained from an + existing connection instance. + + + + + The fallback default database type name when one cannot be obtained from + an existing connection instance. + + + + + The value for the Unix epoch (e.g. January 1, 1970 at midnight, in UTC). + + + + + The value of the OLE Automation epoch represented as a Julian day. This + field cannot be removed as the test suite relies upon it. + + + + + The format string for DateTime values when using the InvariantCulture or CurrentCulture formats. + + + + + This is the minimum Julian Day value supported by this library + (148731163200000). + + + + + This is the maximum Julian Day value supported by this library + (464269060799000). + + + + + An array of ISO-8601 DateTime formats that we support parsing. + + + + + The internal default format for UTC DateTime values when converting + to a string. + + + + + The internal default format for local DateTime values when converting + to a string. + + + + + An UTF-8 Encoding instance, so we can convert strings to and from UTF-8 + + + + + The default DateTime format for this instance. + + + + + The default DateTimeKind for this instance. + + + + + The default DateTime format string for this instance. + + + + + Initializes the conversion class + + The default date/time format to use for this instance + The DateTimeKind to use. + The DateTime format string to use. + + + + Converts a string to a UTF-8 encoded byte array sized to include a null-terminating character. + + The string to convert to UTF-8 + A byte array containing the converted string plus an extra 0 terminating byte at the end of the array. + + + + Convert a DateTime to a UTF-8 encoded, zero-terminated byte array. + + + This function is a convenience function, which first calls ToString() on the DateTime, and then calls ToUTF8() with the + string result. + + The DateTime to convert. + The UTF-8 encoded string, including a 0 terminating byte at the end of the array. + + + + Converts a UTF-8 encoded IntPtr of the specified length into a .NET string + + The pointer to the memory where the UTF-8 string is encoded + The number of bytes to decode + A string containing the translated character(s) + + + + Converts a UTF-8 encoded IntPtr of the specified length into a .NET string + + The pointer to the memory where the UTF-8 string is encoded + The number of bytes to decode + A string containing the translated character(s) + + + + Checks if the specified is within the + supported range for a Julian Day value. + + + The Julian Day value to check. + + + Non-zero if the specified Julian Day value is in the supported + range; otherwise, zero. + + + + + Converts a Julian Day value from a to an + . + + + The Julian Day value to convert. + + + The resulting Julian Day value. + + + + + Converts a Julian Day value from an to a + . + + + The Julian Day value to convert. + + + The resulting Julian Day value. + + + + + Converts a Julian Day value to a . + This method was translated from the "computeYMD" function in the + "date.c" file belonging to the SQLite core library. + + + The Julian Day value to convert. + + + The value to return in the event that the + Julian Day is out of the supported range. If this value is null, + an exception will be thrown instead. + + + A value that contains the year, month, and + day values that are closest to the specified Julian Day value. + + + + + Converts a Julian Day value to a . + This method was translated from the "computeHMS" function in the + "date.c" file belonging to the SQLite core library. + + + The Julian Day value to convert. + + + The value to return in the event that the + Julian Day value is out of the supported range. If this value is + null, an exception will be thrown instead. + + + A value that contains the hour, minute, and + second, and millisecond values that are closest to the specified + Julian Day value. + + + + + Converts a to a Julian Day value. + This method was translated from the "computeJD" function in + the "date.c" file belonging to the SQLite core library. + Since the range of Julian Day values supported by this method + includes all possible (valid) values of a + value, it should be extremely difficult for this method to + raise an exception or return an undefined result. + + + The value to convert. This value + will be within the range of + (00:00:00.0000000, January 1, 0001) to + (23:59:59.9999999, December + 31, 9999). + + + The nearest Julian Day value corresponding to the specified + value. + + + + + Converts a string into a DateTime, using the DateTimeFormat, DateTimeKind, + and DateTimeFormatString specified for the connection when it was opened. + + + Acceptable ISO8601 DateTime formats are: + + THHmmssK + THHmmK + HH:mm:ss.FFFFFFFK + HH:mm:ssK + HH:mmK + yyyy-MM-dd HH:mm:ss.FFFFFFFK + yyyy-MM-dd HH:mm:ssK + yyyy-MM-dd HH:mmK + yyyy-MM-ddTHH:mm:ss.FFFFFFFK + yyyy-MM-ddTHH:mmK + yyyy-MM-ddTHH:mm:ssK + yyyyMMddHHmmssK + yyyyMMddHHmmK + yyyyMMddTHHmmssFFFFFFFK + THHmmss + THHmm + HH:mm:ss.FFFFFFF + HH:mm:ss + HH:mm + yyyy-MM-dd HH:mm:ss.FFFFFFF + yyyy-MM-dd HH:mm:ss + yyyy-MM-dd HH:mm + yyyy-MM-ddTHH:mm:ss.FFFFFFF + yyyy-MM-ddTHH:mm + yyyy-MM-ddTHH:mm:ss + yyyyMMddHHmmss + yyyyMMddHHmm + yyyyMMddTHHmmssFFFFFFF + yyyy-MM-dd + yyyyMMdd + yy-MM-dd + + If the string cannot be matched to one of the above formats -OR- + the DateTimeFormatString if one was provided, an exception will + be thrown. + + The string containing either a long integer number of 100-nanosecond units since + System.DateTime.MinValue, a Julian day double, an integer number of seconds since the Unix epoch, a + culture-independent formatted date and time string, a formatted date and time string in the current + culture, or an ISO8601-format string. + A DateTime value + + + + Converts a string into a DateTime, using the specified DateTimeFormat, + DateTimeKind and DateTimeFormatString. + + + Acceptable ISO8601 DateTime formats are: + + THHmmssK + THHmmK + HH:mm:ss.FFFFFFFK + HH:mm:ssK + HH:mmK + yyyy-MM-dd HH:mm:ss.FFFFFFFK + yyyy-MM-dd HH:mm:ssK + yyyy-MM-dd HH:mmK + yyyy-MM-ddTHH:mm:ss.FFFFFFFK + yyyy-MM-ddTHH:mmK + yyyy-MM-ddTHH:mm:ssK + yyyyMMddHHmmssK + yyyyMMddHHmmK + yyyyMMddTHHmmssFFFFFFFK + THHmmss + THHmm + HH:mm:ss.FFFFFFF + HH:mm:ss + HH:mm + yyyy-MM-dd HH:mm:ss.FFFFFFF + yyyy-MM-dd HH:mm:ss + yyyy-MM-dd HH:mm + yyyy-MM-ddTHH:mm:ss.FFFFFFF + yyyy-MM-ddTHH:mm + yyyy-MM-ddTHH:mm:ss + yyyyMMddHHmmss + yyyyMMddHHmm + yyyyMMddTHHmmssFFFFFFF + yyyy-MM-dd + yyyyMMdd + yy-MM-dd + + If the string cannot be matched to one of the above formats -OR- + the DateTimeFormatString if one was provided, an exception will + be thrown. + + The string containing either a long integer number of 100-nanosecond units since + System.DateTime.MinValue, a Julian day double, an integer number of seconds since the Unix epoch, a + culture-independent formatted date and time string, a formatted date and time string in the current + culture, or an ISO8601-format string. + The SQLiteDateFormats to use. + The DateTimeKind to use. + The DateTime format string to use. + A DateTime value + + + + Converts a julianday value into a DateTime + + The value to convert + A .NET DateTime + + + + Converts a julianday value into a DateTime + + The value to convert + The DateTimeKind to use. + A .NET DateTime + + + + Converts the specified number of seconds from the Unix epoch into a + value. + + + The number of whole seconds since the Unix epoch. + + + Either Utc or Local time. + + + The new value. + + + + + Converts the specified number of ticks since the epoch into a + value. + + + The number of whole ticks since the epoch. + + + Either Utc or Local time. + + + The new value. + + + + + Converts a DateTime struct to a JulianDay double + + The DateTime to convert + The JulianDay value the Datetime represents + + + + Converts a DateTime struct to the whole number of seconds since the + Unix epoch. + + The DateTime to convert + The whole number of seconds since the Unix epoch + + + + Returns the DateTime format string to use for the specified DateTimeKind. + If is not null, it will be returned verbatim. + + The DateTimeKind to use. + The DateTime format string to use. + + The DateTime format string to use for the specified DateTimeKind. + + + + + Converts a string into a DateTime, using the DateTimeFormat, DateTimeKind, + and DateTimeFormatString specified for the connection when it was opened. + + The DateTime value to convert + Either a string containing the long integer number of 100-nanosecond units since System.DateTime.MinValue, a + Julian day double, an integer number of seconds since the Unix epoch, a culture-independent formatted date and time + string, a formatted date and time string in the current culture, or an ISO8601-format date/time string. + + + + Converts a string into a DateTime, using the DateTimeFormat, DateTimeKind, + and DateTimeFormatString specified for the connection when it was opened. + + The DateTime value to convert + The SQLiteDateFormats to use. + The DateTimeKind to use. + The DateTime format string to use. + Either a string containing the long integer number of 100-nanosecond units since System.DateTime.MinValue, a + Julian day double, an integer number of seconds since the Unix epoch, a culture-independent formatted date and time + string, a formatted date and time string in the current culture, or an ISO8601-format date/time string. + + + + Internal function to convert a UTF-8 encoded IntPtr of the specified length to a DateTime. + + + This is a convenience function, which first calls ToString() on the IntPtr to convert it to a string, then calls + ToDateTime() on the string to return a DateTime. + + A pointer to the UTF-8 encoded string + The length in bytes of the string + The parsed DateTime value + + + + Smart method of splitting a string. Skips quoted elements, removes the quotes. + + + This split function works somewhat like the String.Split() function in that it breaks apart a string into + pieces and returns the pieces as an array. The primary differences are: + + Only one character can be provided as a separator character + Quoted text inside the string is skipped over when searching for the separator, and the quotes are removed. + + Thus, if splitting the following string looking for a comma:
+ One,Two, "Three, Four", Five
+
+ The resulting array would contain
+ [0] One
+ [1] Two
+ [2] Three, Four
+ [3] Five
+
+ Note that the leading and trailing spaces were removed from each item during the split. +
+ Source string to split apart + Separator character + A string array of the split up elements +
+ + + Splits the specified string into multiple strings based on a separator + and returns the result as an array of strings. + + + The string to split into pieces based on the separator character. If + this string is null, null will always be returned. If this string is + empty, an array of zero strings will always be returned. + + + The character used to divide the original string into sub-strings. + This character cannot be a backslash or a double-quote; otherwise, no + work will be performed and null will be returned. + + + If this parameter is non-zero, all double-quote characters will be + retained in the returned list of strings; otherwise, they will be + dropped. + + + Upon failure, this parameter will be modified to contain an appropriate + error message. + + + The new array of strings or null if the input string is null -OR- the + separator character is a backslash or a double-quote -OR- the string + contains an unbalanced backslash or double-quote character. + + + + + Queries and returns the string representation for an object, using the + specified (or current) format provider. + + + The object instance to return the string representation for. + + + The format provider to use -OR- null if the current format provider for + the thread should be used instead. + + + The string representation for the object instance -OR- null if the + object instance is also null. + + + + + Attempts to convert an arbitrary object to the Boolean data type. + Null object values are converted to false. Throws an exception + upon failure. + + + The object value to convert. + + + The format provider to use. + + + If non-zero, a string value will be converted using the + + method; otherwise, the + method will be used. + + + The converted boolean value. + + + + + Convert a value to true or false. + + A string or number representing true or false + + + + + Converts an integer to a string that can be round-tripped using the + invariant culture. + + + The integer value to return the string representation for. + + + The string representation of the specified integer value, using the + invariant culture. + + + + + Attempts to convert a into a . + + + The to convert, cannot be null. + + + The converted value. + + + The supported strings are "yes", "no", "y", "n", "on", "off", "0", "1", + as well as any prefix of the strings + and . All strings are treated in a + case-insensitive manner. + + + + + Converts a SQLiteType to a .NET Type object + + The SQLiteType to convert + Returns a .NET Type object + + + + For a given intrinsic type, return a DbType + + The native type to convert + The corresponding (closest match) DbType + + + + Returns the ColumnSize for the given DbType + + The DbType to get the size of + + + + + Determines the default database type name to be used when a + per-connection value is not available. + + + The connection context for type mappings, if any. + + + The default database type name to use. + + + + + If applicable, issues a trace log message warning about falling back to + the default database type name. + + + The database value type. + + + The flags associated with the parent connection object. + + + The textual name of the database type. + + + + + If applicable, issues a trace log message warning about falling back to + the default database value type. + + + The textual name of the database type. + + + The flags associated with the parent connection object. + + + The database value type. + + + + + For a given database value type, return the "closest-match" textual database type name. + + The connection context for custom type mappings, if any. + The database value type. + The flags associated with the parent connection object. + The type name or an empty string if it cannot be determined. + + + + Convert a DbType to a Type + + The DbType to convert from + The closest-match .NET type + + + + For a given type, return the closest-match SQLite TypeAffinity, which only understands a very limited subset of types. + + The type to evaluate + The flags associated with the connection. + The SQLite type affinity for that type. + + + + Builds and returns a map containing the database column types + recognized by this provider. + + + A map containing the database column types recognized by this + provider. + + + + + Determines if a database type is considered to be a string. + + + The database type to check. + + + Non-zero if the database type is considered to be a string, zero + otherwise. + + + + + Determines and returns the runtime configuration setting string that + should be used in place of the specified object value. + + + The object value to convert to a string. + + + Either the string to use in place of the object value -OR- null if it + cannot be determined. + + + + + Determines the default value to be used when a + per-connection value is not available. + + + The connection context for type mappings, if any. + + + The default value to use. + + + + + Converts the object value, which is assumed to have originated + from a , to a string value. + + + The value to be converted to a string. + + + A null value will be returned if the original value is null -OR- + the original value is . Otherwise, + the original value will be converted to a string, using its + (possibly overridden) method and + then returned. + + + + + Determines if the specified textual value appears to be a + value. + + + The textual value to inspect. + + + Non-zero if the text looks like a value, + zero otherwise. + + + + + Determines if the specified textual value appears to be an + value. + + + The textual value to inspect. + + + Non-zero if the text looks like an value, + zero otherwise. + + + + + Determines if the specified textual value appears to be a + value. + + + The textual value to inspect. + + + Non-zero if the text looks like a value, + zero otherwise. + + + + + Determines if the specified textual value appears to be a + value. + + + The object instance configured with + the chosen format. + + + The textual value to inspect. + + + Non-zero if the text looks like a in the + configured format, zero otherwise. + + + + + For a given textual database type name, return the "closest-match" database type. + This method is called during query result processing; therefore, its performance + is critical. + + The connection context for custom type mappings, if any. + The textual name of the database type to match. + The flags associated with the parent connection object. + The .NET DBType the text evaluates to. + + + + SQLite has very limited types, and is inherently text-based. The first 5 types below represent the sum of all types SQLite + understands. The DateTime extension to the spec is for internal use only. + + + + + Not used + + + + + All integers in SQLite default to Int64 + + + + + All floating point numbers in SQLite default to double + + + + + The default data type of SQLite is text + + + + + Typically blob types are only seen when returned from a function + + + + + Null types can be returned from functions + + + + + Used internally by this provider + + + + + Used internally by this provider + + + + + These are the event types associated with the + + delegate (and its corresponding event) and the + class. + + + + + Not used. + + + + + Not used. + + + + + The connection is being opened. + + + + + The connection string has been parsed. + + + + + The connection was opened. + + + + + The method was called on the + connection. + + + + + A transaction was created using the connection. + + + + + The connection was enlisted into a transaction. + + + + + A command was created using the connection. + + + + + A data reader was created using the connection. + + + + + An instance of a derived class has + been created to wrap a native resource. + + + + + The connection is being closed. + + + + + The connection was closed. + + + + + A command is being disposed. + + + + + A data reader is being disposed. + + + + + A data reader is being closed. + + + + + A native resource was opened (i.e. obtained) from the pool. + + + + + A native resource was closed (i.e. released) to the pool. + + + + + This implementation of SQLite for ADO.NET can process date/time fields in + databases in one of six formats. + + + ISO8601 format is more compatible, readable, fully-processable, but less + accurate as it does not provide time down to fractions of a second. + JulianDay is the numeric format the SQLite uses internally and is arguably + the most compatible with 3rd party tools. It is not readable as text + without post-processing. Ticks less compatible with 3rd party tools that + query the database, and renders the DateTime field unreadable as text + without post-processing. UnixEpoch is more compatible with Unix systems. + InvariantCulture allows the configured format for the invariant culture + format to be used and is human readable. CurrentCulture allows the + configured format for the current culture to be used and is also human + readable. + + The preferred order of choosing a DateTime format is JulianDay, ISO8601, + and then Ticks. Ticks is mainly present for legacy code support. + + + + + Use the value of DateTime.Ticks. This value is not recommended and is not well supported with LINQ. + + + + + Use the ISO-8601 format. Uses the "yyyy-MM-dd HH:mm:ss.FFFFFFFK" format for UTC DateTime values and + "yyyy-MM-dd HH:mm:ss.FFFFFFF" format for local DateTime values). + + + + + The interval of time in days and fractions of a day since January 1, 4713 BC. + + + + + The whole number of seconds since the Unix epoch (January 1, 1970). + + + + + Any culture-independent string value that the .NET Framework can interpret as a valid DateTime. + + + + + Any string value that the .NET Framework can interpret as a valid DateTime using the current culture. + + + + + The default format for this provider. + + + + + This enum determines how SQLite treats its journal file. + + + By default SQLite will create and delete the journal file when needed during a transaction. + However, for some computers running certain filesystem monitoring tools, the rapid + creation and deletion of the journal file can cause those programs to fail, or to interfere with SQLite. + + If a program or virus scanner is interfering with SQLite's journal file, you may receive errors like "unable to open database file" + when starting a transaction. If this is happening, you may want to change the default journal mode to Persist. + + + + + The default mode, this causes SQLite to use the existing journaling mode for the database. + + + + + SQLite will create and destroy the journal file as-needed. + + + + + When this is set, SQLite will keep the journal file even after a transaction has completed. It's contents will be erased, + and the journal re-used as often as needed. If it is deleted, it will be recreated the next time it is needed. + + + + + This option disables the rollback journal entirely. Interrupted transactions or a program crash can cause database + corruption in this mode! + + + + + SQLite will truncate the journal file to zero-length instead of deleting it. + + + + + SQLite will store the journal in volatile RAM. This saves disk I/O but at the expense of database safety and integrity. + If the application using SQLite crashes in the middle of a transaction when the MEMORY journaling mode is set, then the + database file will very likely go corrupt. + + + + + SQLite uses a write-ahead log instead of a rollback journal to implement transactions. The WAL journaling mode is persistent; + after being set it stays in effect across multiple database connections and after closing and reopening the database. A database + in WAL journaling mode can only be accessed by SQLite version 3.7.0 or later. + + + + + Possible values for the "synchronous" database setting. This setting determines + how often the database engine calls the xSync method of the VFS. + + + + + Use the default "synchronous" database setting. Currently, this should be + the same as using the FULL mode. + + + + + The database engine continues without syncing as soon as it has handed + data off to the operating system. If the application running SQLite + crashes, the data will be safe, but the database might become corrupted + if the operating system crashes or the computer loses power before that + data has been written to the disk surface. + + + + + The database engine will still sync at the most critical moments, but + less often than in FULL mode. There is a very small (though non-zero) + chance that a power failure at just the wrong time could corrupt the + database in NORMAL mode. + + + + + The database engine will use the xSync method of the VFS to ensure that + all content is safely written to the disk surface prior to continuing. + This ensures that an operating system crash or power failure will not + corrupt the database. FULL synchronous is very safe, but it is also + slower. + + + + + The requested command execution type. This controls which method of the + object will be called. + + + + + Do nothing. No method will be called. + + + + + The command is not expected to return a result -OR- the result is not + needed. The or + method + will be called. + + + + + The command is expected to return a scalar result -OR- the result should + be limited to a scalar result. The + or method will + be called. + + + + + The command is expected to return result. + The or + method will + be called. + + + + + Use the default command execution type. Using this value is the same + as using the value. + + + + + The action code responsible for the current call into the authorizer. + + + + + No action is being performed. This value should not be used from + external code. + + + + + No longer used. + + + + + An index will be created. The action-specific arguments are the + index name and the table name. + + + + + + A table will be created. The action-specific arguments are the + table name and a null value. + + + + + A temporary index will be created. The action-specific arguments + are the index name and the table name. + + + + + A temporary table will be created. The action-specific arguments + are the table name and a null value. + + + + + A temporary trigger will be created. The action-specific arguments + are the trigger name and the table name. + + + + + A temporary view will be created. The action-specific arguments are + the view name and a null value. + + + + + A trigger will be created. The action-specific arguments are the + trigger name and the table name. + + + + + A view will be created. The action-specific arguments are the view + name and a null value. + + + + + A DELETE statement will be executed. The action-specific arguments + are the table name and a null value. + + + + + An index will be dropped. The action-specific arguments are the + index name and the table name. + + + + + A table will be dropped. The action-specific arguments are the tables + name and a null value. + + + + + A temporary index will be dropped. The action-specific arguments are + the index name and the table name. + + + + + A temporary table will be dropped. The action-specific arguments are + the table name and a null value. + + + + + A temporary trigger will be dropped. The action-specific arguments + are the trigger name and the table name. + + + + + A temporary view will be dropped. The action-specific arguments are + the view name and a null value. + + + + + A trigger will be dropped. The action-specific arguments are the + trigger name and the table name. + + + + + A view will be dropped. The action-specific arguments are the view + name and a null value. + + + + + An INSERT statement will be executed. The action-specific arguments + are the table name and a null value. + + + + + A PRAGMA statement will be executed. The action-specific arguments + are the name of the PRAGMA and the new value or a null value. + + + + + A table column will be read. The action-specific arguments are the + table name and the column name. + + + + + A SELECT statement will be executed. The action-specific arguments + are both null values. + + + + + A transaction will be started, committed, or rolled back. The + action-specific arguments are the name of the operation (BEGIN, + COMMIT, or ROLLBACK) and a null value. + + + + + An UPDATE statement will be executed. The action-specific arguments + are the table name and the column name. + + + + + A database will be attached to the connection. The action-specific + arguments are the database file name and a null value. + + + + + A database will be detached from the connection. The action-specific + arguments are the database name and a null value. + + + + + The schema of a table will be altered. The action-specific arguments + are the database name and the table name. + + + + + An index will be deleted and then recreated. The action-specific + arguments are the index name and a null value. + + + + + A table will be analyzed to gathers statistics about it. The + action-specific arguments are the table name and a null value. + + + + + A virtual table will be created. The action-specific arguments are + the table name and the module name. + + + + + A virtual table will be dropped. The action-specific arguments are + the table name and the module name. + + + + + A SQL function will be called. The action-specific arguments are a + null value and the function name. + + + + + A savepoint will be created, released, or rolled back. The + action-specific arguments are the name of the operation (BEGIN, + RELEASE, or ROLLBACK) and the savepoint name. + + + + + A recursive query will be executed. The action-specific arguments + are two null values. + + + + + The possible return codes for the progress callback. + + + + + The operation should continue. + + + + + The operation should be interrupted. + + + + + The return code for the current call into the authorizer. + + + + + The action will be allowed. + + + + + The overall action will be disallowed and an error message will be + returned from the query preparation method. + + + + + The specific action will be disallowed; however, the overall action + will continue. The exact effects of this return code vary depending + on the specific action, please refer to the SQLite core library + documentation for futher details. + + + + + Class used internally to determine the datatype of a column in a resultset + + + + + The DbType of the column, or DbType.Object if it cannot be determined + + + + + The affinity of a column, used for expressions or when Type is DbType.Object + + + + + Constructs a default instance of this type. + + + + + Constructs an instance of this type with the specified field values. + + + The type affinity to use for the new instance. + + + The database type to use for the new instance. + + + + + SQLite implementation of DbDataAdapter. + + + + + This class is just a shell around the DbDataAdapter. Nothing from + DbDataAdapter is overridden here, just a few constructors are defined. + + + Default constructor. + + + + + Constructs a data adapter using the specified select command. + + + The select command to associate with the adapter. + + + + + Constructs a data adapter with the supplied select command text and + associated with the specified connection. + + + The select command text to associate with the data adapter. + + + The connection to associate with the select command. + + + + + Constructs a data adapter with the specified select command text, + and using the specified database connection string. + + + The select command text to use to construct a select command. + + + A connection string suitable for passing to a new SQLiteConnection, + which is associated with the select command. + + + + + Constructs a data adapter with the specified select command text, + and using the specified database connection string. + + + The select command text to use to construct a select command. + + + A connection string suitable for passing to a new SQLiteConnection, + which is associated with the select command. + + + Non-zero to parse the connection string using the built-in (i.e. + framework provided) parser when opening the connection. + + + + + Cleans up resources (native and managed) associated with the current instance. + + + Zero when being disposed via garbage collection; otherwise, non-zero. + + + + + Row updating event handler + + + + + Row updated event handler + + + + + Raised by the underlying DbDataAdapter when a row is being updated + + The event's specifics + + + + Raised by DbDataAdapter after a row is updated + + The event's specifics + + + + Gets/sets the select command for this DataAdapter + + + + + Gets/sets the insert command for this DataAdapter + + + + + Gets/sets the update command for this DataAdapter + + + + + Gets/sets the delete command for this DataAdapter + + + + + SQLite implementation of DbDataReader. + + + + + Underlying command this reader is attached to + + + + + The flags pertaining to the associated connection (via the command). + + + + + Index of the current statement in the command being processed + + + + + Current statement being Read() + + + + + State of the current statement being processed. + -1 = First Step() executed, so the first Read() will be ignored + 0 = Actively reading + 1 = Finished reading + 2 = Non-row-returning statement, no records + + + + + Number of records affected by the insert/update statements executed on the command + + + + + Count of fields (columns) in the row-returning statement currently being processed + + + + + The number of calls to Step() that have returned true (i.e. the number of rows that + have been read in the current result set). + + + + + Maps the field (column) names to their corresponding indexes within the results. + + + + + Datatypes of active fields (columns) in the current statement, used for type-restricting data + + + + + The behavior of the datareader + + + + + If set, then dispose of the command object when the reader is finished + + + + + If set, then raise an exception when the object is accessed after being disposed. + + + + + An array of rowid's for the active statement if CommandBehavior.KeyInfo is specified + + + + + Matches the version of the connection. + + + + + The "stub" (i.e. placeholder) base schema name to use when returning + column schema information. Matches the base schema name used by the + associated connection. + + + + + Internal constructor, initializes the datareader and sets up to begin executing statements + + The SQLiteCommand this data reader is for + The expected behavior of the data reader + + + + Dispose of all resources used by this datareader. + + + + + + Closes the datareader, potentially closing the connection as well if CommandBehavior.CloseConnection was specified. + + + + + Throw an error if the datareader is closed + + + + + Throw an error if a row is not loaded + + + + + Enumerator support + + Returns a DbEnumerator object. + + + + Not implemented. Returns 0 + + + + + Returns the number of columns in the current resultset + + + + + Forces the connection flags cached by this data reader to be refreshed + from the underlying connection. + + + + + Returns the number of rows seen so far in the current result set. + + + + + Returns the number of visible fields in the current resultset + + + + + This method is used to make sure the result set is open and a row is currently available. + + + + + SQLite is inherently un-typed. All datatypes in SQLite are natively strings. The definition of the columns of a table + and the affinity of returned types are all we have to go on to type-restrict data in the reader. + + This function attempts to verify that the type of data being requested of a column matches the datatype of the column. In + the case of columns that are not backed into a table definition, we attempt to match up the affinity of a column (int, double, string or blob) + to a set of known types that closely match that affinity. It's not an exact science, but its the best we can do. + + + This function throws an InvalidTypeCast() exception if the requested type doesn't match the column's definition or affinity. + + The index of the column to type-check + The type we want to get out of the column + + + + Invokes the data reader value callback configured for the database + type name associated with the specified column. If no data reader + value callback is available for the database type name, do nothing. + + + The index of the column being read. + + + The extra event data to pass into the callback. + + + Non-zero if the default handling for the data reader call should be + skipped. If this is set to non-zero and the necessary return value + is unavailable or unsuitable, an exception will be thrown. + + + + + Attempts to query the integer identifier for the current row. This + will not work for tables that were created WITHOUT ROWID -OR- if the + query does not include the "rowid" column or one of its aliases -OR- + if the was not created with the + flag. + + + The index of the BLOB column. + + + The integer identifier for the current row -OR- null if it could not + be determined. + + + + + Retrieves the column as a object. + This will not work for tables that were created WITHOUT ROWID + -OR- if the query does not include the "rowid" column or one + of its aliases -OR- if the was + not created with the + flag. + + The index of the column. + + Non-zero to open the blob object for read-only access. + + A new object. + + + + Retrieves the column as a boolean value + + The index of the column. + bool + + + + Retrieves the column as a single byte value + + The index of the column. + byte + + + + Retrieves a column as an array of bytes (blob) + + The index of the column. + The zero-based index of where to begin reading the data + The buffer to write the bytes into + The zero-based index of where to begin writing into the array + The number of bytes to retrieve + The actual number of bytes written into the array + + To determine the number of bytes in the column, pass a null value for the buffer. The total length will be returned. + + + + + Returns the column as a single character + + The index of the column. + char + + + + Retrieves a column as an array of chars (blob) + + The index of the column. + The zero-based index of where to begin reading the data + The buffer to write the characters into + The zero-based index of where to begin writing into the array + The number of bytes to retrieve + The actual number of characters written into the array + + To determine the number of characters in the column, pass a null value for the buffer. The total length will be returned. + + + + + Retrieves the name of the back-end datatype of the column + + The index of the column. + string + + + + Retrieve the column as a date/time value + + The index of the column. + DateTime + + + + Retrieve the column as a decimal value + + The index of the column. + decimal + + + + Returns the column as a double + + The index of the column. + double + + + + Determines and returns the of the + specified column. + + + The index of the column. + + + The associated with the specified + column, if any. + + + + + Returns the .NET type of a given column + + The index of the column. + Type + + + + Returns a column as a float value + + The index of the column. + float + + + + Returns the column as a Guid + + The index of the column. + Guid + + + + Returns the column as a short + + The index of the column. + Int16 + + + + Retrieves the column as an int + + The index of the column. + Int32 + + + + Retrieves the column as a long + + The index of the column. + Int64 + + + + Retrieves the name of the column + + The index of the column. + string + + + + Returns the name of the database associated with the specified column. + + The index of the column. + string + + + + Returns the name of the table associated with the specified column. + + The index of the column. + string + + + + Returns the original name of the specified column. + + The index of the column. + string + + + + Retrieves the i of a column, given its name + + The name of the column to retrieve + The int i of the column + + + + Schema information in SQLite is difficult to map into .NET conventions, so a lot of work must be done + to gather the necessary information so it can be represented in an ADO.NET manner. + Returns a DataTable containing the schema information for the active SELECT statement being processed. - + - Clears the connection pool associated with the connection. Any other active connections using the same database file - will be discarded instead of returned to the pool when they are closed. + Retrieves the column as a string - + The index of the column. + string - + - Clears all connection pools. Any active connections will be discarded instead of sent to the pool when they are closed. + Retrieves the column as an object corresponding to the underlying datatype of the column + The index of the column. + object - + - Create a new and associate it with this connection. + Retreives the values of multiple columns, up to the size of the supplied array - Returns a new command object already assigned to this connection. + The array to fill with values from the columns in the current resultset + The number of columns retrieved - + - Forwards to the local function. + Returns a collection containing all the column names and values for the + current row of data in the current resultset, if any. If there is no + current row or no current resultset, an exception may be thrown. - + + The collection containing the column name and value information for the + current row of data in the current resultset or null if this information + cannot be obtained. + - + - Parses the connection string into component parts using the custom - connection string parser. + Returns True if the resultset has rows that can be fetched - The connection string to parse - An array of key-value pairs representing each parameter of the connection string - + - Parses a connection string using the built-in (i.e. framework provided) - connection string parser class and returns the key/value pairs. An - exception may be thrown if the connection string is invalid or cannot be - parsed. When compiled for the .NET Compact Framework, the custom - connection string parser is always used instead because the framework - provided one is unavailable there. + Returns True if the data reader is closed - - The connection string to parse. - - - Non-zero to throw an exception if any connection string values are not of - the type. - - The list of key/value pairs. - + - Manual distributed transaction enlistment support + Returns True if the specified column is null - The distributed transaction to enlist in + The index of the column. + True or False - + - Looks for a key in the array of key/values of the parameter string. If not found, return the specified default value + Moves to the next resultset in multiple row-returning SQL command. - The list to look in - The key to find - The default value to return if the key is not found - The value corresponding to the specified key, or the default value if not found. + True if the command was successful and a new resultset is available, False otherwise. - + - Attempts to convert the string value to an enumerated value of the specified type. + This method attempts to query the database connection associated with + the data reader in use. If the underlying command or connection is + unavailable, a null value will be returned. - The enumerated type to convert the string value to. - The string value to be converted. - Non-zero to make the conversion case-insensitive. - The enumerated value upon success or null upon error. + + The connection object -OR- null if it is unavailable. + - + - Attempts to convert an input string into a byte value. + Retrieves the SQLiteType for a given column and row value. - - The string value to be converted. - - - The number styles to use for the conversion. + + The original SQLiteType structure, based only on the column. - - Upon sucess, this will contain the parsed byte value. - Upon failure, the value of this parameter is undefined. + + The textual value of the column for a given row. - Non-zero upon success; zero on failure. + The SQLiteType structure. - + - Enables or disabled extension loading. + Retrieves the SQLiteType for a given column, and caches it to avoid repetetive interop calls. - - True to enable loading of extensions, false to disable. - + The flags associated with the parent connection object. + The index of the column. + A SQLiteType structure - + - Loads a SQLite extension library from the named dynamic link library file. + Reads the next row from the resultset - - The name of the dynamic link library file containing the extension. - + True if a new row was successfully loaded and is ready for processing - + - Loads a SQLite extension library from the named dynamic link library file. + Returns the number of rows affected by the statement being executed. + The value returned may not be accurate for DDL statements. Also, it + will be -1 for any statement that does not modify the database (e.g. + SELECT). If an otherwise read-only statement modifies the database + indirectly (e.g. via a virtual table or user-defined function), the + value returned is undefined. - - The name of the dynamic link library file containing the extension. + + + + Indexer to retrieve data from a column given its name + + The name of the column to retrieve data for + The value contained in the column + + + + Indexer to retrieve data from a column given its i + + The index of the column. + The value contained in the column + + + + SQLite exception class. + + + + + This value was copied from the "WinError.h" file included with the + Platform SDK for Windows 10. + + + + + Private constructor for use with serialization. + + + Holds the serialized object data about the exception being thrown. - - The name of the exported function used to initialize the extension. - If null, the default "sqlite3_extension_init" will be used. + + Contains contextual information about the source or destination. - + - Creates a disposable module containing the implementation of a virtual - table. + Public constructor for generating a SQLite exception given the error + code and message. - - The module object to be used when creating the disposable module. + + The SQLite return code to report. + + + Message text to go along with the return code message text. - + - Parses a string containing a sequence of zero or more hexadecimal - encoded byte values and returns the resulting byte array. The - "0x" prefix is not allowed on the input string. + Public constructor that uses the base class constructor for the error + message. - - The input string containing zero or more hexadecimal encoded byte - values. - - - A byte array containing the parsed byte values or null if an error - was encountered. - + Error message text. - + - Creates and returns a string containing the hexadecimal encoded byte - values from the input array. + Public constructor that uses the default base class constructor. - - The input array of bytes. - - - The resulting string or null upon failure. - - + - Parses a string containing a sequence of zero or more hexadecimal - encoded byte values and returns the resulting byte array. The - "0x" prefix is not allowed on the input string. + Public constructor that uses the base class constructor for the error + message and inner exception. - - The input string containing zero or more hexadecimal encoded byte - values. + Error message text. + The original (inner) exception. + + + + Adds extra information to the serialized object data specific to this + class type. This is only used for serialization. + + + Holds the serialized object data about the exception being thrown. - - Upon failure, this will contain an appropriate error message. + + Contains contextual information about the source or destination. - - A byte array containing the parsed byte values or null if an error - was encountered. - - + - This method figures out what the default connection pool setting should - be based on the connection flags. When present, the "Pooling" connection - string property value always overrides the value returned by this method. + Gets the associated SQLite result code for this exception as a + . This property returns the same + underlying value as the property. + + + + + Gets the associated SQLite return code for this exception as an + . For desktop versions of the .NET Framework, + this property overrides the property of the same name within the + + class. This property returns the same underlying value as the + property. + + + + + This method performs extra initialization tasks. It may be called by + any of the constructors of this class. It must not throw exceptions. + + + + + Maps a Win32 error code to an HRESULT. + + The specified Win32 error code. It must be within the range of zero + (0) to 0xFFFF (65535). + + + Non-zero if the HRESULT should indicate success; otherwise, zero. + - Non-zero if the connection pool should be enabled by default; otherwise, - zero. + The integer value of the HRESULT. - + - Determines the transaction isolation level that should be used by - the caller, primarily based upon the one specified by the caller. - If mapping of transaction isolation levels is enabled, the returned - transaction isolation level may be significantly different than the - originally specified one. + Attempts to map the specified onto an + existing HRESULT -OR- a Win32 error code wrapped in an HRESULT. The + mappings may not have perfectly matching semantics; however, they do + have the benefit of being unique within the context of this exception + type. - - The originally specified transaction isolation level. + + The to map. - The transaction isolation level that should be used. + The integer HRESULT value -OR- null if there is no known mapping. - + - Opens the connection using the parameters found in the . + Returns the error message for the specified SQLite return code. + The SQLite return code. + The error message or null if it cannot be found. - + - Opens the connection using the parameters found in the and then returns it. + Returns the composite error message based on the SQLite return code + and the optional detailed error message. - The current connection object. + The SQLite return code. + Optional detailed error message. + Error message text for the return code. - + - This method causes any pending database operation to abort and return at - its earliest opportunity. This routine is typically called in response - to a user action such as pressing "Cancel" or Ctrl-C where the user wants - a long query operation to halt immediately. It is safe to call this - routine from any thread. However, it is not safe to call this routine - with a database connection that is closed or might close before this method - returns. + SQLite error codes. Actually, this enumeration represents a return code, + which may also indicate success in one of several ways (e.g. SQLITE_OK, + SQLITE_ROW, and SQLITE_DONE). Therefore, the name of this enumeration is + something of a misnomer. - + - Returns various global memory statistics for the SQLite core library via - a dictionary of key/value pairs. Currently, only the "MemoryUsed" and - "MemoryHighwater" keys are returned and they have values that correspond - to the values that could be obtained via the - and connection properties. + The error code is unknown. This error code + is only used by the managed wrapper itself. - - This dictionary will be populated with the global memory statistics. It - will be created if necessary. - - + - Attempts to free as much heap memory as possible for this database connection. + Successful result - + - Attempts to free N bytes of heap memory by deallocating non-essential memory - allocations held by the database library. Memory used to cache database pages - to improve performance is an example of non-essential memory. This is a no-op - returning zero if the SQLite core library was not compiled with the compile-time - option SQLITE_ENABLE_MEMORY_MANAGEMENT. Optionally, attempts to reset and/or - compact the Win32 native heap, if applicable. + SQL error or missing database - - The requested number of bytes to free. - - - Non-zero to attempt a heap reset. - - - Non-zero to attempt heap compaction. - - - The number of bytes actually freed. This value may be zero. - - - This value will be non-zero if the heap reset was successful. - - - The size of the largest committed free block in the heap, in bytes. - This value will be zero unless heap compaction is enabled. - - - A standard SQLite return code (i.e. zero for success and non-zero - for failure). - - + - Sets the status of the memory usage tracking subsystem in the SQLite core library. By default, this is enabled. - If this is disabled, memory usage tracking will not be performed. This is not really a per-connection value, it is - global to the process. + Internal logic error in SQLite - Non-zero to enable memory usage tracking, zero otherwise. - A standard SQLite return code (i.e. zero for success and non-zero for failure). - + - Passes a shutdown request to the SQLite core library. Does not throw - an exception if the shutdown request fails. + Access permission denied - - A standard SQLite return code (i.e. zero for success and non-zero for - failure). - - + - Passes a shutdown request to the SQLite core library. Throws an - exception if the shutdown request fails and the no-throw parameter - is non-zero. + Callback routine requested an abort - - Non-zero to reset the database and temporary directories to their - default values, which should be null for both. - - - When non-zero, throw an exception if the shutdown request fails. - - - Enables or disabled extended result codes returned by SQLite + + + The database file is locked + - - Enables or disabled extended result codes returned by SQLite + + + A table in the database is locked + - - Enables or disabled extended result codes returned by SQLite + + + A malloc() failed + - - Add a log message via the SQLite sqlite3_log interface. + + + Attempt to write a readonly database + - - Add a log message via the SQLite sqlite3_log interface. + + + Operation terminated by sqlite3_interrupt() + - + - Change the password (or assign a password) to an open database. + Some kind of disk I/O error occurred - - No readers or writers may be active for this process. The database must already be open - and if it already was password protected, the existing password must already have been supplied. - - The new password to assign to the database - + - Change the password (or assign a password) to an open database. + The database disk image is malformed - - No readers or writers may be active for this process. The database must already be open - and if it already was password protected, the existing password must already have been supplied. - - The new password to assign to the database - + - Sets the password for a password-protected database. A password-protected database is - unusable for any operation until the password has been set. + Unknown opcode in sqlite3_file_control() - The password for the database - + - Sets the password for a password-protected database. A password-protected database is - unusable for any operation until the password has been set. + Insertion failed because database is full - The password for the database - + - Queries or modifies the number of retries or the retry interval (in milliseconds) for - certain I/O operations that may fail due to anti-virus software. + Unable to open the database file - The number of times to retry the I/O operation. A negative value - will cause the current count to be queried and replace that negative value. - The number of milliseconds to wait before retrying the I/O - operation. This number is multiplied by the number of retry attempts so far to come - up with the final number of milliseconds to wait. A negative value will cause the - current interval to be queried and replace that negative value. - Zero for success, non-zero for error. - + - Sets the chunk size for the primary file associated with this database - connection. + Database lock protocol error - - The new chunk size for the main database, in bytes. - - - Zero for success, non-zero for error. - - + - Removes one set of surrounding single -OR- double quotes from the string - value and returns the resulting string value. If the string is null, empty, - or contains quotes that are not balanced, nothing is done and the original - string value will be returned. + Database is empty - The string value to process. - - The string value, modified to remove one set of surrounding single -OR- - double quotes, if applicable. - - + - Expand the filename of the data source, resolving the |DataDirectory| - macro as appropriate. + The database schema changed - The database filename to expand - - Non-zero if the returned file name should be converted to a full path - (except when using the .NET Compact Framework). - - The expanded path and filename of the filename - - - The following commands are used to extract schema information out of the database. Valid schema types are: - - - MetaDataCollections - - - DataSourceInformation - - - Catalogs - - - Columns - - - ForeignKeys - - - Indexes - - - IndexColumns - - - Tables - - - Views - - - ViewColumns - - - - - Returns the MetaDataCollections schema - - A DataTable of the MetaDataCollections schema + + + String or BLOB exceeds size limit + - + - Returns schema information of the specified collection + Abort due to constraint violation - The schema collection to retrieve - A DataTable of the specified collection - + - Retrieves schema information using the specified constraint(s) for the specified collection + Data type mismatch - The collection to retrieve - The restrictions to impose - A DataTable of the specified collection - + - Builds a MetaDataCollections schema datatable + Library used incorrectly - DataTable - + - Builds a DataSourceInformation datatable + Uses OS features not supported on host - DataTable - + - Build a Columns schema + Authorization denied - The catalog (attached database) to query, can be null - The table to retrieve schema information for, must not be null - The column to retrieve schema information for, can be null - DataTable - + - Returns index information for the given database and catalog + Auxiliary database format error - The catalog (attached database) to query, can be null - The name of the index to retrieve information for, can be null - The table to retrieve index information for, can be null - DataTable - + - Retrieves table schema information for the database and catalog + 2nd parameter to sqlite3_bind out of range - The catalog (attached database) to retrieve tables on - The table to retrieve, can be null - The table type, can be null - DataTable - + - Retrieves view schema information for the database + File opened that is not a database file - The catalog (attached database) to retrieve views on - The view name, can be null - DataTable - + - Retrieves catalog (attached databases) schema information for the database + Notifications from sqlite3_log() - The catalog to retrieve, can be null - DataTable - + - Returns the base column information for indexes in a database + Warnings from sqlite3_log() - The catalog to retrieve indexes for (can be null) - The table to restrict index information by (can be null) - The index to restrict index information by (can be null) - The source column to restrict index information by (can be null) - A DataTable containing the results - + - Returns detailed column information for a specified view + sqlite3_step() has another row ready - The catalog to retrieve columns for (can be null) - The view to restrict column information by (can be null) - The source column to restrict column information by (can be null) - A DataTable containing the results - + - Retrieves foreign key information from the specified set of filters + sqlite3_step() has finished executing - An optional catalog to restrict results on - An optional table to restrict results on - An optional foreign key name to restrict results on - A DataTable with the results of the query - + - Static variable to store the connection event handlers to call. + Used to mask off extended result codes - + - This event is raised whenever the database is opened or closed. + A collation sequence was referenced by a schema and it cannot be + found. - + - This event is raised when events related to the lifecycle of a - SQLiteConnection object occur. + An internal operation failed and it may succeed if retried. - + - This property is used to obtain or set the custom connection pool - implementation to use, if any. Setting this property to null will - cause the default connection pool implementation to be used. + A file read operation failed. - + - Returns the number of pool entries for the file name associated with this connection. + A file read operation returned less data than requested. - + - The connection string containing the parameters for the connection + A file write operation failed. + + + + + A file synchronization operation failed. - - - - Parameter - Values - Required - Default - - - Data Source - - This may be a file name, the string ":memory:", or any supported URI (starting with SQLite 3.7.7). - Starting with release 1.0.86.0, in order to use more than one consecutive backslash (e.g. for a - UNC path), each of the adjoining backslash characters must be doubled (e.g. "\\Network\Share\test.db" - would become "\\\\Network\Share\test.db"). - - Y - - - - Version - 3 - N - 3 - - - UseUTF16Encoding - True
False
- N - False -
- - DateTimeFormat - - Ticks - Use the value of DateTime.Ticks.
- ISO8601 - Use the ISO-8601 format. Uses the "yyyy-MM-dd HH:mm:ss.FFFFFFFK" format for UTC - DateTime values and "yyyy-MM-dd HH:mm:ss.FFFFFFF" format for local DateTime values).
- JulianDay - The interval of time in days and fractions of a day since January 1, 4713 BC.
- UnixEpoch - The whole number of seconds since the Unix epoch (January 1, 1970).
- InvariantCulture - Any culture-independent string value that the .NET Framework can interpret as a valid DateTime.
- CurrentCulture - Any string value that the .NET Framework can interpret as a valid DateTime using the current culture.
- N - ISO8601 -
- - DateTimeKind - Unspecified - Not specified as either UTC or local time.
Utc - The time represented is UTC.
Local - The time represented is local time.
- N - Unspecified -
- - DateTimeFormatString - The exact DateTime format string to use for all formatting and parsing of all DateTime - values for this connection. - N - null - - - BaseSchemaName - Some base data classes in the framework (e.g. those that build SQL queries dynamically) - assume that an ADO.NET provider cannot support an alternate catalog (i.e. database) without supporting - alternate schemas as well; however, SQLite does not fit into this model. Therefore, this value is used - as a placeholder and removed prior to preparing any SQL statements that may contain it. - N - sqlite_default_schema - - - BinaryGUID - True - Store GUID columns in binary form
False - Store GUID columns as text
- N - True -
- - Cache Size - {size in bytes} - N - 2000 - - - Synchronous - Normal - Normal file flushing behavior
Full - Full flushing after all writes
Off - Underlying OS flushes I/O's
- N - Full -
- - Page Size - {size in bytes} - N - 1024 - - - Password - {password} - Using this parameter requires that the CryptoAPI based codec be enabled at compile-time for both the native interop assembly and the core managed assemblies; otherwise, using this parameter may result in an exception being thrown when attempting to open the connection. - N - - - - HexPassword - {hexPassword} - Must contain a sequence of zero or more hexadecimal encoded byte values without a leading "0x" prefix. Using this parameter requires that the CryptoAPI based codec be enabled at compile-time for both the native interop assembly and the core managed assemblies; otherwise, using this parameter may result in an exception being thrown when attempting to open the connection. - N - - - - Enlist - Y - Automatically enlist in distributed transactions
N - No automatic enlistment
- N - Y -
- - Pooling - - True - Use connection pooling.
- False - Do not use connection pooling.

- WARNING: When using the default connection pool implementation, - setting this property to True should be avoided by applications that - make use of COM (either directly or indirectly) due to possible - deadlocks that can occur during the finalization of some COM objects. -
- N - False -
- - FailIfMissing - True - Don't create the database if it does not exist, throw an error instead
False - Automatically create the database if it does not exist
- N - False -
- - Max Page Count - {size in pages} - Limits the maximum number of pages (limits the size) of the database - N - 0 - - - Legacy Format - True - Use the more compatible legacy 3.x database format
False - Use the newer 3.3x database format which compresses numbers more effectively
- N - False -
- - Default Timeout - {time in seconds}
The default command timeout
- N - 30 -
- - Journal Mode - Delete - Delete the journal file after a commit
Persist - Zero out and leave the journal file on disk after a commit
Off - Disable the rollback journal entirely
- N - Delete -
- - Read Only - True - Open the database for read only access
False - Open the database for normal read/write access
- N - False -
- - Max Pool Size - The maximum number of connections for the given connection string that can be in the connection pool - N - 100 - - - Default IsolationLevel - The default transaciton isolation level - N - Serializable - - - Foreign Keys - Enable foreign key constraints - N - False - - - Flags - Extra behavioral flags for the connection. See the enumeration for possible values. - N - Default - - - SetDefaults - - True - Apply the default connection settings to the opened database.
- False - Skip applying the default connection settings to the opened database. -
- N - True -
- - ToFullPath - - True - Attempt to expand the data source file name to a fully qualified path before opening.
- False - Skip attempting to expand the data source file name to a fully qualified path before opening. -
- N - True -
-
-
- + - Returns the data source file name without extension or path. + A directory synchronization operation failed. - + - Returns the string "main". + A file truncate operation failed. - + - Gets/sets the default command timeout for newly-created commands. This is especially useful for - commands used internally such as inside a SQLiteTransaction, where setting the timeout is not possible. - This can also be set in the ConnectionString with "Default Timeout" + A file metadata operation failed. - + - Non-zero if the built-in (i.e. framework provided) connection string - parser should be used when opening the connection. + A file unlock operation failed. - + - Gets/sets the extra behavioral flags for this connection. See the - enumeration for a list of - possible values. + A file lock operation failed. - + - Gets/sets the default database type for this connection. This value - will only be used when not null. + A file delete operation failed. - + - Gets/sets the default database type name for this connection. This - value will only be used when not null. + Not currently used. - + - Returns non-zero if the underlying native connection handle is - owned by this instance. + Out-of-memory during a file operation. - + - Returns the version of the underlying SQLite database engine + A file existence/status operation failed. - + - Returns the rowid of the most recent successful INSERT into the database from this connection. + A check for a reserved lock failed. - + - Returns the number of rows changed by the last INSERT, UPDATE, or DELETE statement executed on - this connection. + A file lock operation failed. - + - Returns non-zero if the given database connection is in autocommit mode. - Autocommit mode is on by default. Autocommit mode is disabled by a BEGIN - statement. Autocommit mode is re-enabled by a COMMIT or ROLLBACK. + A file close operation failed. - + - Returns the amount of memory (in bytes) currently in use by the SQLite core library. + A directory close operation failed. - + - Returns the maximum amount of memory (in bytes) used by the SQLite core library since the high-water mark was last reset. + A shared memory open operation failed. - + - Returns a string containing the define constants (i.e. compile-time - options) used to compile the core managed assembly, delimited with - spaces. + A shared memory size operation failed. - + - Returns the version of the underlying SQLite core library. + A shared memory lock operation failed. - + - This method returns the string whose value is the same as the - SQLITE_SOURCE_ID C preprocessor macro used when compiling the - SQLite core library. + A shared memory map operation failed. - + - Returns a string containing the compile-time options used to - compile the SQLite core native library, delimited with spaces. + A file seek operation failed. - + - This method returns the version of the interop SQLite assembly - used. If the SQLite interop assembly is not in use or the - necessary information cannot be obtained for any reason, a null - value may be returned. + A file delete operation failed because it does not exist. - + - This method returns the string whose value contains the unique - identifier for the source checkout used to build the interop - assembly. If the SQLite interop assembly is not in use or the - necessary information cannot be obtained for any reason, a null - value may be returned. + A file memory mapping operation failed. - + - Returns a string containing the compile-time options used to - compile the SQLite interop assembly, delimited with spaces. + The temporary directory path could not be obtained. - + - This method returns the version of the managed components used - to interact with the SQLite core library. If the necessary - information cannot be obtained for any reason, a null value may - be returned. + A path string conversion operation failed. - + - This method returns the string whose value contains the unique - identifier for the source checkout used to build the managed - components currently executing. If the necessary information - cannot be obtained for any reason, a null value may be returned. + Reserved. - + - The extra connection flags to be used for all opened connections. + An attempt to authenticate failed. - + - Returns the state of the connection. + An attempt to begin a file system transaction failed. - + - This event is raised whenever SQLite encounters an action covered by the - authorizer during query preparation. Changing the value of the - property will determine if - the specific action will be allowed, ignored, or denied. For the entire - duration of the event, the associated connection and statement objects - must not be modified, either directly or indirectly, by the called code. + An attempt to commit a file system transaction failed. - + - This event is raised whenever SQLite makes an update/delete/insert into the database on - this connection. It only applies to the given connection. + An attempt to rollback a file system transaction failed. - + - This event is raised whenever SQLite is committing a transaction. - Return non-zero to trigger a rollback. + A database table is locked in shared-cache mode. - + - This event is raised whenever SQLite statement first begins executing on - this connection. It only applies to the given connection. + A virtual table in the database is locked. + + + + + A database file is locked due to a recovery operation. + + + + + A database file is locked due to snapshot semantics. + + + + + A database file cannot be opened because no temporary directory is available. + + + + + A database file cannot be opened because its path represents a directory. + + + + + A database file cannot be opened because its full path could not be obtained. + + + + + A database file cannot be opened because a path string conversion operation failed. + + + + + A virtual table is malformed. + + + + + A required sequence table is missing or corrupt. + + + + + A database file is read-only due to a recovery operation. + + + + + A database file is read-only because a lock could not be obtained. + + + + + A database file is read-only because it needs rollback processing. + + + + + A database file is read-only because it was moved while open. + + + + + The shared-memory file is read-only and it should be read-write. + + + + + Unable to create journal file because the directory is read-only. + + + + + An operation is being aborted due to rollback processing. + + + + + A CHECK constraint failed. + + + + + A commit hook produced a unsuccessful return code. + + + + + A FOREIGN KEY constraint failed. + + + + + Not currently used. + + + + + A NOT NULL constraint failed. + + + + + A PRIMARY KEY constraint failed. + + + + + The RAISE function was used by a trigger-program. + + + + + A UNIQUE constraint failed. + + + + + Not currently used. + + + + + A ROWID constraint failed. + + + + + Frames were recovered from the WAL log file. + + + + + Pages were recovered from the journal file. + + + + + An automatic index was created to process a query. + + + + + User authentication failed. + + + + + Success. Prevents the extension from unloading until the process + terminates. + + + + + SQLite implementation of . + + + SQLite implementation of . - + + + Constructs a new instance. + + + + + Cleans up resources (native and managed) associated with the current instance. + + + + + Cleans up resources associated with the current instance. + + + + + This event is raised whenever SQLite raises a logging event. + Note that this should be set as one of the first things in the + application. This event is provided for backward compatibility only. + New code should use the class instead. + + + + + Static instance member which returns an instanced class. + + + + + Creates and returns a new object. + + The new object. + + + + Creates and returns a new object. + + The new object. + + + + Creates and returns a new object. + + The new object. + + + + Creates and returns a new object. + + The new object. + + + + Creates and returns a new object. + + The new object. + + + + Creates and returns a new object. + + The new object. + + + + Will provide a object in .NET 3.5. + + The class or interface type to query for. + + + + + This abstract class is designed to handle user-defined functions easily. An instance of the derived class is made for each + connection to the database. + + + Although there is one instance of a class derived from SQLiteFunction per database connection, the derived class has no access + to the underlying connection. This is necessary to deter implementers from thinking it would be a good idea to make database + calls during processing. + + It is important to distinguish between a per-connection instance, and a per-SQL statement context. One instance of this class + services all SQL statements being stepped through on that connection, and there can be many. One should never store per-statement + information in member variables of user-defined function classes. + + For aggregate functions, always create and store your per-statement data in the contextData object on the 1st step. This data will + be automatically freed for you (and Dispose() called if the item supports IDisposable) when the statement completes. + + + - This event is raised whenever SQLite is rolling back a transaction. + The base connection this function is attached to - + - Returns the instance. + Internal array used to keep track of aggregate function context data - + - The I/O file cache flushing behavior for the connection + The connection flags associated with this object (this should be the + same value as the flags associated with the parent connection object). - + - Normal file flushing at critical sections of the code + Holds a reference to the callback function for user functions - + - Full file flushing after every write operation + Holds a reference to the callbakc function for stepping in an aggregate function - + - Use the default operating system's file flushing, SQLite does not explicitly flush the file buffers after writing + Holds a reference to the callback function for finalizing an aggregate function - + - Raised when authorization is required to perform an action contained - within a SQL query. + Holds a reference to the callback function for collating sequences - The connection performing the action. - A that contains the - event data. - + - Raised when a transaction is about to be committed. To roll back a transaction, set the - rollbackTrans boolean value to true. + Current context of the current callback. Only valid during a callback - The connection committing the transaction - Event arguments on the transaction - + - Raised when data is inserted, updated and deleted on a given connection + This static dictionary contains all the registered (known) user-defined + functions declared using the proper attributes. The contained dictionary + values are always null and are not currently used. - The connection committing the transaction - The event parameters which triggered the event - + - Raised when a statement first begins executing on a given connection + Internal constructor, initializes the function's internal variables. - The connection executing the statement - Event arguments of the trace - + - Raised between each backup step. + Constructs an instance of this class using the specified data-type + conversion parameters. - - The source database connection. - - - The source database name. - - - The destination database connection. - - - The destination database name. - - - The number of pages copied with each step. + + The DateTime format to be used when converting string values to a + DateTime and binding DateTime parameters. - - The number of pages remaining to be copied. + + The to be used when creating DateTime + values. - - The total number of pages in the source database. + + The format string to be used when parsing and formatting DateTime + values. - - Set to true if the operation needs to be retried due to database - locking issues; otherwise, set to false. + + Non-zero to create a UTF-16 data-type conversion context; otherwise, + a UTF-8 data-type conversion context will be created. - - True to continue with the backup process or false to halt the backup - process, rolling back any changes that have been made so far. - - - - - The data associated with a call into the authorizer. - - + - The user-defined native data associated with this event. Currently, - this will always contain the value of . + Disposes of any active contextData variables that were not automatically cleaned up. Sometimes this can happen if + someone closes the connection while a DataReader is open. - + - The action code responsible for the current call into the authorizer. + Placeholder for a user-defined disposal routine + True if the object is being disposed explicitly - + - The first string argument for the current call into the authorizer. - The exact value will vary based on the action code, see the - enumeration for possible - values. + Cleans up resources associated with the current instance. - + - The second string argument for the current call into the authorizer. - The exact value will vary based on the action code, see the - enumeration for possible - values. + Returns a reference to the underlying connection's SQLiteConvert class, which can be used to convert + strings and DateTime's into the current connection's encoding schema. - + - The database name for the current call into the authorizer, if - applicable. + Scalar functions override this method to do their magic. + + Parameters passed to functions have only an affinity for a certain data type, there is no underlying schema available + to force them into a certain type. Therefore the only types you will ever see as parameters are + DBNull.Value, Int64, Double, String or byte[] array. + + The arguments for the command to process + You may return most simple types as a return value, null or DBNull.Value to return null, DateTime, or + you may return an Exception-derived class if you wish to return an error to SQLite. Do not actually throw the error, + just return it! - + - The name of the inner-most trigger or view that is responsible for - the access attempt or a null value if this access attempt is directly - from top-level SQL code. + Aggregate functions override this method to do their magic. + + Typically you'll be updating whatever you've placed in the contextData field and returning as quickly as possible. + + The arguments for the command to process + The 1-based step number. This is incrememted each time the step method is called. + A placeholder for implementers to store contextual data pertaining to the current context. - + - The return code for the current call into the authorizer. + Aggregate functions override this method to finish their aggregate processing. + + If you implemented your aggregate function properly, + you've been recording and keeping track of your data in the contextData object provided, and now at this stage you should have + all the information you need in there to figure out what to return. + NOTE: It is possible to arrive here without receiving a previous call to Step(), in which case the contextData will + be null. This can happen when no rows were returned. You can either return null, or 0 or some other custom return value + if that is the case. + + Your own assigned contextData, provided for you so you can return your final results. + You may return most simple types as a return value, null or DBNull.Value to return null, DateTime, or + you may return an Exception-derived class if you wish to return an error to SQLite. Do not actually throw the error, + just return it! + - + - Constructs an instance of this class with default property values. + User-defined collating sequences override this method to provide a custom string sorting algorithm. + The first string to compare. + The second strnig to compare. + 1 if param1 is greater than param2, 0 if they are equal, or -1 if param1 is less than param2. - + - Constructs an instance of this class with specific property values. + Converts an IntPtr array of context arguments to an object array containing the resolved parameters the pointers point to. - - The user-defined native data associated with this event. - - - The authorizer action code. - - - The first authorizer argument. - - - The second authorizer argument. - - - The database name, if applicable. - - - The name of the inner-most trigger or view that is responsible for - the access attempt or a null value if this access attempt is directly - from top-level SQL code. - - - The authorizer return code. - + + Parameters passed to functions have only an affinity for a certain data type, there is no underlying schema available + to force them into a certain type. Therefore the only types you will ever see as parameters are + DBNull.Value, Int64, Double, String or byte[] array. + + The number of arguments + A pointer to the array of arguments + An object array of the arguments once they've been converted to .NET values - + - Whenever an update event is triggered on a connection, this enum will indicate - exactly what type of operation is being performed. + Takes the return value from Invoke() and Final() and figures out how to return it to SQLite's context. + The context the return value applies to + The parameter to return to SQLite - + - A row is being deleted from the given database and table + Internal scalar callback function, which wraps the raw context pointer and calls the virtual Invoke() method. + WARNING: Must not throw exceptions. + A raw context pointer + Number of arguments passed in + A pointer to the array of arguments - + - A row is being inserted into the table. + Internal collating sequence function, which wraps up the raw string pointers and executes the Compare() virtual function. + WARNING: Must not throw exceptions. + Not used + Length of the string pv1 + Pointer to the first string to compare + Length of the string pv2 + Pointer to the second string to compare + Returns -1 if the first string is less than the second. 0 if they are equal, or 1 if the first string is greater + than the second. Returns 0 if an exception is caught. - + - A row is being updated in the table. + Internal collating sequence function, which wraps up the raw string pointers and executes the Compare() virtual function. + WARNING: Must not throw exceptions. + Not used + Length of the string pv1 + Pointer to the first string to compare + Length of the string pv2 + Pointer to the second string to compare + Returns -1 if the first string is less than the second. 0 if they are equal, or 1 if the first string is greater + than the second. Returns 0 if an exception is caught. - + - Passed during an Update callback, these event arguments detail the type of update operation being performed - on the given connection. + The internal aggregate Step function callback, which wraps the raw context pointer and calls the virtual Step() method. + WARNING: Must not throw exceptions. + + This function takes care of doing the lookups and getting the important information put together to call the Step() function. + That includes pulling out the user's contextData and updating it after the call is made. We use a sorted list for this so + binary searches can be done to find the data. + + A raw context pointer + Number of arguments passed in + A pointer to the array of arguments - + - The name of the database being updated (usually "main" but can be any attached or temporary database) + An internal aggregate Final function callback, which wraps the context pointer and calls the virtual Final() method. + WARNING: Must not throw exceptions. + A raw context pointer - + - The name of the table being updated + Using reflection, enumerate all assemblies in the current appdomain looking for classes that + have a SQLiteFunctionAttribute attribute, and registering them accordingly. - + - The type of update being performed (insert/update/delete) + Manual method of registering a function. The type must still have the SQLiteFunctionAttributes in order to work + properly, but this is a workaround for the Compact Framework where enumerating assemblies is not currently supported. + The type of the function to register - + - The RowId affected by this update. + Alternative method of registering a function. This method + does not require the specified type to be annotated with + . + + The name of the function to register. + + + The number of arguments accepted by the function. + + + The type of SQLite function being resitered (e.g. scalar, + aggregate, or collating sequence). + + + The that actually implements the function. + This will only be used if the + and parameters are null. + + + The to be used for all calls into the + , + , + and virtual methods. + + + The to be used for all calls into the + virtual method. This + parameter is only necessary for aggregate functions. + - + - Event arguments raised when a transaction is being committed + Replaces a registered function, disposing of the associated (old) + value if necessary. + + The attribute that describes the function to replace. + + + The new value to use. + + + Non-zero if an existing registered function was replaced; otherwise, + zero. + - + - Set to true to abort the transaction and trigger a rollback + Creates a instance based on the specified + . + + The containing the metadata about + the function to create. + + + The created function -OR- null if the function could not be created. + + + Non-zero if the function was created; otherwise, zero. + - + - Passed during an Trace callback, these event arguments contain the UTF-8 rendering of the SQL statement text + Called by the SQLiteBase derived classes, this method binds all registered (known) user-defined functions to a connection. + It is done this way so that all user-defined functions will access the database using the same encoding scheme + as the connection (UTF-8 or UTF-16). + + The wrapper functions that interop with SQLite will create a unique cookie value, which internally is a pointer to + all the wrapped callback functions. The interop function uses it to map CDecl callbacks to StdCall callbacks. + + The base object on which the functions are to bind. + The flags associated with the parent connection object. + Returns a logical list of functions which the connection should retain until it is closed. - + - SQL statement text as the statement first begins executing + Called by the SQLiteBase derived classes, this method unbinds all registered (known) + functions -OR- all previously bound user-defined functions from a connection. + The base object from which the functions are to be unbound. + The flags associated with the parent connection object. + + Non-zero to unbind all registered (known) functions -OR- zero to unbind all functions + currently bound to the connection. + + Non-zero if all the specified user-defined functions were unbound. - + - This interface represents a custom connection pool implementation - usable by System.Data.SQLite. + This function binds a user-defined function to a connection. + + The object instance associated with the + that the function should be bound to. + + + The object instance containing + the metadata for the function to be bound. + + + The object instance that implements the + function to be bound. + + + The flags associated with the parent connection object. + - + - Counts the number of pool entries matching the specified file name. + This function unbinds a user-defined functions from a connection. - - The file name to match or null to match all files. - - - The pool entry counts for each matching file. + + The object instance associated with the + that the function should be bound to. - - The total number of connections successfully opened from any pool. + + The object instance containing + the metadata for the function to be bound. - - The total number of connections successfully closed from any pool. + + The object instance that implements the + function to be bound. - - The total number of pool entries for all matching files. + + The flags associated with the parent connection object. + Non-zero if the function was unbound. - + - Disposes of all pooled connections associated with the specified - database file name. + This type is used with the + method. - - The database file name. + + This is always the string literal "Invoke". + + + The arguments for the scalar function. + + The result of the scalar function. + - + - Disposes of all pooled connections. + This type is used with the + method. + + This is always the string literal "Step". + + + The arguments for the aggregate function. + + + The step number (one based). This is incrememted each time the + method is called. + + + A placeholder for implementers to store contextual data pertaining + to the current context. + - + - Adds a connection to the pool of those associated with the - specified database file name. + This type is used with the + method. - - The database file name. - - - The database connection handle. + + This is always the string literal "Final". - - The connection pool version at the point the database connection - handle was received from the connection pool. This is also the - connection pool version that the database connection handle was - created under. + + A placeholder for implementers to store contextual data pertaining + to the current context. + + The result of the aggregate function. + - + - Removes a connection from the pool of those associated with the - specified database file name with the intent of using it to - interact with the database. + This type is used with the + method. - - The database file name. + + This is always the string literal "Compare". - - The new maximum size of the connection pool for the specified - database file name. + + The first string to compare. - - The connection pool version associated with the returned database - connection handle, if any. + + The second strnig to compare. - The database connection handle associated with the specified - database file name or null if it cannot be obtained. + A positive integer if the parameter is + greater than the parameter, a negative + integer if the parameter is less than + the parameter, or zero if they are + equal. - + - This default method implementations in this class should not be used by - applications that make use of COM (either directly or indirectly) due - to possible deadlocks that can occur during finalization of some COM - objects. + This class implements a SQLite function using a . + All the virtual methods of the class are + implemented using calls to the , + , , + and strongly typed delegate types + or via the method. + The arguments are presented in the same order they appear in + the associated methods with one exception: + the first argument is the name of the virtual method being implemented. - + - This field is used to synchronize access to the private static data - in this class. + This error message is used by the overridden virtual methods when + a required property (e.g. + or ) has not been + set. - + - When this field is non-null, it will be used to provide the - implementation of all the connection pool methods; otherwise, - the default method implementations will be used. + This error message is used by the overridden + method when the result does not have a type of . - + - The dictionary of connection pools, based on the normalized file - name of the SQLite database. + Constructs an empty instance of this class. - + - The default version number new pools will get. + Constructs an instance of this class using the specified + as the + implementation. + + The to be used for all calls into the + , , and + virtual methods needed by the + base class. + + + The to be used for all calls into the + virtual methods needed by the + base class. + - + - The number of connections successfully opened from any pool. - This value is incremented by the Remove method. + Returns the list of arguments for the method, + as an of . The first + argument is always the literal string "Invoke". + + The original arguments received by the method. + + + Non-zero if the returned arguments are going to be used with the + type; otherwise, zero. + + + The arguments to pass to the configured . + - + - The number of connections successfully closed from any pool. - This value is incremented by the Add method. + Returns the list of arguments for the method, + as an of . The first + argument is always the literal string "Step". + + The original arguments received by the method. + + + The step number (one based). This is incrememted each time the + method is called. + + + A placeholder for implementers to store contextual data pertaining + to the current context. + + + Non-zero if the returned arguments are going to be used with the + type; otherwise, zero. + + + The arguments to pass to the configured . + - + - Counts the number of pool entries matching the specified file name. + Updates the output arguments for the method, + using an of . The first + argument is always the literal string "Step". Currently, only the + parameter is updated. - - The file name to match or null to match all files. + + The original arguments received by the method. - - The pool entry counts for each matching file. + + A placeholder for implementers to store contextual data pertaining + to the current context. - - The total number of connections successfully opened from any pool. + + Non-zero if the returned arguments are going to be used with the + type; otherwise, zero. - - The total number of connections successfully closed from any pool. + + The arguments to pass to the configured . + + + + + Returns the list of arguments for the method, + as an of . The first + argument is always the literal string "Final". + + + A placeholder for implementers to store contextual data pertaining + to the current context. - - The total number of pool entries for all matching files. + + Non-zero if the returned arguments are going to be used with the + type; otherwise, zero. + + The arguments to pass to the configured . + - + - Disposes of all pooled connections associated with the specified - database file name. + Returns the list of arguments for the method, + as an of . The first + argument is always the literal string "Compare". - - The database file name. + + The first string to compare. + + The second strnig to compare. + + + Non-zero if the returned arguments are going to be used with the + type; otherwise, zero. + + + The arguments to pass to the configured . + - + - Disposes of all pooled connections. + The to be used for all calls into the + , , and + virtual methods needed by the + base class. - + - Adds a connection to the pool of those associated with the - specified database file name. + The to be used for all calls into the + virtual methods needed by the + base class. - - The database file name. + + + + This virtual method is the implementation for scalar functions. + See the method for more + details. + + + The arguments for the scalar function. - - The database connection handle. + + The result of the scalar function. + + + + + This virtual method is part of the implementation for aggregate + functions. See the method + for more details. + + + The arguments for the aggregate function. - - The connection pool version at the point the database connection - handle was received from the connection pool. This is also the - connection pool version that the database connection handle was - created under. + + The step number (one based). This is incrememted each time the + method is called. + + + A placeholder for implementers to store contextual data pertaining + to the current context. - + - Removes a connection from the pool of those associated with the - specified database file name with the intent of using it to - interact with the database. + This virtual method is part of the implementation for aggregate + functions. See the method + for more details. - - The database file name. + + A placeholder for implementers to store contextual data pertaining + to the current context. - - The new maximum size of the connection pool for the specified - database file name. + + The result of the aggregate function. + + + + + This virtual method is part of the implementation for collating + sequences. See the method + for more details. + + + The first string to compare. - - The connection pool version associated with the returned database - connection handle, if any. + + The second strnig to compare. - The database connection handle associated with the specified - database file name or null if it cannot be obtained. + A positive integer if the parameter is + greater than the parameter, a negative + integer if the parameter is less than + the parameter, or zero if they are + equal. - + - This method is used to obtain a reference to the custom connection - pool implementation currently in use, if any. + Extends SQLiteFunction and allows an inherited class to obtain the collating sequence associated with a function call. - - The custom connection pool implementation or null if the default - connection pool implementation should be used. - + + User-defined functions can call the GetCollationSequence() method in this class and use it to compare strings and char arrays. + - + - This method is used to set the reference to the custom connection - pool implementation to use, if any. + Obtains the collating sequence in effect for the given function. - - The custom connection pool implementation to use or null if the - default connection pool implementation should be used. - + - + - We do not have to thread-lock anything in this function, because it - is only called by other functions above which already take the lock. + Cleans up resources (native and managed) associated with the current instance. - - The pool queue to resize. - - - If a function intends to add to the pool, this is true, which - forces the resize to take one more than it needs from the pool. + + Zero when being disposed via garbage collection; otherwise, non-zero. - + - Keeps track of connections made on a specified file. The PoolVersion - dictates whether old objects get returned to the pool or discarded - when no longer in use. + The type of user-defined function to declare - + - The queue of weak references to the actual database connection - handles. + Scalar functions are designed to be called and return a result immediately. Examples include ABS(), Upper(), Lower(), etc. - + - This pool version associated with the database connection - handles in this pool queue. + Aggregate functions are designed to accumulate data until the end of a call and then return a result gleaned from the accumulated data. + Examples include SUM(), COUNT(), AVG(), etc. - + - The maximum size of this pool queue. + Collating sequences are used to sort textual data in a custom manner, and appear in an ORDER BY clause. Typically text in an ORDER BY is + sorted using a straight case-insensitive comparison function. Custom collating sequences can be used to alter the behavior of text sorting + in a user-defined manner. - + - Constructs a connection pool queue using the specified version - and maximum size. Normally, all the database connection - handles in this pool are associated with a single database file - name. + An internal callback delegate declaration. - - The initial pool version for this connection pool queue. - - - The initial maximum size for this connection pool queue. - + Raw native context pointer for the user function. + Total number of arguments to the user function. + Raw native pointer to the array of raw native argument pointers. - + - SQLite implementation of DbConnectionStringBuilder. + An internal final callback delegate declaration. + Raw context pointer for the user function - + - Properties of this class + Internal callback delegate for implementing collating sequences + Not used + Length of the string pv1 + Pointer to the first string to compare + Length of the string pv2 + Pointer to the second string to compare + Returns -1 if the first string is less than the second. 0 if they are equal, or 1 if the first string is greater + than the second. - - - Constructs a new instance of the class - + - Default constructor + The type of collating sequence - + - Constructs a new instance of the class using the specified connection string. + The built-in BINARY collating sequence - The connection string to parse - + - Private initializer, which assigns the connection string and resets the builder + The built-in NOCASE collating sequence - The connection string to assign - + - Helper function for retrieving values from the connectionstring + The built-in REVERSE collating sequence - The keyword to retrieve settings for - The resulting parameter value - Returns true if the value was found and returned - + - Fallback method for MONO, which doesn't implement DbConnectionStringBuilder.GetProperties() + A custom user-defined collating sequence - The hashtable to fill with property descriptors - + - Gets/Sets the default version of the SQLite engine to instantiate. Currently the only valid value is 3, indicating version 3 of the sqlite library. + The encoding type the collation sequence uses - + - Gets/Sets the synchronization mode (file flushing) of the connection string. Default is "Normal". + The collation sequence is UTF8 - + - Gets/Sets the encoding for the connection string. The default is "False" which indicates UTF-8 encoding. + The collation sequence is UTF16 little-endian - + - Gets/Sets whether or not to use connection pooling. The default is "False" + The collation sequence is UTF16 big-endian - + - Gets/Sets whethor not to store GUID's in binary format. The default is True - which saves space in the database. + A struct describing the collating sequence a function is executing in - + - Gets/Sets the filename to open on the connection string. + The name of the collating sequence - + - An alternate to the data source property + The type of collating sequence - + - An alternate to the data source property that uses the SQLite URI syntax. + The text encoding of the collation sequence - + - Gets/sets the default command timeout for newly-created commands. This is especially useful for - commands used internally such as inside a SQLiteTransaction, where setting the timeout is not possible. + Context of the function that requested the collating sequence - + - Determines whether or not the connection will automatically participate - in the current distributed transaction (if one exists) + Calls the base collating sequence to compare two strings + The first string to compare + The second string to compare + -1 if s1 is less than s2, 0 if s1 is equal to s2, and 1 if s1 is greater than s2 - + - If set to true, will throw an exception if the database specified in the connection - string does not exist. If false, the database will be created automatically. + Calls the base collating sequence to compare two character arrays + The first array to compare + The second array to compare + -1 if c1 is less than c2, 0 if c1 is equal to c2, and 1 if c1 is greater than c2 - + - If enabled, uses the legacy 3.xx format for maximum compatibility, but results in larger - database sizes. + A simple custom attribute to enable us to easily find user-defined functions in + the loaded assemblies and initialize them in SQLite as connections are made. - + - When enabled, the database will be opened for read-only access and writing will be disabled. + Default constructor, initializes the internal variables for the function. - + - Gets/sets the database encryption password + Constructs an instance of this class. This sets the initial + , , and + properties to null. + + The name of the function, as seen by the SQLite core library. + + + The number of arguments that the function will accept. + + + The type of function being declared. This will either be Scalar, + Aggregate, or Collation. + - + - Gets/sets the database encryption hexadecimal password + The function's name as it will be used in SQLite command text. - + - Gets/Sets the page size for the connection. + The number of arguments this function expects. -1 if the number of arguments is variable. - + - Gets/Sets the maximum number of pages the database may hold + The type of function this implementation will be. - + - Gets/Sets the cache size for the connection. + The object instance that describes the class + containing the implementation for the associated function. The value of + this property will not be used if either the or + property values are set to non-null. - + - Gets/Sets the DateTime format for the connection. + The that refers to the implementation for the + associated function. If this property value is set to non-null, it will + be used instead of the property value. - + - Gets/Sets the DateTime kind for the connection. + The that refers to the implementation for the + associated function. If this property value is set to non-null, it will + be used instead of the property value. - + - Gets/sets the DateTime format string used for formatting - and parsing purposes. + This class provides key info for a given SQLite statement. + + Providing key information for a given statement is non-trivial :( + - + - Gets/Sets the placeholder base schema name used for - .NET Framework compatibility purposes. + Used to support CommandBehavior.KeyInfo - + - Determines how SQLite handles the transaction journal file. + Used to keep track of the per-table RowId column metadata. - + - Sets the default isolation level for transactions on the connection. + A single sub-query for a given table/database. - + - Gets/sets the default database type for the connection. + This function does all the nasty work at determining what keys need to be returned for + a given statement. + + + - + - Gets/sets the default type name for the connection. + How many additional columns of keyinfo we're holding - + - If enabled, use foreign key constraints + Make sure all the subqueries are open and ready and sync'd with the current rowid + of the table they're supporting - + - Gets/Sets the extra behavioral flags. + Release any readers on any subqueries - + - If enabled, apply the default connection settings to opened databases. + Append all the columns we've added to the original query to the schema + - + - If enabled, attempt to resolve the provided data source file name to a - full path before opening. + Event data for logging event handlers. - + - If enabled, skip using the configured shared connection flags. + The error code. The type of this object value should be + or . - + - SQLite has very limited types, and is inherently text-based. The first 5 types below represent the sum of all types SQLite - understands. The DateTime extension to the spec is for internal use only. + SQL statement text as the statement first begins executing - + - Not used + Extra data associated with this event, if any. - + - All integers in SQLite default to Int64 + Constructs the object. + Should be null. + + The error code. The type of this object value should be + or . + + The error message, if any. + The extra data, if any. - + - All floating point numbers in SQLite default to double + Raised when a log event occurs. + The current connection + Event arguments of the trace - + - The default data type of SQLite is text + Manages the SQLite custom logging functionality and the associated + callback for the whole process. - + - Typically blob types are only seen when returned from a function + Object used to synchronize access to the static instance data + for this class. - + - Null types can be returned from functions + Member variable to store the AppDomain.DomainUnload event handler. - + - Used internally by this provider + Member variable to store the application log handler to call. - + - Used internally by this provider + The default log event handler. - + - These are the event types associated with the - - delegate (and its corresponding event) and the - class. + The log callback passed to native SQLite engine. This must live + as long as the SQLite library has a pointer to it. - + - Not used. + The base SQLite object to interop with. - + - Not used. + The number of times that the + has been called when the logging subystem was actually eligible + to be initialized (i.e. without the "No_SQLiteLog" environment + variable being set). - + - The connection is being opened. + This will be non-zero if an attempt was already made to initialize + the (managed) logging subsystem. - + - The connection string has been parsed. + This will be non-zero if logging is currently enabled. - + - The connection was opened. + Initializes the SQLite logging facilities. - + - The method was called on the - connection. + Initializes the SQLite logging facilities. + + The name of the managed class that called this method. This + parameter may be null. + - + - A transaction was created using the connection. + Handles the AppDomain being unloaded. + Should be null. + The data associated with this event. - + - The connection was enlisted into a transaction. + This event is raised whenever SQLite raises a logging event. + Note that this should be set as one of the first things in the + application. - + - A command was created using the connection. + If this property is true, logging is enabled; otherwise, logging is + disabled. When logging is disabled, no logging events will fire. - + - A data reader was created using the connection. + Log a message to all the registered log event handlers without going + through the SQLite library. + The message to be logged. - + - An instance of a derived class has - been created to wrap a native resource. + Log a message to all the registered log event handlers without going + through the SQLite library. + The SQLite error code. + The message to be logged. - + - The connection is being closed. + Log a message to all the registered log event handlers without going + through the SQLite library. + The integer error code. + The message to be logged. - + - The connection was closed. + Log a message to all the registered log event handlers without going + through the SQLite library. + + The error code. The type of this object value should be + System.Int32 or SQLiteErrorCode. + + The message to be logged. - + - A command is being disposed. + Creates and initializes the default log event handler. - + - A data reader is being disposed. + Adds the default log event handler to the list of handlers. - + - A data reader is being closed. + Removes the default log event handler from the list of handlers. - + - This implementation of SQLite for ADO.NET can process date/time fields in - databases in one of six formats. - - - ISO8601 format is more compatible, readable, fully-processable, but less - accurate as it does not provide time down to fractions of a second. - JulianDay is the numeric format the SQLite uses internally and is arguably - the most compatible with 3rd party tools. It is not readable as text - without post-processing. Ticks less compatible with 3rd party tools that - query the database, and renders the DateTime field unreadable as text - without post-processing. UnixEpoch is more compatible with Unix systems. - InvariantCulture allows the configured format for the invariant culture - format to be used and is human readable. CurrentCulture allows the - configured format for the current culture to be used and is also human - readable. + Internal proxy function that calls any registered application log + event handlers. - The preferred order of choosing a DateTime format is JulianDay, ISO8601, - and then Ticks. Ticks is mainly present for legacy code support. - + WARNING: This method is used more-or-less directly by native code, + do not modify its type signature. +
+ + The extra data associated with this message, if any. + + + The error code associated with this message. + + + The message string to be logged. +
- + - Use the value of DateTime.Ticks. This value is not recommended and is not well supported with LINQ. + Default logger. Currently, uses the Trace class (i.e. sends events + to the current trace listeners, if any). + Should be null. + The data associated with this event. - + - Use the ISO-8601 format. Uses the "yyyy-MM-dd HH:mm:ss.FFFFFFFK" format for UTC DateTime values and - "yyyy-MM-dd HH:mm:ss.FFFFFFF" format for local DateTime values). + MetaDataCollections specific to SQLite - + - The interval of time in days and fractions of a day since January 1, 4713 BC. + Returns a list of databases attached to the connection - + - The whole number of seconds since the Unix epoch (January 1, 1970). + Returns column information for the specified table - + - Any culture-independent string value that the .NET Framework can interpret as a valid DateTime. + Returns index information for the optionally-specified table - + - Any string value that the .NET Framework can interpret as a valid DateTime using the current culture. + Returns base columns for the given index - + - The default format for this provider. + Returns the tables in the given catalog - - - This enum determines how SQLite treats its journal file. - - - By default SQLite will create and delete the journal file when needed during a transaction. - However, for some computers running certain filesystem monitoring tools, the rapid - creation and deletion of the journal file can cause those programs to fail, or to interfere with SQLite. - - If a program or virus scanner is interfering with SQLite's journal file, you may receive errors like "unable to open database file" - when starting a transaction. If this is happening, you may want to change the default journal mode to Persist. - + + + Returns user-defined views in the given catalog + - + - The default mode, this causes SQLite to use the existing journaling mode for the database. + Returns underlying column information on the given view - + - SQLite will create and destroy the journal file as-needed. + Returns foreign key information for the given catalog - + - When this is set, SQLite will keep the journal file even after a transaction has completed. It's contents will be erased, - and the journal re-used as often as needed. If it is deleted, it will be recreated the next time it is needed. + Returns the triggers on the database - + - This option disables the rollback journal entirely. Interrupted transactions or a program crash can cause database - corruption in this mode! + SQLite implementation of DbParameter. - + - SQLite will truncate the journal file to zero-length instead of deleting it. + This value represents an "unknown" . - + - SQLite will store the journal in volatile RAM. This saves disk I/O but at the expense of database safety and integrity. - If the application using SQLite crashes in the middle of a transaction when the MEMORY journaling mode is set, then the - database file will very likely go corrupt. + The command associated with this parameter. - + - SQLite uses a write-ahead log instead of a rollback journal to implement transactions. The WAL journaling mode is persistent; - after being set it stays in effect across multiple database connections and after closing and reopening the database. A database - in WAL journaling mode can only be accessed by SQLite version 3.7.0 or later. + The data type of the parameter - + - Possible values for the "synchronous" database setting. This setting determines - how often the database engine calls the xSync method of the VFS. + The version information for mapping the parameter - + - Use the default "synchronous" database setting. Currently, this should be - the same as using the FULL mode. + The value of the data in the parameter - + - The database engine continues without syncing as soon as it has handed - data off to the operating system. If the application running SQLite - crashes, the data will be safe, but the database might become corrupted - if the operating system crashes or the computer loses power before that - data has been written to the disk surface. + The source column for the parameter - + - The database engine will still sync at the most critical moments, but - less often than in FULL mode. There is a very small (though non-zero) - chance that a power failure at just the wrong time could corrupt the - database in NORMAL mode. + The column name - + - The database engine will use the xSync method of the VFS to ensure that - all content is safely written to the disk surface prior to continuing. - This ensures that an operating system crash or power failure will not - corrupt the database. FULL synchronous is very safe, but it is also - slower. + The data size, unused by SQLite - + - The requested command execution type. This controls which method of the - object will be called. + The database type name associated with this parameter, if any. - + - Do nothing. No method will be called. + Constructor used when creating for use with a specific command. + + The command associated with this parameter. + - + - The command is not expected to return a result -OR- the result is not - needed. The or - method - will be called. + Default constructor - + - The command is expected to return a scalar result -OR- the result should - be limited to a scalar result. The - or method will - be called. + Constructs a named parameter given the specified parameter name + The parameter name - + - The command is expected to return result. - The or - method will - be called. + Constructs a named parameter given the specified parameter name and initial value + The parameter name + The initial value of the parameter - + - Use the default command execution type. Using this value is the same - as using the value. + Constructs a named parameter of the specified type + The parameter name + The datatype of the parameter - + - The action code responsible for the current call into the authorizer. + Constructs a named parameter of the specified type and source column reference + The parameter name + The data type + The source column - + - No action is being performed. This value should not be used from - external code. + Constructs a named parameter of the specified type, source column and row version + The parameter name + The data type + The source column + The row version information - + - No longer used. + Constructs an unnamed parameter of the specified data type + The datatype of the parameter - - - An index will be created. The action-specific arguments are the - index name and the table name. - - + + + Constructs an unnamed parameter of the specified data type and sets the initial value + + The datatype of the parameter + The initial value of the parameter - + - A table will be created. The action-specific arguments are the - table name and a null value. + Constructs an unnamed parameter of the specified data type and source column + The datatype of the parameter + The source column - + - A temporary index will be created. The action-specific arguments - are the index name and the table name. + Constructs an unnamed parameter of the specified data type, source column and row version + The data type + The source column + The row version information - + - A temporary table will be created. The action-specific arguments - are the table name and a null value. + Constructs a named parameter of the specified type and size + The parameter name + The data type + The size of the parameter - + - A temporary trigger will be created. The action-specific arguments - are the trigger name and the table name. + Constructs a named parameter of the specified type, size and source column + The name of the parameter + The data type + The size of the parameter + The source column - + - A temporary view will be created. The action-specific arguments are - the view name and a null value. + Constructs a named parameter of the specified type, size, source column and row version + The name of the parameter + The data type + The size of the parameter + The source column + The row version information - + - A trigger will be created. The action-specific arguments are the - trigger name and the table name. + Constructs a named parameter of the specified type, size, source column and row version + The name of the parameter + The data type + The size of the parameter + Only input parameters are supported in SQLite + Ignored + Ignored + Ignored + The source column + The row version information + The initial value to assign the parameter - + - A view will be created. The action-specific arguments are the view - name and a null value. + Constructs a named parameter, yet another flavor + The name of the parameter + The data type + The size of the parameter + Only input parameters are supported in SQLite + Ignored + Ignored + The source column + The row version information + Whether or not this parameter is for comparing NULL's + The intial value to assign the parameter - + - A DELETE statement will be executed. The action-specific arguments - are the table name and a null value. + Constructs an unnamed parameter of the specified type and size + The data type + The size of the parameter - + - An index will be dropped. The action-specific arguments are the - index name and the table name. + Constructs an unnamed parameter of the specified type, size, and source column + The data type + The size of the parameter + The source column - + - A table will be dropped. The action-specific arguments are the tables - name and a null value. + Constructs an unnamed parameter of the specified type, size, source column and row version + The data type + The size of the parameter + The source column + The row version information - + - A temporary index will be dropped. The action-specific arguments are - the index name and the table name. + The command associated with this parameter. - + - A temporary table will be dropped. The action-specific arguments are - the table name and a null value. + Whether or not the parameter can contain a null value - + - A temporary trigger will be dropped. The action-specific arguments - are the trigger name and the table name. + Returns the datatype of the parameter - + - A temporary view will be dropped. The action-specific arguments are - the view name and a null value. + Supports only input parameters - + - A trigger will be dropped. The action-specific arguments are the - trigger name and the table name. + Returns the parameter name - + - A view will be dropped. The action-specific arguments are the view - name and a null value. + Resets the DbType of the parameter so it can be inferred from the value - + - An INSERT statement will be executed. The action-specific arguments - are the table name and a null value. + Returns the size of the parameter - + - A PRAGMA statement will be executed. The action-specific arguments - are the name of the PRAGMA and the new value or a null value. + Gets/sets the source column - + - A table column will be read. The action-specific arguments are the - table name and the column name. + Used by DbCommandBuilder to determine the mapping for nullable fields - + - A SELECT statement will be executed. The action-specific arguments - are both null values. + Gets and sets the row version - + - A transaction will be started, committed, or rolled back. The - action-specific arguments are the name of the operation (BEGIN, - COMMIT, or ROLLBACK) and a null value. + Gets and sets the parameter value. If no datatype was specified, the datatype will assume the type from the value given. - + - An UPDATE statement will be executed. The action-specific arguments - are the table name and the column name. + The database type name associated with this parameter, if any. - + - A database will be attached to the connection. The action-specific - arguments are the database file name and a null value. + Clones a parameter + A new, unassociated SQLiteParameter - + - A database will be detached from the connection. The action-specific - arguments are the database name and a null value. + SQLite implementation of DbParameterCollection. - + - The schema of a table will be altered. The action-specific arguments - are the database name and the table name. + The underlying command to which this collection belongs - + - An index will be deleted and then recreated. The action-specific - arguments are the index name and a null value. + The internal array of parameters in this collection - + - A table will be analyzed to gathers statistics about it. The - action-specific arguments are the table name and a null value. + Determines whether or not all parameters have been bound to their statement(s) - + - A virtual table will be created. The action-specific arguments are - the table name and the module name. + Initializes the collection + The command to which the collection belongs - + - A virtual table will be dropped. The action-specific arguments are - the table name and the module name. + Returns false - + - A SQL function will be called. The action-specific arguments are a - null value and the function name. + Returns false - + - A savepoint will be created, released, or rolled back. The - action-specific arguments are the name of the operation (BEGIN, - RELEASE, or ROLLBACK) and the savepoint name. + Returns false - + - A recursive query will be executed. The action-specific arguments - are two null values. + Returns null - + - The return code for the current call into the authorizer. + Retrieves an enumerator for the collection + An enumerator for the underlying array - + - The action will be allowed. + Adds a parameter to the collection + The parameter name + The data type + The size of the value + The source column + A SQLiteParameter object - + - The overall action will be disallowed and an error message will be - returned from the query preparation method. + Adds a parameter to the collection + The parameter name + The data type + The size of the value + A SQLiteParameter object - + - The specific action will be disallowed; however, the overall action - will continue. The exact effects of this return code vary depending - on the specific action, please refer to the SQLite core library - documentation for futher details. + Adds a parameter to the collection + The parameter name + The data type + A SQLiteParameter object - + - Class used internally to determine the datatype of a column in a resultset + Adds a parameter to the collection + The parameter to add + A zero-based index of where the parameter is located in the array - + - The DbType of the column, or DbType.Object if it cannot be determined + Adds a parameter to the collection + The parameter to add + A zero-based index of where the parameter is located in the array - + - The affinity of a column, used for expressions or when Type is DbType.Object + Adds a named/unnamed parameter and its value to the parameter collection. + Name of the parameter, or null to indicate an unnamed parameter + The initial value of the parameter + Returns the SQLiteParameter object created during the call. - + - Constructs a default instance of this type. + Adds an array of parameters to the collection + The array of parameters to add - + - Constructs an instance of this type with the specified field values. + Adds an array of parameters to the collection - - The type affinity to use for the new instance. - - - The database type to use for the new instance. - + The array of parameters to add - + - SQLite implementation of DbDataAdapter. + Clears the array and resets the collection - - - This class is just a shell around the DbDataAdapter. Nothing from - DbDataAdapter is overridden here, just a few constructors are defined. - + - Default constructor. + Determines if the named parameter exists in the collection + The name of the parameter to check + True if the parameter is in the collection - + - Constructs a data adapter using the specified select command. + Determines if the parameter exists in the collection - - The select command to associate with the adapter. - + The SQLiteParameter to check + True if the parameter is in the collection - + - Constructs a data adapter with the supplied select command text and - associated with the specified connection. + Not implemented - - The select command text to associate with the data adapter. - - - The connection to associate with the select command. - + + - + - Constructs a data adapter with the specified select command text, - and using the specified database connection string. + Returns a count of parameters in the collection - - The select command text to use to construct a select command. - - - A connection string suitable for passing to a new SQLiteConnection, - which is associated with the select command. - - + - Constructs a data adapter with the specified select command text, - and using the specified database connection string. + Overloaded to specialize the return value of the default indexer - - The select command text to use to construct a select command. - - - A connection string suitable for passing to a new SQLiteConnection, - which is associated with the select command. - - - Non-zero to parse the connection string using the built-in (i.e. - framework provided) parser when opening the connection. - + Name of the parameter to get/set + The specified named SQLite parameter - + - Raised by the underlying DbDataAdapter when a row is being updated + Overloaded to specialize the return value of the default indexer - The event's specifics + The index of the parameter to get/set + The specified SQLite parameter - + - Raised by DbDataAdapter after a row is updated + Retrieve a parameter by name from the collection - The event's specifics + The name of the parameter to fetch + A DbParameter object - + - Row updating event handler + Retrieves a parameter by its index in the collection + The index of the parameter to retrieve + A DbParameter object - + - Row updated event handler + Returns the index of a parameter given its name + The name of the parameter to find + -1 if not found, otherwise a zero-based index of the parameter - + - Gets/sets the select command for this DataAdapter + Returns the index of a parameter + The parameter to find + -1 if not found, otherwise a zero-based index of the parameter - + - Gets/sets the insert command for this DataAdapter + Inserts a parameter into the array at the specified location + The zero-based index to insert the parameter at + The parameter to insert - + - Gets/sets the update command for this DataAdapter + Removes a parameter from the collection + The parameter to remove - + - Gets/sets the delete command for this DataAdapter + Removes a parameter from the collection given its name + The name of the parameter to remove - + - SQLite implementation of DbDataReader. + Removes a parameter from the collection given its index + The zero-based parameter index to remove - + - Underlying command this reader is attached to + Re-assign the named parameter to a new parameter object + The name of the parameter to replace + The new parameter - + - The flags pertaining to the associated connection (via the command). + Re-assign a parameter at the specified index + The zero-based index of the parameter to replace + The new parameter - + - Index of the current statement in the command being processed + Un-binds all parameters from their statements - + - Current statement being Read() + This function attempts to map all parameters in the collection to all statements in a Command. + Since named parameters may span multiple statements, this function makes sure all statements are bound + to the same named parameter. Unnamed parameters are bound in sequence. - + - State of the current statement being processed. - -1 = First Step() executed, so the first Read() will be ignored - 0 = Actively reading - 1 = Finished reading - 2 = Non-row-returning statement, no records + Represents a single SQL statement in SQLite. - + - Number of records affected by the insert/update statements executed on the command + The underlying SQLite object this statement is bound to - + - Count of fields (columns) in the row-returning statement currently being processed + The command text of this SQL statement - + - The number of calls to Step() that have returned true (i.e. the number of rows that - have been read in the current result set). + The actual statement pointer - + - Maps the field (column) names to their corresponding indexes within the results. + An index from which unnamed parameters begin - + - Datatypes of active fields (columns) in the current statement, used for type-restricting data + Names of the parameters as SQLite understands them to be - + - The behavior of the datareader + Parameters for this statement - + - If set, then dispose of the command object when the reader is finished + Command this statement belongs to (if any) - + - If set, then raise an exception when the object is accessed after being disposed. + The flags associated with the parent connection object. - + - An array of rowid's for the active statement if CommandBehavior.KeyInfo is specified + Initializes the statement and attempts to get all information about parameters in the statement + The base SQLite object + The flags associated with the parent connection object + The statement + The command text for this statement + The previous command in a multi-statement command - + - Matches the version of the connection. + Disposes and finalizes the statement - + - The "stub" (i.e. placeholder) base schema name to use when returning - column schema information. Matches the base schema name used by the - associated connection. + If the underlying database connection is open, fetches the number of changed rows + resulting from the most recent query; otherwise, does nothing. + + The number of changes when true is returned. + Undefined if false is returned. + + + The read-only flag when true is returned. + Undefined if false is returned. + + Non-zero if the number of changed rows was fetched. - + - Internal constructor, initializes the datareader and sets up to begin executing statements + Called by SQLiteParameterCollection, this function determines if the specified parameter name belongs to + this statement, and if so, keeps a reference to the parameter so it can be bound later. - The SQLiteCommand this data reader is for - The expected behavior of the data reader + The parameter name to map + The parameter to assign it - + - Dispose of all resources used by this datareader. + Bind all parameters, making sure the caller didn't miss any - - + - Closes the datareader, potentially closing the connection as well if CommandBehavior.CloseConnection was specified. + This method attempts to query the database connection associated with + the statement in use. If the underlying command or connection is + unavailable, a null value will be returned. + + The connection object -OR- null if it is unavailable. + - + - Throw an error if the datareader is closed + Invokes the parameter binding callback configured for the database + type name associated with the specified column. If no parameter + binding callback is available for the database type name, do + nothing. + + The index of the column being read. + + + The instance being bound to the + command. + + + Non-zero if the default handling for the parameter binding call + should be skipped (i.e. the parameter should not be bound at all). + Great care should be used when setting this to non-zero. + - + - Throw an error if a row is not loaded + Perform the bind operation for an individual parameter + The index of the parameter to bind + The parameter we're binding - + - Enumerator support + SQLite implementation of DbTransaction that does not support nested transactions. - Returns a DbEnumerator object. - + - Forces the connection flags cached by this data reader to be refreshed - from the underlying connection. + Constructs the transaction object, binding it to the supplied connection + The connection to open a transaction on + TRUE to defer the writelock, or FALSE to lock immediately - - - SQLite is inherently un-typed. All datatypes in SQLite are natively strings. The definition of the columns of a table - and the affinity of returned types are all we have to go on to type-restrict data in the reader. - - This function attempts to verify that the type of data being requested of a column matches the datatype of the column. In - the case of columns that are not backed into a table definition, we attempt to match up the affinity of a column (int, double, string or blob) - to a set of known types that closely match that affinity. It's not an exact science, but its the best we can do. - - - This function throws an InvalidTypeCast() exception if the requested type doesn't match the column's definition or affinity. - - The index of the column to type-check - The type we want to get out of the column - - + - Retrieves the column as a boolean value + Disposes the transaction. If it is currently active, any changes are rolled back. - The index of the column to retrieve - bool - + - Retrieves the column as a single byte value + Commits the current transaction. - The index of the column to retrieve - byte - + - Retrieves a column as an array of bytes (blob) + Attempts to start a transaction. An exception will be thrown if the transaction cannot + be started for any reason. - The index of the column to retrieve - The zero-based index of where to begin reading the data - The buffer to write the bytes into - The zero-based index of where to begin writing into the array - The number of bytes to retrieve - The actual number of bytes written into the array - - To determine the number of bytes in the column, pass a null value for the buffer. The total length will be returned. - + TRUE to defer the writelock, or FALSE to lock immediately - + - Returns the column as a single character + Issue a ROLLBACK command against the database connection, + optionally re-throwing any caught exception. - The index of the column to retrieve - char + + Non-zero to re-throw caught exceptions. + - + - Retrieves a column as an array of chars (blob) + SQLite implementation of DbTransaction that does support nested transactions. - The index of the column to retrieve - The zero-based index of where to begin reading the data - The buffer to write the characters into - The zero-based index of where to begin writing into the array - The number of bytes to retrieve - The actual number of characters written into the array - - To determine the number of characters in the column, pass a null value for the buffer. The total length will be returned. - - + - Retrieves the name of the back-end datatype of the column + The original transaction level for the associated connection + when this transaction was created (i.e. begun). - The index of the column to retrieve - string - + - Retrieve the column as a date/time value + The SAVEPOINT name for this transaction, if any. This will + only be non-null if this transaction is a nested one. - The index of the column to retrieve - DateTime - + - Retrieve the column as a decimal value + Constructs the transaction object, binding it to the supplied connection - The index of the column to retrieve - decimal + The connection to open a transaction on + TRUE to defer the writelock, or FALSE to lock immediately - + - Returns the column as a double + Disposes the transaction. If it is currently active, any changes are rolled back. - The index of the column to retrieve - double - + - Returns the .NET type of a given column + Commits the current transaction. - The index of the column to retrieve - Type - + - Returns a column as a float value + Attempts to start a transaction. An exception will be thrown if the transaction cannot + be started for any reason. - The index of the column to retrieve - float + TRUE to defer the writelock, or FALSE to lock immediately - + - Returns the column as a Guid + Issue a ROLLBACK command against the database connection, + optionally re-throwing any caught exception. - The index of the column to retrieve - Guid + + Non-zero to re-throw caught exceptions. + - + - Returns the column as a short + Constructs the name of a new savepoint for this transaction. It + should only be called from the constructor of this class. - The index of the column to retrieve - Int16 + + The name of the new savepoint -OR- null if it cannot be constructed. + - + - Retrieves the column as an int + Base class used by to implement DbTransaction for SQLite. - The index of the column to retrieve - Int32 - + - Retrieves the column as a long + The connection to which this transaction is bound. - The index of the column to retrieve - Int64 - + - Retrieves the name of the column + Matches the version of the connection. - The index of the column to retrieve - string - + - Retrieves the i of a column, given its name + The isolation level for this transaction. - The name of the column to retrieve - The int i of the column - + - Schema information in SQLite is difficult to map into .NET conventions, so a lot of work must be done - to gather the necessary information so it can be represented in an ADO.NET manner. + Constructs the transaction object, binding it to the supplied connection - Returns a DataTable containing the schema information for the active SELECT statement being processed. + The connection to open a transaction on + TRUE to defer the writelock, or FALSE to lock immediately - + - Retrieves the column as a string + Gets the isolation level of the transaction. SQLite only supports Serializable transactions. - The index of the column to retrieve - string - + - Retrieves the column as an object corresponding to the underlying datatype of the column + Disposes the transaction. If it is currently active, any changes are rolled back. - The index of the column to retrieve - object - + - Retreives the values of multiple columns, up to the size of the supplied array + Returns the underlying connection to which this transaction applies. - The array to fill with values from the columns in the current resultset - The number of columns retrieved - + - Returns a collection containing all the column names and values for the - current row of data in the current resultset, if any. If there is no - current row or no current resultset, an exception may be thrown. + Forwards to the local Connection property - - The collection containing the column name and value information for the - current row of data in the current resultset or null if this information - cannot be obtained. - - + - Returns True if the specified column is null + Rolls back the active transaction. - The index of the column to retrieve - True or False - + - Moves to the next resultset in multiple row-returning SQL command. + Attempts to start a transaction. An exception will be thrown if the transaction cannot + be started for any reason. - True if the command was successful and a new resultset is available, False otherwise. + TRUE to defer the writelock, or FALSE to lock immediately - + - This method attempts to query the database connection associated with - the data reader in use. If the underlying command or connection is - unavailable, a null value will be returned. + Issue a ROLLBACK command against the database connection, + optionally re-throwing any caught exception. - - The connection object -OR- null if it is unavailable. - + + Non-zero to re-throw caught exceptions. + - + - Retrieves the SQLiteType for a given column and row value. + Checks the state of this transaction, optionally throwing an exception if a state + inconsistency is found. - - The original SQLiteType structure, based only on the column. - - - The textual value of the column for a given row. + + Non-zero to throw an exception if a state inconsistency is found. - The SQLiteType structure. + Non-zero if this transaction is valid; otherwise, false. - + - Retrieves the SQLiteType for a given column, and caches it to avoid repetetive interop calls. + This static class provides some methods that are shared between the + native library pre-loader and other classes. - The flags associated with the parent connection object. - The index of the column to retrieve - A SQLiteType structure - + - Reads the next row from the resultset + This lock is used to protect the static and + fields. - True if a new row was successfully loaded and is ready for processing - + - Not implemented. Returns 0 + This type is only present when running on Mono. - + - Returns the number of columns in the current resultset + This type is only present when running on .NET Core. - + - Returns the number of rows seen so far in the current result set. + Keeps track of whether we are running on Mono. Initially null, it is + set by the method on its first call. Later, it + is returned verbatim by the method. - + - Returns the number of visible fields in the current resultset + Keeps track of whether we are running on .NET Core. Initially null, + it is set by the method on its first + call. Later, it is returned verbatim by the + method. - + - Returns True if the resultset has rows that can be fetched + Keeps track of whether we successfully invoked the + method. Initially null, it is set by + the method on its first call. - + - Returns True if the data reader is closed + Determines the ID of the current process. Only used for debugging. + + The ID of the current process -OR- zero if it cannot be determined. + - + - Retrieve the count of records affected by an update/insert command. Only valid once the data reader is closed! + Determines whether or not this assembly is running on Mono. + + Non-zero if this assembly is running on Mono. + - + - Indexer to retrieve data from a column given its name + Determines whether or not this assembly is running on .NET Core. - The name of the column to retrieve data for - The value contained in the column + + Non-zero if this assembly is running on .NET Core. + - + - Indexer to retrieve data from a column given its i + Resets the cached value for the "PreLoadSQLite_BreakIntoDebugger" + configuration setting. - The index of the column to retrieve - The value contained in the column - + - SQLite exception class. + If the "PreLoadSQLite_BreakIntoDebugger" configuration setting is + present (e.g. via the environment), give the interactive user an + opportunity to attach a debugger to the current process; otherwise, + do nothing. - + - Private constructor for use with serialization. + Determines the ID of the current thread. Only used for debugging. - - Holds the serialized object data about the exception being thrown. - - - Contains contextual information about the source or destination. - + + The ID of the current thread -OR- zero if it cannot be determined. + - + - Public constructor for generating a SQLite exception given the error - code and message. + Determines if the specified flags are present within the flags + associated with the parent connection object. - - The SQLite return code to report. + + The flags associated with the parent connection object. - - Message text to go along with the return code message text. + + The flags to check for. + + Non-zero if the specified flag or flags were present; otherwise, + zero. + - + - Public constructor that uses the base class constructor for the error - message. + Determines if preparing a query should be logged. - Error message text. + + The flags associated with the parent connection object. + + + Non-zero if the query preparation should be logged; otherwise, zero. + - + - Public constructor that uses the default base class constructor. + Determines if pre-parameter binding should be logged. + + The flags associated with the parent connection object. + + + Non-zero if the pre-parameter binding should be logged; otherwise, + zero. + - + - Public constructor that uses the base class constructor for the error - message and inner exception. + Determines if parameter binding should be logged. - Error message text. - The original (inner) exception. + + The flags associated with the parent connection object. + + + Non-zero if the parameter binding should be logged; otherwise, zero. + - + - Adds extra information to the serialized object data specific to this - class type. This is only used for serialization. + Determines if an exception in a native callback should be logged. - - Holds the serialized object data about the exception being thrown. - - - Contains contextual information about the source or destination. + + The flags associated with the parent connection object. + + Non-zero if the exception should be logged; otherwise, zero. + - + - Returns the error message for the specified SQLite return code. + Determines if backup API errors should be logged. - The SQLite return code. - The error message or null if it cannot be found. + + The flags associated with the parent connection object. + + + Non-zero if the backup API error should be logged; otherwise, zero. + - + - Returns the composite error message based on the SQLite return code - and the optional detailed error message. + Determines if logging for the class is + disabled. - The SQLite return code. - Optional detailed error message. - Error message text for the return code. + + The flags associated with the parent connection object. + + + Non-zero if logging for the class is + disabled; otherwise, zero. + - + - Gets the associated SQLite result code for this exception as a - . This property returns the same - underlying value as the property. + Determines if errors should be logged. + + The flags associated with the parent connection object. + + + Non-zero if the error should be logged; + otherwise, zero. + - + - Gets the associated SQLite return code for this exception as an - . For desktop versions of the .NET Framework, - this property overrides the property of the same name within the - - class. This property returns the same underlying value as the - property. + Determines if exceptions should be + logged. + + The flags associated with the parent connection object. + + + Non-zero if the exception should be + logged; otherwise, zero. + - + - SQLite error codes. Actually, this enumeration represents a return code, - which may also indicate success in one of several ways (e.g. SQLITE_OK, - SQLITE_ROW, and SQLITE_DONE). Therefore, the name of this enumeration is - something of a misnomer. + Determines if the current process is running on one of the Windows + [sub-]platforms. + + Non-zero when running on Windows; otherwise, zero. + - + - The error code is unknown. This error code - is only used by the managed wrapper itself. + This is a wrapper around the + method. + On Mono, it has to call the method overload without the + parameter, due to a bug in Mono. + + This is used for culture-specific formatting. + + + The format string. + + + An array the objects to format. + + + The resulting string. + - + - Successful result + This static class provides a thin wrapper around the native library + loading features of the underlying platform. - + - SQL error or missing database + This delegate is used to wrap the concept of loading a native + library, based on a file name, and returning the loaded module + handle. + + The file name of the native library to load. + + + The native module handle upon success -OR- IntPtr.Zero on failure. + - + - Internal logic error in SQLite + This delegate is used to wrap the concept of querying the machine + name of the current process. + + The machine name for the current process -OR- null on failure. + - + - Access permission denied + Attempts to load the specified native library file using the Win32 + API. + + The file name of the native library to load. + + + The native module handle upon success -OR- IntPtr.Zero on failure. + - + - Callback routine requested an abort + Attempts to determine the machine name of the current process using + the Win32 API. + + The machine name for the current process -OR- null on failure. + - + - The database file is locked + Attempts to load the specified native library file using the POSIX + API. + + The file name of the native library to load. + + + The native module handle upon success -OR- IntPtr.Zero on failure. + - + - A table in the database is locked + Attempts to determine the machine name of the current process using + the POSIX API. + + The machine name for the current process -OR- null on failure. + - + - A malloc() failed + Attempts to load the specified native library file. + + The file name of the native library to load. + + + The native module handle upon success -OR- IntPtr.Zero on failure. + - + - Attempt to write a readonly database + Attempts to determine the machine name of the current process. + + The machine name for the current process -OR- null on failure. + - + - Operation terminated by sqlite3_interrupt() + This class declares P/Invoke methods to call native POSIX APIs. - + - Some kind of disk I/O error occurred + This structure is used when running on POSIX operating systems + to store information about the current machine, including the + human readable name of the operating system as well as that of + the underlying hardware. - + - The database disk image is malformed + This structure is passed directly to the P/Invoke method to + obtain the information about the current machine, including + the human readable name of the operating system as well as + that of the underlying hardware. - + - Unknown opcode in sqlite3_file_control() + This is the P/Invoke method that wraps the native Unix uname + function. See the POSIX documentation for full details on what it + does. + + Structure containing a preallocated byte buffer to fill with the + requested information. + + + Zero for success and less than zero upon failure. + - + - Insertion failed because database is full + This is the P/Invoke method that wraps the native Unix dlopen + function. See the POSIX documentation for full details on what it + does. + + The name of the executable library. + + + This must be a combination of the individual bit flags RTLD_LAZY, + RTLD_NOW, RTLD_GLOBAL, and/or RTLD_LOCAL. + + + The native module handle upon success -OR- IntPtr.Zero on failure. + - + - Unable to open the database file + This is the P/Invoke method that wraps the native Unix dlclose + function. See the POSIX documentation for full details on what it + does. + + The handle to the loaded native library. + + + Zero upon success -OR- non-zero on failure. + - + - Database lock protocol error + For use with dlopen(), bind function calls lazily. - + - Database is empty + For use with dlopen(), bind function calls immediately. - + - The database schema changed + For use with dlopen(), make symbols globally available. - + - String or BLOB exceeds size limit + For use with dlopen(), opposite of RTLD_GLOBAL, and the default. - + - Abort due to constraint violation + For use with dlopen(), the defaults used by this class. - + - Data type mismatch + These are the characters used to separate the string fields within + the raw buffer returned by the P/Invoke method. - + - Library used incorrectly + This method is a wrapper around the P/Invoke + method that extracts and returns the human readable strings from + the raw buffer. + + This structure, which contains strings, will be filled based on the + data placed in the raw buffer returned by the + P/Invoke method. + + + Non-zero upon success; otherwise, zero. + - + - Uses OS features not supported on host + This class declares P/Invoke methods to call native Win32 APIs. - + - Authorization denied + This is the P/Invoke method that wraps the native Win32 LoadLibrary + function. See the MSDN documentation for full details on what it + does. + + The name of the executable library. + + + The native module handle upon success -OR- IntPtr.Zero on failure. + - + - Auxiliary database format error + This is the P/Invoke method that wraps the native Win32 GetSystemInfo + function. See the MSDN documentation for full details on what it + does. + + The system information structure to be filled in by the function. + - + - 2nd parameter to sqlite3_bind out of range + This enumeration contains the possible values for the processor + architecture field of the system information structure. - + - File opened that is not a database file + This structure contains information about the current computer. This + includes the processor type, page size, memory addresses, etc. - + - Notifications from sqlite3_log() + This class declares P/Invoke methods to call native SQLite APIs. - + - Warnings from sqlite3_log() + The file extension used for dynamic link libraries. - + - sqlite3_step() has another row ready + The file extension used for the XML configuration file. - + - sqlite3_step() has finished executing + This is the name of the XML configuration file specific to the + System.Data.SQLite assembly. - + - Used to mask off extended result codes + This is the XML configuratrion file token that will be replaced with + the qualified path to the directory containing the XML configuration + file. - + - SQLite implementation of . + This is the environment variable token that will be replaced with + the qualified path to the directory containing this assembly. + + - SQLite implementation of . + This is the environment variable token that will be replaced with an + abbreviation of the target framework attribute value associated with + this assembly. - + - Constructs a new instance. + This lock is used to protect the static _SQLiteNativeModuleFileName, + _SQLiteNativeModuleHandle, and processorArchitecturePlatforms fields. - + - Static instance member which returns an instanced class. + This dictionary stores the mappings between processor architecture + names and platform names. These mappings are now used for two + purposes. First, they are used to determine if the assembly code + base should be used instead of the location, based upon whether one + or more of the named sub-directories exist within the assembly code + base. Second, they are used to assist in loading the appropriate + SQLite interop assembly into the current process. - + - Creates and returns a new object. + This is the cached return value from the + method -OR- null if that method + has never returned a valid value. - The new object. - + - Creates and returns a new object. + When this field is non-zero, it indicates the + method was not able to locate a + suitable assembly directory. The + method will check this + field and skips calls into the + method whenever it is non-zero. - The new object. - + - Creates and returns a new object. + This is the cached return value from the + method -OR- null if that method + has never returned a valid value. - The new object. - + - Creates and returns a new object. + When this field is non-zero, it indicates the + method was not able to locate a + suitable XML configuration file name. The + method will check this + field and skips calls into the + method whenever it is non-zero. - The new object. - + - Creates and returns a new object. + For now, this method simply calls the Initialize method. - The new object. - + - Creates and returns a new object. + Attempts to initialize this class by pre-loading the native SQLite + library for the processor architecture of the current process. - The new object. - + - Will provide a object in .NET 3.5. + Combines two path strings. - The class or interface type to query for. - + + The first path -OR- null. + + + The second path -OR- null. + + + The combined path string -OR- null if both of the original path + strings are null. + - + - This event is raised whenever SQLite raises a logging event. - Note that this should be set as one of the first things in the - application. This event is provided for backward compatibility only. - New code should use the class instead. + Resets the cached XML configuration file name value, thus forcing the + next call to method to rely + upon the method to fetch the + XML configuration file name. - - - This abstract class is designed to handle user-defined functions easily. An instance of the derived class is made for each - connection to the database. - - - Although there is one instance of a class derived from SQLiteFunction per database connection, the derived class has no access - to the underlying connection. This is necessary to deter implementers from thinking it would be a good idea to make database - calls during processing. - - It is important to distinguish between a per-connection instance, and a per-SQL statement context. One instance of this class - services all SQL statements being stepped through on that connection, and there can be many. One should never store per-statement - information in member variables of user-defined function classes. - - For aggregate functions, always create and store your per-statement data in the contextData object on the 1st step. This data will - be automatically freed for you (and Dispose() called if the item supports IDisposable) when the statement completes. - - - + - The base connection this function is attached to + Queries and returns the cached XML configuration file name for the + assembly containing the managed System.Data.SQLite components, if + available. If the cached XML configuration file name value is not + available, the method will + be used to obtain the XML configuration file name. + + The XML configuration file name -OR- null if it cannot be determined + or does not exist. + - + - Internal array used to keep track of aggregate function context data + Queries and returns the XML configuration file name for the assembly + containing the managed System.Data.SQLite components. + + The XML configuration file name -OR- null if it cannot be determined + or does not exist. + - + - The connection flags associated with this object (this should be the - same value as the flags associated with the parent connection object). + If necessary, replaces all supported XML configuration file tokens + with their associated values. + + The name of the XML configuration file being read. + + + A setting value read from the XML configuration file. + + + The value of the will all supported XML + configuration file tokens replaced. No return value is reserved + to indicate an error. This method cannot fail. + - + - Holds a reference to the callback function for user functions + Queries and returns the value of the specified setting, using the + specified XML configuration file. + + The name of the XML configuration file to read. + + + The name of the setting. + + + The value to be returned if the setting has not been set explicitly + or cannot be determined. + + + Non-zero to expand any environment variable references contained in + the setting value to be returned. This has no effect on the .NET + Compact Framework. + + + The value of the setting -OR- the default value specified by + if it has not been set explicitly or + cannot be determined. + - + - Holds a reference to the callbakc function for stepping in an aggregate function + Attempts to determine the target framework attribute value that is + associated with the specified managed assembly, if applicable. + + The managed assembly to read the target framework attribute value + from. + + + The value of the target framework attribute value for the specified + managed assembly -OR- null if it cannot be determined. If this + assembly was compiled with a version of the .NET Framework prior to + version 4.0, the value returned MAY reflect that version of the .NET + Framework instead of the one associated with the specified managed + assembly. + - + - Holds a reference to the callback function for finalizing an aggregate function + Accepts a long target framework attribute value and makes it into a + much shorter version, suitable for use with NuGet packages. + + The long target framework attribute value to convert. + + + The short target framework attribute value -OR- null if it cannot + be determined or converted. + - + - Holds a reference to the callback function for collation sequences + If necessary, replaces all supported environment variable tokens + with their associated values. + + A setting value read from an environment variable. + + + The value of the will all supported + environment variable tokens replaced. No return value is reserved + to indicate an error. This method cannot fail. + - + - Current context of the current callback. Only valid during a callback + Queries and returns the value of the specified setting, using the XML + configuration file and/or the environment variables for the current + process and/or the current system, when available. + + The name of the setting. + + + The value to be returned if the setting has not been set explicitly + or cannot be determined. + + + The value of the setting -OR- the default value specified by + if it has not been set explicitly or + cannot be determined. By default, all references to existing + environment variables will be expanded to their corresponding values + within the value to be returned unless either the "No_Expand" or + "No_Expand_" environment variable is set [to + anything]. + - + - This static list contains all the user-defined functions declared using the proper attributes. + Resets the cached assembly directory value, thus forcing the next + call to method to rely + upon the method to fetch the + assembly directory. - + - Internal constructor, initializes the function's internal variables. + Queries and returns the cached directory for the assembly currently + being executed, if available. If the cached assembly directory value + is not available, the method will + be used to obtain the assembly directory. + + The directory for the assembly currently being executed -OR- null if + it cannot be determined. + - + - Constructs an instance of this class using the specified data-type - conversion parameters. + Queries and returns the directory for the assembly currently being + executed. - - The DateTime format to be used when converting string values to a - DateTime and binding DateTime parameters. - - - The to be used when creating DateTime - values. - - - The format string to be used when parsing and formatting DateTime - values. - - - Non-zero to create a UTF-16 data-type conversion context; otherwise, - a UTF-8 data-type conversion context will be created. - + + The directory for the assembly currently being executed -OR- null if + it cannot be determined. + - + - Disposes of any active contextData variables that were not automatically cleaned up. Sometimes this can happen if - someone closes the connection while a DataReader is open. + The name of the environment variable containing the processor + architecture of the current process. - + - Placeholder for a user-defined disposal routine + The native module file name for the native SQLite library or null. - True if the object is being disposed explicitly - + - Scalar functions override this method to do their magic. + The native module handle for the native SQLite library or the value + IntPtr.Zero. - - Parameters passed to functions have only an affinity for a certain data type, there is no underlying schema available - to force them into a certain type. Therefore the only types you will ever see as parameters are - DBNull.Value, Int64, Double, String or byte[] array. - - The arguments for the command to process - You may return most simple types as a return value, null or DBNull.Value to return null, DateTime, or - you may return an Exception-derived class if you wish to return an error to SQLite. Do not actually throw the error, - just return it! - + - Aggregate functions override this method to do their magic. + Determines the base file name (without any directory information) + for the native SQLite library to be pre-loaded by this class. - - Typically you'll be updating whatever you've placed in the contextData field and returning as quickly as possible. - - The arguments for the command to process - The 1-based step number. This is incrememted each time the step method is called. - A placeholder for implementers to store contextual data pertaining to the current context. + + The base file name for the native SQLite library to be pre-loaded by + this class -OR- null if its value cannot be determined. + - + - Aggregate functions override this method to finish their aggregate processing. + Searches for the native SQLite library in the directory containing + the assembly currently being executed as well as the base directory + for the current application domain. - - If you implemented your aggregate function properly, - you've been recording and keeping track of your data in the contextData object provided, and now at this stage you should have - all the information you need in there to figure out what to return. - NOTE: It is possible to arrive here without receiving a previous call to Step(), in which case the contextData will - be null. This can happen when no rows were returned. You can either return null, or 0 or some other custom return value - if that is the case. - - Your own assigned contextData, provided for you so you can return your final results. - You may return most simple types as a return value, null or DBNull.Value to return null, DateTime, or - you may return an Exception-derived class if you wish to return an error to SQLite. Do not actually throw the error, - just return it! + + Upon success, this parameter will be modified to refer to the base + directory containing the native SQLite library. + + + Upon success, this parameter will be modified to refer to the name + of the immediate directory (i.e. the offset from the base directory) + containing the native SQLite library. + + + Upon success, this parameter will be modified to non-zero only if + the base directory itself should be allowed for loading the native + library. + + + Non-zero (success) if the native SQLite library was found; otherwise, + zero (failure). - + - User-defined collation sequences override this method to provide a custom string sorting algorithm. + Queries and returns the base directory of the current application + domain. - The first string to compare - The second strnig to compare - 1 if param1 is greater than param2, 0 if they are equal, or -1 if param1 is less than param2 + + The base directory for the current application domain -OR- null if it + cannot be determined. + - + - Converts an IntPtr array of context arguments to an object array containing the resolved parameters the pointers point to. + Determines if the dynamic link library file name requires a suffix + and adds it if necessary. - - Parameters passed to functions have only an affinity for a certain data type, there is no underlying schema available - to force them into a certain type. Therefore the only types you will ever see as parameters are - DBNull.Value, Int64, Double, String or byte[] array. - - The number of arguments - A pointer to the array of arguments - An object array of the arguments once they've been converted to .NET values + + The original dynamic link library file name to inspect. + + + The dynamic link library file name, possibly modified to include an + extension. + - + - Takes the return value from Invoke() and Final() and figures out how to return it to SQLite's context. + Queries and returns the processor architecture of the current + process. - The context the return value applies to - The parameter to return to SQLite + + The processor architecture of the current process -OR- null if it + cannot be determined. + - + - Internal scalar callback function, which wraps the raw context pointer and calls the virtual Invoke() method. - WARNING: Must not throw exceptions. + Given the processor architecture, returns the name of the platform. - A raw context pointer - Number of arguments passed in - A pointer to the array of arguments + + The processor architecture to be translated to a platform name. + + + The platform name for the specified processor architecture -OR- null + if it cannot be determined. + - + - Internal collation sequence function, which wraps up the raw string pointers and executes the Compare() virtual function. - WARNING: Must not throw exceptions. + Attempts to load the native SQLite library based on the specified + directory and processor architecture. - Not used - Length of the string pv1 - Pointer to the first string to compare - Length of the string pv2 - Pointer to the second string to compare - Returns -1 if the first string is less than the second. 0 if they are equal, or 1 if the first string is greater - than the second. Returns 0 if an exception is caught. + + The base directory to use, null for default (the base directory of + the current application domain). This directory should contain the + processor architecture specific sub-directories. + + + The requested processor architecture, null for default (the + processor architecture of the current process). This caller should + almost always specify null for this parameter. + + + Non-zero indicates that the native SQLite library can be loaded + from the base directory itself. + + + The candidate native module file name to load will be stored here, + if necessary. + + + The native module handle as returned by LoadLibrary will be stored + here, if necessary. This value will be IntPtr.Zero if the call to + LoadLibrary fails. + + + Non-zero if the native module was loaded successfully; otherwise, + zero. + - + - Internal collation sequence function, which wraps up the raw string pointers and executes the Compare() virtual function. - WARNING: Must not throw exceptions. + A strongly-typed resource class, for looking up localized strings, etc. - Not used - Length of the string pv1 - Pointer to the first string to compare - Length of the string pv2 - Pointer to the second string to compare - Returns -1 if the first string is less than the second. 0 if they are equal, or 1 if the first string is greater - than the second. Returns 0 if an exception is caught. - + - The internal aggregate Step function callback, which wraps the raw context pointer and calls the virtual Step() method. - WARNING: Must not throw exceptions. + Returns the cached ResourceManager instance used by this class. - - This function takes care of doing the lookups and getting the important information put together to call the Step() function. - That includes pulling out the user's contextData and updating it after the call is made. We use a sorted list for this so - binary searches can be done to find the data. - - A raw context pointer - Number of arguments passed in - A pointer to the array of arguments - + - An internal aggregate Final function callback, which wraps the context pointer and calls the virtual Final() method. - WARNING: Must not throw exceptions. + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. - A raw context pointer - + + + Looks up a localized string similar to <?xml version="1.0" standalone="yes"?> + <DocumentElement> + <DataTypes> + <TypeName>smallint</TypeName> + <ProviderDbType>10</ProviderDbType> + <ColumnSize>5</ColumnSize> + <DataType>System.Int16</DataType> + <CreateFormat>smallint</CreateFormat> + <IsAutoIncrementable>false</IsAutoIncrementable> + <IsCaseSensitive>false</IsCaseSensitive> + <IsFixedLength>true</IsFixedLength> + <IsFixedPrecisionScale>true</IsFixedPrecisionScale> + <IsLong>false</IsLong> + <IsNullable>true</ [rest of string was truncated]";. + + + - Using reflection, enumerate all assemblies in the current appdomain looking for classes that - have a SQLiteFunctionAttribute attribute, and registering them accordingly. + Looks up a localized string similar to ALL,ALTER,AND,AS,AUTOINCREMENT,BETWEEN,BY,CASE,CHECK,COLLATE,COMMIT,CONSTRAINT,CREATE,CROSS,DEFAULT,DEFERRABLE,DELETE,DISTINCT,DROP,ELSE,ESCAPE,EXCEPT,FOREIGN,FROM,FULL,GROUP,HAVING,IN,INDEX,INNER,INSERT,INTERSECT,INTO,IS,ISNULL,JOIN,LEFT,LIMIT,NATURAL,NOT,NOTNULL,NULL,ON,OR,ORDER,OUTER,PRIMARY,REFERENCES,RIGHT,ROLLBACK,SELECT,SET,TABLE,THEN,TO,TRANSACTION,UNION,UNIQUE,UPDATE,USING,VALUES,WHEN,WHERE. - + + + Looks up a localized string similar to <?xml version="1.0" encoding="utf-8" ?> + <DocumentElement> + <MetaDataCollections> + <CollectionName>MetaDataCollections</CollectionName> + <NumberOfRestrictions>0</NumberOfRestrictions> + <NumberOfIdentifierParts>0</NumberOfIdentifierParts> + </MetaDataCollections> + <MetaDataCollections> + <CollectionName>DataSourceInformation</CollectionName> + <NumberOfRestrictions>0</NumberOfRestrictions> + <NumberOfIdentifierParts>0</NumberOfIdentifierParts> + </MetaDataCollections> + <MetaDataC [rest of string was truncated]";. + + + - Manual method of registering a function. The type must still have the SQLiteFunctionAttributes in order to work - properly, but this is a workaround for the Compact Framework where enumerating assemblies is not currently supported. + This interface represents a virtual table implementation written in + native code. - The type of the function to register - + - Called by SQLiteBase derived classes, this function binds all user-defined functions to a connection. - It is done this way so that all user-defined functions will access the database using the same encoding scheme - as the connection (UTF-8 or UTF-16). + + int (*xCreate)(sqlite3 *db, void *pAux, + int argc, char *const*argv, + sqlite3_vtab **ppVTab, + char **pzErr); + + + The xCreate method is called to create a new instance of a virtual table + in response to a CREATE VIRTUAL TABLE statement. + If the xCreate method is the same pointer as the xConnect method, then the + virtual table is an eponymous virtual table. + If the xCreate method is omitted (if it is a NULL pointer) then the virtual + table is an eponymous-only virtual table. + + + The db parameter is a pointer to the SQLite database connection that + is executing the CREATE VIRTUAL TABLE statement. + The pAux argument is the copy of the client data pointer that was the + fourth argument to the sqlite3_create_module() or + sqlite3_create_module_v2() call that registered the + virtual table module. + The argv parameter is an array of argc pointers to null terminated strings. + The first string, argv[0], is the name of the module being invoked. The + module name is the name provided as the second argument to + sqlite3_create_module() and as the argument to the USING clause of the + CREATE VIRTUAL TABLE statement that is running. + The second, argv[1], is the name of the database in which the new virtual table is being created. The database name is "main" for the primary database, or + "temp" for TEMP database, or the name given at the end of the ATTACH + statement for attached databases. The third element of the array, argv[2], + is the name of the new virtual table, as specified following the TABLE + keyword in the CREATE VIRTUAL TABLE statement. + If present, the fourth and subsequent strings in the argv[] array report + the arguments to the module name in the CREATE VIRTUAL TABLE statement. + + + The job of this method is to construct the new virtual table object + (an sqlite3_vtab object) and return a pointer to it in *ppVTab. + + + As part of the task of creating a new sqlite3_vtab structure, this + method must invoke sqlite3_declare_vtab() to tell the SQLite + core about the columns and datatypes in the virtual table. + The sqlite3_declare_vtab() API has the following prototype: + + + int sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable) + + + The first argument to sqlite3_declare_vtab() must be the same + database connection pointer as the first parameter to this method. + The second argument to sqlite3_declare_vtab() must a zero-terminated + UTF-8 string that contains a well-formed CREATE TABLE statement that + defines the columns in the virtual table and their data types. + The name of the table in this CREATE TABLE statement is ignored, + as are all constraints. Only the column names and datatypes matter. + The CREATE TABLE statement string need not to be + held in persistent memory. The string can be + deallocated and/or reused as soon as the sqlite3_declare_vtab() + routine returns. + + + The xCreate method need not initialize the pModule, nRef, and zErrMsg + fields of the sqlite3_vtab object. The SQLite core will take care of + that chore. + + + The xCreate should return SQLITE_OK if it is successful in + creating the new virtual table, or SQLITE_ERROR if it is not successful. + If not successful, the sqlite3_vtab structure must not be allocated. + An error message may optionally be returned in *pzErr if unsuccessful. + Space to hold the error message string must be allocated using + an SQLite memory allocation function like + sqlite3_malloc() or sqlite3_mprintf() as the SQLite core will + attempt to free the space using sqlite3_free() after the error has + been reported up to the application. + + + If the xCreate method is omitted (left as a NULL pointer) then the + virtual table is an eponymous-only virtual table. New instances of + the virtual table cannot be created using CREATE VIRTUAL TABLE and the + virtual table can only be used via its module name. + Note that SQLite versions prior to 3.9.0 (2015-10-14) do not understand + eponymous-only virtual tables and will segfault if an attempt is made + to CREATE VIRTUAL TABLE on an eponymous-only virtual table because + the xCreate method was not checked for null. + + + If the xCreate method is the exact same pointer as the xConnect method, + that indicates that the virtual table does not need to initialize backing + store. Such a virtual table can be used as an eponymous virtual table + or as a named virtual table using CREATE VIRTUAL TABLE or both. + + + If a column datatype contains the special keyword "HIDDEN" + (in any combination of upper and lower case letters) then that keyword + it is omitted from the column datatype name and the column is marked + as a hidden column internally. + A hidden column differs from a normal column in three respects: + + + ]]> + ]]> Hidden columns are not listed in the dataset returned by + "PRAGMA table_info", + ]]>]]> Hidden columns are not included in the expansion of a "*" + expression in the result set of a SELECT, and + ]]>]]> Hidden columns are not included in the implicit column-list + used by an INSERT statement that lacks an explicit column-list. + ]]>]]> + + + For example, if the following SQL is passed to sqlite3_declare_vtab(): + + + CREATE TABLE x(a HIDDEN VARCHAR(12), b INTEGER, c INTEGER Hidden); + + + Then the virtual table would be created with two hidden columns, + and with datatypes of "VARCHAR(12)" and "INTEGER". + + + An example use of hidden columns can be seen in the FTS3 virtual + table implementation, where every FTS virtual table + contains an FTS hidden column that is used to pass information from the + virtual table into FTS auxiliary functions and to the FTS MATCH operator. + + + A virtual table that contains hidden columns can be used like + a table-valued function in the FROM clause of a SELECT statement. + The arguments to the table-valued function become constraints on + the HIDDEN columns of the virtual table. + + + For example, the "generate_series" extension (located in the + ext/misc/series.c + file in the source tree) + implements an eponymous virtual table with the following schema: + + + CREATE TABLE generate_series( + value, + start HIDDEN, + stop HIDDEN, + step HIDDEN + ); + + + The sqlite3_module.xBestIndex method in the implementation of this + table checks for equality constraints against the HIDDEN columns, and uses + those as input parameters to determine the range of integer "value" outputs + to generate. Reasonable defaults are used for any unconstrained columns. + For example, to list all integers between 5 and 50: + + + SELECT value FROM generate_series(5,50); + + + The previous query is equivalent to the following: + + + SELECT value FROM generate_series WHERE start=5 AND stop=50; + + + Arguments on the virtual table name are matched to hidden columns + in order. The number of arguments can be less than the + number of hidden columns, in which case the latter hidden columns are + unconstrained. However, an error results if there are more arguments + than there are hidden columns in the virtual table. + + + Beginning with SQLite version 3.14.0 (2016-08-08), + the CREATE TABLE statement that + is passed into sqlite3_declare_vtab() may contain a WITHOUT ROWID clause. + This is useful for cases where the virtual table rows + cannot easily be mapped into unique integers. A CREATE TABLE + statement that includes WITHOUT ROWID must define one or more columns as + the PRIMARY KEY. Every column of the PRIMARY KEY must individually be + NOT NULL and all columns for each row must be collectively unique. + + + Note that SQLite does not enforce the PRIMARY KEY for a WITHOUT ROWID + virtual table. Enforcement is the responsibility of the underlying + virtual table implementation. But SQLite does assume that the PRIMARY KEY + constraint is valid - that the identified columns really are UNIQUE and + NOT NULL - and it uses that assumption to optimize queries against the + virtual table. + + + The rowid column is not accessible on a + WITHOUT ROWID virtual table (of course). + + + The xUpdate method was originally designed around having a + ROWID as a single value. The xUpdate method has been expanded to + accommodate an arbitrary PRIMARY KEY in place of the ROWID, but the + PRIMARY KEY must still be only one column. For this reason, SQLite + will reject any WITHOUT ROWID virtual table that has more than one + PRIMARY KEY column and a non-NULL xUpdate method. + - - The wrapper functions that interop with SQLite will create a unique cookie value, which internally is a pointer to - all the wrapped callback functions. The interop function uses it to map CDecl callbacks to StdCall callbacks. - - The base object on which the functions are to bind - The flags associated with the parent connection object - Returns a logical list of functions which the connection should retain until it is closed. + + The native database connection handle. + + + The original native pointer value that was provided to the + sqlite3_create_module(), sqlite3_create_module_v2() or + sqlite3_create_disposable_module() functions. + + + The number of arguments from the CREATE VIRTUAL TABLE statement. + + + The array of string arguments from the CREATE VIRTUAL TABLE + statement. + + + Upon success, this parameter must be modified to point to the newly + created native sqlite3_vtab derived structure. + + + Upon failure, this parameter must be modified to point to the error + message, with the underlying memory having been obtained from the + sqlite3_malloc() function. + + + A standard SQLite return code. + - + - This function binds a user-defined functions to a connection. + + int (*xConnect)(sqlite3*, void *pAux, + int argc, char *const*argv, + sqlite3_vtab **ppVTab, + char **pzErr); + + + The xConnect method is very similar to xCreate. + It has the same parameters and constructs a new sqlite3_vtab structure + just like xCreate. + And it must also call sqlite3_declare_vtab() like xCreate. + + + The difference is that xConnect is called to establish a new + connection to an existing virtual table whereas xCreate is called + to create a new virtual table from scratch. + + + The xCreate and xConnect methods are only different when the + virtual table has some kind of backing store that must be initialized + the first time the virtual table is created. The xCreate method creates + and initializes the backing store. The xConnect method just connects + to an existing backing store. When xCreate and xConnect are the same, + the table is an eponymous virtual table. + + + As an example, consider a virtual table implementation that + provides read-only access to existing comma-separated-value (CSV) + files on disk. There is no backing store that needs to be created + or initialized for such a virtual table (since the CSV files already + exist on disk) so the xCreate and xConnect methods will be identical + for that module. + + + Another example is a virtual table that implements a full-text index. + The xCreate method must create and initialize data structures to hold + the dictionary and posting lists for that index. The xConnect method, + on the other hand, only has to locate and use an existing dictionary + and posting lists that were created by a prior xCreate call. + + + The xConnect method must return SQLITE_OK if it is successful + in creating the new virtual table, or SQLITE_ERROR if it is not + successful. If not successful, the sqlite3_vtab structure must not be + allocated. An error message may optionally be returned in *pzErr if + unsuccessful. + Space to hold the error message string must be allocated using + an SQLite memory allocation function like + sqlite3_malloc() or sqlite3_mprintf() as the SQLite core will + attempt to free the space using sqlite3_free() after the error has + been reported up to the application. + + + The xConnect method is required for every virtual table implementation, + though the xCreate and xConnect pointers of the sqlite3_module object + may point to the same function if the virtual table does not need to + initialize backing store. + - - The object instance associated with the - that the function should be bound to. + + The native database connection handle. - - The object instance containing - the metadata for the function to be bound. + + The original native pointer value that was provided to the + sqlite3_create_module(), sqlite3_create_module_v2() or + sqlite3_create_disposable_module() functions. - - The object instance that implements the - function to be bound. + + The number of arguments from the CREATE VIRTUAL TABLE statement. - - The flags associated with the parent connection object. + + The array of string arguments from the CREATE VIRTUAL TABLE + statement. + + Upon success, this parameter must be modified to point to the newly + created native sqlite3_vtab derived structure. + + + Upon failure, this parameter must be modified to point to the error + message, with the underlying memory having been obtained from the + sqlite3_malloc() function. + + + A standard SQLite return code. + - - - Returns a reference to the underlying connection's SQLiteConvert class, which can be used to convert - strings and DateTime's into the current connection's encoding schema. - - - - - Extends SQLiteFunction and allows an inherited class to obtain the collating sequence associated with a function call. - - - User-defined functions can call the GetCollationSequence() method in this class and use it to compare strings and char arrays. - - - - - Obtains the collating sequence in effect for the given function. - - - - - - The type of user-defined function to declare - - - - - Scalar functions are designed to be called and return a result immediately. Examples include ABS(), Upper(), Lower(), etc. - - - - - Aggregate functions are designed to accumulate data until the end of a call and then return a result gleaned from the accumulated data. - Examples include SUM(), COUNT(), AVG(), etc. - - - - - Collation sequences are used to sort textual data in a custom manner, and appear in an ORDER BY clause. Typically text in an ORDER BY is - sorted using a straight case-insensitive comparison function. Custom collating sequences can be used to alter the behavior of text sorting - in a user-defined manner. - - - - - An internal callback delegate declaration. - - Raw native context pointer for the user function. - Total number of arguments to the user function. - Raw native pointer to the array of raw native argument pointers. - - - - An internal final callback delegate declaration. - - Raw context pointer for the user function - - - - Internal callback delegate for implementing collation sequences - - Not used - Length of the string pv1 - Pointer to the first string to compare - Length of the string pv2 - Pointer to the second string to compare - Returns -1 if the first string is less than the second. 0 if they are equal, or 1 if the first string is greater - than the second. - - + - The type of collating sequence + + SQLite uses the xBestIndex method of a virtual table module to determine + the best way to access the virtual table. + The xBestIndex method has a prototype like this: + + + int (*xBestIndex)(sqlite3_vtab *pVTab, sqlite3_index_info*); + + + The SQLite core communicates with the xBestIndex method by filling + in certain fields of the sqlite3_index_info structure and passing a + pointer to that structure into xBestIndex as the second parameter. + The xBestIndex method fills out other fields of this structure which + forms the reply. The sqlite3_index_info structure looks like this: + + + struct sqlite3_index_info { + /* Inputs */ + const int nConstraint; /* Number of entries in aConstraint */ + const struct sqlite3_index_constraint { + int iColumn; /* Column constrained. -1 for ROWID */ + unsigned char op; /* Constraint operator */ + unsigned char usable; /* True if this constraint is usable */ + int iTermOffset; /* Used internally - xBestIndex should ignore */ + } *const aConstraint; /* Table of WHERE clause constraints */ + const int nOrderBy; /* Number of terms in the ORDER BY clause */ + const struct sqlite3_index_orderby { + int iColumn; /* Column number */ + unsigned char desc; /* True for DESC. False for ASC. */ + } *const aOrderBy; /* The ORDER BY clause */ + /* Outputs */ + struct sqlite3_index_constraint_usage { + int argvIndex; /* if >0, constraint is part of argv to xFilter */ + unsigned char omit; /* Do not code a test for this constraint */ + } *const aConstraintUsage; + int idxNum; /* Number used to identify the index */ + char *idxStr; /* String, possibly obtained from sqlite3_malloc */ + int needToFreeIdxStr; /* Free idxStr using sqlite3_free() if true */ + int orderByConsumed; /* True if output is already ordered */ + double estimatedCost; /* Estimated cost of using this index */ + ]]>/* Fields below are only available in SQLite 3.8.2 and later */]]> + sqlite3_int64 estimatedRows; /* Estimated number of rows returned */ + ]]>/* Fields below are only available in SQLite 3.9.0 and later */]]> + int idxFlags; /* Mask of SQLITE_INDEX_SCAN_* flags */ + ]]>/* Fields below are only available in SQLite 3.10.0 and later */]]> + sqlite3_uint64 colUsed; /* Input: Mask of columns used by statement */ + }; + + + Note the warnings on the "estimatedRows", "idxFlags", and colUsed fields. + These fields were added with SQLite versions 3.8.2, 3.9.0, and 3.10.0, respectively. + Any extension that reads or writes these fields must first check that the + version of the SQLite library in use is greater than or equal to appropriate + version - perhaps comparing the value returned from sqlite3_libversion_number() + against constants 3008002, 3009000, and/or 3010000. The result of attempting + to access these fields in an sqlite3_index_info structure created by an + older version of SQLite are undefined. + + + In addition, there are some defined constants: + + + #define SQLITE_INDEX_CONSTRAINT_EQ 2 + #define SQLITE_INDEX_CONSTRAINT_GT 4 + #define SQLITE_INDEX_CONSTRAINT_LE 8 + #define SQLITE_INDEX_CONSTRAINT_LT 16 + #define SQLITE_INDEX_CONSTRAINT_GE 32 + #define SQLITE_INDEX_CONSTRAINT_MATCH 64 + #define SQLITE_INDEX_CONSTRAINT_LIKE 65 /* 3.10.0 and later */ + #define SQLITE_INDEX_CONSTRAINT_GLOB 66 /* 3.10.0 and later */ + #define SQLITE_INDEX_CONSTRAINT_REGEXP 67 /* 3.10.0 and later */ + #define SQLITE_INDEX_CONSTRAINT_NE 68 /* 3.21.0 and later */ + #define SQLITE_INDEX_CONSTRAINT_ISNOT 69 /* 3.21.0 and later */ + #define SQLITE_INDEX_CONSTRAINT_ISNOTNULL 70 /* 3.21.0 and later */ + #define SQLITE_INDEX_CONSTRAINT_ISNULL 71 /* 3.21.0 and later */ + #define SQLITE_INDEX_CONSTRAINT_IS 72 /* 3.21.0 and later */ + #define SQLITE_INDEX_CONSTRAINT_FUNCTION 150 /* 3.25.0 and later */ + #define SQLITE_INDEX_SCAN_UNIQUE 1 /* Scan visits at most 1 row */ + + + The SQLite core calls the xBestIndex method when it is compiling a query + that involves a virtual table. In other words, SQLite calls this method + when it is running sqlite3_prepare() or the equivalent. + By calling this method, the + SQLite core is saying to the virtual table that it needs to access + some subset of the rows in the virtual table and it wants to know the + most efficient way to do that access. The xBestIndex method replies + with information that the SQLite core can then use to conduct an + efficient search of the virtual table. + + + While compiling a single SQL query, the SQLite core might call + xBestIndex multiple times with different settings in sqlite3_index_info. + The SQLite core will then select the combination that appears to + give the best performance. + + + Before calling this method, the SQLite core initializes an instance + of the sqlite3_index_info structure with information about the + query that it is currently trying to process. This information + derives mainly from the WHERE clause and ORDER BY or GROUP BY clauses + of the query, but also from any ON or USING clauses if the query is a + join. The information that the SQLite core provides to the xBestIndex + method is held in the part of the structure that is marked as "Inputs". + The "Outputs" section is initialized to zero. + + + The information in the sqlite3_index_info structure is ephemeral + and may be overwritten or deallocated as soon as the xBestIndex method + returns. If the xBestIndex method needs to remember any part of the + sqlite3_index_info structure, it should make a copy. Care must be + take to store the copy in a place where it will be deallocated, such + as in the idxStr field with needToFreeIdxStr set to 1. + + + Note that xBestIndex will always be called before xFilter, since + the idxNum and idxStr outputs from xBestIndex are required inputs to + xFilter. However, there is no guarantee that xFilter will be called + following a successful xBestIndex. + + + The xBestIndex method is required for every virtual table implementation. + + + The main thing that the SQLite core is trying to communicate to + the virtual table is the constraints that are available to limit + the number of rows that need to be searched. The aConstraint[] array + contains one entry for each constraint. There will be exactly + nConstraint entries in that array. + + + Each constraint will usually correspond to a term in the WHERE clause + or in a USING or ON clause that is of the form + + + column OP EXPR + + + Where "column" is a column in the virtual table, OP is an operator + like "=" or "<", and EXPR is an arbitrary expression. So, for example, + if the WHERE clause contained a term like this: + + + a = 5 + + + Then one of the constraints would be on the "a" column with + operator "=" and an expression of "5". Constraints need not have a + literal representation of the WHERE clause. The query optimizer might + make transformations to the + WHERE clause in order to extract as many constraints + as it can. So, for example, if the WHERE clause contained something + like this: + + + x BETWEEN 10 AND 100 AND 999>y + + + The query optimizer might translate this into three separate constraints: + + + x >= 10 + x <= 100 + y < 999 + + + For each such constraint, the aConstraint[].iColumn field indicates which + column appears on the left-hand side of the constraint. + The first column of the virtual table is column 0. + The rowid of the virtual table is column -1. + The aConstraint[].op field indicates which operator is used. + The SQLITE_INDEX_CONSTRAINT_* constants map integer constants + into operator values. + Columns occur in the order they were defined by the call to + sqlite3_declare_vtab() in the xCreate or xConnect method. + Hidden columns are counted when determining the column index. + + + If the xFindFunction() method for the virtual table is defined, and + if xFindFunction() sometimes returns SQLITE_INDEX_CONSTRAINT_FUNCTION or + larger, then the constraints might also be of the form: + + + FUNCTION( column, EXPR) + + + In this case the aConstraint[].op value is the same as the value + returned by xFindFunction() for FUNCTION. + + + The aConstraint[] array contains information about all constraints + that apply to the virtual table. But some of the constraints might + not be usable because of the way tables are ordered in a join. + The xBestIndex method must therefore only consider constraints + that have an aConstraint[].usable flag which is true. + + + In addition to WHERE clause constraints, the SQLite core also + tells the xBestIndex method about the ORDER BY clause. + (In an aggregate query, the SQLite core might put in GROUP BY clause + information in place of the ORDER BY clause information, but this fact + should not make any difference to the xBestIndex method.) + If all terms of the ORDER BY clause are columns in the virtual table, + then nOrderBy will be the number of terms in the ORDER BY clause + and the aOrderBy[] array will identify the column for each term + in the order by clause and whether or not that column is ASC or DESC. + + + In SQLite version 3.10.0 (2016-01-06) and later, + the colUsed field is available + to indicate which fields of the virtual table are actually used by the + statement being prepared. If the lowest bit of colUsed is set, that + means that the first column is used. The second lowest bit corresponds + to the second column. And so forth. If the most significant bit of + colUsed is set, that means that one or more columns other than the + first 63 columns are used. If column usage information is needed by the + xFilter method, then the required bits must be encoded into either + the idxNum or idxStr output fields. + + + Given all of the information above, the job of the xBestIndex + method it to figure out the best way to search the virtual table. + + + The xBestIndex method fills the idxNum and idxStr fields with + information that communicates an indexing strategy to the xFilter + method. The information in idxNum and idxStr is arbitrary as far + as the SQLite core is concerned. The SQLite core just copies the + information through to the xFilter method. Any desired meaning can + be assigned to idxNum and idxStr as long as xBestIndex and xFilter + agree on what that meaning is. + + + The idxStr value may be a string obtained from an SQLite + memory allocation function such as sqlite3_mprintf(). + If this is the case, then the needToFreeIdxStr flag must be set to + true so that the SQLite core will know to call sqlite3_free() on + that string when it has finished with it, and thus avoid a memory leak. + The idxStr value may also be a static constant string, in which case + the needToFreeIdxStr boolean should remain false. + + + If the virtual table will output rows in the order specified by + the ORDER BY clause, then the orderByConsumed flag may be set to + true. If the output is not automatically in the correct order + then orderByConsumed must be left in its default false setting. + This will indicate to the SQLite core that it will need to do a + separate sorting pass over the data after it comes out of the virtual table. + + + The estimatedCost field should be set to the estimated number + of disk access operations required to execute this query against + the virtual table. The SQLite core will often call xBestIndex + multiple times with different constraints, obtain multiple cost + estimates, then choose the query plan that gives the lowest estimate. + The SQLite core initializes estimatedCost to a very large value + prior to invoking xBestIndex, so if xBestIndex determines that the + current combination of parameters is undesirable, it can leave the + estimatedCost field unchanged to discourage its use. + + + If the current version of SQLite is 3.8.2 or greater, the estimatedRows + field may be set to an estimate of the number of rows returned by the + proposed query plan. If this value is not explicitly set, the default + estimate of 25 rows is used. + + + If the current version of SQLite is 3.9.0 or greater, the idxFlags field + may be set to SQLITE_INDEX_SCAN_UNIQUE to indicate that the virtual table + will return only zero or one rows given the input constraints. Additional + bits of the idxFlags field might be understood in later versions of SQLite. + + + The aConstraintUsage[] array contains one element for each of + the nConstraint constraints in the inputs section of the + sqlite3_index_info structure. + The aConstraintUsage[] array is used by xBestIndex to tell the + core how it is using the constraints. + + + The xBestIndex method may set aConstraintUsage[].argvIndex + entries to values greater than zero. + Exactly one entry should be set to 1, another to 2, another to 3, + and so forth up to as many or as few as the xBestIndex method wants. + The EXPR of the corresponding constraints will then be passed + in as the argv[] parameters to xFilter. + + + For example, if the aConstraint[3].argvIndex is set to 1, then + when xFilter is called, the argv[0] passed to xFilter will have + the EXPR value of the aConstraint[3] constraint. + + + By default, the SQLite core double checks all constraints on + each row of the virtual table that it receives. If such a check + is redundant, the xBestFilter method can suppress that double-check by + setting aConstraintUsage[].omit. + + + The xBestIndex method should return SQLITE_OK on success. If any + kind of fatal error occurs, an appropriate error code (ex: SQLITE_NOMEM) + should be returned instead. + + + If xBestIndex returns SQLITE_CONSTRAINT, that does not indicate an + error. Rather, SQLITE_CONSTRAINT indicates that the particular combination + of input parameters specified should not be used in the query plan. + The SQLITE_CONSTRAINT return is useful for table-valued functions that + have required parameters. If the aConstraint[].usable field is false + for one of the required parameter, then the xBestIndex method should + return SQLITE_CONSTRAINT. + + + The following example will better illustrate the use of SQLITE_CONSTRAINT + as a return value from xBestIndex: + + + SELECT * FROM realtab, tablevaluedfunc(realtab.x); + + + Assuming that the first hidden column of "tablevaluedfunc" is "param1", + the query above is semantically equivalent to this: + + + SELECT * FROM realtab, tablevaluedfunc + WHERE tablevaluedfunc.param1 = realtab.x; + + + The query planner must decide between many possible implementations + of this query, but two plans in particular are of note: + + ]]> + ]]>Scan all + rows of realtab and for each row, find rows in tablevaluedfunc where + param1 is equal to realtab.x + ]]>]]>Scan all rows of tablevalued func and for each row find rows + in realtab where x is equal to tablevaluedfunc.param1. + ]]>]]> + + The xBestIndex method will be invoked once for each of the potential + plans above. For plan 1, the aConstraint[].usable flag for for the + SQLITE_CONSTRAINT_EQ constraint on the param1 column will be true because + the right-hand side value for the "param1 = ?" constraint will be known, + since it is determined by the outer realtab loop. + But for plan 2, the aConstraint[].usable flag for "param1 = ?" will be false + because the right-hand side value is determined by an inner loop and is thus + an unknown quantity. Because param1 is a required input to the table-valued + functions, the xBestIndex method should return SQLITE_CONSTRAINT when presented + with plan 2, indicating that a required input is missing. This forces the + query planner to select plan 1. + + + The native pointer to the sqlite3_vtab derived structure. + + + The native pointer to the sqlite3_index_info structure. + + + A standard SQLite return code. + - + - The built-in BINARY collating sequence + + int (*xDisconnect)(sqlite3_vtab *pVTab); + + + This method releases a connection to a virtual table. + Only the sqlite3_vtab object is destroyed. + The virtual table is not destroyed and any backing store + associated with the virtual table persists. + + This method undoes the work of xConnect. + + This method is a destructor for a connection to the virtual table. + Contrast this method with xDestroy. The xDestroy is a destructor + for the entire virtual table. + + + The xDisconnect method is required for every virtual table implementation, + though it is acceptable for the xDisconnect and xDestroy methods to be + the same function if that makes sense for the particular virtual table. + + + The native pointer to the sqlite3_vtab derived structure. + + + A standard SQLite return code. + - + - The built-in NOCASE collating sequence + + int (*xDestroy)(sqlite3_vtab *pVTab); + + + This method releases a connection to a virtual table, just like + the xDisconnect method, and it also destroys the underlying + table implementation. This method undoes the work of xCreate. + + + The xDisconnect method is called whenever a database connection + that uses a virtual table is closed. The xDestroy method is only + called when a DROP TABLE statement is executed against the virtual table. + + + The xDestroy method is required for every virtual table implementation, + though it is acceptable for the xDisconnect and xDestroy methods to be + the same function if that makes sense for the particular virtual table. + + + The native pointer to the sqlite3_vtab derived structure. + + + A standard SQLite return code. + - + - The built-in REVERSE collating sequence + + int (*xOpen)(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor); + + + The xOpen method creates a new cursor used for accessing (read and/or + writing) a virtual table. A successful invocation of this method + will allocate the memory for the sqlite3_vtab_cursor (or a subclass), + initialize the new object, and make *ppCursor point to the new object. + The successful call then returns SQLITE_OK. + + + For every successful call to this method, the SQLite core will + later invoke the xClose method to destroy + the allocated cursor. + + + The xOpen method need not initialize the pVtab field of the + sqlite3_vtab_cursor structure. The SQLite core will take care + of that chore automatically. + + + A virtual table implementation must be able to support an arbitrary + number of simultaneously open cursors. + + + When initially opened, the cursor is in an undefined state. + The SQLite core will invoke the xFilter method + on the cursor prior to any attempt to position or read from the cursor. + + + The xOpen method is required for every virtual table implementation. + + + The native pointer to the sqlite3_vtab derived structure. + + + Upon success, this parameter must be modified to point to the newly + created native sqlite3_vtab_cursor derived structure. + + + A standard SQLite return code. + - + - A custom user-defined collating sequence + + int (*xClose)(sqlite3_vtab_cursor*); + + + The xClose method closes a cursor previously opened by + xOpen. + The SQLite core will always call xClose once for each cursor opened + using xOpen. + + + This method must release all resources allocated by the + corresponding xOpen call. The routine will not be called again even if it + returns an error. The SQLite core will not use the + sqlite3_vtab_cursor again after it has been closed. + + + The xClose method is required for every virtual table implementation. + + + The native pointer to the sqlite3_vtab_cursor derived structure. + + + A standard SQLite return code. + - + - The encoding type the collation sequence uses + + int (*xFilter)(sqlite3_vtab_cursor*, int idxNum, const char *idxStr, + int argc, sqlite3_value **argv); + + + This method begins a search of a virtual table. + The first argument is a cursor opened by xOpen. + The next two arguments define a particular search index previously + chosen by xBestIndex. The specific meanings of idxNum and idxStr + are unimportant as long as xFilter and xBestIndex agree on what + that meaning is. + + + The xBestIndex function may have requested the values of + certain expressions using the aConstraintUsage[].argvIndex values + of the sqlite3_index_info structure. + Those values are passed to xFilter using the argc and argv parameters. + + + If the virtual table contains one or more rows that match the + search criteria, then the cursor must be left point at the first row. + Subsequent calls to xEof must return false (zero). + If there are no rows match, then the cursor must be left in a state + that will cause the xEof to return true (non-zero). + The SQLite engine will use + the xColumn and xRowid methods to access that row content. + The xNext method will be used to advance to the next row. + + + This method must return SQLITE_OK if successful, or an sqlite + error code if an error occurs. + + + The xFilter method is required for every virtual table implementation. + + + The native pointer to the sqlite3_vtab_cursor derived structure. + + + Number used to help identify the selected index. + + + The native pointer to the UTF-8 encoded string containing the + string used to help identify the selected index. + + + The number of native pointers to sqlite3_value structures specified + in . + + + An array of native pointers to sqlite3_value structures containing + filtering criteria for the selected index. + + + A standard SQLite return code. + - + - The collation sequence is UTF8 + + int (*xNext)(sqlite3_vtab_cursor*); + + + The xNext method advances a virtual table cursor + to the next row of a result set initiated by xFilter. + If the cursor is already pointing at the last row when this + routine is called, then the cursor no longer points to valid + data and a subsequent call to the xEof method must return true (non-zero). + If the cursor is successfully advanced to another row of content, then + subsequent calls to xEof must return false (zero). + + + This method must return SQLITE_OK if successful, or an sqlite + error code if an error occurs. + + + The xNext method is required for every virtual table implementation. + + + The native pointer to the sqlite3_vtab_cursor derived structure. + + + A standard SQLite return code. + - + - The collation sequence is UTF16 little-endian + + int (*xEof)(sqlite3_vtab_cursor*); + + + The xEof method must return false (zero) if the specified cursor + currently points to a valid row of data, or true (non-zero) otherwise. + This method is called by the SQL engine immediately after each + xFilter and xNext invocation. + + + The xEof method is required for every virtual table implementation. + + + The native pointer to the sqlite3_vtab_cursor derived structure. + + + Non-zero if no more rows are available; zero otherwise. + - + - The collation sequence is UTF16 big-endian + + int (*xColumn)(sqlite3_vtab_cursor*, sqlite3_context*, int N); + + + The SQLite core invokes this method in order to find the value for + the N-th column of the current row. N is zero-based so the first column + is numbered 0. + The xColumn method may return its result back to SQLite using one of the + following interface: + + + ]]> + ]]> sqlite3_result_blob() + ]]>]]> sqlite3_result_double() + ]]>]]> sqlite3_result_int() + ]]>]]> sqlite3_result_int64() + ]]>]]> sqlite3_result_null() + ]]>]]> sqlite3_result_text() + ]]>]]> sqlite3_result_text16() + ]]>]]> sqlite3_result_text16le() + ]]>]]> sqlite3_result_text16be() + ]]>]]> sqlite3_result_zeroblob() + ]]>]]> + + + If the xColumn method implementation calls none of the functions above, + then the value of the column defaults to an SQL NULL. + + + To raise an error, the xColumn method should use one of the result_text() + methods to set the error message text, then return an appropriate + error code. The xColumn method must return SQLITE_OK on success. + + + The xColumn method is required for every virtual table implementation. + + + The native pointer to the sqlite3_vtab_cursor derived structure. + + + The native pointer to the sqlite3_context structure to be used + for returning the specified column value to the SQLite core + library. + + + The zero-based index corresponding to the column containing the + value to be returned. + + + A standard SQLite return code. + - + - A struct describing the collating sequence a function is executing in + + int (*xRowid)(sqlite3_vtab_cursor *pCur, sqlite_int64 *pRowid); + + + A successful invocation of this method will cause *pRowid to be + filled with the rowid of row that the + virtual table cursor pCur is currently pointing at. + This method returns SQLITE_OK on success. + It returns an appropriate error code on failure. + + + The xRowid method is required for every virtual table implementation. + + + The native pointer to the sqlite3_vtab_cursor derived structure. + + + Upon success, this parameter must be modified to contain the unique + integer row identifier for the current row for the specified cursor. + + + A standard SQLite return code. + - + - The name of the collating sequence + + int (*xUpdate)( + sqlite3_vtab *pVTab, + int argc, + sqlite3_value **argv, + sqlite_int64 *pRowid + ); + + + All changes to a virtual table are made using the xUpdate method. + This one method can be used to insert, delete, or update. + + + The argc parameter specifies the number of entries in the argv array. + The value of argc will be 1 for a pure delete operation or N+2 for an insert + or replace or update where N is the number of columns in the table. + In the previous sentence, N includes any hidden columns. + + + Every argv entry will have a non-NULL value in C but may contain the + SQL value NULL. In other words, it is always true that + ]]>argv[i]!=0]]> for ]]>i]]> between 0 and ]]>argc-1]]>. + However, it might be the case that + ]]>sqlite3_value_type(argv[i])==SQLITE_NULL]]>. + + + The argv[0] parameter is the rowid of a row in the virtual table + to be deleted. If argv[0] is an SQL NULL, then no deletion occurs. + + + The argv[1] parameter is the rowid of a new row to be inserted + into the virtual table. If argv[1] is an SQL NULL, then the implementation + must choose a rowid for the newly inserted row. Subsequent argv[] + entries contain values of the columns of the virtual table, in the + order that the columns were declared. The number of columns will + match the table declaration that the xConnect or xCreate method made + using the sqlite3_declare_vtab() call. All hidden columns are included. + + + When doing an insert without a rowid (argc>1, argv[1] is an SQL NULL), + on a virtual table that uses ROWID (but not on a WITHOUT ROWID virtual table), + the implementation must set *pRowid to the rowid of the newly inserted row; + this will become the value returned by the sqlite3_last_insert_rowid() + function. Setting this value in all the other cases is a harmless no-op; + the SQLite engine ignores the *pRowid return value if argc==1 or + argv[1] is not an SQL NULL. + + + Each call to xUpdate will fall into one of cases shown below. + Not that references to ]]>argv[i]]]> mean the SQL value + held within the argv[i] object, not the argv[i] + object itself. + + + ]]> + ]]>]]>argc = 1 ]]> argv[0] ≠ NULL]]> + ]]>]]> + DELETE: The single row with rowid or PRIMARY KEY equal to argv[0] is deleted. + No insert occurs. + ]]>]]>]]>argc > 1 ]]> argv[0] = NULL]]> + ]]>]]> + INSERT: A new row is inserted with column values taken from + argv[2] and following. In a rowid virtual table, if argv[1] is an SQL NULL, + then a new unique rowid is generated automatically. The argv[1] will be NULL + for a WITHOUT ROWID virtual table, in which case the implementation should + take the PRIMARY KEY value from the appropriate column in argv[2] and following. + ]]>]]>]]>argc > 1 ]]> argv[0] ≠ NULL ]]> argv[0] = argv[1]]]> + ]]>]]> + UPDATE: + The row with rowid or PRIMARY KEY argv[0] is updated with new values + in argv[2] and following parameters. + ]]>]]>]]>argc > 1 ]]> argv[0] ≠ NULL ]]> argv[0] ≠ argv[1]]]> + ]]>]]> + UPDATE with rowid or PRIMARY KEY change: + The row with rowid or PRIMARY KEY argv[0] is updated with + the rowid or PRIMARY KEY in argv[1] + and new values in argv[2] and following parameters. This will occur + when an SQL statement updates a rowid, as in the statement: + + UPDATE table SET rowid=rowid+1 WHERE ...; + + ]]>]]> + + + The xUpdate method must return SQLITE_OK if and only if it is + successful. If a failure occurs, the xUpdate must return an appropriate + error code. On a failure, the pVTab->zErrMsg element may optionally + be replaced with error message text stored in memory allocated from SQLite + using functions such as sqlite3_mprintf() or sqlite3_malloc(). + + + If the xUpdate method violates some constraint of the virtual table + (including, but not limited to, attempting to store a value of the wrong + datatype, attempting to store a value that is too + large or too small, or attempting to change a read-only value) then the + xUpdate must fail with an appropriate error code. + + + If the xUpdate method is performing an UPDATE, then + sqlite3_value_nochange(X) can be used to discover which columns + of the virtual table were actually modified by the UPDATE + statement. The sqlite3_value_nochange(X) interface returns + true for columns that do not change. + On every UPDATE, SQLite will first invoke + xColumn separately for each unchanging column in the table to + obtain the value for that column. The xColumn method can + check to see if the column is unchanged at the SQL level + by invoking sqlite3_vtab_nochange(). If xColumn sees that + the column is not being modified, it should return without setting + a result using one of the sqlite3_result_xxxxx() + interfaces. Only in that case sqlite3_value_nochange() will be + true within the xUpdate method. If xColumn does + invoke one or more sqlite3_result_xxxxx() + interfaces, then SQLite understands that as a change in the value + of the column and the sqlite3_value_nochange() call for that + column within xUpdate will return false. + + + There might be one or more sqlite3_vtab_cursor objects open and in use + on the virtual table instance and perhaps even on the row of the virtual + table when the xUpdate method is invoked. The implementation of + xUpdate must be prepared for attempts to delete or modify rows of the table + out from other existing cursors. If the virtual table cannot accommodate + such changes, the xUpdate method must return an error code. + + + The xUpdate method is optional. + If the xUpdate pointer in the sqlite3_module for a virtual table + is a NULL pointer, then the virtual table is read-only. + + + The native pointer to the sqlite3_vtab derived structure. + + + The number of new or modified column values contained in + . + + + The array of native pointers to sqlite3_value structures containing + the new or modified column values, if any. + + + Upon success, this parameter must be modified to contain the unique + integer row identifier for the row that was inserted, if any. + + + A standard SQLite return code. + - + - The type of collating sequence + + int (*xBegin)(sqlite3_vtab *pVTab); + + + This method begins a transaction on a virtual table. + This is method is optional. The xBegin pointer of sqlite3_module + may be NULL. + + + This method is always followed by one call to either the + xCommit or xRollback method. Virtual table transactions do + not nest, so the xBegin method will not be invoked more than once + on a single virtual table + without an intervening call to either xCommit or xRollback. + Multiple calls to other methods can and likely will occur in between + the xBegin and the corresponding xCommit or xRollback. + + + The native pointer to the sqlite3_vtab derived structure. + + + A standard SQLite return code. + - + - The text encoding of the collation sequence + + int (*xSync)(sqlite3_vtab *pVTab); + + + This method signals the start of a two-phase commit on a virtual + table. + This is method is optional. The xSync pointer of sqlite3_module + may be NULL. + + + This method is only invoked after call to the xBegin method and + prior to an xCommit or xRollback. In order to implement two-phase + commit, the xSync method on all virtual tables is invoked prior to + invoking the xCommit method on any virtual table. If any of the + xSync methods fail, the entire transaction is rolled back. + + + The native pointer to the sqlite3_vtab derived structure. + + + A standard SQLite return code. + - + - Context of the function that requested the collating sequence + + int (*xCommit)(sqlite3_vtab *pVTab); + + + This method causes a virtual table transaction to commit. + This is method is optional. The xCommit pointer of sqlite3_module + may be NULL. + + + A call to this method always follows a prior call to xBegin and + xSync. + + + The native pointer to the sqlite3_vtab derived structure. + + + A standard SQLite return code. + - + - Calls the base collating sequence to compare two strings + + int (*xRollback)(sqlite3_vtab *pVTab); + + + This method causes a virtual table transaction to rollback. + This is method is optional. The xRollback pointer of sqlite3_module + may be NULL. + + + A call to this method always follows a prior call to xBegin. + - The first string to compare - The second string to compare - -1 if s1 is less than s2, 0 if s1 is equal to s2, and 1 if s1 is greater than s2 + + The native pointer to the sqlite3_vtab derived structure. + + + A standard SQLite return code. + - + - Calls the base collating sequence to compare two character arrays + + int (*xFindFunction)( + sqlite3_vtab *pVtab, + int nArg, + const char *zName, + void (**pxFunc)(sqlite3_context*,int,sqlite3_value**), + void **ppArg + ); + + + This method is called during sqlite3_prepare() to give the virtual + table implementation an opportunity to overload functions. + This method may be set to NULL in which case no overloading occurs. + + + When a function uses a column from a virtual table as its first + argument, this method is called to see if the virtual table would + like to overload the function. The first three parameters are inputs: + the virtual table, the number of arguments to the function, and the + name of the function. If no overloading is desired, this method + returns 0. To overload the function, this method writes the new + function implementation into *pxFunc and writes user data into *ppArg + and returns either 1 or a number between + SQLITE_INDEX_CONSTRAINT_FUNCTION and 255. + + + Historically, the return value from xFindFunction() was either zero + or one. Zero means that the function is not overloaded and one means that + it is overload. The ability to return values of + SQLITE_INDEX_CONSTRAINT_FUNCTION or greater was added in + version 3.25.0 (2018-09-15). If xFindFunction returns + SQLITE_INDEX_CONSTRAINT_FUNCTION or greater, than means that the function + takes two arguments and the function + can be used as a boolean in the WHERE clause of a query and that + the virtual table is able to exploit that function to speed up the query + result. When xFindFunction returns SQLITE_INDEX_CONSTRAINT_FUNCTION or + larger, the value returned becomes the sqlite3_index_info.aConstraint.op + value for one of the constraints passed into xBestIndex() and the second + argument becomes the value corresponding to that constraint that is passed + to xFilter(). This enables the + xBestIndex()/xFilter implementations to use the function to speed + its search. + + + The technique of having xFindFunction() return values of + SQLITE_INDEX_CONSTRAINT_FUNCTION was initially used in the implementation + of the Geopoly module. The xFindFunction() method of that module returns + SQLITE_INDEX_CONSTRAINT_FUNCTION for the geopoly_overlap() SQL function + and it returns + SQLITE_INDEX_CONSTRAINT_FUNCTION+1 for the geopoly_within() SQL function. + This permits search optimizations for queries such as: + + + SELECT * FROM geopolytab WHERE geopoly_overlap(_shape, $query_polygon); + + + Note that infix functions (LIKE, GLOB, REGEXP, and MATCH) reverse + the order of their arguments. So "like(A,B)" is equivalent to "B like A". + For the form "B like A" the B term is considered the first argument + to the function. But for "like(A,B)" the A term is considered the + first argument. + + + The function pointer returned by this routine must be valid for + the lifetime of the sqlite3_vtab object given in the first parameter. + - The first array to compare - The second array to compare - -1 if c1 is less than c2, 0 if c1 is equal to c2, and 1 if c1 is greater than c2 + + The native pointer to the sqlite3_vtab derived structure. + + + The number of arguments to the function being sought. + + + The name of the function being sought. + + + Upon success, this parameter must be modified to contain the + delegate responsible for implementing the specified function. + + + Upon success, this parameter must be modified to contain the + native user-data pointer associated with + . + + + Non-zero if the specified function was found; zero otherwise. + - + - A simple custom attribute to enable us to easily find user-defined functions in - the loaded assemblies and initialize them in SQLite as connections are made. + + int (*xRename)(sqlite3_vtab *pVtab, const char *zNew); + + + This method provides notification that the virtual table implementation + that the virtual table will be given a new name. + If this method returns SQLITE_OK then SQLite renames the table. + If this method returns an error code then the renaming is prevented. + + + The xRename method is optional. If omitted, then the virtual + table may not be renamed using the ALTER TABLE RENAME command. + + + The PRAGMA legacy_alter_table setting is enabled prior to invoking this + method, and the value for legacy_alter_table is restored after this + method finishes. This is necessary for the correct operation of virtual + tables that make use of shadow tables where the shadow tables must be + renamed to match the new virtual table name. If the legacy_alter_format is + off, then the xConnect method will be invoked for the virtual table every + time the xRename method tries to change the name of the shadow table. + + + The native pointer to the sqlite3_vtab derived structure. + + + The native pointer to the UTF-8 encoded string containing the new + name for the virtual table. + + + A standard SQLite return code. + - + - Default constructor, initializes the internal variables for the function. + + int (*xSavepoint)(sqlite3_vtab *pVtab, int); + int (*xRelease)(sqlite3_vtab *pVtab, int); + int (*xRollbackTo)(sqlite3_vtab *pVtab, int); + + + These methods provide the virtual table implementation an opportunity to + implement nested transactions. They are always optional and will only be + called in SQLite version 3.7.7 (2011-06-23) and later. + + + When xSavepoint(X,N) is invoked, that is a signal to the virtual table X + that it should save its current state as savepoint N. + A subsequent call + to xRollbackTo(X,R) means that the state of the virtual table should return + to what it was when xSavepoint(X,R) was last called. + The call + to xRollbackTo(X,R) will invalidate all savepoints with N>R; none of the + invalided savepoints will be rolled back or released without first + being reinitialized by a call to xSavepoint(). + A call to xRelease(X,M) invalidates all savepoints where N>=M. + + + None of the xSavepoint(), xRelease(), or xRollbackTo() methods will ever + be called except in between calls to xBegin() and + either xCommit() or xRollback(). + + + The native pointer to the sqlite3_vtab derived structure. + + + This is an integer identifier under which the the current state of + the virtual table should be saved. + + + A standard SQLite return code. + - + - Constructs an instance of this class. + + int (*xSavepoint)(sqlite3_vtab *pVtab, int); + int (*xRelease)(sqlite3_vtab *pVtab, int); + int (*xRollbackTo)(sqlite3_vtab *pVtab, int); + + + These methods provide the virtual table implementation an opportunity to + implement nested transactions. They are always optional and will only be + called in SQLite version 3.7.7 (2011-06-23) and later. + + + When xSavepoint(X,N) is invoked, that is a signal to the virtual table X + that it should save its current state as savepoint N. + A subsequent call + to xRollbackTo(X,R) means that the state of the virtual table should return + to what it was when xSavepoint(X,R) was last called. + The call + to xRollbackTo(X,R) will invalidate all savepoints with N>R; none of the + invalided savepoints will be rolled back or released without first + being reinitialized by a call to xSavepoint(). + A call to xRelease(X,M) invalidates all savepoints where N>=M. + + + None of the xSavepoint(), xRelease(), or xRollbackTo() methods will ever + be called except in between calls to xBegin() and + either xCommit() or xRollback(). + - - The name of the function, as seen by the SQLite core library. - - - The number of arguments that the function will accept. + + The native pointer to the sqlite3_vtab derived structure. - - The type of function being declared. This will either be Scalar, - Aggregate, or Collation. + + This is an integer used to indicate that any saved states with an + identifier greater than or equal to this should be deleted by the + virtual table. + + A standard SQLite return code. + - + - The function's name as it will be used in SQLite command text. + + int (*xSavepoint)(sqlite3_vtab *pVtab, int); + int (*xRelease)(sqlite3_vtab *pVtab, int); + int (*xRollbackTo)(sqlite3_vtab *pVtab, int); + + + These methods provide the virtual table implementation an opportunity to + implement nested transactions. They are always optional and will only be + called in SQLite version 3.7.7 (2011-06-23) and later. + + + When xSavepoint(X,N) is invoked, that is a signal to the virtual table X + that it should save its current state as savepoint N. + A subsequent call + to xRollbackTo(X,R) means that the state of the virtual table should return + to what it was when xSavepoint(X,R) was last called. + The call + to xRollbackTo(X,R) will invalidate all savepoints with N>R; none of the + invalided savepoints will be rolled back or released without first + being reinitialized by a call to xSavepoint(). + A call to xRelease(X,M) invalidates all savepoints where N>=M. + + + None of the xSavepoint(), xRelease(), or xRollbackTo() methods will ever + be called except in between calls to xBegin() and + either xCommit() or xRollback(). + + + The native pointer to the sqlite3_vtab derived structure. + + + This is an integer identifier used to specify a specific saved + state for the virtual table for it to restore itself back to, which + should also have the effect of deleting all saved states with an + integer identifier greater than this one. + + + A standard SQLite return code. + - + - The number of arguments this function expects. -1 if the number of arguments is variable. + This class represents a context from the SQLite core library that can + be passed to the sqlite3_result_*() and associated functions. - + - The type of function this implementation will be. + The native context handle. - + - The object instance that describes the class - containing the implementation for the associated function. + Constructs an instance of this class using the specified native + context handle. + + The native context handle to use. + - + - This class provides key info for a given SQLite statement. - - Providing key information for a given statement is non-trivial :( - + Returns the underlying SQLite native handle associated with this + object instance. - + - This function does all the nasty work at determining what keys need to be returned for - a given statement. + Sets the context result to NULL. - - - - + - Make sure all the subqueries are open and ready and sync'd with the current rowid - of the table they're supporting + Sets the context result to the specified + value. + + The value to use. + - + - Release any readers on any subqueries + Sets the context result to the specified + value. + + The value to use. + - + - Append all the columns we've added to the original query to the schema + Sets the context result to the specified + value. - + + The value to use. + - + - How many additional columns of keyinfo we're holding + Sets the context result to the specified + value. + + The value to use. This value will be + converted to the UTF-8 encoding prior to being used. + - + - Used to support CommandBehavior.KeyInfo + Sets the context result to the specified + value containing an error message. + + The value containing the error message text. + This value will be converted to the UTF-8 encoding prior to being + used. + - + - A single sub-query for a given table/database. + Sets the context result to the specified + value. + + The value to use. + - + - Event data for logging event handlers. + Sets the context result to contain the error code SQLITE_TOOBIG. - + - The error code. The type of this object value should be - or . + Sets the context result to contain the error code SQLITE_NOMEM. - + - SQL statement text as the statement first begins executing + Sets the context result to the specified array + value. + + The array value to use. + - + - Extra data associated with this event, if any. + Sets the context result to a BLOB of zeros of the specified size. + + The number of zero bytes to use for the BLOB context result. + - + - Constructs the object. + Sets the context result to the specified . - Should be null. - - The error code. The type of this object value should be - or . + + The to use. - The error message, if any. - The extra data, if any. - + + + This class represents a value from the SQLite core library that can be + passed to the sqlite3_value_*() and associated functions. + + + - Raised when a log event occurs. + The native value handle. - The current connection - Event arguments of the trace - + - Manages the SQLite custom logging functionality and the associated - callback for the whole process. + Constructs an instance of this class using the specified native + value handle. + + The native value handle to use. + - + - Object used to synchronize access to the static instance data - for this class. + Invalidates the native value handle, thereby preventing further + access to it from this object instance. - + - Member variable to store the AppDomain.DomainUnload event handler. + Converts a native pointer to a native sqlite3_value structure into + a managed object instance. + + The native pointer to a native sqlite3_value structure to convert. + + + The managed object instance or null upon + failure. + - + - The default log event handler. + Converts a logical array of native pointers to native sqlite3_value + structures into a managed array of + object instances. + + The number of elements in the logical array of native sqlite3_value + structures. + + + The native pointer to the logical array of native sqlite3_value + structures to convert. + + + The managed array of object instances or + null upon failure. + - + - The log callback passed to native SQLite engine. This must live - as long as the SQLite library has a pointer to it. + Returns the underlying SQLite native handle associated with this + object instance. - + - The base SQLite object to interop with. + Returns non-zero if the native SQLite value has been successfully + persisted as a managed value within this object instance (i.e. the + property may then be read successfully). - + - This will be non-zero if logging is currently enabled. + If the managed value for this object instance is available (i.e. it + has been previously persisted via the ) method, + that value is returned; otherwise, an exception is thrown. The + returned value may be null. - + - Initializes the SQLite logging facilities. + Gets and returns the type affinity associated with this value. + + The type affinity associated with this value. + - + - Handles the AppDomain being unloaded. + Gets and returns the number of bytes associated with this value, if + it refers to a UTF-8 encoded string. - Should be null. - The data associated with this event. + + The number of bytes associated with this value. The returned value + may be zero. + - + - Log a message to all the registered log event handlers without going - through the SQLite library. + Gets and returns the associated with this + value. - The message to be logged. + + The associated with this value. + - + - Log a message to all the registered log event handlers without going - through the SQLite library. + Gets and returns the associated with + this value. - The SQLite error code. - The message to be logged. + + The associated with this value. + - + - Log a message to all the registered log event handlers without going - through the SQLite library. + Gets and returns the associated with this + value. - The integer error code. - The message to be logged. + + The associated with this value. + - + - Log a message to all the registered log event handlers without going - through the SQLite library. + Gets and returns the associated with this + value. - - The error code. The type of this object value should be - System.Int32 or SQLiteErrorCode. - - The message to be logged. + + The associated with this value. The value is + converted from the UTF-8 encoding prior to being returned. + - + - Creates and initializes the default log event handler. + Gets and returns the array associated with this + value. + + The array associated with this value. + - + - Adds the default log event handler to the list of handlers. + Gets and returns an instance associated with + this value. + + The associated with this value. If the type + affinity of the object is unknown or cannot be determined, a null + value will be returned. + - + - Removes the default log event handler from the list of handlers. + Uses the native value handle to obtain and store the managed value + for this object instance, thus saving it for later use. The type + of the managed value is determined by the type affinity of the + native value. If the type affinity is not recognized by this + method, no work is done and false is returned. + + Non-zero if the native value was persisted successfully. + - - - Internal proxy function that calls any registered application log - event handlers. - - WARNING: This method is used more-or-less directly by native code, - do not modify its type signature. - - - The extra data associated with this message, if any. - - - The error code associated with this message. - - - The message string to be logged. - + + + These are the allowed values for the operators that are part of a + constraint term in the WHERE clause of a query that uses a virtual + table. + - + - Default logger. Currently, uses the Trace class (i.e. sends events - to the current trace listeners, if any). + This value represents the equality operator. - Should be null. - The data associated with this event. - + - Member variable to store the application log handler to call. + This value represents the greater than operator. - + - This event is raised whenever SQLite raises a logging event. - Note that this should be set as one of the first things in the - application. + This value represents the less than or equal to operator. - + - If this property is true, logging is enabled; otherwise, logging is - disabled. When logging is disabled, no logging events will fire. + This value represents the less than operator. - + - MetaDataCollections specific to SQLite + This value represents the greater than or equal to operator. - + - Returns a list of databases attached to the connection + This value represents the MATCH operator. - + - Returns column information for the specified table + This value represents the LIKE operator. - + - Returns index information for the optionally-specified table + This value represents the GLOB operator. - + - Returns base columns for the given index + This value represents the REGEXP operator. - + - Returns the tables in the given catalog + This value represents the inequality operator. - + - Returns user-defined views in the given catalog + This value represents the IS NOT operator. - + - Returns underlying column information on the given view + This value represents the IS NOT NULL operator. - + - Returns foreign key information for the given catalog + This value represents the IS NULL operator. - + - Returns the triggers on the database + This value represents the IS operator. - + - SQLite implementation of DbParameter. + These are the allowed values for the index flags from the + method. - + - The data type of the parameter + No special handling. This is the default. - + - The version information for mapping the parameter + This value indicates that the scan of the index will visit at + most one row. - + - The value of the data in the parameter + This class represents the native sqlite3_index_constraint structure + from the SQLite core library. - + - The source column for the parameter + Constructs an instance of this class using the specified native + sqlite3_index_constraint structure. + + The native sqlite3_index_constraint structure to use. + - + - The column name + Constructs an instance of this class using the specified field + values. + + Column on left-hand side of constraint. + + + Constraint operator (). + + + True if this constraint is usable. + + + Used internally - + should ignore. + - + - The data size, unused by SQLite + Column on left-hand side of constraint. - + - Default constructor + Constraint operator (). - + - Constructs a named parameter given the specified parameter name + True if this constraint is usable. - The parameter name - + - Constructs a named parameter given the specified parameter name and initial value + Used internally - + should ignore. - The parameter name - The initial value of the parameter - + - Constructs a named parameter of the specified type + This class represents the native sqlite3_index_orderby structure from + the SQLite core library. - The parameter name - The datatype of the parameter - + - Constructs a named parameter of the specified type and source column reference + Constructs an instance of this class using the specified native + sqlite3_index_orderby structure. - The parameter name - The data type - The source column + + The native sqlite3_index_orderby structure to use. + - + - Constructs a named parameter of the specified type, source column and row version + Constructs an instance of this class using the specified field + values. - The parameter name - The data type - The source column - The row version information + + Column number. + + + True for DESC. False for ASC. + - + - Constructs an unnamed parameter of the specified data type + Column number. - The datatype of the parameter - + - Constructs an unnamed parameter of the specified data type and sets the initial value + True for DESC. False for ASC. - The datatype of the parameter - The initial value of the parameter - + - Constructs an unnamed parameter of the specified data type and source column + This class represents the native sqlite3_index_constraint_usage + structure from the SQLite core library. - The datatype of the parameter - The source column - + - Constructs an unnamed parameter of the specified data type, source column and row version + Constructs a default instance of this class. - The data type - The source column - The row version information - + - Constructs a named parameter of the specified type and size + Constructs an instance of this class using the specified native + sqlite3_index_constraint_usage structure. - The parameter name - The data type - The size of the parameter + + The native sqlite3_index_constraint_usage structure to use. + - + - Constructs a named parameter of the specified type, size and source column + Constructs an instance of this class using the specified field + values. - The name of the parameter - The data type - The size of the parameter - The source column + + If greater than 0, constraint is part of argv to xFilter. + + + Do not code a test for this constraint. + - + - Constructs a named parameter of the specified type, size, source column and row version + If greater than 0, constraint is part of argv to xFilter. - The name of the parameter - The data type - The size of the parameter - The source column - The row version information - + - Constructs a named parameter of the specified type, size, source column and row version + Do not code a test for this constraint. - The name of the parameter - The data type - The size of the parameter - Only input parameters are supported in SQLite - Ignored - Ignored - Ignored - The source column - The row version information - The initial value to assign the parameter - + - Constructs a named parameter, yet another flavor + This class represents the various inputs provided by the SQLite core + library to the method. - The name of the parameter - The data type - The size of the parameter - Only input parameters are supported in SQLite - Ignored - Ignored - The source column - The row version information - Whether or not this parameter is for comparing NULL's - The intial value to assign the parameter - + - Constructs an unnamed parameter of the specified type and size + Constructs an instance of this class. - The data type - The size of the parameter + + The number of instances to + pre-allocate space for. + + + The number of instances to + pre-allocate space for. + - + - Constructs an unnamed parameter of the specified type, size, and source column + An array of object instances, + each containing information supplied by the SQLite core library. - The data type - The size of the parameter - The source column - + - Constructs an unnamed parameter of the specified type, size, source column and row version + An array of object instances, + each containing information supplied by the SQLite core library. - The data type - The size of the parameter - The source column - The row version information - + - Resets the DbType of the parameter so it can be inferred from the value + This class represents the various outputs provided to the SQLite core + library by the method. - + - Clones a parameter + Constructs an instance of this class. - A new, unassociated SQLiteParameter + + The number of instances + to pre-allocate space for. + - + - Whether or not the parameter can contain a null value + Determines if the native estimatedRows field can be used, based on + the available version of the SQLite core library. + + Non-zero if the property is supported + by the SQLite core library. + - + - Returns the datatype of the parameter + Determines if the native flags field can be used, based on the + available version of the SQLite core library. + + Non-zero if the property is supported by + the SQLite core library. + - + - Supports only input parameters + Determines if the native flags field can be used, based on the + available version of the SQLite core library. + + Non-zero if the property is supported by + the SQLite core library. + - + - Returns the parameter name + An array of object + instances, each containing information to be supplied to the SQLite + core library. - + - Returns the size of the parameter + Number used to help identify the selected index. This value will + later be provided to the + method. - + - Gets/sets the source column + String used to help identify the selected index. This value will + later be provided to the + method. - + - Used by DbCommandBuilder to determine the mapping for nullable fields + Non-zero if the index string must be freed by the SQLite core + library. - + - Gets and sets the row version + True if output is already ordered. - + - Gets and sets the parameter value. If no datatype was specified, the datatype will assume the type from the value given. + Estimated cost of using this index. Using a null value here + indicates that a default estimated cost value should be used. - + - SQLite implementation of DbParameterCollection. + Estimated number of rows returned. Using a null value here + indicates that a default estimated rows value should be used. + This property has no effect if the SQLite core library is not at + least version 3.8.2. - + - The underlying command to which this collection belongs + The flags that should be used with this index. Using a null value + here indicates that a default flags value should be used. This + property has no effect if the SQLite core library is not at least + version 3.9.0. - + - The internal array of parameters in this collection + + Indicates which columns of the virtual table may be required by the + current scan. Virtual table columns are numbered from zero in the + order in which they appear within the CREATE TABLE statement passed + to sqlite3_declare_vtab(). For the first 63 columns (columns 0-62), + the corresponding bit is set within the bit mask if the column may + be required by SQLite. If the table has at least 64 columns and + any column to the right of the first 63 is required, then bit 63 of + colUsed is also set. In other words, column iCol may be required + if the expression + + + (colUsed & ((sqlite3_uint64)1 << (iCol>=63 ? 63 : iCol))) + + + evaluates to non-zero. Using a null value here indicates that a + default flags value should be used. This property has no effect if + the SQLite core library is not at least version 3.10.0. + - + - Determines whether or not all parameters have been bound to their statement(s) + This class represents the various inputs and outputs used with the + method. - + - Initializes the collection + Constructs an instance of this class. - The command to which the collection belongs + + The number of (and + ) instances to + pre-allocate space for. + + + The number of instances to + pre-allocate space for. + - + - Retrieves an enumerator for the collection + Attempts to determine the structure sizes needed to create and + populate a native + + structure. - An enumerator for the underlying array + + The size of the native + + structure is stored here. + + + The size of the native + + structure is stored here. + + + The size of the native + + structure is stored here. + + + The size of the native + + structure is stored here. + - + - Adds a parameter to the collection + Attempts to allocate and initialize a native + + structure. - The parameter name - The data type - The size of the value - The source column - A SQLiteParameter object + + The number of instances to + pre-allocate space for. + + + The number of instances to + pre-allocate space for. + + + The newly allocated native + structure + -OR- if it could not be fully allocated. + - + - Adds a parameter to the collection + Frees all the memory associated with a native + + structure. - The parameter name - The data type - The size of the value - A SQLiteParameter object + + The native pointer to the native sqlite3_index_info structure to + free. + - + - Adds a parameter to the collection + Converts a native pointer to a native sqlite3_index_info structure + into a new object instance. - The parameter name - The data type - A SQLiteParameter object + + The native pointer to the native sqlite3_index_info structure to + convert. + + + Non-zero to include fields from the outputs portion of the native + structure; otherwise, the "output" fields will not be read. + + + Upon success, this parameter will be modified to contain the newly + created object instance. + - + - Adds a parameter to the collection + Populates the outputs of a pre-allocated native sqlite3_index_info + structure using an existing object + instance. - The parameter to add - A zero-based index of where the parameter is located in the array + + The existing object instance containing + the output data to use. + + + The native pointer to the pre-allocated native sqlite3_index_info + structure. + + + Non-zero to include fields from the inputs portion of the native + structure; otherwise, the "input" fields will not be written. + - + - Adds a parameter to the collection + The object instance containing + the inputs to the + method. - The parameter to add - A zero-based index of where the parameter is located in the array - + - Adds a named/unnamed parameter and its value to the parameter collection. + The object instance containing + the outputs from the + method. - Name of the parameter, or null to indicate an unnamed parameter - The initial value of the parameter - Returns the SQLiteParameter object created during the call. - + - Adds an array of parameters to the collection + This class represents a managed virtual table implementation. It is + not sealed and should be used as the base class for any user-defined + virtual table classes implemented in managed code. - The array of parameters to add - + - Adds an array of parameters to the collection + The index within the array of strings provided to the + and + methods containing the + name of the module implementing this virtual table. - The array of parameters to add - + - Clears the array and resets the collection + The index within the array of strings provided to the + and + methods containing the + name of the database containing this virtual table. - + - Determines if the named parameter exists in the collection + The index within the array of strings provided to the + and + methods containing the + name of the virtual table. - The name of the parameter to check - True if the parameter is in the collection - + - Determines if the parameter exists in the collection + Constructs an instance of this class. - The SQLiteParameter to check - True if the parameter is in the collection + + The original array of strings provided to the + and + methods. + - + - Not implemented + The original array of strings provided to the + and + methods. - - - + - Retrieve a parameter by name from the collection + The name of the module implementing this virtual table. - The name of the parameter to fetch - A DbParameter object - + - Retrieves a parameter by its index in the collection + The name of the database containing this virtual table. - The index of the parameter to retrieve - A DbParameter object - + - Returns the index of a parameter given its name + The name of the virtual table. - The name of the parameter to find - -1 if not found, otherwise a zero-based index of the parameter - + - Returns the index of a parameter + The object instance containing all the + data for the inputs and outputs relating to the most recent index + selection. - The parameter to find - -1 if not found, otherwise a zero-based index of the parameter - + - Inserts a parameter into the array at the specified location + This method should normally be used by the + method in order to + perform index selection based on the constraints provided by the + SQLite core library. - The zero-based index to insert the parameter at - The parameter to insert + + The object instance containing all the + data for the inputs and outputs relating to index selection. + + + Non-zero upon success. + - + - Removes a parameter from the collection + Attempts to record the renaming of the virtual table associated + with this object instance. - The parameter to remove + + The new name for the virtual table. + + + Non-zero upon success. + - + - Removes a parameter from the collection given its name + Returns the underlying SQLite native handle associated with this + object instance. - The name of the parameter to remove - + - Removes a parameter from the collection given its index + Disposes of this object instance. - The zero-based parameter index to remove - + - Re-assign the named parameter to a new parameter object + Throws an if this object + instance has been disposed. - The name of the parameter to replace - The new parameter - + - Re-assign a parameter at the specified index + Disposes of this object instance. - The zero-based index of the parameter to replace - The new parameter + + Non-zero if this method is being called from the + method. Zero if this method is being called + from the finalizer. + - + - Un-binds all parameters from their statements + Finalizes this object instance. - + - This function attempts to map all parameters in the collection to all statements in a Command. - Since named parameters may span multiple statements, this function makes sure all statements are bound - to the same named parameter. Unnamed parameters are bound in sequence. + This class represents a managed virtual table cursor implementation. + It is not sealed and should be used as the base class for any + user-defined virtual table cursor classes implemented in managed code. - + - Returns false + This value represents an invalid integer row sequence number. - + - Returns false + The field holds the integer row sequence number for the current row + pointed to by this cursor object instance. - + - Returns false + Constructs an instance of this class. + + The object instance associated + with this object instance. + - + - Returns null + Constructs an instance of this class. - + - Returns a count of parameters in the collection + The object instance associated + with this object instance. - + - Overloaded to specialize the return value of the default indexer + Number used to help identify the selected index. This value will + be set via the method. - Name of the parameter to get/set - The specified named SQLite parameter - + - Overloaded to specialize the return value of the default indexer + String used to help identify the selected index. This value will + be set via the method. - The index of the parameter to get/set - The specified SQLite parameter - + - Represents a single SQL statement in SQLite. + The values used to filter the rows returned via this cursor object + instance. This value will be set via the + method. - + - The underlying SQLite object this statement is bound to + Attempts to persist the specified object + instances in order to make them available after the + method returns. + + The array of object instances to be + persisted. + + + The number of object instances that were + successfully persisted. + - + - The command text of this SQL statement + This method should normally be used by the + method in order to + perform filtering of the result rows and/or to record the filtering + criteria provided by the SQLite core library. + + Number used to help identify the selected index. + + + String used to help identify the selected index. + + + The values corresponding to each column in the selected index. + - + - The actual statement pointer + Determines the integer row sequence number for the current row. + + The integer row sequence number for the current row -OR- zero if + it cannot be determined. + - + - An index from which unnamed parameters begin + Adjusts the integer row sequence number so that it refers to the + next row. - + - Names of the parameters as SQLite understands them to be + Returns the underlying SQLite native handle associated with this + object instance. - + - Parameters for this statement + Disposes of this object instance. - + - Command this statement belongs to (if any) + Throws an if this object + instance has been disposed. - + - The flags associated with the parent connection object. + Disposes of this object instance. + + Non-zero if this method is being called from the + method. Zero if this method is being called + from the finalizer. + - + - Initializes the statement and attempts to get all information about parameters in the statement + Finalizes this object instance. - The base SQLite object - The flags associated with the parent connection object - The statement - The command text for this statement - The previous command in a multi-statement command - + - Disposes and finalizes the statement + This interface represents a native handle provided by the SQLite core + library. - + - If the underlying database connection is open, fetches the number of changed rows - resulting from the most recent query; otherwise, does nothing. + The native handle value. - - The number of changes when true is returned. - Undefined if false is returned. - - Non-zero if the number of changed rows was fetched. - + - Called by SQLiteParameterCollection, this function determines if the specified parameter name belongs to - this statement, and if so, keeps a reference to the parameter so it can be bound later. + This interface represents a virtual table implementation written in + managed code. - The parameter name to map - The parameter to assign it - + - Bind all parameters, making sure the caller didn't miss any + Returns non-zero if the schema for the virtual table has been + declared. - + - Perform the bind operation for an individual parameter + Returns the name of the module as it was registered with the SQLite + core library. - The index of the parameter to bind - The parameter we're binding - + - SQLite implementation of DbTransaction. + This method is called in response to the + method. + + The object instance associated with + the virtual table. + + + The native user-data pointer associated with this module, as it was + provided to the SQLite core library when the native module instance + was created. + + + The module name, database name, virtual table name, and all other + arguments passed to the CREATE VIRTUAL TABLE statement. + + + Upon success, this parameter must be modified to contain the + object instance associated with + the virtual table. + + + Upon failure, this parameter must be modified to contain an error + message. + + + A standard SQLite return code. + - + - The connection to which this transaction is bound + This method is called in response to the + method. + + The object instance associated with + the virtual table. + + + The native user-data pointer associated with this module, as it was + provided to the SQLite core library when the native module instance + was created. + + + The module name, database name, virtual table name, and all other + arguments passed to the CREATE VIRTUAL TABLE statement. + + + Upon success, this parameter must be modified to contain the + object instance associated with + the virtual table. + + + Upon failure, this parameter must be modified to contain an error + message. + + + A standard SQLite return code. + - + - Constructs the transaction object, binding it to the supplied connection + This method is called in response to the + method. - The connection to open a transaction on - TRUE to defer the writelock, or FALSE to lock immediately + + The object instance associated + with this virtual table. + + + The object instance containing all the + data for the inputs and outputs relating to index selection. + + + A standard SQLite return code. + - + - Disposes the transaction. If it is currently active, any changes are rolled back. + This method is called in response to the + method. + + The object instance associated + with this virtual table. + + + A standard SQLite return code. + - + - Commits the current transaction. + This method is called in response to the + method. + + The object instance associated + with this virtual table. + + + A standard SQLite return code. + - + - Rolls back the active transaction. + This method is called in response to the + method. + + The object instance associated + with this virtual table. + + + Upon success, this parameter must be modified to contain the + object instance associated + with the newly opened virtual table cursor. + + + A standard SQLite return code. + - + - Returns the underlying connection to which this transaction applies. + This method is called in response to the + method. + + The object instance + associated with the previously opened virtual table cursor to be + used. + + + A standard SQLite return code. + - + - Forwards to the local Connection property + This method is called in response to the + method. + + The object instance + associated with the previously opened virtual table cursor to be + used. + + + Number used to help identify the selected index. + + + String used to help identify the selected index. + + + The values corresponding to each column in the selected index. + + + A standard SQLite return code. + - + - Gets the isolation level of the transaction. SQLite only supports Serializable transactions. + This method is called in response to the + method. + + The object instance + associated with the previously opened virtual table cursor to be + used. + + + A standard SQLite return code. + - + - The file extension used for dynamic link libraries. + This method is called in response to the + method. + + The object instance + associated with the previously opened virtual table cursor to be + used. + + + Non-zero if no more rows are available; zero otherwise. + - + - The file extension used for the XML configuration file. + This method is called in response to the + method. + + The object instance + associated with the previously opened virtual table cursor to be + used. + + + The object instance to be used for + returning the specified column value to the SQLite core library. + + + The zero-based index corresponding to the column containing the + value to be returned. + + + A standard SQLite return code. + - + - This is the name of the XML configuration file specific to the - System.Data.SQLite assembly. + This method is called in response to the + method. + + The object instance + associated with the previously opened virtual table cursor to be + used. + + + Upon success, this parameter must be modified to contain the unique + integer row identifier for the current row for the specified cursor. + + + A standard SQLite return code. + - + - This lock is used to protect the static _SQLiteNativeModuleFileName, - _SQLiteNativeModuleHandle, and processorArchitecturePlatforms fields. + This method is called in response to the + method. + + The object instance associated + with this virtual table. + + + The array of object instances containing + the new or modified column values, if any. + + + Upon success, this parameter must be modified to contain the unique + integer row identifier for the row that was inserted, if any. + + + A standard SQLite return code. + - + - This dictionary stores the mappings between processor architecture - names and platform names. These mappings are now used for two - purposes. First, they are used to determine if the assembly code - base should be used instead of the location, based upon whether one - or more of the named sub-directories exist within the assembly code - base. Second, they are used to assist in loading the appropriate - SQLite interop assembly into the current process. + This method is called in response to the + method. + + The object instance associated + with this virtual table. + + + A standard SQLite return code. + - + - For now, this method simply calls the Initialize method. + This method is called in response to the + method. + + The object instance associated + with this virtual table. + + + A standard SQLite return code. + - + - Attempts to initialize this class by pre-loading the native SQLite - library for the processor architecture of the current process. + This method is called in response to the + method. + + The object instance associated + with this virtual table. + + + A standard SQLite return code. + - + - Queries and returns the XML configuration file name for the assembly - containing the managed System.Data.SQLite components. + This method is called in response to the + method. + + The object instance associated + with this virtual table. + - The XML configuration file name -OR- null if it cannot be determined - or does not exist. + A standard SQLite return code. - + - Queries and returns the value of the specified setting, using the XML - configuration file and/or the environment variables for the current - process and/or the current system, when available. + This method is called in response to the + method. + + The object instance associated + with this virtual table. + + + The number of arguments to the function being sought. + - The name of the setting. + The name of the function being sought. - - The value to be returned if the setting has not been set explicitly - or cannot be determined. + + Upon success, this parameter must be modified to contain the + object instance responsible for + implementing the specified function. + + + Upon success, this parameter must be modified to contain the + native user-data pointer associated with + . - The value of the setting -OR- the default value specified by - if it has not been set explicitly or - cannot be determined. By default, all references to existing - environment variables will be expanded to their corresponding values - within the value to be returned unless either the "No_Expand" or - "No_Expand_" environment variable is set [to - anything]. + Non-zero if the specified function was found; zero otherwise. - + - Queries and returns the directory for the assembly currently being - executed. + This method is called in response to the + method. + + The object instance associated + with this virtual table. + + + The new name for the virtual table. + - The directory for the assembly currently being executed -OR- null if - it cannot be determined. + A standard SQLite return code. - + - The name of the environment variable containing the processor - architecture of the current process. + This method is called in response to the + method. + + The object instance associated + with this virtual table. + + + This is an integer identifier under which the the current state of + the virtual table should be saved. + + + A standard SQLite return code. + - + - This is the P/Invoke method that wraps the native Win32 LoadLibrary - function. See the MSDN documentation for full details on what it - does. + This method is called in response to the + method. - - The name of the executable library. + + The object instance associated + with this virtual table. + + + This is an integer used to indicate that any saved states with an + identifier greater than or equal to this should be deleted by the + virtual table. - The native module handle upon success -OR- IntPtr.Zero on failure. + A standard SQLite return code. - + - The native module file name for the native SQLite library or null. + This method is called in response to the + method. + + The object instance associated + with this virtual table. + + + This is an integer identifier used to specify a specific saved + state for the virtual table for it to restore itself back to, which + should also have the effect of deleting all saved states with an + integer identifier greater than this one. + + + A standard SQLite return code. + - + - The native module handle for the native SQLite library or the value - IntPtr.Zero. + This class contains static methods that are used to allocate, + manipulate, and free native memory provided by the SQLite core library. - + - Searches for the native SQLite library in the directory containing - the assembly currently being executed as well as the base directory - for the current application domain. + Determines if the native sqlite3_msize() API can be used, based on + the available version of the SQLite core library. - - Upon success, this parameter will be modified to refer to the base - directory containing the native SQLite library. - - - Upon success, this parameter will be modified to refer to the name - of the immediate directory (i.e. the offset from the base directory) - containing the native SQLite library. - - Non-zero (success) if the native SQLite library was found; otherwise, - zero (failure). + Non-zero if the native sqlite3_msize() API is supported by the + SQLite core library. - + - Queries and returns the base directory of the current application - domain. + Allocates at least the specified number of bytes of native memory + via the SQLite core library sqlite3_malloc() function and returns + the resulting native pointer. If the TRACK_MEMORY_BYTES option + was enabled at compile-time, adjusts the number of bytes currently + allocated by this class. + + The number of bytes to allocate. + - The base directory for the current application domain -OR- null if it - cannot be determined. + The native pointer that points to a block of memory of at least the + specified size -OR- if the memory could + not be allocated. - + - Determines if the dynamic link library file name requires a suffix - and adds it if necessary. + Allocates at least the specified number of bytes of native memory + via the SQLite core library sqlite3_malloc64() function and returns + the resulting native pointer. If the TRACK_MEMORY_BYTES option + was enabled at compile-time, adjusts the number of bytes currently + allocated by this class. - - The original dynamic link library file name to inspect. + + The number of bytes to allocate. - The dynamic link library file name, possibly modified to include an - extension. + The native pointer that points to a block of memory of at least the + specified size -OR- if the memory could + not be allocated. - + - Queries and returns the processor architecture of the current - process. + Allocates at least the specified number of bytes of native memory + via the SQLite core library sqlite3_malloc() function and returns + the resulting native pointer without adjusting the number of + allocated bytes currently tracked by this class. This is useful + when dealing with blocks of memory that will be freed directly by + the SQLite core library. + + The number of bytes to allocate. + - The processor architecture of the current process -OR- null if it - cannot be determined. + The native pointer that points to a block of memory of at least the + specified size -OR- if the memory could + not be allocated. - + - Given the processor architecture, returns the name of the platform. + Allocates at least the specified number of bytes of native memory + via the SQLite core library sqlite3_malloc64() function and returns + the resulting native pointer without adjusting the number of + allocated bytes currently tracked by this class. This is useful + when dealing with blocks of memory that will be freed directly by + the SQLite core library. - - The processor architecture to be translated to a platform name. + + The number of bytes to allocate. - The platform name for the specified processor architecture -OR- null - if it cannot be determined. + The native pointer that points to a block of memory of at least the + specified size -OR- if the memory could + not be allocated. - - - Attempts to load the native SQLite library based on the specified - directory and processor architecture. - - - The base directory to use, null for default (the base directory of - the current application domain). This directory should contain the - processor architecture specific sub-directories. - - - The requested processor architecture, null for default (the - processor architecture of the current process). This caller should - almost always specify null for this parameter. - - - The candidate native module file name to load will be stored here, - if necessary. - - - The native module handle as returned by LoadLibrary will be stored - here, if necessary. This value will be IntPtr.Zero if the call to - LoadLibrary fails. + + + Gets and returns the actual size of the specified memory block + that was previously obtained from the , + , , or + methods or directly from the + SQLite core library. + + + The native pointer to the memory block previously obtained from + the , , + , or + methods or directly from the + SQLite core library. - Non-zero if the native module was loaded successfully; otherwise, - zero. + The actual size, in bytes, of the memory block specified via the + native pointer. - + - A strongly-typed resource class, for looking up localized strings, etc. + Gets and returns the actual size of the specified memory block + that was previously obtained from the , + , , or + methods or directly from the + SQLite core library. + + The native pointer to the memory block previously obtained from + the , , + , or + methods or directly from the + SQLite core library. + + + The actual size, in bytes, of the memory block specified via the + native pointer. + - + - Returns the cached ResourceManager instance used by this class. + Frees a memory block previously obtained from the + or methods. If + the TRACK_MEMORY_BYTES option was enabled at compile-time, adjusts + the number of bytes currently allocated by this class. + + The native pointer to the memory block previously obtained from the + or methods. + - + - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. + Frees a memory block previously obtained from the SQLite core + library without adjusting the number of allocated bytes currently + tracked by this class. This is useful when dealing with blocks of + memory that were not allocated using this class. + + The native pointer to the memory block previously obtained from the + SQLite core library. + - - - Looks up a localized string similar to <?xml version="1.0" standalone="yes"?> - <DocumentElement> - <DataTypes> - <TypeName>smallint</TypeName> - <ProviderDbType>10</ProviderDbType> - <ColumnSize>5</ColumnSize> - <DataType>System.Int16</DataType> - <CreateFormat>smallint</CreateFormat> - <IsAutoIncrementable>false</IsAutoIncrementable> - <IsCaseSensitive>false</IsCaseSensitive> - <IsFixedLength>true</IsFixedLength> - <IsFixedPrecisionScale>true</IsFixedPrecisionScale> - <IsLong>false</IsLong> - <IsNullable>true</ [rest of string was truncated]";. - - - + - Looks up a localized string similar to ALL,ALTER,AND,AS,AUTOINCREMENT,BETWEEN,BY,CASE,CHECK,COLLATE,COMMIT,CONSTRAINT,CREATE,CROSS,DEFAULT,DEFERRABLE,DELETE,DISTINCT,DROP,ELSE,ESCAPE,EXCEPT,FOREIGN,FROM,FULL,GROUP,HAVING,IN,INDEX,INNER,INSERT,INTERSECT,INTO,IS,ISNULL,JOIN,LEFT,LIMIT,NATURAL,NOT,NOTNULL,NULL,ON,OR,ORDER,OUTER,PRIMARY,REFERENCES,RIGHT,ROLLBACK,SELECT,SET,TABLE,THEN,TO,TRANSACTION,UNION,UNIQUE,UPDATE,USING,VALUES,WHEN,WHERE. + This class contains static methods that are used to deal with native + UTF-8 string pointers to be used with the SQLite core library. - - - Looks up a localized string similar to <?xml version="1.0" encoding="utf-8" ?> - <DocumentElement> - <MetaDataCollections> - <CollectionName>MetaDataCollections</CollectionName> - <NumberOfRestrictions>0</NumberOfRestrictions> - <NumberOfIdentifierParts>0</NumberOfIdentifierParts> - </MetaDataCollections> - <MetaDataCollections> - <CollectionName>DataSourceInformation</CollectionName> - <NumberOfRestrictions>0</NumberOfRestrictions> - <NumberOfIdentifierParts>0</NumberOfIdentifierParts> - </MetaDataCollections> - <MetaDataC [rest of string was truncated]";. - - - + - This class represents a context from the SQLite core library that can - be passed to the sqlite3_result_*() and associated functions. + This is the maximum possible length for the native UTF-8 encoded + strings used with the SQLite core library. - + - This interface represents a native handle provided by the SQLite core - library. + This is the object instance used to handle + conversions from/to UTF-8. - + - The native handle value. + Converts the specified managed string into the UTF-8 encoding and + returns the array of bytes containing its representation in that + encoding. + + The managed string to convert. + + + The array of bytes containing the representation of the managed + string in the UTF-8 encoding or null upon failure. + - + - The native context handle. + Converts the specified array of bytes representing a string in the + UTF-8 encoding and returns a managed string. + + The array of bytes to convert. + + + The managed string or null upon failure. + - + - Constructs an instance of this class using the specified native - context handle. + Probes a native pointer to a string in the UTF-8 encoding for its + terminating NUL character, within the specified length limit. - - The native context handle to use. + + The native NUL-terminated string pointer. + + + The maximum length of the native string, in bytes. + + The length of the native string, in bytes -OR- zero if the length + could not be determined. + - + - Sets the context result to NULL. + Converts the specified native NUL-terminated UTF-8 string pointer + into a managed string. + + The native NUL-terminated UTF-8 string pointer. + + + The managed string or null upon failure. + - + - Sets the context result to the specified - value. + Converts the specified native UTF-8 string pointer of the specified + length into a managed string. - - The value to use. + + The native UTF-8 string pointer. + + + The length of the native string, in bytes. + + The managed string or null upon failure. + - + - Sets the context result to the specified - value. + Converts the specified managed string into a native NUL-terminated + UTF-8 string pointer using memory obtained from the SQLite core + library. - The value to use. + The managed string to convert. + + The native NUL-terminated UTF-8 string pointer or + upon failure. + - + - Sets the context result to the specified - value. + Converts the specified managed string into a native NUL-terminated + UTF-8 string pointer using memory obtained from the SQLite core + library. - The value to use. + The managed string to convert. + + + Non-zero to obtain memory from the SQLite core library without + adjusting the number of allocated bytes currently being tracked + by the class. + + The native NUL-terminated UTF-8 string pointer or + upon failure. + - + - Sets the context result to the specified - value. + Converts the specified managed string into a native NUL-terminated + UTF-8 string pointer using memory obtained from the SQLite core + library. - The value to use. This value will be - converted to the UTF-8 encoding prior to being used. + The managed string to convert. + + + The length of the native string, in bytes. + + The native NUL-terminated UTF-8 string pointer or + upon failure. + - + - Sets the context result to the specified - value containing an error message. + Converts the specified managed string into a native NUL-terminated + UTF-8 string pointer using memory obtained from the SQLite core + library. - The value containing the error message text. - This value will be converted to the UTF-8 encoding prior to being - used. + The managed string to convert. + + Non-zero to obtain memory from the SQLite core library without + adjusting the number of allocated bytes currently being tracked + by the class. + + + The length of the native string, in bytes. + + + The native NUL-terminated UTF-8 string pointer or + upon failure. + - + - Sets the context result to the specified - value. + Converts a logical array of native NUL-terminated UTF-8 string + pointers into an array of managed strings. - - The value to use. + + The number of elements in the logical array of native + NUL-terminated UTF-8 string pointers. + + The native pointer to the logical array of native NUL-terminated + UTF-8 string pointers to convert. + + + The array of managed strings or null upon failure. + - + - Sets the context result to contain the error code SQLITE_TOOBIG. + Converts an array of managed strings into an array of native + NUL-terminated UTF-8 string pointers. + + The array of managed strings to convert. + + + Non-zero to obtain memory from the SQLite core library without + adjusting the number of allocated bytes currently being tracked + by the class. + + + The array of native NUL-terminated UTF-8 string pointers or null + upon failure. + - + - Sets the context result to contain the error code SQLITE_NOMEM. + This class contains static methods that are used to deal with native + pointers to memory blocks that logically contain arrays of bytes to be + used with the SQLite core library. - + - Sets the context result to the specified array - value. + Converts a native pointer to a logical array of bytes of the + specified length into a managed byte array. - - The array value to use. + + The native pointer to the logical array of bytes to convert. + + + The length, in bytes, of the logical array of bytes to convert. + + The managed byte array or null upon failure. + - + - Sets the context result to a BLOB of zeros of the specified size. + Converts a managed byte array into a native pointer to a logical + array of bytes. - The number of zero bytes to use for the BLOB context result. + The managed byte array to convert. + + The native pointer to a logical byte array or null upon failure. + - + - Sets the context result to the specified . + Converts a managed byte array into a native pointer to a logical + array of bytes. - The to use. + The managed byte array to convert. + + + The length, in bytes, of the converted logical array of bytes. + + The native pointer to a logical byte array or null upon failure. + - + - Returns the underlying SQLite native handle associated with this - object instance. + This class contains static methods that are used to perform several + low-level data marshalling tasks between native and managed code. - + - This class represents a value from the SQLite core library that can be - passed to the sqlite3_value_*() and associated functions. + Returns a new object instance based on the + specified object instance and an integer + offset. + + The object instance representing the base + memory location. + + + The integer offset from the base memory location that the new + object instance should point to. + + + The new object instance. + - + - The native value handle. + Rounds up an integer size to the next multiple of the alignment. + + The size, in bytes, to be rounded up. + + + The required alignment for the return value. + + + The size, in bytes, rounded up to the next multiple of the + alignment. This value may end up being the same as the original + size. + - + - Constructs an instance of this class using the specified native - value handle. + Determines the offset, in bytes, of the next structure member. - - The native value handle to use. + + The offset, in bytes, of the current structure member. + + + The size, in bytes, of the current structure member. + + The alignment, in bytes, of the next structure member. + + + The offset, in bytes, of the next structure member. + - + - Invalidates the native value handle, thereby preventing further - access to it from this object instance. + Reads a value from the specified memory + location. + + The object instance representing the base + memory location. + + + The integer offset from the base memory location where the + value to be read is located. + + + The value at the specified memory location. + - + - Converts a logical array of native pointers to native sqlite3_value - structures into a managed array of - object instances. + Reads a value from the specified memory + location. - - The number of elements in the logical array of native sqlite3_value - structures. + + The object instance representing the base + memory location. - - The native pointer to the logical array of native sqlite3_value - structures to convert. + + The integer offset from the base memory location where the + value to be read is located. - The managed array of object instances or - null upon failure. + The value at the specified memory location. - + - Gets and returns the type affinity associated with this value. + Reads a value from the specified memory + location. + + The object instance representing the base + memory location. + + + The integer offset from the base memory location where the + to be read is located. + - The type affinity associated with this value. + The value at the specified memory location. - + - Gets and returns the number of bytes associated with this value, if - it refers to a UTF-8 encoded string. + Reads an value from the specified memory + location. + + The object instance representing the base + memory location. + + + The integer offset from the base memory location where the + value to be read is located. + - The number of bytes associated with this value. The returned value - may be zero. + The value at the specified memory location. - + - Gets and returns the associated with this - value. + Writes an value to the specified memory + location. - - The associated with this value. - + + The object instance representing the base + memory location. + + + The integer offset from the base memory location where the + value to be written is located. + + + The value to write. + - + - Gets and returns the associated with - this value. + Writes an value to the specified memory + location. - - The associated with this value. - + + The object instance representing the base + memory location. + + + The integer offset from the base memory location where the + value to be written is located. + + + The value to write. + - + - Gets and returns the associated with this - value. + Writes a value to the specified memory + location. - - The associated with this value. - + + The object instance representing the base + memory location. + + + The integer offset from the base memory location where the + value to be written is located. + + + The value to write. + - + - Gets and returns the associated with this - value. + Writes a value to the specified memory + location. - - The associated with this value. The value is - converted from the UTF-8 encoding prior to being returned. - + + The object instance representing the base + memory location. + + + The integer offset from the base memory location where the + value to be written is located. + + + The value to write. + - + - Gets and returns the array associated with this - value. + Generates a hash code value for the object. + + The object instance used to calculate the hash code. + + + Non-zero if different object instances with the same value should + generate different hash codes, where applicable. This parameter + has no effect on the .NET Compact Framework. + - The array associated with this value. + The hash code value -OR- zero if the object is null. - + - Uses the native value handle to obtain and store the managed value - for this object instance, thus saving it for later use. The type - of the managed value is determined by the type affinity of the - native value. If the type affinity is not recognized by this - method, no work is done and false is returned. + This class represents a managed virtual table module implementation. + It is not sealed and must be used as the base class for any + user-defined virtual table module classes implemented in managed code. - - Non-zero if the native value was persisted successfully. - - + - Returns the underlying SQLite native handle associated with this - object instance. + This class implements the + interface by forwarding those method calls to the + object instance it contains. If the + contained object instance is null, all + the methods simply generate an + error. - + - Returns non-zero if the native SQLite value has been successfully - persisted as a managed value within this object instance (i.e. the - property may then be read successfully). + This is the value that is always used for the "logErrors" + parameter to the various static error handling methods provided + by the class. - + - If the managed value for this object instance is available (i.e. it - has been previously persisted via the ) method, - that value is returned; otherwise, an exception is thrown. The - returned value may be null. + This is the value that is always used for the "logExceptions" + parameter to the various static error handling methods provided + by the class. - + - These are the allowed values for the operators that are part of a - constraint term in the WHERE clause of a query that uses a virtual - table. + This is the error message text used when the contained + object instance is not available + for any reason. - + - This value represents the equality operator. + The object instance used to provide + an implementation of the + interface. - + - This value represents the greater than operator. + Constructs an instance of this class. + + The object instance used to provide + an implementation of the + interface. + - + - This value represents the less than or equal to operator. + Sets the table error message to one that indicates the native + module implementation is not available. + + + The native pointer to the sqlite3_vtab derived structure. + + + The value of . + + + + + Sets the table error message to one that indicates the native + module implementation is not available. + + The native pointer to the sqlite3_vtab_cursor derived + structure. + + + The value of . + - + - This value represents the less than operator. + See the method. + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + - + - This value represents the greater than or equal to operator. + See the method. + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + - + - This value represents the MATCH operator. + See the method. + + See the method. + + + See the method. + + + See the method. + - + - This class represents the native sqlite3_index_constraint structure - from the SQLite core library. + See the method. + + See the method. + + + See the method. + - + - Constructs an instance of this class using the specified native - sqlite3_index_constraint structure. + See the method. - - The native sqlite3_index_constraint structure to use. + + See the method. + + See the method. + - + - Constructs an instance of this class using the specified field - values. + See the method. - - Column on left-hand side of constraint. - - - Constraint operator (). - - - True if this constraint is usable. + + See the method. - - Used internally - - should ignore. + + See the method. + + See the method. + - + - Column on left-hand side of constraint. + See the method. + + See the method. + + + See the method. + - + - Constraint operator (). + See the method. + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + - + - True if this constraint is usable. + See the method. + + See the method. + + + See the method. + - + - Used internally - - should ignore. + See the method. + + See the method. + + + See the method. + - + - This class represents the native sqlite3_index_orderby structure from - the SQLite core library. + See the method. + + See the method. + + + See the method. + + + See the method. + + + See the method. + - + - Constructs an instance of this class using the specified native - sqlite3_index_orderby structure. + See the method. - - The native sqlite3_index_orderby structure to use. + + See the method. + + + See the method. + + See the method. + - + - Constructs an instance of this class using the specified field - values. + See the method. - - Column number. + + See the method. - - True for DESC. False for ASC. + + See the method. + + + See the method. + + + See the method. + + See the method. + - + - Column number. + See the method. + + See the method. + + + See the method. + - + - True for DESC. False for ASC. + See the method. + + See the method. + + + See the method. + - + - This class represents the native sqlite3_index_constraint_usage - structure from the SQLite core library. + See the method. + + See the method. + + + See the method. + - + - Constructs an instance of this class using the specified native - sqlite3_index_constraint_usage structure. + See the method. - - The native sqlite3_index_constraint_usage structure to use. + + See the method. + + See the method. + - + - Constructs an instance of this class using the specified field - values. + See the method. - - If greater than 0, constraint is part of argv to xFilter. + + See the method. - - Do not code a test for this constraint. + + See the method. + + See the method. + + + See the method. + + + See the method. + + + See the method. + - - - If greater than 0, constraint is part of argv to xFilter. - - - - - Do not code a test for this constraint. - - - + - This class represents the various inputs provided by the SQLite core - library to the method. + See the method. + + See the method. + + + See the method. + + + See the method. + - + - Constructs an instance of this class. + See the method. - - The number of instances to - pre-allocate space for. + + See the method. - - The number of instances to - pre-allocate space for. + + See the method. + + See the method. + - + - An array of object instances, - each containing information supplied by the SQLite core library. + See the method. + + See the method. + + + See the method. + + + See the method. + - + - An array of object instances, - each containing information supplied by the SQLite core library. + See the method. + + See the method. + + + See the method. + + + See the method. + - + - This class represents the various outputs provided to the SQLite core - library by the method. + Disposes of this object instance. - + - Constructs an instance of this class. + Throws an if this object + instance has been disposed. - - The number of instances - to pre-allocate space for. - - + - Determines if the native estimatedRows field can be used, based on - the available version of the SQLite core library. + Disposes of this object instance. - - Non-zero if the property is supported - by the SQLite core library. - + + Non-zero if this method is being called from the + method. Zero if this method is being + called from the finalizer. + - + - An array of object - instances, each containing information to be supplied to the SQLite - core library. + Finalizes this object instance. - + - Number used to help identify the selected index. This value will - later be provided to the - method. + The default version of the native sqlite3_module structure in use. - + - String used to help identify the selected index. This value will - later be provided to the - method. + This field is used to store the native sqlite3_module structure + associated with this object instance. - + - Non-zero if the index string must be freed by the SQLite core - library. + This field is used to store the destructor delegate to be passed to + the SQLite core library via the sqlite3_create_disposable_module() + function. - + - True if output is already ordered. + This field is used to store a pointer to the native sqlite3_module + structure returned by the sqlite3_create_disposable_module + function. - + - Estimated cost of using this index. Using a null value here - indicates that a default estimated cost value should be used. + This field is used to store the virtual table instances associated + with this module. The native pointer to the sqlite3_vtab derived + structure is used to key into this collection. - + - Estimated number of rows returned. Using a null value here - indicates that a default estimated rows value should be used. + This field is used to store the virtual table cursor instances + associated with this module. The native pointer to the + sqlite3_vtab_cursor derived structure is used to key into this + collection. - + - This class represents the various inputs and outputs used with the - method. + This field is used to store the virtual table function instances + associated with this module. The case-insensitive function name + and the number of arguments (with -1 meaning "any") are used to + construct the string that is used to key into this collection. - + Constructs an instance of this class. - - The number of (and - ) instances to - pre-allocate space for. - - - The number of instances to - pre-allocate space for. + + The name of the module. This parameter cannot be null. - + - Converts a native pointer to a native sqlite3_index_info structure - into a new object instance. + Calls the native SQLite core library in order to create a new + disposable module containing the implementation of a virtual table. - - The native pointer to the native sqlite3_index_info structure to - convert. - - - Upon success, this parameter will be modified to contain the newly - created object instance. + + The native database connection pointer to use. + + Non-zero upon success. + - + - Populates the outputs of a pre-allocated native sqlite3_index_info - structure using an existing object - instance. + This method is called by the SQLite core library when the native + module associated with this object instance is being destroyed due + to its parent connection being closed. It may also be called by + the "vtshim" module if/when the sqlite3_dispose_module() function + is called. - - The existing object instance containing - the output data to use. - - - The native pointer to the pre-allocated native sqlite3_index_info - structure. + + The native user-data pointer associated with this module, as it was + provided to the SQLite core library when the native module instance + was created. - + - The object instance containing - the inputs to the - method. + Creates and returns the native sqlite_module structure using the + configured (or default) + interface implementation. + + The native sqlite_module structure using the configured (or + default) interface + implementation. + - + - The object instance containing - the outputs from the - method. + Creates and returns the native sqlite_module structure using the + specified interface + implementation. + + The interface implementation to + use. + + + The native sqlite_module structure using the specified + interface implementation. + - + - This class represents a managed virtual table implementation. It is - not sealed and should be used as the base class for any user-defined - virtual table classes implemented in managed code. + Creates a copy of the specified + object instance, + using default implementations for the contained delegates when + necessary. + + The object + instance to copy. + + + The new object + instance. + - + - The index within the array of strings provided to the - and - methods containing the - name of the module implementing this virtual table. + Calls one of the virtual table initialization methods. + + Non-zero to call the + method; otherwise, the + method will be called. + + + The native database connection handle. + + + The original native pointer value that was provided to the + sqlite3_create_module(), sqlite3_create_module_v2() or + sqlite3_create_disposable_module() functions. + + + The number of arguments from the CREATE VIRTUAL TABLE statement. + + + The array of string arguments from the CREATE VIRTUAL TABLE + statement. + + + Upon success, this parameter must be modified to point to the newly + created native sqlite3_vtab derived structure. + + + Upon failure, this parameter must be modified to point to the error + message, with the underlying memory having been obtained from the + sqlite3_malloc() function. + + + A standard SQLite return code. + - + - The index within the array of strings provided to the - and - methods containing the - name of the database containing this virtual table. + Calls one of the virtual table finalization methods. + + Non-zero to call the + method; otherwise, the + method will be + called. + + + The native pointer to the sqlite3_vtab derived structure. + + + A standard SQLite return code. + - + - The index within the array of strings provided to the - and - methods containing the - name of the virtual table. + Arranges for the specified error message to be placed into the + zErrMsg field of a sqlite3_vtab derived structure, freeing the + existing error message, if any. + + The object instance to be used. + + + The native pointer to the sqlite3_vtab derived structure. + + + Non-zero if this error message should also be logged using the + class. + + + Non-zero if caught exceptions should be logged using the + class. + + + The error message. + + + Non-zero upon success. + - + - Constructs an instance of this class. + Arranges for the specified error message to be placed into the + zErrMsg field of a sqlite3_vtab derived structure, freeing the + existing error message, if any. - - The original array of strings provided to the - and - methods. + + The object instance to be used. + + + The object instance used to + lookup the native pointer to the sqlite3_vtab derived structure. + + + Non-zero if this error message should also be logged using the + class. + + + Non-zero if caught exceptions should be logged using the + class. + + + The error message. + + Non-zero upon success. + - + - This method should normally be used by the - method in order to - perform index selection based on the constraints provided by the - SQLite core library. + Arranges for the specified error message to be placed into the + zErrMsg field of a sqlite3_vtab derived structure, freeing the + existing error message, if any. - - The object instance containing all the - data for the inputs and outputs relating to index selection. + + The object instance to be used. + + + The native pointer to the sqlite3_vtab_cursor derived structure + used to get the native pointer to the sqlite3_vtab derived + structure. + + + Non-zero if this error message should also be logged using the + class. + + + Non-zero if caught exceptions should be logged using the + class. + + + The error message. Non-zero upon success. - + - Attempts to record the renaming of the virtual table associated - with this object instance. + Arranges for the specified error message to be placed into the + zErrMsg field of a sqlite3_vtab derived structure, freeing the + existing error message, if any. - - The new name for the virtual table. + + The object instance to be used. + + + The object instance used to + lookup the native pointer to the sqlite3_vtab derived structure. + + + Non-zero if this error message should also be logged using the + class. + + + Non-zero if caught exceptions should be logged using the + class. + + + The error message. Non-zero upon success. - - - Disposes of this object instance. - - - - - Throws an if this object - instance has been disposed. - - - - - Disposes of this object instance. - - - Non-zero if this method is being called from the - method. Zero if this method is being called - from the finalizer. - - - + - Finalizes this object instance. + Gets and returns the interface + implementation to be used when creating the native sqlite3_module + structure. Derived classes may override this method to supply an + alternate implementation for the + interface. + + The interface implementation to + be used when populating the native sqlite3_module structure. If + the returned value is null, the private methods provided by the + class and relating to the + interface will be used to + create the necessary delegates. + - + - The original array of strings provided to the - and - methods. + Creates and returns the + interface implementation corresponding to the current + object instance. + + The interface implementation + corresponding to the current object + instance. + - + - The name of the module implementing this virtual table. + Allocates a native sqlite3_vtab derived structure and returns a + native pointer to it. + + A native pointer to a native sqlite3_vtab derived structure. + - + - The name of the database containing this virtual table. + Zeros out the fields of a native sqlite3_vtab derived structure. + + The native pointer to the native sqlite3_vtab derived structure to + zero. + - + - The name of the virtual table. + Frees a native sqlite3_vtab structure using the provided native + pointer to it. + + A native pointer to a native sqlite3_vtab derived structure. + - + - The object instance containing all the - data for the inputs and outputs relating to the most recent index - selection. + Allocates a native sqlite3_vtab_cursor derived structure and + returns a native pointer to it. + + A native pointer to a native sqlite3_vtab_cursor derived structure. + - + - Returns the underlying SQLite native handle associated with this - object instance. + Frees a native sqlite3_vtab_cursor structure using the provided + native pointer to it. + + A native pointer to a native sqlite3_vtab_cursor derived structure. + - + - This class represents a managed virtual table cursor implementation. - It is not sealed and should be used as the base class for any - user-defined virtual table cursor classes implemented in managed code. + Reads and returns the native pointer to the sqlite3_vtab derived + structure based on the native pointer to the sqlite3_vtab_cursor + derived structure. + + The object instance to be used. + + + The native pointer to the sqlite3_vtab_cursor derived structure + from which to read the native pointer to the sqlite3_vtab derived + structure. + + + The native pointer to the sqlite3_vtab derived structure -OR- + if it cannot be determined. + - + - This value represents an invalid integer row sequence number. + Reads and returns the native pointer to the sqlite3_vtab derived + structure based on the native pointer to the sqlite3_vtab_cursor + derived structure. + + The native pointer to the sqlite3_vtab_cursor derived structure + from which to read the native pointer to the sqlite3_vtab derived + structure. + + + The native pointer to the sqlite3_vtab derived structure -OR- + if it cannot be determined. + - + - The field holds the integer row sequence number for the current row - pointed to by this cursor object instance. + Looks up and returns the object + instance based on the native pointer to the sqlite3_vtab derived + structure. + + The native pointer to the sqlite3_vtab derived structure. + + + The object instance or null if + the corresponding one cannot be found. + - + - Constructs an instance of this class. + Allocates and returns a native pointer to a sqlite3_vtab derived + structure and creates an association between it and the specified + object instance. - The object instance associated - with this object instance. + The object instance to be used + when creating the association. + + The native pointer to a sqlite3_vtab derived structure or + if the method fails for any reason. + - + - Constructs an instance of this class. + Looks up and returns the + object instance based on the native pointer to the + sqlite3_vtab_cursor derived structure. + + The native pointer to the sqlite3_vtab derived structure. + + + The native pointer to the sqlite3_vtab_cursor derived structure. + + + The object instance or null + if the corresponding one cannot be found. + - + - Attempts to persist the specified object - instances in order to make them available after the - method returns. + Allocates and returns a native pointer to a sqlite3_vtab_cursor + derived structure and creates an association between it and the + specified object instance. - - The array of object instances to be - persisted. + + The object instance to be + used when creating the association. - The number of object instances that were - successfully persisted. + The native pointer to a sqlite3_vtab_cursor derived structure or + if the method fails for any reason. - + - This method should normally be used by the - method in order to - perform filtering of the result rows and/or to record the filtering - criteria provided by the SQLite core library. + Deterimines the key that should be used to identify and store the + object instance for the virtual table + (i.e. to be returned via the + method). - - Number used to help identify the selected index. + + The number of arguments to the virtual table function. - - String used to help identify the selected index. + + The name of the virtual table function. - - The values corresponding to each column in the selected index. + + The object instance associated with + this virtual table function. - - - - Determines the integer row sequence number for the current row. - - The integer row sequence number for the current row -OR- zero if - it cannot be determined. + The string that should be used to identify and store the virtual + table function instance. This method cannot return null. If null + is returned from this method, the behavior is undefined. - - - Adjusts the integer row sequence number so that it refers to the - next row. - - - - - Disposes of this object instance. - - - + - Throws an if this object - instance has been disposed. + Attempts to declare the schema for the virtual table using the + specified database connection. + + The object instance to use when + declaring the schema of the virtual table. This parameter may not + be null. + + + The string containing the CREATE TABLE statement that completely + describes the schema for the virtual table. This parameter may not + be null. + + + Upon failure, this parameter must be modified to contain an error + message. + + + A standard SQLite return code. + - + - Disposes of this object instance. + Calls the native SQLite core library in order to declare a virtual + table function in response to a call into the + + or virtual table + methods. - - Non-zero if this method is being called from the - method. Zero if this method is being called - from the finalizer. + + The object instance to use when + declaring the schema of the virtual table. + + + The number of arguments to the function being declared. + + The name of the function being declared. + + + Upon success, the contents of this parameter are undefined. Upon + failure, it should contain an appropriate error message. + + + A standard SQLite return code. + - + - Finalizes this object instance. + Returns or sets a boolean value indicating whether virtual table + errors should be logged using the class. - + - The object instance associated - with this object instance. + Returns or sets a boolean value indicating whether exceptions + caught in the + method, + the method, + the method, + the method, + and the method should be logged using the + class. - + - Number used to help identify the selected index. This value will - be set via the method. + Arranges for the specified error message to be placed into the + zErrMsg field of a sqlite3_vtab derived structure, freeing the + existing error message, if any. + + The native pointer to the sqlite3_vtab derived structure. + + + The error message. + + + Non-zero upon success. + - + - String used to help identify the selected index. This value will - be set via the method. + Arranges for the specified error message to be placed into the + zErrMsg field of a sqlite3_vtab derived structure, freeing the + existing error message, if any. + + The object instance used to + lookup the native pointer to the sqlite3_vtab derived structure. + + + The error message. + + + Non-zero upon success. + - + - The values used to filter the rows returned via this cursor object - instance. This value will be set via the - method. + Arranges for the specified error message to be placed into the + zErrMsg field of a sqlite3_vtab derived structure, freeing the + existing error message, if any. + + The object instance used to + lookup the native pointer to the sqlite3_vtab derived structure. + + + The error message. + + + Non-zero upon success. + - + - Returns the underlying SQLite native handle associated with this - object instance. + Modifies the specified object instance + to contain the specified estimated cost. + + The object instance to modify. + + + The estimated cost value to use. Using a null value means that the + default value provided by the SQLite core library should be used. + + + Non-zero upon success. + - + - This interface represents a virtual table implementation written in - native code. + Modifies the specified object instance + to contain the default estimated cost. + + The object instance to modify. + + + Non-zero upon success. + - + - - This method is called to create a new instance of a virtual table - in response to a CREATE VIRTUAL TABLE statement. The db parameter - is a pointer to the SQLite database connection that is executing - the CREATE VIRTUAL TABLE statement. The pAux argument is the copy - of the client data pointer that was the fourth argument to the - sqlite3_create_module() or sqlite3_create_module_v2() call that - registered the virtual table module. The argv parameter is an - array of argc pointers to null terminated strings. The first - string, argv[0], is the name of the module being invoked. The - module name is the name provided as the second argument to - sqlite3_create_module() and as the argument to the USING clause of - the CREATE VIRTUAL TABLE statement that is running. The second, - argv[1], is the name of the database in which the new virtual table - is being created. The database name is "main" for the primary - database, or "temp" for TEMP database, or the name given at the - end of the ATTACH statement for attached databases. The third - element of the array, argv[2], is the name of the new virtual - table, as specified following the TABLE keyword in the CREATE - VIRTUAL TABLE statement. If present, the fourth and subsequent - strings in the argv[] array report the arguments to the module name - in the CREATE VIRTUAL TABLE statement. - - - The job of this method is to construct the new virtual table object - (an sqlite3_vtab object) and return a pointer to it in *ppVTab. - - - As part of the task of creating a new sqlite3_vtab structure, this - method must invoke sqlite3_declare_vtab() to tell the SQLite core - about the columns and datatypes in the virtual table. The - sqlite3_declare_vtab() API has the following prototype: - - - - int sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable) - - - - The first argument to sqlite3_declare_vtab() must be the same - database connection pointer as the first parameter to this method. - The second argument to sqlite3_declare_vtab() must a - zero-terminated UTF-8 string that contains a well-formed CREATE - TABLE statement that defines the columns in the virtual table and - their data types. The name of the table in this CREATE TABLE - statement is ignored, as are all constraints. Only the column names - and datatypes matter. The CREATE TABLE statement string need not to - be held in persistent memory. The string can be deallocated and/or - reused as soon as the sqlite3_declare_vtab() routine returns. - + Modifies the specified object instance + to contain the specified estimated rows. - - The native database connection handle. - - - The original native pointer value that was provided to the - sqlite3_create_module(), sqlite3_create_module_v2() or - sqlite3_create_disposable_module() functions. - - - The number of arguments from the CREATE VIRTUAL TABLE statement. - - - The array of string arguments from the CREATE VIRTUAL TABLE - statement. - - - Upon success, this parameter must be modified to point to the newly - created native sqlite3_vtab derived structure. + + The object instance to modify. - - Upon failure, this parameter must be modified to point to the error - message, with the underlying memory having been obtained from the - sqlite3_malloc() function. + + The estimated rows value to use. Using a null value means that the + default value provided by the SQLite core library should be used. - A standard SQLite return code. + Non-zero upon success. - + - - The xConnect method is very similar to xCreate. It has the same - parameters and constructs a new sqlite3_vtab structure just like - xCreate. And it must also call sqlite3_declare_vtab() like xCreate. - - - The difference is that xConnect is called to establish a new - connection to an existing virtual table whereas xCreate is called - to create a new virtual table from scratch. - - - The xCreate and xConnect methods are only different when the - virtual table has some kind of backing store that must be - initialized the first time the virtual table is created. The - xCreate method creates and initializes the backing store. The - xConnect method just connects to an existing backing store. - - - As an example, consider a virtual table implementation that - provides read-only access to existing comma-separated-value (CSV) - files on disk. There is no backing store that needs to be created - or initialized for such a virtual table (since the CSV files - already exist on disk) so the xCreate and xConnect methods will be - identical for that module. - - - Another example is a virtual table that implements a full-text - index. The xCreate method must create and initialize data - structures to hold the dictionary and posting lists for that index. - The xConnect method, on the other hand, only has to locate and use - an existing dictionary and posting lists that were created by a - prior xCreate call. - - - The xConnect method must return SQLITE_OK if it is successful in - creating the new virtual table, or SQLITE_ERROR if it is not - successful. If not successful, the sqlite3_vtab structure must not - be allocated. An error message may optionally be returned in *pzErr - if unsuccessful. Space to hold the error message string must be - allocated using an SQLite memory allocation function like - sqlite3_malloc() or sqlite3_mprintf() as the SQLite core will - attempt to free the space using sqlite3_free() after the error has - been reported up to the application. - - - The xConnect method is required for every virtual table - implementation, though the xCreate and xConnect pointers of the - sqlite3_module object may point to the same function the virtual - table does not need to initialize backing store. - + Modifies the specified object instance + to contain the default estimated rows. - - The native database connection handle. - - - The original native pointer value that was provided to the - sqlite3_create_module(), sqlite3_create_module_v2() or - sqlite3_create_disposable_module() functions. - - - The number of arguments from the CREATE VIRTUAL TABLE statement. - - - The array of string arguments from the CREATE VIRTUAL TABLE - statement. + + The object instance to modify. - - Upon success, this parameter must be modified to point to the newly - created native sqlite3_vtab derived structure. + + Non-zero upon success. + + + + + Modifies the specified object instance + to contain the specified flags. + + + The object instance to modify. - - Upon failure, this parameter must be modified to point to the error - message, with the underlying memory having been obtained from the - sqlite3_malloc() function. + + The index flags value to use. Using a null value means that the + default value provided by the SQLite core library should be used. - A standard SQLite return code. + Non-zero upon success. - + - - SQLite uses the xBestIndex method of a virtual table module to - determine the best way to access the virtual table. The xBestIndex - method has a prototype like this: - - - int (*xBestIndex)(sqlite3_vtab *pVTab, sqlite3_index_info*); - - - The SQLite core communicates with the xBestIndex method by filling - in certain fields of the sqlite3_index_info structure and passing a - pointer to that structure into xBestIndex as the second parameter. - The xBestIndex method fills out other fields of this structure - which forms the reply. The sqlite3_index_info structure looks like - this: - - - struct sqlite3_index_info { - /* Inputs */ - const int nConstraint; /* Number of entries in aConstraint */ - const struct sqlite3_index_constraint { - int iColumn; /* Column on left-hand side of - * constraint */ - unsigned char op; /* Constraint operator */ - unsigned char usable; /* True if this constraint is usable */ - int iTermOffset; /* Used internally - xBestIndex should - * ignore */ - } *const aConstraint; /* Table of WHERE clause constraints */ - const int nOrderBy; /* Number of terms in the ORDER BY - * clause */ - const struct sqlite3_index_orderby { - int iColumn; /* Column number */ - unsigned char desc; /* True for DESC. False for ASC. */ - } *const aOrderBy; /* The ORDER BY clause */ - /* Outputs */ - struct sqlite3_index_constraint_usage { - int argvIndex; /* if greater than zero, constraint is - * part of argv to xFilter */ - unsigned char omit; /* Do not code a test for this - * constraint */ - } *const aConstraintUsage; - int idxNum; /* Number used to identify the index */ - char *idxStr; /* String, possibly obtained from - * sqlite3_malloc() */ - int needToFreeIdxStr; /* Free idxStr using sqlite3_free() if - * true */ - int orderByConsumed; /* True if output is already ordered */ - double estimatedCost; /* Estimated cost of using this index */ - }; - - - In addition, there are some defined constants: - - - #define SQLITE_INDEX_CONSTRAINT_EQ 2 - #define SQLITE_INDEX_CONSTRAINT_GT 4 - #define SQLITE_INDEX_CONSTRAINT_LE 8 - #define SQLITE_INDEX_CONSTRAINT_LT 16 - #define SQLITE_INDEX_CONSTRAINT_GE 32 - #define SQLITE_INDEX_CONSTRAINT_MATCH 64 - - - The SQLite core calls the xBestIndex method when it is compiling a - query that involves a virtual table. In other words, SQLite calls - this method when it is running sqlite3_prepare() or the equivalent. - By calling this method, the SQLite core is saying to the virtual - table that it needs to access some subset of the rows in the - virtual table and it wants to know the most efficient way to do - that access. The xBestIndex method replies with information that - the SQLite core can then use to conduct an efficient search of the - virtual table. - - - While compiling a single SQL query, the SQLite core might call - xBestIndex multiple times with different settings in - sqlite3_index_info. The SQLite core will then select the - combination that appears to give the best performance. - - - Before calling this method, the SQLite core initializes an instance - of the sqlite3_index_info structure with information about the - query that it is currently trying to process. This information - derives mainly from the WHERE clause and ORDER BY or GROUP BY - clauses of the query, but also from any ON or USING clauses if the - query is a join. The information that the SQLite core provides to - the xBestIndex method is held in the part of the structure that is - marked as "Inputs". The "Outputs" section is initialized to zero. - - - The information in the sqlite3_index_info structure is ephemeral - and may be overwritten or deallocated as soon as the xBestIndex - method returns. If the xBestIndex method needs to remember any part - of the sqlite3_index_info structure, it should make a copy. Care - must be take to store the copy in a place where it will be - deallocated, such as in the idxStr field with needToFreeIdxStr set - to 1. - - - Note that xBestIndex will always be called before xFilter, since - the idxNum and idxStr outputs from xBestIndex are required inputs - to xFilter. However, there is no guarantee that xFilter will be - called following a successful xBestIndex. - - - The xBestIndex method is required for every virtual table - implementation. - - - 2.3.1 Inputs - - - The main thing that the SQLite core is trying to communicate to the - virtual table is the constraints that are available to limit the - number of rows that need to be searched. The aConstraint[] array - contains one entry for each constraint. There will be exactly - nConstraint entries in that array. - - - Each constraint will correspond to a term in the WHERE clause or in - a USING or ON clause that is of the form - - - column OP EXPR - - - Where "column" is a column in the virtual table, OP is an operator - like "=" or "<", and EXPR is an arbitrary expression. So, for - example, if the WHERE clause contained a term like this: - - - a = 5 - - - Then one of the constraints would be on the "a" column with - operator "=" and an expression of "5". Constraints need not have a - literal representation of the WHERE clause. The query optimizer - might make transformations to the WHERE clause in order to extract - as many constraints as it can. So, for example, if the WHERE clause - contained something like this: - - - x BETWEEN 10 AND 100 AND 999>y - - - The query optimizer might translate this into three separate - constraints: - - - x >= 10 - x <= 100 - y < 999 - - - For each constraint, the aConstraint[].iColumn field indicates - which column appears on the left-hand side of the constraint. The - first column of the virtual table is column 0. The rowid of the - virtual table is column -1. The aConstraint[].op field indicates - which operator is used. The SQLITE_INDEX_CONSTRAINT_* constants map - integer constants into operator values. Columns occur in the order - they were defined by the call to sqlite3_declare_vtab() in the - xCreate or xConnect method. Hidden columns are counted when - determining the column index. - - - The aConstraint[] array contains information about all constraints - that apply to the virtual table. But some of the constraints might - not be usable because of the way tables are ordered in a join. The - xBestIndex method must therefore only consider constraints that - have an aConstraint[].usable flag which is true. - - - In addition to WHERE clause constraints, the SQLite core also tells - the xBestIndex method about the ORDER BY clause. (In an aggregate - query, the SQLite core might put in GROUP BY clause information in - place of the ORDER BY clause information, but this fact should not - make any difference to the xBestIndex method.) If all terms of the - ORDER BY clause are columns in the virtual table, then nOrderBy - will be the number of terms in the ORDER BY clause and the - aOrderBy[] array will identify the column for each term in the - order by clause and whether or not that column is ASC or DESC. - - - 2.3.2 Outputs - - - Given all of the information above, the job of the xBestIndex - method it to figure out the best way to search the virtual table. - - - The xBestIndex method fills the idxNum and idxStr fields with - information that communicates an indexing strategy to the xFilter - method. The information in idxNum and idxStr is arbitrary as far as - the SQLite core is concerned. The SQLite core just copies the - information through to the xFilter method. Any desired meaning can - be assigned to idxNum and idxStr as long as xBestIndex and xFilter - agree on what that meaning is. - - - The idxStr value may be a string obtained from an SQLite memory - allocation function such as sqlite3_mprintf(). If this is the case, - then the needToFreeIdxStr flag must be set to true so that the - SQLite core will know to call sqlite3_free() on that string when it - has finished with it, and thus avoid a memory leak. - - - If the virtual table will output rows in the order specified by the - ORDER BY clause, then the orderByConsumed flag may be set to true. - If the output is not automatically in the correct order then - orderByConsumed must be left in its default false setting. This - will indicate to the SQLite core that it will need to do a separate - sorting pass over the data after it comes out of the virtual table. - - - The estimatedCost field should be set to the estimated number of - disk access operations required to execute this query against the - virtual table. The SQLite core will often call xBestIndex multiple - times with different constraints, obtain multiple cost estimates, - then choose the query plan that gives the lowest estimate. - - - The aConstraintUsage[] array contains one element for each of the - nConstraint constraints in the inputs section of the - sqlite3_index_info structure. The aConstraintUsage[] array is used - by xBestIndex to tell the core how it is using the constraints. - - - The xBestIndex method may set aConstraintUsage[].argvIndex entries - to values greater than one. Exactly one entry should be set to 1, - another to 2, another to 3, and so forth up to as many or as few as - the xBestIndex method wants. The EXPR of the corresponding - constraints will then be passed in as the argv[] parameters to - xFilter. - - - For example, if the aConstraint[3].argvIndex is set to 1, then when - xFilter is called, the argv[0] passed to xFilter will have the EXPR - value of the aConstraint[3] constraint. - - - By default, the SQLite core double checks all constraints on each - row of the virtual table that it receives. If such a check is - redundant, the xBestFilter method can suppress that double-check by - setting aConstraintUsage[].omit. - + Modifies the specified object instance + to contain the default index flags. + + + The object instance to modify. + + + Non-zero upon success. + + + + + Returns or sets a boolean value indicating whether virtual table + errors should be logged using the class. + + + + + Returns or sets a boolean value indicating whether exceptions + caught in the + method, + method, and the + method should be logged using the + class. + + + + + See the method. + + See the method. + + + See the method. + + + See the method. + + + See the method. + - The native pointer to the sqlite3_vtab derived structure. + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + + + See the method. + + + See the method. - The native pointer to the sqlite3_index_info structure. + See the method. - A standard SQLite return code. + See the method. - + - - This method releases a connection to a virtual table. Only the - sqlite3_vtab object is destroyed. The virtual table is not - destroyed and any backing store associated with the virtual table - persists. This method undoes the work of xConnect. - - - This method is a destructor for a connection to the virtual table. - Contrast this method with xDestroy. The xDestroy is a destructor - for the entire virtual table. - - - The xDisconnect method is required for every virtual table - implementation, though it is acceptable for the xDisconnect and - xDestroy methods to be the same function if that makes sense for - the particular virtual table. - + See the method. - The native pointer to the sqlite3_vtab derived structure. + See the method. - A standard SQLite return code. + See the method. - + - - This method releases a connection to a virtual table, just like the - xDisconnect method, and it also destroys the underlying table - implementation. This method undoes the work of xCreate. - - - The xDisconnect method is called whenever a database connection - that uses a virtual table is closed. The xDestroy method is only - called when a DROP TABLE statement is executed against the virtual - table. - - - The xDestroy method is required for every virtual table - implementation, though it is acceptable for the xDisconnect and - xDestroy methods to be the same function if that makes sense for - the particular virtual table. - + See the method. - The native pointer to the sqlite3_vtab derived structure. + See the method. - A standard SQLite return code. + See the method. - + - - The xOpen method creates a new cursor used for accessing (read - and/or writing) a virtual table. A successful invocation of this - method will allocate the memory for the sqlite3_vtab_cursor (or a - subclass), initialize the new object, and make *ppCursor point to - the new object. The successful call then returns SQLITE_OK. - - - For every successful call to this method, the SQLite core will - later invoke the xClose method to destroy the allocated cursor. - - - The xOpen method need not initialize the pVtab field of the - sqlite3_vtab_cursor structure. The SQLite core will take care of - that chore automatically. - - - A virtual table implementation must be able to support an arbitrary - number of simultaneously open cursors. - - - When initially opened, the cursor is in an undefined state. The - SQLite core will invoke the xFilter method on the cursor prior to - any attempt to position or read from the cursor. - - - The xOpen method is required for every virtual table - implementation. - + See the method. - The native pointer to the sqlite3_vtab derived structure. + See the method. - Upon success, this parameter must be modified to point to the newly - created native sqlite3_vtab_cursor derived structure. + See the method. - A standard SQLite return code. + See the method. - + - - The xClose method closes a cursor previously opened by xOpen. The - SQLite core will always call xClose once for each cursor opened - using xOpen. - - - This method must release all resources allocated by the - corresponding xOpen call. The routine will not be called again even - if it returns an error. The SQLite core will not use the - sqlite3_vtab_cursor again after it has been closed. - - - The xClose method is required for every virtual table - implementation. - + See the method. - The native pointer to the sqlite3_vtab_cursor derived structure. + See the method. - A standard SQLite return code. + See the method. - + - - This method begins a search of a virtual table. The first argument - is a cursor opened by xOpen. The next two argument define a - particular search index previously chosen by xBestIndex. The - specific meanings of idxNum and idxStr are unimportant as long as - xFilter and xBestIndex agree on what that meaning is. - - - The xBestIndex function may have requested the values of certain - expressions using the aConstraintUsage[].argvIndex values of the - sqlite3_index_info structure. Those values are passed to xFilter - using the argc and argv parameters. - - - If the virtual table contains one or more rows that match the - search criteria, then the cursor must be left point at the first - row. Subsequent calls to xEof must return false (zero). If there - are no rows match, then the cursor must be left in a state that - will cause the xEof to return true (non-zero). The SQLite engine - will use the xColumn and xRowid methods to access that row content. - The xNext method will be used to advance to the next row. - - - This method must return SQLITE_OK if successful, or an sqlite error - code if an error occurs. - - - The xFilter method is required for every virtual table - implementation. - + See the method. - The native pointer to the sqlite3_vtab_cursor derived structure. + See the method. - Number used to help identify the selected index. + See the method. - The native pointer to the UTF-8 encoded string containing the - string used to help identify the selected index. + See the method. - The number of native pointers to sqlite3_value structures specified - in . + See the method. - An array of native pointers to sqlite3_value structures containing - filtering criteria for the selected index. + See the method. - A standard SQLite return code. + See the method. - + - - The xNext method advances a virtual table cursor to the next row of - a result set initiated by xFilter. If the cursor is already - pointing at the last row when this routine is called, then the - cursor no longer points to valid data and a subsequent call to the - xEof method must return true (non-zero). If the cursor is - successfully advanced to another row of content, then subsequent - calls to xEof must return false (zero). - - - This method must return SQLITE_OK if successful, or an sqlite error - code if an error occurs. - - - The xNext method is required for every virtual table - implementation. - + See the method. - The native pointer to the sqlite3_vtab_cursor derived structure. + See the method. - A standard SQLite return code. + See the method. - + - - The xEof method must return false (zero) if the specified cursor - currently points to a valid row of data, or true (non-zero) - otherwise. This method is called by the SQL engine immediately - after each xFilter and xNext invocation. - - - The xEof method is required for every virtual table implementation. - + See the method. - The native pointer to the sqlite3_vtab_cursor derived structure. + See the method. - Non-zero if no more rows are available; zero otherwise. + See the method. - + - - The SQLite core invokes this method in order to find the value for - the N-th column of the current row. N is zero-based so the first - column is numbered 0. The xColumn method may return its result back - to SQLite using one of the following interface: - - - sqlite3_result_blob() - sqlite3_result_double() - sqlite3_result_int() - sqlite3_result_int64() - sqlite3_result_null() - sqlite3_result_text() - sqlite3_result_text16() - sqlite3_result_text16le() - sqlite3_result_text16be() - sqlite3_result_zeroblob() - - - If the xColumn method implementation calls none of the functions - above, then the value of the column defaults to an SQL NULL. - - - To raise an error, the xColumn method should use one of the - result_text() methods to set the error message text, then return an - appropriate error code. The xColumn method must return SQLITE_OK on - success. - - - The xColumn method is required for every virtual table - implementation. - + See the method. - The native pointer to the sqlite3_vtab_cursor derived structure. + See the method. - The native pointer to the sqlite3_context structure to be used - for returning the specified column value to the SQLite core - library. + See the method. - The zero-based index corresponding to the column containing the - value to be returned. + See the method. - A standard SQLite return code. + See the method. - + - - A successful invocation of this method will cause *pRowid to be - filled with the rowid of row that the virtual table cursor pCur is - currently pointing at. This method returns SQLITE_OK on success. It - returns an appropriate error code on failure. - - - The xRowid method is required for every virtual table - implementation. - + See the method. - The native pointer to the sqlite3_vtab_cursor derived structure. + See the method. - Upon success, this parameter must be modified to contain the unique - integer row identifier for the current row for the specified cursor. + See the method. - A standard SQLite return code. + See the method. - + - - All changes to a virtual table are made using the xUpdate method. - This one method can be used to insert, delete, or update. - - - The argc parameter specifies the number of entries in the argv - array. The value of argc will be 1 for a pure delete operation or - N+2 for an insert or replace or update where N is the number of - columns in the table. In the previous sentence, N includes any - hidden columns. - - - Every argv entry will have a non-NULL value in C but may contain - the SQL value NULL. In other words, it is always true that - argv[i]!=0 for i between 0 and argc-1. However, it might be the - case that sqlite3_value_type(argv[i])==SQLITE_NULL. - - - The argv[0] parameter is the rowid of a row in the virtual table - to be deleted. If argv[0] is an SQL NULL, then no deletion occurs. - - - The argv[1] parameter is the rowid of a new row to be inserted into - the virtual table. If argv[1] is an SQL NULL, then the - implementation must choose a rowid for the newly inserted row. - Subsequent argv[] entries contain values of the columns of the - virtual table, in the order that the columns were declared. The - number of columns will match the table declaration that the - xConnect or xCreate method made using the sqlite3_declare_vtab() - call. All hidden columns are included. - - - When doing an insert without a rowid (argc>1, argv[1] is an SQL - NULL), the implementation must set *pRowid to the rowid of the - newly inserted row; this will become the value returned by the - sqlite3_last_insert_rowid() function. Setting this value in all the - other cases is a harmless no-op; the SQLite engine ignores the - *pRowid return value if argc==1 or argv[1] is not an SQL NULL. - - - Each call to xUpdate will fall into one of cases shown below. Note - that references to argv[i] mean the SQL value held within the - argv[i] object, not the argv[i] object itself. - - - argc = 1 - - - The single row with rowid equal to argv[0] is deleted. No - insert occurs. - - - argc > 1 - argv[0] = NULL - - - A new row is inserted with a rowid argv[1] and column - values in argv[2] and following. If argv[1] is an SQL NULL, - the a new unique rowid is generated automatically. - - - argc > 1 - argv[0] ? NULL - argv[0] = argv[1] - - - The row with rowid argv[0] is updated with new values in - argv[2] and following parameters. - - - argc > 1 - argv[0] ? NULL - argv[0] ? argv[1] - - - The row with rowid argv[0] is updated with rowid argv[1] - and new values in argv[2] and following parameters. This - will occur when an SQL statement updates a rowid, as in - the statement: - - - UPDATE table SET rowid=rowid+1 WHERE ...; - - - The xUpdate method must return SQLITE_OK if and only if it is - successful. If a failure occurs, the xUpdate must return an - appropriate error code. On a failure, the pVTab->zErrMsg element - may optionally be replaced with error message text stored in memory - allocated from SQLite using functions such as sqlite3_mprintf() or - sqlite3_malloc(). - - - If the xUpdate method violates some constraint of the virtual table - (including, but not limited to, attempting to store a value of the - wrong datatype, attempting to store a value that is too large or - too small, or attempting to change a read-only value) then the - xUpdate must fail with an appropriate error code. - - - There might be one or more sqlite3_vtab_cursor objects open and in - use on the virtual table instance and perhaps even on the row of - the virtual table when the xUpdate method is invoked. The - implementation of xUpdate must be prepared for attempts to delete - or modify rows of the table out from other existing cursors. If the - virtual table cannot accommodate such changes, the xUpdate method - must return an error code. - - - The xUpdate method is optional. If the xUpdate pointer in the - sqlite3_module for a virtual table is a NULL pointer, then the - virtual table is read-only. - + See the method. - The native pointer to the sqlite3_vtab derived structure. + See the method. - The number of new or modified column values contained in - . + See the method. - The array of native pointers to sqlite3_value structures containing - the new or modified column values, if any. + See the method. - Upon success, this parameter must be modified to contain the unique - integer row identifier for the row that was inserted, if any. + See the method. - A standard SQLite return code. + See the method. - + - - This method begins a transaction on a virtual table. This is method - is optional. The xBegin pointer of sqlite3_module may be NULL. - - - This method is always followed by one call to either the xCommit or - xRollback method. Virtual table transactions do not nest, so the - xBegin method will not be invoked more than once on a single - virtual table without an intervening call to either xCommit or - xRollback. Multiple calls to other methods can and likely will - occur in between the xBegin and the corresponding xCommit or - xRollback. - + See the method. - The native pointer to the sqlite3_vtab derived structure. + See the method. - A standard SQLite return code. + See the method. - + - - This method signals the start of a two-phase commit on a virtual - table. This is method is optional. The xSync pointer of - sqlite3_module may be NULL. - - - This method is only invoked after call to the xBegin method and - prior to an xCommit or xRollback. In order to implement two-phase - commit, the xSync method on all virtual tables is invoked prior to - invoking the xCommit method on any virtual table. If any of the - xSync methods fail, the entire transaction is rolled back. - + See the method. - The native pointer to the sqlite3_vtab derived structure. + See the method. - A standard SQLite return code. + See the method. - + - - This method causes a virtual table transaction to commit. This is - method is optional. The xCommit pointer of sqlite3_module may be - NULL. - - - A call to this method always follows a prior call to xBegin and - xSync. - + See the method. - The native pointer to the sqlite3_vtab derived structure. + See the method. - A standard SQLite return code. + See the method. - + - - This method causes a virtual table transaction to rollback. This is - method is optional. The xRollback pointer of sqlite3_module may be - NULL. - - - A call to this method always follows a prior call to xBegin. - + See the method. - The native pointer to the sqlite3_vtab derived structure. + See the method. - A standard SQLite return code. + See the method. - + - - This method provides notification that the virtual table - implementation that the virtual table will be given a new name. If - this method returns SQLITE_OK then SQLite renames the table. If - this method returns an error code then the renaming is prevented. - - - The xRename method is required for every virtual table - implementation. - + See the method. - The native pointer to the sqlite3_vtab derived structure. + See the method. - The number of arguments to the function being sought. + See the method. - The name of the function being sought. + See the method. - Upon success, this parameter must be modified to contain the - delegate responsible for implementing the specified function. + See the method. - Upon success, this parameter must be modified to contain the - native user-data pointer associated with - . + See the method. - Non-zero if the specified function was found; zero otherwise. + See the method. - + - - This method provides notification that the virtual table - implementation that the virtual table will be given a new name. If - this method returns SQLITE_OK then SQLite renames the table. If - this method returns an error code then the renaming is prevented. - - - The xRename method is required for every virtual table - implementation. - + See the method. - The native pointer to the sqlite3_vtab derived structure. + See the method. - The native pointer to the UTF-8 encoded string containing the new - name for the virtual table. + See the method. - A standard SQLite return code. + See the method. - + - - These methods provide the virtual table implementation an - opportunity to implement nested transactions. They are always - optional and will only be called in SQLite version 3.7.7 and later. - - - When xSavepoint(X,N) is invoked, that is a signal to the virtual - table X that it should save its current state as savepoint N. A - subsequent call to xRollbackTo(X,R) means that the state of the - virtual table should return to what it was when xSavepoint(X,R) was - last called. The call to xRollbackTo(X,R) will invalidate all - savepoints with N>R; none of the invalided savepoints will be - rolled back or released without first being reinitialized by a call - to xSavepoint(). A call to xRelease(X,M) invalidates all savepoints - where N>=M. - - - None of the xSavepoint(), xRelease(), or xRollbackTo() methods will - ever be called except in between calls to xBegin() and either - xCommit() or xRollback(). - + See the method. - The native pointer to the sqlite3_vtab derived structure. + See the method. - This is an integer identifier under which the the current state of - the virtual table should be saved. + See the method. - A standard SQLite return code. + See the method. - + - - These methods provide the virtual table implementation an - opportunity to implement nested transactions. They are always - optional and will only be called in SQLite version 3.7.7 and later. - - - When xSavepoint(X,N) is invoked, that is a signal to the virtual - table X that it should save its current state as savepoint N. A - subsequent call to xRollbackTo(X,R) means that the state of the - virtual table should return to what it was when xSavepoint(X,R) was - last called. The call to xRollbackTo(X,R) will invalidate all - savepoints with N>R; none of the invalided savepoints will be - rolled back or released without first being reinitialized by a call - to xSavepoint(). A call to xRelease(X,M) invalidates all savepoints - where N>=M. - - - None of the xSavepoint(), xRelease(), or xRollbackTo() methods will - ever be called except in between calls to xBegin() and either - xCommit() or xRollback(). - + See the method. - The native pointer to the sqlite3_vtab derived structure. + See the method. - This is an integer used to indicate that any saved states with an - identifier greater than or equal to this should be deleted by the - virtual table. + See the method. - A standard SQLite return code. + See the method. - + - - These methods provide the virtual table implementation an - opportunity to implement nested transactions. They are always - optional and will only be called in SQLite version 3.7.7 and later. - - - When xSavepoint(X,N) is invoked, that is a signal to the virtual - table X that it should save its current state as savepoint N. A - subsequent call to xRollbackTo(X,R) means that the state of the - virtual table should return to what it was when xSavepoint(X,R) was - last called. The call to xRollbackTo(X,R) will invalidate all - savepoints with N>R; none of the invalided savepoints will be - rolled back or released without first being reinitialized by a call - to xSavepoint(). A call to xRelease(X,M) invalidates all savepoints - where N>=M. - - - None of the xSavepoint(), xRelease(), or xRollbackTo() methods will - ever be called except in between calls to xBegin() and either - xCommit() or xRollback(). - + See the method. - The native pointer to the sqlite3_vtab derived structure. + See the method. - This is an integer identifier used to specify a specific saved - state for the virtual table for it to restore itself back to, which - should also have the effect of deleting all saved states with an - integer identifier greater than this one. + See the method. - A standard SQLite return code. + See the method. - + - This interface represents a virtual table implementation written in - managed code. + Returns non-zero if the schema for the virtual table has been + declared. - + + + Returns the name of the module as it was registered with the SQLite + core library. + + + This method is called in response to the - method. + method. - The object instance associated with + The object instance associated with the virtual table. @@ -9782,7 +17010,7 @@ Upon success, this parameter must be modified to contain the - object instance associated with + object instance associated with the virtual table. @@ -9793,13 +17021,13 @@ A standard SQLite return code. - + This method is called in response to the - method. + method. - The object instance associated with + The object instance associated with the virtual table. @@ -9813,7 +17041,7 @@ Upon success, this parameter must be modified to contain the - object instance associated with + object instance associated with the virtual table. @@ -9824,74 +17052,74 @@ A standard SQLite return code. - + This method is called in response to the - method. + method. - The object instance associated + The object instance associated with this virtual table. - The object instance containing all the + The object instance containing all the data for the inputs and outputs relating to index selection. A standard SQLite return code. - + This method is called in response to the - method. + method. - The object instance associated + The object instance associated with this virtual table. A standard SQLite return code. - + This method is called in response to the - method. + method. - The object instance associated + The object instance associated with this virtual table. A standard SQLite return code. - + This method is called in response to the - method. + method. - The object instance associated + The object instance associated with this virtual table. Upon success, this parameter must be modified to contain the - object instance associated + object instance associated with the newly opened virtual table cursor. A standard SQLite return code. - + This method is called in response to the - method. + method. - The object instance + The object instance associated with the previously opened virtual table cursor to be used. @@ -9899,13 +17127,13 @@ A standard SQLite return code. - + This method is called in response to the - method. + method. - The object instance + The object instance associated with the previously opened virtual table cursor to be used. @@ -9922,13 +17150,13 @@ A standard SQLite return code. - + This method is called in response to the - method. + method. - The object instance + The object instance associated with the previously opened virtual table cursor to be used. @@ -9936,13 +17164,13 @@ A standard SQLite return code. - + This method is called in response to the - method. + method. - The object instance + The object instance associated with the previously opened virtual table cursor to be used. @@ -9950,18 +17178,18 @@ Non-zero if no more rows are available; zero otherwise. - + This method is called in response to the - method. + method. - The object instance + The object instance associated with the previously opened virtual table cursor to be used. - The object instance to be used for + The object instance to be used for returning the specified column value to the SQLite core library. @@ -9972,13 +17200,13 @@ A standard SQLite return code. - + This method is called in response to the - method. + method. - The object instance + The object instance associated with the previously opened virtual table cursor to be used. @@ -9990,17 +17218,17 @@ A standard SQLite return code. - + This method is called in response to the - method. + method. - The object instance associated + The object instance associated with this virtual table. - The array of object instances containing + The array of object instances containing the new or modified column values, if any. @@ -10011,65 +17239,65 @@ A standard SQLite return code. - + This method is called in response to the - method. + method. - The object instance associated + The object instance associated with this virtual table. A standard SQLite return code. - + This method is called in response to the - method. + method. - The object instance associated + The object instance associated with this virtual table. A standard SQLite return code. - + This method is called in response to the - method. + method. - The object instance associated + The object instance associated with this virtual table. A standard SQLite return code. - + This method is called in response to the - method. + method. - The object instance associated + The object instance associated with this virtual table. A standard SQLite return code. - + This method is called in response to the - method. + method. - The object instance associated + The object instance associated with this virtual table. @@ -10080,558 +17308,827 @@ Upon success, this parameter must be modified to contain the - object instance responsible for + object instance responsible for implementing the specified function. Upon success, this parameter must be modified to contain the native user-data pointer associated with - . + . + + + Non-zero if the specified function was found; zero otherwise. + + + + + This method is called in response to the + method. + + + The object instance associated + with this virtual table. + + + The new name for the virtual table. + + + A standard SQLite return code. + + + + + This method is called in response to the + method. + + + The object instance associated + with this virtual table. + + + This is an integer identifier under which the the current state of + the virtual table should be saved. + + + A standard SQLite return code. + + + + + This method is called in response to the + method. + + + The object instance associated + with this virtual table. + + + This is an integer used to indicate that any saved states with an + identifier greater than or equal to this should be deleted by the + virtual table. + + + A standard SQLite return code. + + + + + This method is called in response to the + method. + + + The object instance associated + with this virtual table. + + + This is an integer identifier used to specify a specific saved + state for the virtual table for it to restore itself back to, which + should also have the effect of deleting all saved states with an + integer identifier greater than this one. + + + A standard SQLite return code. + + + + + Disposes of this object instance. + + + + + Throws an if this object + instance has been disposed. + + + + + Disposes of this object instance. + + + Non-zero if this method is being called from the + method. Zero if this method is being + called from the finalizer. + + + + + Finalizes this object instance. + + + + + This class contains some virtual methods that may be useful for other + virtual table classes. It specifically does NOT implement any of the + interface methods. + + + + + The CREATE TABLE statement used to declare the schema for the + virtual table. + + + + + Non-zero if different object instances with the same value should + generate different row identifiers, where applicable. This has no + effect on the .NET Compact Framework. + + + + + Constructs an instance of this class. + + + The name of the module. This parameter cannot be null. + + + + + Constructs an instance of this class. + + + The name of the module. This parameter cannot be null. + + + Non-zero if different object instances with the same value should + generate different row identifiers, where applicable. This + parameter has no effect on the .NET Compact Framework. + + + + Determines the SQL statement used to declare the virtual table. + This method should be overridden in derived classes if they require + a custom virtual table schema. + - Non-zero if the specified function was found; zero otherwise. + The SQL statement used to declare the virtual table -OR- null if it + cannot be determined. - + - This method is called in response to the - method. + Sets the table error message to one that indicates the virtual + table cursor is of the wrong type. - - The object instance associated - with this virtual table. + + The object instance. - - The new name for the virtual table. + + The that the virtual table cursor should be. - A standard SQLite return code. + The value of . - + - This method is called in response to the - method. + Determines the string to return as the column value for the object + instance value. - - The object instance associated - with this virtual table. + + The object instance + associated with the previously opened virtual table cursor to be + used. - - This is an integer identifier under which the the current state of - the virtual table should be saved. + + The object instance to return a string representation for. - A standard SQLite return code. + The string representation of the specified object instance or null + upon failure. - + - This method is called in response to the - method. + Constructs an unique row identifier from two + values. The first value + must contain the row sequence number for the current row and the + second value must contain the hash code of the key column value + for the current row. - - The object instance associated - with this virtual table. + + The integer row sequence number for the current row. - - This is an integer used to indicate that any saved states with an - identifier greater than or equal to this should be deleted by the - virtual table. + + The hash code of the key column value for the current row. - A standard SQLite return code. + The unique row identifier or zero upon failure. - + - This method is called in response to the - method. + Determines the unique row identifier for the current row. - - The object instance associated - with this virtual table. + + The object instance + associated with the previously opened virtual table cursor to be + used. - - This is an integer identifier used to specify a specific saved - state for the virtual table for it to restore itself back to, which - should also have the effect of deleting all saved states with an - integer identifier greater than this one. + + The object instance to return a unique row identifier for. - A standard SQLite return code. + The unique row identifier or zero upon failure. - + - Returns non-zero if the schema for the virtual table has been - declared. + Throws an if this object + instance has been disposed. - + - Returns the name of the module as it was registered with the SQLite - core library. + Disposes of this object instance. + + Non-zero if this method is being called from the + method. Zero if this method is + being called from the finalizer. + - + - This class contains static methods that are used to allocate, - manipulate, and free native memory provided by the SQLite core library. + This class represents a virtual table cursor to be used with the + class. It is not sealed and may + be used as the base class for any user-defined virtual table cursor + class that wraps an object instance. - + - Allocates at least the specified number of bytes of native memory - via the SQLite core library sqlite3_malloc() function and returns - the resulting native pointer. + The instance provided when this cursor + was created. - - The number of bytes to allocate. - - - The native pointer that points to a block of memory of at least the - specified size -OR- if the memory could - not be allocated. - - + - Gets and returns the actual size of the specified memory block that - was previously obtained from the method. + This value will be non-zero if false has been returned from the + method. - - The native pointer to the memory block previously obtained from the - method. + + + + Constructs an instance of this class. + + + The object instance associated + with this object instance. + + The instance to expose as a virtual + table cursor. + + + + + Advances to the next row of the virtual table cursor using the + method of the + object instance. + - The actual size, in bytes, of the memory block specified via the - native pointer. + Non-zero if the current row is valid; zero otherwise. If zero is + returned, no further rows are available. - + - Frees a memory block previously obtained from the - method. + Returns the value for the current row of the virtual table cursor + using the property of the + object instance. - - The native pointer to the memory block previously obtained from the - method. + + + + Resets the virtual table cursor position, also invalidating the + current row, using the method of + the object instance. + + + + + Returns non-zero if the end of the virtual table cursor has been + seen (i.e. no more rows are available, including the current one). + + + + + Returns non-zero if the virtual table cursor is open. + + + + + Closes the virtual table cursor. This method must not throw any + exceptions. + + + + + Throws an if the virtual + table cursor has been closed. + + + + + Throws an if this object + instance has been disposed. + + + + + Disposes of this object instance. + + + Non-zero if this method is being called from the + method. Zero if this method is + being called from the finalizer. - + + + This class implements a virtual table module that exposes an + object instance as a read-only virtual + table. It is not sealed and may be used as the base class for any + user-defined virtual table class that wraps an + object instance. The following short + example shows it being used to treat an array of strings as a table + data source: + + public static class Sample + { + public static void Main() + { + using (SQLiteConnection connection = new SQLiteConnection( + "Data Source=:memory:;")) + { + connection.Open(); + + connection.CreateModule(new SQLiteModuleEnumerable( + "sampleModule", new string[] { "one", "two", "three" })); + + using (SQLiteCommand command = connection.CreateCommand()) + { + command.CommandText = + "CREATE VIRTUAL TABLE t1 USING sampleModule;"; + + command.ExecuteNonQuery(); + } + + using (SQLiteCommand command = connection.CreateCommand()) + { + command.CommandText = "SELECT * FROM t1;"; + + using (SQLiteDataReader dataReader = command.ExecuteReader()) + { + while (dataReader.Read()) + Console.WriteLine(dataReader[0].ToString()); + } + } + + connection.Close(); + } + } + } + + + + - This class contains static methods that are used to deal with native - UTF-8 string pointers to be used with the SQLite core library. + The instance containing the backing data + for the virtual table. - + - This is the maximum possible length for the native UTF-8 encoded - strings used with the SQLite core library. + Non-zero if different object instances with the same value should + generate different row identifiers, where applicable. This has no + effect on the .NET Compact Framework. - + - This is the object instance used to handle - conversions from/to UTF-8. + Constructs an instance of this class. + + The name of the module. This parameter cannot be null. + + + The instance to expose as a virtual + table. This parameter cannot be null. + - + - Converts the specified managed string into the UTF-8 encoding and - returns the array of bytes containing its representation in that - encoding. + Constructs an instance of this class. - - The managed string to convert. + + The name of the module. This parameter cannot be null. + + + The instance to expose as a virtual + table. This parameter cannot be null. + + + Non-zero if different object instances with the same value should + generate different row identifiers, where applicable. This + parameter has no effect on the .NET Compact Framework. - - The array of bytes containing the representation of the managed - string in the UTF-8 encoding or null upon failure. - - + - Converts the specified array of bytes representing a string in the - UTF-8 encoding and returns a managed string. + Sets the table error message to one that indicates the virtual + table cursor has no current row. - - The array of bytes to convert. + + The object instance. - The managed string or null upon failure. + The value of . - + - Probes a native pointer to a string in the UTF-8 encoding for its - terminating NUL character, within the specified length limit. + See the method. - - The native NUL-terminated string pointer. + + See the method. - - The maximum length of the native string, in bytes. + + See the method. + + + See the method. + + + See the method. + + + See the method. - The length of the native string, in bytes -OR- zero if the length - could not be determined. + See the method. - + - Converts the specified native NUL-terminated UTF-8 string pointer - into a managed string. + See the method. - - The native NUL-terminated UTF-8 string pointer. + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. - The managed string or null upon failure. + See the method. - + - Converts the specified native UTF-8 string pointer of the specified - length into a managed string. + See the method. - - The native UTF-8 string pointer. + + See the method. - - The length of the native string, in bytes. + + See the method. - The managed string or null upon failure. + See the method. - + - Converts the specified managed string into a native NUL-terminated - UTF-8 string pointer using memory obtained from the SQLite core - library. + See the method. - - The managed string to convert. + + See the method. - The native NUL-terminated UTF-8 string pointer or - upon failure. + See the method. - + - Converts a logical array of native NUL-terminated UTF-8 string - pointers into an array of managed strings. + See the method. - - The number of elements in the logical array of native - NUL-terminated UTF-8 string pointers. - - - The native pointer to the logical array of native NUL-terminated - UTF-8 string pointers to convert. + + See the method. - The array of managed strings or null upon failure. + See the method. - + - Converts an array of managed strings into an array of native - NUL-terminated UTF-8 string pointers. + See the method. - - The array of managed strings to convert. + + See the method. + + + See the method. - The array of native NUL-terminated UTF-8 string pointers or null - upon failure. + See the method. - + - This class contains static methods that are used to deal with native - pointers to memory blocks that logically contain arrays of bytes to be - used with the SQLite core library. + See the method. + + See the method. + + + See the method. + - + - Converts a native pointer to a logical array of bytes of the - specified length into a managed byte array. + See the method. - - The native pointer to the logical array of bytes to convert. + + See the method. - - The length, in bytes, of the logical array of bytes to convert. + + See the method. + + + See the method. + + + See the method. - The managed byte array or null upon failure. + See the method. - + - Converts a managed byte array into a native pointer to a logical - array of bytes. + See the method. - - The managed byte array to convert. + + See the method. - The native pointer to a logical byte array or null upon failure. + See the method. - + - This class contains static methods that are used to perform several - low-level data marshalling tasks between native and managed code. + See the method. + + See the method. + + + See the method. + - + - Returns a new object instance based on the - specified object instance and an integer - offset. + See the method. - - The object instance representing the base - memory location. + + See the method. - - The integer offset from the base memory location that the new - object instance should point to. + + See the method. + + + See the method. - The new object instance. + See the method. - + - Rounds up an integer size to the next multiple of the alignment. + See the method. - - The size, in bytes, to be rounded up. + + See the method. - - The required alignment for the return value. + + See the method. - The size, in bytes, rounded up to the next multiple of the - alignment. This value may end up being the same as the original - size. + See the method. - + - Determines the offset, in bytes, of the next structure member. + See the method. - - The offset, in bytes, of the current structure member. + + See the method. - - The size, in bytes, of the current structure member. + + See the method. - - The alignment, in bytes, of the next structure member. + + See the method. - The offset, in bytes, of the next structure member. + See the method. - + - Reads a value from the specified memory - location. + See the method. - - The object instance representing the base - memory location. + + See the method. - - The integer offset from the base memory location where the - value to be read is located. + + See the method. - The value at the specified memory location. + See the method. - + - Reads a value from the specified memory - location. + Throws an if this object + instance has been disposed. - - The object instance representing the base - memory location. - - - The integer offset from the base memory location where the - to be read is located. - - - The value at the specified memory location. - - + - Reads an value from the specified memory - location. + Disposes of this object instance. - - The object instance representing the base - memory location. - - - The integer offset from the base memory location where the - value to be read is located. + + Non-zero if this method is being called from the + method. Zero if this method is + being called from the finalizer. - - The value at the specified memory location. - - + - Writes an value to the specified memory - location. + This class represents a virtual table cursor to be used with the + class. It is not sealed and may + be used as the base class for any user-defined virtual table cursor + class that wraps an object instance. - - The object instance representing the base - memory location. - - - The integer offset from the base memory location where the - value to be written is located. - - - The value to write. - - + - Writes an value to the specified memory - location. + The instance provided when this + cursor was created. - - The object instance representing the base - memory location. - - - The integer offset from the base memory location where the - value to be written is located. - - - The value to write. - - + - Writes a value to the specified memory - location. + Constructs an instance of this class. - - The object instance representing the base - memory location. - - - The integer offset from the base memory location where the - value to be written is located. + + The object instance associated + with this object instance. - - The value to write. + + The instance to expose as a virtual + table cursor. - + + + Returns the value for the current row of the virtual table cursor + using the property of the + object instance. + + + + + Closes the virtual table cursor. This method must not throw any + exceptions. + + + + + Throws an if this object + instance has been disposed. + + + - Writes a value to the specified memory - location. + Disposes of this object instance. - - The object instance representing the base - memory location. - - - The integer offset from the base memory location where the - value to be written is located. - - - The value to write. + + Non-zero if this method is being called from the + method. Zero if this method is + being called from the finalizer. - + - Generates a hash code value for the object. + This class implements a virtual table module that exposes an + object instance as a read-only virtual + table. It is not sealed and may be used as the base class for any + user-defined virtual table class that wraps an + object instance. - - The object instance used to calculate the hash code. - - - Non-zero if different object instances with the same value should - generate different hash codes, where applicable. This parameter - has no effect on the .NET Compact Framework. - - - The hash code value -OR- zero if the object is null. - - + - This class represents a managed virtual table module implementation. - It is not sealed and must be used as the base class for any - user-defined virtual table module classes implemented in managed code. + The instance containing the backing + data for the virtual table. - + - The default version of the native sqlite3_module structure in use. + Constructs an instance of this class. + + The name of the module. This parameter cannot be null. + + + The instance to expose as a virtual + table. This parameter cannot be null. + - + - This field is used to store the native sqlite3_module structure - associated with this object instance. + See the method. + + See the method. + + + See the method. + + + See the method. + - + - This field is used to store the destructor delegate to be passed to - the SQLite core library via the sqlite3_create_disposable_module() - function. + See the method. + + See the method. + + + See the method. + + + See the method. + + + See the method. + - + - This field is used to store a pointer to the native sqlite3_module - structure returned by the sqlite3_create_disposable_module - function. + Throws an if this object + instance has been disposed. - + - This field is used to store the virtual table instances associated - with this module. The native pointer to the sqlite3_vtab derived - structure is used to key into this collection. + Disposes of this object instance. + + Non-zero if this method is being called from the + method. Zero if this method is + being called from the finalizer. + - + - This field is used to store the virtual table cursor instances - associated with this module. The native pointer to the - sqlite3_vtab_cursor derived structure is used to key into this - collection. + This class implements a virtual table module that does nothing by + providing "empty" implementations for all of the + interface methods. The result + codes returned by these "empty" method implementations may be + controlled on a per-method basis by using and/or overriding the + , + , + , + , and + methods from within derived classes. - + - This field is used to store the virtual table function instances - associated with this module. The case-insensitive function name - and the number of arguments (with -1 meaning "any") are used to - construct the string that is used to key into this collection. + This field is used to store the + values to return, on a per-method basis, for all methods that are + part of the interface. - + Constructs an instance of this class. @@ -10639,2901 +18136,2918 @@ The name of the module. This parameter cannot be null. - + - Calls the native SQLite core library in order to create a new - disposable module containing the implementation of a virtual table. + Determines the default value to be + returned by methods of the + interface that lack an overridden implementation in all classes + derived from the class. - - The native database connection pointer to use. - - Non-zero upon success. + The value that should be returned + by all interface methods unless + a more specific result code has been set for that interface method. - + - This method is called by the SQLite core library when the native - module associated with this object instance is being destroyed due - to its parent connection being closed. It may also be called by - the "vtshim" module if/when the sqlite3_dispose_module() function - is called. + Converts a value into a boolean + return value for use with the + method. - - The native user-data pointer associated with this module, as it was - provided to the SQLite core library when the native module instance - was created. + + The value to convert. - - - - Creates and returns the native sqlite_module structure using the - configured (or default) - interface implementation. - - The native sqlite_module structure using the configured (or - default) interface - implementation. + The value. - + - Creates and returns the native sqlite_module structure using the - specified interface - implementation. + Converts a value into a boolean + return value for use with the + method. - - The interface implementation to - use. + + The value to convert. - The native sqlite_module structure using the specified - interface implementation. + The value. - + - Creates a copy of the specified - object instance, - using default implementations for the contained delegates when - necessary. + Determines the value that should be + returned by the specified + interface method if it lack an overridden implementation. If no + specific value is available (or set) + for the specified method, the value + returned by the method will be + returned instead. - - The object - instance to copy. + + The name of the method. Currently, this method must be part of + the interface. - The new object - instance. + The value that should be returned + by the interface method. - + - Calls one of the virtual table initialization methods. + Sets the value that should be + returned by the specified + interface method if it lack an overridden implementation. - - Non-zero to call the - method; otherwise, the - method will be called. - - - The native database connection handle. - - - The original native pointer value that was provided to the - sqlite3_create_module(), sqlite3_create_module_v2() or - sqlite3_create_disposable_module() functions. - - - The number of arguments from the CREATE VIRTUAL TABLE statement. - - - The array of string arguments from the CREATE VIRTUAL TABLE - statement. - - - Upon success, this parameter must be modified to point to the newly - created native sqlite3_vtab derived structure. + + The name of the method. Currently, this method must be part of + the interface. - - Upon failure, this parameter must be modified to point to the error - message, with the underlying memory having been obtained from the - sqlite3_malloc() function. + + The value that should be returned + by the interface method. - A standard SQLite return code. + Non-zero upon success. - + - Calls one of the virtual table finalization methods. + See the method. - - Non-zero to call the - method; otherwise, the - method will be - called. + + See the method. - - The native pointer to the sqlite3_vtab derived structure. + + See the method. + + + See the method. + + + See the method. + + + See the method. - A standard SQLite return code. + See the method. - + - Arranges for the specified error message to be placed into the - zErrMsg field of a sqlite3_vtab derived structure, freeing the - existing error message, if any. + See the method. - - The object instance to be used. + + See the method. - - The native pointer to the sqlite3_vtab derived structure. + + See the method. - - Non-zero if this error message should also be logged using the - class. + + See the method. - - Non-zero if caught exceptions should be logged using the - class. + + See the method. - The error message. + See the method. - Non-zero upon success. + See the method. - + - Arranges for the specified error message to be placed into the - zErrMsg field of a sqlite3_vtab derived structure, freeing the - existing error message, if any. + See the method. - - The object instance to be used. - - The object instance used to - lookup the native pointer to the sqlite3_vtab derived structure. + See the method. - - Non-zero if this error message should also be logged using the - class. + + See the method. - - Non-zero if caught exceptions should be logged using the - class. + + See the method. + + + + + See the method. + + + See the method. - - The error message. + + See the method. + + + + + See the method. + + + See the method. - Non-zero upon success. + See the method. - + - Arranges for the specified error message to be placed into the - zErrMsg field of a sqlite3_vtab derived structure, freeing the - existing error message, if any. + See the method. - - The object instance to be used. - - - The native pointer to the sqlite3_vtab_cursor derived structure - used to get the native pointer to the sqlite3_vtab derived - structure. - - - Non-zero if this error message should also be logged using the - class. - - - Non-zero if caught exceptions should be logged using the - class. + + See the method. - - The error message. + + See the method. - Non-zero upon success. + See the method. - + - Arranges for the specified error message to be placed into the - zErrMsg field of a sqlite3_vtab derived structure, freeing the - existing error message, if any. + See the method. - - The object instance to be used. + + See the method. + + See the method. + + + + + See the method. + - The object instance used to - lookup the native pointer to the sqlite3_vtab derived structure. + See the method. - - Non-zero if this error message should also be logged using the - class. + + See the method. - - Non-zero if caught exceptions should be logged using the - class. + + See the method. - - The error message. + + See the method. - Non-zero upon success. + See the method. - + - Gets and returns the interface - implementation to be used when creating the native sqlite3_module - structure. Derived classes may override this method to supply an - alternate implementation for the - interface. + See the method. + + See the method. + - The interface implementation to - be used when populating the native sqlite3_module structure. If - the returned value is null, the private methods provided by the - class and relating to the - interface will be used to - create the necessary delegates. + See the method. - + - Creates and returns the - interface implementation corresponding to the current - object instance. + See the method. + + See the method. + - The interface implementation - corresponding to the current object - instance. + See the method. - + - Allocates a native sqlite3_vtab derived structure and returns a - native pointer to it. + See the method. + + See the method. + + + See the method. + + + See the method. + - A native pointer to a native sqlite3_vtab derived structure. + See the method. - + - Zeros out the fields of a native sqlite3_vtab derived structure. + See the method. - - The native pointer to the native sqlite3_vtab derived structure to - zero. + + See the method. + + + See the method. + + See the method. + - + - Frees a native sqlite3_vtab structure using the provided native - pointer to it. + See the method. - - A native pointer to a native sqlite3_vtab derived structure. + + See the method. + + + See the method. + + + See the method. + + See the method. + - + - Allocates a native sqlite3_vtab_cursor derived structure and - returns a native pointer to it. + See the method. + + See the method. + - A native pointer to a native sqlite3_vtab_cursor derived structure. + See the method. - + - Frees a native sqlite3_vtab_cursor structure using the provided - native pointer to it. + See the method. - - A native pointer to a native sqlite3_vtab_cursor derived structure. + + See the method. + + See the method. + - + - Reads and returns the native pointer to the sqlite3_vtab derived - structure based on the native pointer to the sqlite3_vtab_cursor - derived structure. + See the method. - - The object instance to be used. - - - The native pointer to the sqlite3_vtab_cursor derived structure - from which to read the native pointer to the sqlite3_vtab derived - structure. + + See the method. - The native pointer to the sqlite3_vtab derived structure -OR- - if it cannot be determined. + See the method. - + - Reads and returns the native pointer to the sqlite3_vtab derived - structure based on the native pointer to the sqlite3_vtab_cursor - derived structure. + See the method. - - The native pointer to the sqlite3_vtab_cursor derived structure - from which to read the native pointer to the sqlite3_vtab derived - structure. + + See the method. - The native pointer to the sqlite3_vtab derived structure -OR- - if it cannot be determined. + See the method. - + - Looks up and returns the object - instance based on the native pointer to the sqlite3_vtab derived - structure. + See the method. - - The native pointer to the sqlite3_vtab derived structure. + + See the method. + + + See the method. + + + See the method. + + + See the method. + + + See the method. - The object instance or null if - the corresponding one cannot be found. + See the method. - + - Allocates and returns a native pointer to a sqlite3_vtab derived - structure and creates an association between it and the specified - object instance. + See the method. - The object instance to be used - when creating the association. + See the method. + + + See the method. - The native pointer to a sqlite3_vtab derived structure or - if the method fails for any reason. + See the method. - + - Looks up and returns the - object instance based on the native pointer to the - sqlite3_vtab_cursor derived structure. + See the method. - - The native pointer to the sqlite3_vtab derived structure. + + See the method. - - The native pointer to the sqlite3_vtab_cursor derived structure. + + See the method. - The object instance or null - if the corresponding one cannot be found. + See the method. - + - Allocates and returns a native pointer to a sqlite3_vtab_cursor - derived structure and creates an association between it and the - specified object instance. + See the method. - - The object instance to be - used when creating the association. + + See the method. + + + See the method. - The native pointer to a sqlite3_vtab_cursor derived structure or - if the method fails for any reason. + See the method. - + - Deterimines the key that should be used to identify and store the - object instance for the virtual table - (i.e. to be returned via the - method). + See the method. - - The number of arguments to the virtual table function. - - - The name of the virtual table function. + + See the method. - - The object instance associated with - this virtual table function. + + See the method. - The string that should be used to identify and store the virtual - table function instance. This method cannot return null. If null - is returned from this method, the behavior is undefined. + See the method. - + + + Throws an if this object + instance has been disposed. + + + + + Disposes of this object instance. + + + Non-zero if this method is being called from the + method. Zero if this method is + being called from the finalizer. + + + + + This enumerated type represents a type of conflict seen when apply + changes from a change set or patch set. + + + + + This value is seen when processing a DELETE or UPDATE change if a + row with the required PRIMARY KEY fields is present in the + database, but one or more other (non primary-key) fields modified + by the update do not contain the expected "before" values. + + + + + This value is seen when processing a DELETE or UPDATE change if a + row with the required PRIMARY KEY fields is not present in the + database. There is no conflicting row in this case. + + The results of invoking the + + method are undefined. + + + + + This value is seen when processing an INSERT change if the + operation would result in duplicate primary key values. + The conflicting row in this case is the database row with the + matching primary key. + + + + + If a non-foreign key constraint violation occurs while applying a + change (i.e. a UNIQUE, CHECK or NOT NULL constraint), the conflict + callback will see this value. + + There is no conflicting row in this case. The results of invoking + the + method are undefined. + + + + + If foreign key handling is enabled, and applying a changes leaves + the database in a state containing foreign key violations, this + value will be seen exactly once before the changes are committed. + If the conflict handler + , the changes, + including those that caused the foreign key constraint violation, + are committed. Or, if it returns + , the changes are + rolled back. + + No current or conflicting row information is provided. The only + method it is possible to call on the supplied + object is + . + + + + + This enumerated type represents the result of a user-defined conflict + resolution callback. + + + + + If a conflict callback returns this value no special action is + taken. The change that caused the conflict is not applied. The + application of changes continues with the next change. + + + + + This value may only be returned from a conflict callback if the + type of conflict was + or . If this is + not the case, any changes applied so far are rolled back and the + call to + + will raise a with an error code of + . + + If this value is returned for a + conflict, then the + conflicting row is either updated or deleted, depending on the type + of change. + + If this value is returned for a + conflict, then + the conflicting row is removed from the database and a second + attempt to apply the change is made. If this second attempt fails, + the original row is restored to the database before continuing. + + + + + If this value is returned, any changes applied so far are rolled + back and the call to + + will raise a with an error code of + . + + + + + This enumerated type represents possible flags that may be passed + to the appropriate overloads of various change set creation methods. + + + + + No special handling. + + + + + Invert the change set while iterating through it. + This is equivalent to inverting a change set using + before + applying it. It is an error to specify this flag + with a patch set. + + + - Attempts to declare the schema for the virtual table using the - specified database connection. + This callback is invoked when a determination must be made about + whether changes to a specific table should be tracked -OR- applied. + It will not be called for tables that are already attached to a + . - - The object instance to use when - declaring the schema of the virtual table. This parameter may not - be null. - - - The string containing the CREATE TABLE statement that completely - describes the schema for the virtual table. This parameter may not - be null. + + The optional application-defined context data that was originally + passed to the or + + methods. This value may be null. - - Upon failure, this parameter must be modified to contain an error - message. + + The name of the table. - A standard SQLite return code. + Non-zero if changes to the table should be considered; otherwise, + zero. Throwing an exception from this callback will result in + undefined behavior. - + - Calls the native SQLite core library in order to declare a virtual - table function in response to a call into the - - or virtual table - methods. + This callback is invoked when there is a conflict while apply changes + to a database. - - The object instance to use when - declaring the schema of the virtual table. - - - The number of arguments to the function being declared. + + The optional application-defined context data that was originally + passed to the + + method. This value may be null. - - The name of the function being declared. + + The type of this conflict. - - Upon success, the contents of this parameter are undefined. Upon - failure, it should contain an appropriate error message. + + The object associated with + this conflict. This value may not be null; however, only properties + that are applicable to the conflict type will be available. Further + information on this is available within the descriptions of the + available values. - A standard SQLite return code. + A value that indicates the + action to be taken in order to resolve the conflict. Throwing an + exception from this callback will result in undefined behavior. - + - Arranges for the specified error message to be placed into the - zErrMsg field of a sqlite3_vtab derived structure, freeing the - existing error message, if any. + This interface contains methods used to manipulate a set of changes for + a database. + + + + + This method "inverts" the set of changes within this instance. + Applying an inverted set of changes to a database reverses the + effects of applying the uninverted changes. Specifically: + ]]>]]> + Each DELETE change is changed to an INSERT, and + ]]>]]> + Each INSERT change is changed to a DELETE, and + ]]>]]> + For each UPDATE change, the old.* and new.* values are exchanged. + ]]>]]> + This method does not change the order in which changes appear + within the set of changes. It merely reverses the sense of each + individual change. - - The native pointer to the sqlite3_vtab derived structure. - - - The error message. - - Non-zero upon success. + The new instance that represents + the resulting set of changes -OR- null if it is not available. - + - Arranges for the specified error message to be placed into the - zErrMsg field of a sqlite3_vtab derived structure, freeing the - existing error message, if any. + This method combines the specified set of changes with the ones + contained in this instance. - - The object instance used to - lookup the native pointer to the sqlite3_vtab derived structure. - - - The error message. + + The changes to be combined with those in this instance. - Non-zero upon success. + The new instance that represents + the resulting set of changes -OR- null if it is not available. - + - Arranges for the specified error message to be placed into the - zErrMsg field of a sqlite3_vtab derived structure, freeing the - existing error message, if any. + Attempts to apply the set of changes in this instance to the + associated database. - - The object instance used to - lookup the native pointer to the sqlite3_vtab derived structure. + + The delegate that will need + to handle any conflicting changes that may arise. - - The error message. + + The optional application-defined context data. This value may be + null. - - Non-zero upon success. - - + - Modifies the specified object instance - to contain the specified estimated cost. + Attempts to apply the set of changes in this instance to the + associated database. - - The object instance to modify. + + The delegate that will need + to handle any conflicting changes that may arise. - - The estimated cost value to use. Using a null value means that the - default value provided by the SQLite core library should be used. + + The optional delegate + that can be used to filter the list of tables impacted by the set + of changes. + + + The optional application-defined context data. This value may be + null. - - Non-zero upon success. - - + - Modifies the specified object instance - to contain the default estimated cost. + This interface contains methods used to manipulate multiple sets of + changes for a database. - - The object instance to modify. - - - Non-zero upon success. - - + - Modifies the specified object instance - to contain the specified estimated rows. + Attempts to add a change set (or patch set) to this change group + instance. The underlying data must be contained entirely within + the byte array. - - The object instance to modify. + + The raw byte data for the specified change set (or patch set). - - The estimated rows value to use. Using a null value means that the - default value provided by the SQLite core library should be used. - - - Non-zero upon success. - - + - Modifies the specified object instance - to contain the default estimated rows. + Attempts to add a change set (or patch set) to this change group + instance. The underlying data will be read from the specified + . - - The object instance to modify. + + The instance containing the raw change set + (or patch set) data to read. - - Non-zero upon success. - - + - See the method. + Attempts to create and return, via , the + combined set of changes represented by this change group instance. - - See the method. - - - See the method. - - - See the method. - - - See the method. - - - See the method. - - - See the method. + + Upon success, this will contain the raw byte data for all the + changes in this change group instance. - - See the method. - - + - See the method. + Attempts to create and write, via , the + combined set of changes represented by this change group instance. - - See the method. - - - See the method. - - - See the method. - - - See the method. - - - See the method. + + Upon success, the raw byte data for all the changes in this change + group instance will be written to this . - - See the method. + + + + This interface contains properties and methods used to fetch metadata + about one change within a set of changes for a database. + + + + + The name of the table the change was made to. + + + + + The number of columns impacted by this change. This value can be + used to determine the highest valid column index that may be used + with the , , + and methods of this interface. It + will be this value minus one. + + + + + This will contain the value + , + , or + , corresponding to + the overall type of change this item represents. + + + + + Non-zero if this change is considered to be indirect (i.e. as + though they were made via a trigger or foreign key action). + + + + + This array contains a for each column in + the table associated with this change. The element will be zero + if the column is not part of the primary key; otherwise, it will + be non-zero. + + + + + This method may only be called from within a + delegate when the conflict + type is . It + returns the total number of known foreign key violations in the + destination database. + + + + + Queries and returns the original value of a given column for this + change. This method may only be called when the + has a value of + or + . + + + The index for the column. This value must be between zero and one + less than the total number of columns for this table. - See the method. + The original value of a given column for this change. - + - See the method. + Queries and returns the updated value of a given column for this + change. This method may only be called when the + has a value of + or + . - - See the method. - - - See the method. + + The index for the column. This value must be between zero and one + less than the total number of columns for this table. - See the method. + The updated value of a given column for this change. - + - See the method. + Queries and returns the conflicting value of a given column for + this change. This method may only be called from within a + delegate when the conflict + type is or + . - - See the method. + + The index for the column. This value must be between zero and one + less than the total number of columns for this table. - See the method. + The conflicting value of a given column for this change. - + - See the method. + This interface contains methods to query and manipulate the state of a + change tracking session for a database. + + + + + Determines if this session is currently tracking changes to its + associated database. - - See the method. - - See the method. + Non-zero if changes to the associated database are being trakced; + otherwise, zero. - + - See the method. + Enables tracking of changes to the associated database. + + + + + Disables tracking of changes to the associated database. + + + + + Determines if this session is currently set to mark changes as + indirect (i.e. as though they were made via a trigger or foreign + key action). - - See the method. - - - See the method. - - See the method. + Non-zero if changes to the associated database are being marked as + indirect; otherwise, zero. - + - See the method. + Sets the indirect flag for this session. Subsequent changes will + be marked as indirect until this flag is changed again. + + + + + Clears the indirect flag for this session. Subsequent changes will + be marked as direct until this flag is changed again. + + + + + Determines if there are any tracked changes currently within the + data for this session. - - See the method. - - See the method. + Non-zero if there are no changes within the data for this session; + otherwise, zero. - + - See the method. + Upon success, causes changes to the specified table(s) to start + being tracked. Any tables impacted by calls to this method will + not cause the callback + to be invoked. - - See the method. - - - See the method. - - - See the method. + + The name of the table to be tracked -OR- null to track all + applicable tables within this database. - - See the method. + + + + This method is used to set the table filter for this instance. + + + The table filter callback -OR- null to clear any existing table + filter callback. - - See the method. + + The optional application-defined context data. This value may be + null. - - See the method. - - + - See the method. + Attempts to create and return, via , the + combined set of changes represented by this session instance. - - See the method. + + Upon success, this will contain the raw byte data for all the + changes in this session instance. - - See the method. - - + - See the method. + Attempts to create and write, via , the + combined set of changes represented by this session instance. - - See the method. + + Upon success, the raw byte data for all the changes in this session + instance will be written to this . - - See the method. - - + - See the method. + Attempts to create and return, via , the + combined set of changes represented by this session instance as a + patch set. - - See the method. - - - See the method. + + Upon success, this will contain the raw byte data for all the + changes in this session instance. - - See the method. + + + + Attempts to create and write, via , the + combined set of changes represented by this session instance as a + patch set. + + + Upon success, the raw byte data for all the changes in this session + instance will be written to this . - - See the method. - - + - See the method. + This method loads the differences between two tables [with the same + name, set of columns, and primary key definition] into this session + instance. - - See the method. + + The name of the database containing the table with the original + data (i.e. it will need updating in order to be identical to the + one within the database associated with this session instance). - - See the method. + + The name of the table. - - See the method. - - + - See the method. + This class contains some static helper methods for use within this + subsystem. - - See the method. + + + + This method checks the byte array specified by the caller to make + sure it will be usable. + + + A byte array provided by the caller into one of the public methods + for the classes that belong to this subsystem. This value cannot + be null or represent an empty array; otherwise, an appropriate + exception will be thrown. - - See the method. + + + + This class is used to hold the native connection handle associated with + a open until this subsystem is totally + done with it. This class is for internal use by this subsystem only. + + + + + The SQL statement used when creating the native statement handle. + There are no special requirements for this other than counting as + an "open statement handle". + + + + + The format of the error message used when reporting, during object + disposal, that the statement handle is still open (i.e. because + this situation is considered a fairly serious programming error). + + + + + The wrapped native connection handle associated with this lock. + + + + + The flags associated with the connection represented by the + value. + + + + + The native statement handle for this lock. The garbage collector + cannot cause this statement to be finalized; therefore, it will + serve to hold the associated native connection open until it is + freed manually using the method. + + + + + Constructs a new instance of this class using the specified wrapped + native connection handle and associated flags. + + + The wrapped native connection handle to be associated with this + lock. - - See the method. + + The flags associated with the connection represented by the + value. - - See the method. + + Non-zero if the method should be called prior + to returning from this constructor. + + + + Queries and returns the wrapped native connection handle for this + instance. + - See the method. + The wrapped native connection handle for this instance -OR- null + if it is unavailable. - + - See the method. + Queries and returns the flags associated with the connection for + this instance. - - See the method. - - See the method. + The value. There is no return + value reserved to indicate an error. - + - See the method. + Queries and returns the native connection handle for this instance. - - See the method. - - See the method. + The native connection handle for this instance. If this value is + unavailable or invalid an exception will be thrown. - + - See the method. + This method attempts to "lock" the associated native connection + handle by preparing a SQL statement that will not be finalized + until the method is called (i.e. and which + cannot be done by the garbage collector). If the statement is + already prepared, nothing is done. If the statement cannot be + prepared for any reason, an exception will be thrown. - - See the method. - - - See the method. - - + - See the method. + This method attempts to "unlock" the associated native connection + handle by finalizing the previously prepared statement. If the + statement is already finalized, nothing is done. If the statement + cannot be finalized for any reason, an exception will be thrown. - - See the method. - - - See the method. - - + - See the method. + Disposes of this object instance. - - See the method. - - - See the method. - - - See the method. - - - See the method. - - - See the method. - - - See the method. - - + - See the method. + Non-zero if this object instance has been disposed. - - See the method. - - - See the method. - - - See the method. - - + - See the method. + Throws an exception if this object instance has been disposed. - - See the method. - - - See the method. - - - See the method. - - + - See the method. + Disposes or finalizes this object instance. - - See the method. - - - See the method. + + Non-zero if this object is being disposed; otherwise, this object + is being finalized. - - See the method. - - + - See the method. + Finalizes this object instance. - - See the method. - - - See the method. - - - See the method. - - + - This method is called in response to the - method. + This class manages the native change set iterator. It is used as the + base class for the and + classes. It knows how to + advance the native iterator handle as well as finalize it. - - The object instance associated with - the virtual table. - - - The native user-data pointer associated with this module, as it was - provided to the SQLite core library when the native module instance - was created. - - - The module name, database name, virtual table name, and all other - arguments passed to the CREATE VIRTUAL TABLE statement. - - - Upon success, this parameter must be modified to contain the - object instance associated with - the virtual table. - - - Upon failure, this parameter must be modified to contain an error - message. - - - A standard SQLite return code. - - + - This method is called in response to the - method. + The native change set (a.k.a. iterator) handle. - - The object instance associated with - the virtual table. - - - The native user-data pointer associated with this module, as it was - provided to the SQLite core library when the native module instance - was created. - - - The module name, database name, virtual table name, and all other - arguments passed to the CREATE VIRTUAL TABLE statement. - - - Upon success, this parameter must be modified to contain the - object instance associated with - the virtual table. - - - Upon failure, this parameter must be modified to contain an error - message. - - - A standard SQLite return code. - - + - This method is called in response to the - method. + Non-zero if this instance owns the native iterator handle in the + field. In that case, this instance will + finalize the native iterator handle upon being disposed or + finalized. - - The object instance associated - with this virtual table. + + + + Constructs a new instance of this class using the specified native + iterator handle. + + + The native iterator handle to use. - - The object instance containing all the - data for the inputs and outputs relating to index selection. + + Non-zero if this instance is to take ownership of the native + iterator handle specified by . - - A standard SQLite return code. - - + - This method is called in response to the - method. + Throws an exception if the native iterator handle is invalid. - - The object instance associated - with this virtual table. - - - A standard SQLite return code. - - + - This method is called in response to the - method. + Used to query the native iterator handle. This method is only used + by the class. - - The object instance associated - with this virtual table. - - A standard SQLite return code. + The native iterator handle -OR- if it + is not available. - + - This method is called in response to the - method. + Attempts to advance the native iterator handle to its next item. - - The object instance associated - with this virtual table. - - - Upon success, this parameter must be modified to contain the - object instance associated - with the newly opened virtual table cursor. - - A standard SQLite return code. + Non-zero if the native iterator handle was advanced and contains + more data; otherwise, zero. If the underlying native API returns + an unexpected value then an exception will be thrown. - + - This method is called in response to the - method. + Attempts to create an instance of this class that is associated + with the specified native iterator handle. Ownership of the + native iterator handle is NOT transferred to the new instance of + this class. - - The object instance - associated with the previously opened virtual table cursor to be - used. + + The native iterator handle to use. - A standard SQLite return code. + The new instance of this class. No return value is reserved to + indicate an error; however, if the native iterator handle is not + valid, any subsequent attempt to make use of it via the returned + instance of this class may throw exceptions. - + - This method is called in response to the - method. + Disposes of this object instance. - - The object instance - associated with the previously opened virtual table cursor to be - used. - - - Number used to help identify the selected index. - - - String used to help identify the selected index. - - - The values corresponding to each column in the selected index. - - - A standard SQLite return code. - - + - This method is called in response to the - method. + Non-zero if this object instance has been disposed. - - The object instance - associated with the previously opened virtual table cursor to be - used. - - - A standard SQLite return code. - - + - This method is called in response to the - method. + Throws an exception if this object instance has been disposed. - - The object instance - associated with the previously opened virtual table cursor to be - used. + + + + Disposes or finalizes this object instance. + + + Non-zero if this object is being disposed; otherwise, this object + is being finalized. - - Non-zero if no more rows are available; zero otherwise. - - + - This method is called in response to the - method. + Finalizes this object instance. - - The object instance - associated with the previously opened virtual table cursor to be - used. + + + + This class manages the native change set iterator for a set of changes + contained entirely in memory. + + + + + The native memory buffer allocated to contain the set of changes + associated with this instance. This will always be freed when this + instance is disposed or finalized. + + + + + Constructs an instance of this class using the specified native + memory buffer and native iterator handle. + + + The native memory buffer to use. - - The object instance to be used for - returning the specified column value to the SQLite core library. + + The native iterator handle to use. - - The zero-based index corresponding to the column containing the - value to be returned. + + Non-zero if this instance is to take ownership of the native + iterator handle specified by . - - A standard SQLite return code. - - + - This method is called in response to the - method. + Attempts to create an instance of this class using the specified + raw byte data. - - The object instance - associated with the previously opened virtual table cursor to be - used. - - - Upon success, this parameter must be modified to contain the unique - integer row identifier for the current row for the specified cursor. + + The raw byte data containing the set of changes for this native + iterator. - A standard SQLite return code. + The new instance of this class -OR- null if it cannot be created. - + - This method is called in response to the - method. + Attempts to create an instance of this class using the specified + raw byte data. - - The object instance associated - with this virtual table. - - - The array of object instances containing - the new or modified column values, if any. + + The raw byte data containing the set of changes for this native + iterator. - - Upon success, this parameter must be modified to contain the unique - integer row identifier for the row that was inserted, if any. + + The flags used to create the change set iterator. - A standard SQLite return code. + The new instance of this class -OR- null if it cannot be created. - + + + Non-zero if this object instance has been disposed. + + + + + Throws an exception if this object instance has been disposed. + + + + + Disposes or finalizes this object instance. + + + Non-zero if this object is being disposed; otherwise, this object + is being finalized. + + + + + This class manages the native change set iterator for a set of changes + backed by a instance. + + + + + The instance that is managing + the underlying used as the backing store for + the set of changes associated with this native change set iterator. + + + - This method is called in response to the - method. + Constructs an instance of this class using the specified native + iterator handle and . - - The object instance associated - with this virtual table. + + The instance to use. + + + The native iterator handle to use. + + + Non-zero if this instance is to take ownership of the native + iterator handle specified by . - - A standard SQLite return code. - - + - This method is called in response to the - method. + Attempts to create an instance of this class using the specified + . - - The object instance associated - with this virtual table. + + The where the raw byte data for the set of + changes may be read. + + + The flags associated with the parent connection. - A standard SQLite return code. + The new instance of this class -OR- null if it cannot be created. - + - This method is called in response to the - method. + Attempts to create an instance of this class using the specified + . - - The object instance associated - with this virtual table. + + The where the raw byte data for the set of + changes may be read. + + + The flags associated with the parent connection. + + + The flags used to create the change set iterator. - A standard SQLite return code. + The new instance of this class -OR- null if it cannot be created. - + - This method is called in response to the - method. + Non-zero if this object instance has been disposed. - - The object instance associated - with this virtual table. - - - A standard SQLite return code. - - + - This method is called in response to the - method. + Throws an exception if this object instance has been disposed. - - The object instance associated - with this virtual table. - - - The number of arguments to the function being sought. - - - The name of the function being sought. + + + + Disposes or finalizes this object instance. + + + Non-zero if this object is being disposed; otherwise, this object + is being finalized. - - Upon success, this parameter must be modified to contain the - object instance responsible for - implementing the specified function. + + + + This class is used to act as a bridge between a + instance and the delegates used with the native streaming API. + + + + + The managed stream instance used to in order to service the native + delegates for both input and output. + + + + + The flags associated with the connection. + + + + + The delegate used to provide input to the native streaming API. + It will be null -OR- point to the method. + + + + + The delegate used to provide output to the native streaming API. + It will be null -OR- point to the method. + + + + + Constructs a new instance of this class using the specified managed + stream and connection flags. + + + The managed stream instance to be used in order to service the + native delegates for both input and output. - - Upon success, this parameter must be modified to contain the - native user-data pointer associated with - . + + The flags associated with the parent connection. + + + + Queries and returns the flags associated with the connection for + this instance. + - Non-zero if the specified function was found; zero otherwise. + The value. There is no return + value reserved to indicate an error. - + - This method is called in response to the - method. + Returns a delegate that wraps the method, + creating it first if necessary. - - The object instance associated - with this virtual table. - - - The new name for the virtual table. - - A standard SQLite return code. + A delegate that refers to the method. - + - This method is called in response to the - method. + Returns a delegate that wraps the method, + creating it first if necessary. - - The object instance associated - with this virtual table. - - - This is an integer identifier under which the the current state of - the virtual table should be saved. - - A standard SQLite return code. + A delegate that refers to the method. - + - This method is called in response to the - method. + This method attempts to read bytes from + the managed stream, writing them to the + buffer. - - The object instance associated - with this virtual table. + + Optional extra context information. Currently, this will always + have a value of . - - This is an integer used to indicate that any saved states with an - identifier greater than or equal to this should be deleted by the - virtual table. + + A preallocated native buffer to receive the requested input bytes. + It must be at least bytes in size. + + + Upon entry, the number of bytes to read. Upon exit, the number of + bytes actually read. This value may be zero upon exit. - A standard SQLite return code. + The value upon success -OR- an + appropriate error code upon failure. - + - This method is called in response to the - method. + This method attempts to write bytes to + the managed stream, reading them from the + buffer. - - The object instance associated - with this virtual table. + + Optional extra context information. Currently, this will always + have a value of . - - This is an integer identifier used to specify a specific saved - state for the virtual table for it to restore itself back to, which - should also have the effect of deleting all saved states with an - integer identifier greater than this one. + + A preallocated native buffer containing the requested output + bytes. It must be at least bytes in + size. + + + The number of bytes to write. - A standard SQLite return code. + The value upon success -OR- an + appropriate error code upon failure. - + Disposes of this object instance. - + - Throws an if this object - instance has been disposed. + Non-zero if this object instance has been disposed. - + - Disposes of this object instance. + Throws an exception if this object instance has been disposed. + + + + + Disposes or finalizes this object instance. - Non-zero if this method is being called from the - method. Zero if this method is being - called from the finalizer. + Non-zero if this object is being disposed; otherwise, this object + is being finalized. - + Finalizes this object instance. - + - Returns or sets a boolean value indicating whether virtual table - errors should be logged using the class. + This class manages a collection of + instances. When used, it takes responsibility for creating, returning, + and disposing of its instances. - + - Returns or sets a boolean value indicating whether exceptions - caught in the - method, - the method, - the method, - the method, - and the method should be logged using the - class. + The managed collection of + instances, keyed by their associated + instance. - + - Returns or sets a boolean value indicating whether virtual table - errors should be logged using the class. + The flags associated with the connection. - + - Returns or sets a boolean value indicating whether exceptions - caught in the - method, - method, and the - method should be logged using the - class. + Constructs a new instance of this class using the specified + connection flags. + + The flags associated with the parent connection. + - + - Returns non-zero if the schema for the virtual table has been - declared. + Makes sure the collection of + is created. - + - Returns the name of the module as it was registered with the SQLite - core library. + Makes sure the collection of + is disposed. - + - This class implements the - interface by forwarding those method calls to the - object instance it contains. If the - contained object instance is null, all - the methods simply generate an - error. + Attempts to return a instance + suitable for the specified . + + The instance. If this value is null, a null + value will be returned. + + + A instance. Typically, these + are always freshly created; however, this method is designed to + return the existing instance + associated with the specified stream, should one exist. + - + - This is the value that is always used for the "logErrors" - parameter to the various static error handling methods provided - by the class. + Disposes of this object instance. - + - This is the value that is always used for the "logExceptions" - parameter to the various static error handling methods provided - by the class. + Non-zero if this object instance has been disposed. - + - This is the error message text used when the contained - object instance is not available - for any reason. + Throws an exception if this object instance has been disposed. - + - The object instance used to provide - an implementation of the - interface. + Disposes or finalizes this object instance. + + Non-zero if this object is being disposed; otherwise, this object + is being finalized. + - + - Constructs an instance of this class. + Finalizes this object instance. - - The object instance used to provide - an implementation of the - interface. - - + - Sets the table error message to one that indicates the native - module implementation is not available. + This class represents a group of change sets (or patch sets). - - The native pointer to the sqlite3_vtab derived structure. - - - The value of . - - + - Sets the table error message to one that indicates the native - module implementation is not available. + The instance associated + with this change group. - - The native pointer to the sqlite3_vtab_cursor derived - structure. - - - The value of . - - + - See the method. + The flags associated with the connection. - - See the method. - - - See the method. - - - See the method. - - - See the method. - - - See the method. + + + + The native handle for this change group. This will be deleted when + this instance is disposed or finalized. + + + + + Constructs a new instance of this class using the specified + connection flags. + + + The flags associated with the parent connection. - - See the method. + + + + Throws an exception if the native change group handle is invalid. + + + + + Makes sure the native change group handle is valid, creating it if + necessary. + + + + + Makes sure the instance + is available, creating it if necessary. + + + + + Attempts to return a instance + suitable for the specified . + + + The instance. If this value is null, a null + value will be returned. - See the method. + A instance. Typically, these + are always freshly created; however, this method is designed to + return the existing instance + associated with the specified stream, should one exist. - + - See the method. + Attempts to add a change set (or patch set) to this change group + instance. The underlying data must be contained entirely within + the byte array. - - See the method. + + The raw byte data for the specified change set (or patch set). - - See the method. - - - See the method. - - - See the method. - - - See the method. - - - See the method. - - - See the method. - - + - See the method. + Attempts to add a change set (or patch set) to this change group + instance. The underlying data will be read from the specified + . - - See the method. + + The instance containing the raw change set + (or patch set) data to read. - - See the method. + + + + Attempts to create and return, via , the + combined set of changes represented by this change group instance. + + + Upon success, this will contain the raw byte data for all the + changes in this change group instance. - - See the method. - - + - See the method. + Attempts to create and write, via , the + combined set of changes represented by this change group instance. - - See the method. + + Upon success, the raw byte data for all the changes in this change + group instance will be written to this . - - See the method. - - + + + Disposes of this object instance. + + + + + Non-zero if this object instance has been disposed. + + + - See the method. + Throws an exception if this object instance has been disposed. - - See the method. - - - See the method. - - + - See the method. + Disposes or finalizes this object instance. - - See the method. - - - See the method. + + Non-zero if this object is being disposed; otherwise, this object + is being finalized. - - See the method. - - + - See the method. + Finalizes this object instance. - - See the method. - - - See the method. - - + - See the method. + This class represents the change tracking session associated with a + database. - - See the method. - - - See the method. - - - See the method. - - - See the method. - - - See the method. - - - See the method. - - + - See the method. + The instance associated + with this session. - - See the method. - - - See the method. - - + - See the method. + The name of the database (e.g. "main") for this session. - - See the method. - - - See the method. - - + - See the method. + The native handle for this session. This will be deleted when + this instance is disposed or finalized. - - See the method. - - - See the method. - - - See the method. - - - See the method. - - + - See the method. + The delegate used to provide table filtering to the native API. + It will be null -OR- point to the method. - - See the method. - - - See the method. - - - See the method. - - + - See the method. + The managed callback used to filter tables for this session. Set + via the method. - - See the method. - - - See the method. - - - See the method. - - - See the method. - - - See the method. - - + - See the method. + The optional application-defined context data that was passed to + the method. This value may be null. - - See the method. - - - See the method. - - + - See the method. + Constructs a new instance of this class using the specified wrapped + native connection handle and associated flags. - - See the method. + + The wrapped native connection handle to be associated with this + session. + + + The flags associated with the connection represented by the + value. + + + The name of the database (e.g. "main") for this session. - - See the method. - - + - See the method. + Throws an exception if the native session handle is invalid. - - See the method. - - - See the method. - - + - See the method. + Makes sure the native session handle is valid, creating it if + necessary. - - See the method. - - - See the method. - - + - See the method. + This method sets up the internal table filtering associated state + of this instance. - - See the method. - - - See the method. - - - See the method. - - See the method. + The table filter callback -OR- null to clear any existing table + filter callback. - - See the method. + + The optional application-defined context data. This value may be + null. - See the method. + The native + delegate -OR- null to clear any existing table filter. - + - See the method. + Makes sure the instance + is available, creating it if necessary. - - See the method. - - - See the method. - - - See the method. - - + - See the method. + Attempts to return a instance + suitable for the specified . - - See the method. - - - See the method. + + The instance. If this value is null, a null + value will be returned. - See the method. + A instance. Typically, these + are always freshly created; however, this method is designed to + return the existing instance + associated with the specified stream, should one exist. - + - See the method. + This method is called when determining if a table needs to be + included in the tracked changes for the associated database. - - See the method. + + Optional extra context information. Currently, this will always + have a value of . - - See the method. + + The native pointer to the name of the table. - See the method. + Non-zero if changes to the specified table should be considered; + otherwise, zero. - + - See the method. + Determines if this session is currently tracking changes to its + associated database. - - See the method. - - - See the method. - - See the method. + Non-zero if changes to the associated database are being trakced; + otherwise, zero. - - - Disposes of this object instance. - - - - - Throws an if this object - instance has been disposed. - - - - - Disposes of this object instance. - - - Non-zero if this method is being called from the - method. Zero if this method is being - called from the finalizer. - - - + - Finalizes this object instance. + Enables tracking of changes to the associated database. - + - This class represents a virtual table cursor to be used with the - class. It is not sealed and may - be used as the base class for any user-defined virtual table cursor - class that wraps an object instance. + Disables tracking of changes to the associated database. - + - The instance provided when this cursor - was created. + Determines if this session is currently set to mark changes as + indirect (i.e. as though they were made via a trigger or foreign + key action). + + Non-zero if changes to the associated database are being marked as + indirect; otherwise, zero. + - + - This value will be non-zero if false has been returned from the - method. + Sets the indirect flag for this session. Subsequent changes will + be marked as indirect until this flag is changed again. - + - Constructs an instance of this class. + Clears the indirect flag for this session. Subsequent changes will + be marked as direct until this flag is changed again. - - The object instance associated - with this object instance. - - - The instance to expose as a virtual - table cursor. - - + - Advances to the next row of the virtual table cursor using the - method of the - object instance. + Determines if there are any tracked changes currently within the + data for this session. - Non-zero if the current row is valid; zero otherwise. If zero is - returned, no further rows are available. + Non-zero if there are no changes within the data for this session; + otherwise, zero. - - - Resets the virtual table cursor position, also invalidating the - current row, using the method of - the object instance. - - - + - Closes the virtual table cursor. This method must not throw any - exceptions. + Upon success, causes changes to the specified table(s) to start + being tracked. Any tables impacted by calls to this method will + not cause the callback + to be invoked. + + The name of the table to be tracked -OR- null to track all + applicable tables within this database. + - + - Throws an if the virtual - table cursor has been closed. + This method is used to set the table filter for this instance. + + The table filter callback -OR- null to clear any existing table + filter callback. + + + The optional application-defined context data. This value may be + null. + - + - Throws an if this object - instance has been disposed. + Attempts to create and return, via , the + set of changes represented by this session instance. + + Upon success, this will contain the raw byte data for all the + changes in this session instance. + - + - Disposes of this object instance. + Attempts to create and write, via , the + set of changes represented by this session instance. - - Non-zero if this method is being called from the - method. Zero if this method is - being called from the finalizer. + + Upon success, the raw byte data for all the changes in this session + instance will be written to this . - + - Returns the value for the current row of the virtual table cursor - using the property of the - object instance. + Attempts to create and return, via , the + set of changes represented by this session instance as a patch set. + + Upon success, this will contain the raw byte data for all the + changes in this session instance. + - + - Returns non-zero if the end of the virtual table cursor has been - seen (i.e. no more rows are available, including the current one). + Attempts to create and write, via , the + set of changes represented by this session instance as a patch set. + + Upon success, the raw byte data for all the changes in this session + instance will be written to this . + - + - Returns non-zero if the virtual table cursor is open. + This method loads the differences between two tables [with the same + name, set of columns, and primary key definition] into this session + instance. + + The name of the database containing the table with the original + data (i.e. it will need updating in order to be identical to the + one within the database associated with this session instance). + + + The name of the table. + - - - This class implements a virtual table module that exposes an - object instance as a read-only virtual - table. It is not sealed and may be used as the base class for any - user-defined virtual table class that wraps an - object instance. The following short - example shows it being used to treat an array of strings as a table - data source: - - public static class Sample - { - public static void Main() - { - using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=:memory:;")) - { - connection.Open(); - - connection.CreateModule(new SQLiteModuleEnumerable( - "sampleModule", new string[] { "one", "two", "three" })); - - using (SQLiteCommand command = connection.CreateCommand()) - { - command.CommandText = - "CREATE VIRTUAL TABLE t1 USING sampleModule;"; - - command.ExecuteNonQuery(); - } - - using (SQLiteCommand command = connection.CreateCommand()) - { - command.CommandText = "SELECT * FROM t1;"; - - using (SQLiteDataReader dataReader = command.ExecuteReader()) - { - while (dataReader.Read()) - Console.WriteLine(dataReader[0].ToString()); - } - } - - connection.Close(); - } - } - } - - - - + - This class implements a virtual table module that does nothing by - providing "empty" implementations for all of the - interface methods. The result - codes returned by these "empty" method implementations may be - controlled on a per-method basis by using and/or overriding the - , - , - , - , and - methods from within derived classes. + Non-zero if this object instance has been disposed. - + - This field is used to store the - values to return, on a per-method basis, for all methods that are - part of the interface. + Throws an exception if this object instance has been disposed. - + - Constructs an instance of this class. + Disposes or finalizes this object instance. - - The name of the module. This parameter cannot be null. + + Non-zero if this object is being disposed; otherwise, this object + is being finalized. - + - Determines the default value to be - returned by methods of the - interface that lack an overridden implementation in all classes - derived from the class. + This class represents the abstract concept of a set of changes. It + acts as the base class for the + and classes. It derives from + the class, which is used to hold + the underlying native connection handle open until the instances of + this class are disposed or finalized. It also provides the ability + to construct wrapped native delegates of the + and + types. - - The value that should be returned - by all interface methods unless - a more specific result code has been set for that interface method. - - + - Converts a value into a boolean - return value for use with the - method. + Constructs an instance of this class using the specified wrapped + native connection handle. - - The value to convert. + + The wrapped native connection handle to be associated with this + change set. + + + The flags associated with the connection represented by the + value. - - The value. - - + - Converts a value into a boolean - return value for use with the - method. + Creates and returns a concrete implementation of the + interface. - - The value to convert. + + The native iterator handle to use. - The value. + An instance of the + interface, which can be used to fetch metadata associated with + the current item in this set of changes. - + - Determines the value that should be - returned by the specified - interface method if it lack an overridden implementation. If no - specific value is available (or set) - for the specified method, the value - returned by the method will be - returned instead. + Attempts to create a + native delegate + that invokes the specified + delegate. - - The name of the method. Currently, this method must be part of - the interface. + + The to invoke when the + native delegate + is called. If this value is null then null is returned. + + + The optional application-defined context data. This value may be + null. - The value that should be returned - by the interface method. + The created + native delegate -OR- null if it cannot be created. - + - Sets the value that should be - returned by the specified - interface method if it lack an overridden implementation. + Attempts to create a + native delegate + that invokes the specified + delegate. - - The name of the method. Currently, this method must be part of - the interface. + + The to invoke when the + native delegate + is called. If this value is null then null is returned. - - The value that should be returned - by the interface method. + + The optional application-defined context data. This value may be + null. - Non-zero upon success. + The created + native delegate -OR- null if it cannot be created. - + - See the method. + Non-zero if this object instance has been disposed. - - See the method. - - - See the method. + + + + Throws an exception if this object instance has been disposed. + + + + + Disposes or finalizes this object instance. + + + Non-zero if this object is being disposed; otherwise, this object + is being finalized. - - See the method. + + + + This class represents a set of changes contained entirely in memory. + + + + + The raw byte data for this set of changes. Since this data must + be marshalled to a native memory buffer before being used, there + must be enough memory available to store at least two times the + amount of data contained within it. + + + + + The flags used to create the change set iterator. + + + + + Constructs an instance of this class using the specified raw byte + data and wrapped native connection handle. + + + The raw byte data for the specified change set (or patch set). - - See the method. + + The wrapped native connection handle to be associated with this + set of changes. - - See the method. + + The flags associated with the connection represented by the + value. - - See the method. - - + - See the method. + Constructs an instance of this class using the specified raw byte + data and wrapped native connection handle. - - See the method. - - - See the method. + + The raw byte data for the specified change set (or patch set). - - See the method. + + The wrapped native connection handle to be associated with this + set of changes. - - See the method. + + The flags associated with the connection represented by the + value. - - See the method. + + The flags used to create the change set iterator. - - See the method. - - + - See the method. + This method "inverts" the set of changes within this instance. + Applying an inverted set of changes to a database reverses the + effects of applying the uninverted changes. Specifically: + ]]>]]> + Each DELETE change is changed to an INSERT, and + ]]>]]> + Each INSERT change is changed to a DELETE, and + ]]>]]> + For each UPDATE change, the old.* and new.* values are exchanged. + ]]>]]> + This method does not change the order in which changes appear + within the set of changes. It merely reverses the sense of each + individual change. - - See the method. - - - See the method. - - See the method. + The new instance that represents + the resulting set of changes. - + - See the method. + This method combines the specified set of changes with the ones + contained in this instance. - - See the method. + + The changes to be combined with those in this instance. - See the method. + The new instance that represents + the resulting set of changes. - + - See the method. + Attempts to apply the set of changes in this instance to the + associated database. - - See the method. + + The delegate that will need + to handle any conflicting changes that may arise. + + + The optional application-defined context data. This value may be + null. - - See the method. - - + - See the method. + Attempts to apply the set of changes in this instance to the + associated database. - - See the method. + + The delegate that will need + to handle any conflicting changes that may arise. - - See the method. + + The optional delegate + that can be used to filter the list of tables impacted by the set + of changes. + + + The optional application-defined context data. This value may be + null. - - See the method. - - + - See the method. + Creates an capable of iterating over the + items within this set of changes. - - See the method. - - See the method. + The new + instance. - + - See the method. + Creates an capable of iterating over the + items within this set of changes. - - See the method. - - - See the method. - - - See the method. - - - See the method. - - See the method. + The new instance. - + - See the method. + Non-zero if this object instance has been disposed. - - See the method. - - - See the method. - - + - See the method. + Throws an exception if this object instance has been disposed. - - See the method. - - - See the method. - - + - See the method. + Disposes or finalizes this object instance. - - See the method. - - - See the method. - - - See the method. + + Non-zero if this object is being disposed; otherwise, this object + is being finalized. - - See the method. - - + - See the method. + This class represents a set of changes that are backed by a + instance. - - See the method. + + + + The instance that is managing + the underlying input used as the backing + store for the set of changes associated with this instance. + + + + + The instance that is managing + the underlying output used as the backing + store for the set of changes generated by the + or methods. + + + + + The instance used as the backing store for + the set of changes associated with this instance. + + + + + The instance used as the backing store for + the set of changes generated by the or + methods. + + + + + The flags used to create the change set iterator. + + + + + Constructs an instance of this class using the specified streams + and wrapped native connection handle. + + + The where the raw byte data for the set of + changes may be read. - - See the method. + + The where the raw byte data for resulting + sets of changes may be written. + + + The wrapped native connection handle to be associated with this + set of changes. + + + The flags associated with the connection represented by the + value. - - See the method. - - + - See the method. + Constructs an instance of this class using the specified streams + and wrapped native connection handle. - - See the method. + + The where the raw byte data for the set of + changes may be read. - - See the method. + + The where the raw byte data for resulting + sets of changes may be written. - - See the method. + + The wrapped native connection handle to be associated with this + set of changes. + + + The flags associated with the connection represented by the + value. + + + The flags used to create the change set iterator. - - See the method. - - + - See the method. + Throws an exception if the input stream or its associated stream + adapter are invalid. - - See the method. - - - See the method. - - + - See the method. + Throws an exception if the output stream or its associated stream + adapter are invalid. - - See the method. - - - See the method. - - + - See the method. + This method "inverts" the set of changes within this instance. + Applying an inverted set of changes to a database reverses the + effects of applying the uninverted changes. Specifically: + ]]>]]> + Each DELETE change is changed to an INSERT, and + ]]>]]> + Each INSERT change is changed to a DELETE, and + ]]>]]> + For each UPDATE change, the old.* and new.* values are exchanged. + ]]>]]> + This method does not change the order in which changes appear + within the set of changes. It merely reverses the sense of each + individual change. - - See the method. - - See the method. + Since the resulting set of changes is written to the output stream, + this method always returns null. - + - See the method. + This method combines the specified set of changes with the ones + contained in this instance. - - See the method. + + The changes to be combined with those in this instance. - See the method. + Since the resulting set of changes is written to the output stream, + this method always returns null. - + - See the method. + Attempts to apply the set of changes in this instance to the + associated database. - - See the method. + + The delegate that will need + to handle any conflicting changes that may arise. - - See the method. + + The optional application-defined context data. This value may be + null. - - See the method. + + + + Attempts to apply the set of changes in this instance to the + associated database. + + + The delegate that will need + to handle any conflicting changes that may arise. - - See the method. + + The optional delegate + that can be used to filter the list of tables impacted by the set + of changes. - - See the method. + + The optional application-defined context data. This value may be + null. - - See the method. - - + - See the method. + Creates an capable of iterating over the + items within this set of changes. - - See the method. - - - See the method. - - See the method. + The new + instance. - + - See the method. + Creates an capable of iterating over the + items within this set of changes. - - See the method. - - - See the method. - - See the method. + The new instance. - + - See the method. + Non-zero if this object instance has been disposed. - - See the method. - - - See the method. + + + + Throws an exception if this object instance has been disposed. + + + + + Disposes or finalizes this object instance. + + + Non-zero if this object is being disposed; otherwise, this object + is being finalized. - - See the method. - - + - See the method. + This class represents an that is capable of + enumerating over a set of changes. It serves as the base class for the + and + classes. It manages and + owns an instance of the class. - - See the method. + + + + This managed change set iterator is managed and owned by this + class. It will be disposed when this class is disposed. + + + + + Constructs an instance of this class using the specified managed + change set iterator. + + + The managed iterator instance to use. - - See the method. + + + + Throws an exception if the managed iterator instance is invalid. + + + + + Sets the managed iterator instance to a new value. + + + The new managed iterator instance to use. - - See the method. - - + - Throws an if this object - instance has been disposed. + Disposes of the managed iterator instance and sets its value to + null. - + - Disposes of this object instance. + Disposes of the existing managed iterator instance and then sets it + to a new value. - - Non-zero if this method is being called from the - method. Zero if this method is - being called from the finalizer. + + The new managed iterator instance to use. - + - The CREATE TABLE statement used to declare the schema for the - virtual table. + Returns the current change within the set of changes, represented + by a instance. - + - The instance containing the backing data - for the virtual table. + Returns the current change within the set of changes, represented + by a instance. - + - Non-zero if different object instances with the same value should - generate different row identifiers, where applicable. This has no - effect on the .NET Compact Framework. + Attempts to advance to the next item in the set of changes. + + Non-zero if more items are available; otherwise, zero. + - + - Constructs an instance of this class. + Throws because not all the + derived classes are able to support reset functionality. - - The name of the module. This parameter cannot be null. - - - The instance to expose as a virtual - table. This parameter cannot be null. + + + + Disposes of this object instance. + + + + + Non-zero if this object instance has been disposed. + + + + + Throws an exception if this object instance has been disposed. + + + + + Disposes or finalizes this object instance. + + + Non-zero if this object is being disposed; otherwise, this object + is being finalized. - + + + Finalizes this object instance. + + + - Constructs an instance of this class. + This class represents an that is capable of + enumerating over a set of changes contained entirely in memory. - - The name of the module. This parameter cannot be null. - - - The instance to expose as a virtual - table. This parameter cannot be null. - - - Non-zero if different object instances with the same value should - generate different row identifiers, where applicable. This - parameter has no effect on the .NET Compact Framework. - - + - Determines the SQL statement used to declare the virtual table. - This method should be overridden in derived classes if they require - a custom virtual table schema. + The raw byte data for this set of changes. Since this data must + be marshalled to a native memory buffer before being used, there + must be enough memory available to store at least two times the + amount of data contained within it. - - The SQL statement used to declare the virtual table -OR- null if it - cannot be determined. - - + - Sets the table error message to one that indicates the virtual - table cursor is of the wrong type. + The flags used to create the change set iterator. - - The object instance. - - - The value of . - - + - Sets the table error message to one that indicates the virtual - table cursor has no current row. + Constructs an instance of this class using the specified raw byte + data. - - The object instance. + + The raw byte data containing the set of changes for this + enumerator. - - The value of . - - + - Determines the string to return as the column value for the object - instance value. + Constructs an instance of this class using the specified raw byte + data. - - The object instance - associated with the previously opened virtual table cursor to be - used. + + The raw byte data containing the set of changes for this + enumerator. - - The object instance to return a string representation for. + + The flags used to create the change set iterator. - - The string representation of the specified object instance or null - upon failure. - - + - Constructs an unique row identifier from two - values. The first value - must contain the row sequence number for the current row and the - second value must contain the hash code of the enumerator value - for the current row. + Resets the enumerator to its initial position. - - The integer row sequence number for the current row. - - - The hash code of the enumerator value for the current row. - - - The unique row identifier or zero upon failure. - - + - Determines the unique row identifier for the current row. + Non-zero if this object instance has been disposed. - - The object instance - associated with the previously opened virtual table cursor to be - used. - - - The object instance to return a unique row identifier for. - - - The unique row identifier or zero upon failure. - - + - See the method. + Throws an exception if this object instance has been disposed. - - See the method. - - - See the method. - - - See the method. - - - See the method. - - - See the method. - - - See the method. - - + - See the method. + Disposes or finalizes this object instance. - - See the method. - - - See the method. - - - See the method. + + Non-zero if this object is being disposed; otherwise, this object + is being finalized. - - See the method. + + + + This class represents an that is capable of + enumerating over a set of changes backed by a + instance. + + + + + Constructs an instance of this class using the specified stream. + + + The where the raw byte data for the set of + changes may be read. - - See the method. + + The flags associated with the parent connection. - - See the method. - - + - See the method. + Constructs an instance of this class using the specified stream. - - See the method. + + The where the raw byte data for the set of + changes may be read. - - See the method. + + The flags associated with the parent connection. + + + The flags used to create the change set iterator. - - See the method. - - + - See the method. + Non-zero if this object instance has been disposed. - - See the method. - - - See the method. - - + - See the method. + Throws an exception if this object instance has been disposed. - - See the method. - - - See the method. - - + - See the method. + Disposes or finalizes this object instance. - - See the method. - - - See the method. + + Non-zero if this object is being disposed; otherwise, this object + is being finalized. - - See the method. - - + - See the method. + This interface implements properties and methods used to fetch metadata + about one change within a set of changes for a database. - - See the method. - - - See the method. - - + - See the method. + The instance to use. This + will NOT be owned by this class and will not be disposed upon this + class being disposed or finalized. - - See the method. - - - See the method. - - - See the method. - - - See the method. - - - See the method. - - + - See the method. + Constructs an instance of this class using the specified iterator + instance. - - See the method. + + The managed iterator instance to use. - - See the method. - - + - See the method. + Throws an exception if the managed iterator instance is invalid. - - See the method. - - - See the method. - - + - See the method. + Populates the underlying data for the , + , , and + properties, using the appropriate native + API. - - See the method. - - - See the method. - - - See the method. - - - See the method. - - + - See the method. + Populates the underlying data for the + property using the appropriate + native API. - - See the method. - - - See the method. - - - See the method. - - + - See the method. + Populates the underlying data for the + property using the + appropriate native API. - - See the method. - - - See the method. - - - See the method. - - - See the method. - - + - See the method. + Backing field for the property. This value + will be null if this field has not yet been populated via the + underlying native API. - - See the method. - - - See the method. - - - See the method. - - + - Throws an if this object - instance has been disposed. + The name of the table the change was made to. - + - Disposes of this object instance. + Backing field for the property. This + value will be null if this field has not yet been populated via the + underlying native API. - - Non-zero if this method is being called from the - method. Zero if this method is - being called from the finalizer. - - + - This class represents a virtual table cursor to be used with the - class. It is not sealed and may - be used as the base class for any user-defined virtual table cursor - class that wraps an object instance. + The number of columns impacted by this change. This value can be + used to determine the highest valid column index that may be used + with the , , + and methods of this interface. It + will be this value minus one. - + - The instance provided when this - cursor was created. + Backing field for the property. This + value will be null if this field has not yet been populated via the + underlying native API. - + - Constructs an instance of this class. + This will contain the value + , + , or + , corresponding to + the overall type of change this item represents. - - The object instance associated - with this object instance. - - - The instance to expose as a virtual - table cursor. - - + - Closes the virtual table cursor. This method must not throw any - exceptions. + Backing field for the property. This value + will be null if this field has not yet been populated via the + underlying native API. - + - Throws an if this object - instance has been disposed. + Non-zero if this change is considered to be indirect (i.e. as + though they were made via a trigger or foreign key action). - + - Disposes of this object instance. + Backing field for the property. + This value will be null if this field has not yet been populated + via the underlying native API. - - Non-zero if this method is being called from the - method. Zero if this method is - being called from the finalizer. - - + - Returns the value for the current row of the virtual table cursor - using the property of the - object instance. + This array contains a for each column in + the table associated with this change. The element will be zero + if the column is not part of the primary key; otherwise, it will + be non-zero. - + - This class implements a virtual table module that exposes an - object instance as a read-only virtual - table. It is not sealed and may be used as the base class for any - user-defined virtual table class that wraps an - object instance. + Backing field for the + property. This value will be null if this field has not yet been + populated via the underlying native API. - + - The instance containing the backing - data for the virtual table. + This method may only be called from within a + delegate when the conflict + type is . It + returns the total number of known foreign key violations in the + destination database. - + - Constructs an instance of this class. + Queries and returns the original value of a given column for this + change. This method may only be called when the + has a value of + or + . - - The name of the module. This parameter cannot be null. - - - The instance to expose as a virtual - table. This parameter cannot be null. + + The index for the column. This value must be between zero and one + less than the total number of columns for this table. + + The original value of a given column for this change. + - + - See the method. + Queries and returns the updated value of a given column for this + change. This method may only be called when the + has a value of + or + . - - See the method. - - - See the method. + + The index for the column. This value must be between zero and one + less than the total number of columns for this table. - See the method. + The updated value of a given column for this change. - + - See the method. + Queries and returns the conflicting value of a given column for + this change. This method may only be called from within a + delegate when the conflict + type is or + . - - See the method. - - - See the method. - - - See the method. + + The index for the column. This value must be between zero and one + less than the total number of columns for this table. - See the method. + The conflicting value of a given column for this change. - + - Throws an if this object - instance has been disposed. + Disposes of this object instance. - + - Disposes of this object instance. + Non-zero if this object instance has been disposed. + + + + + Throws an exception if this object instance has been disposed. + + + + + Disposes or finalizes this object instance. - Non-zero if this method is being called from the - method. Zero if this method is - being called from the finalizer. + Non-zero if this object is being disposed; otherwise, this object + is being finalized. + + + Finalizes this object instance. + + diff --git a/src/Libraries/Sqlite/libsqlite3.0.dylib b/src/Libraries/Sqlite/libsqlite3.0.dylib index 364b585e7..0c477bda1 100644 Binary files a/src/Libraries/Sqlite/libsqlite3.0.dylib and b/src/Libraries/Sqlite/libsqlite3.0.dylib differ diff --git a/src/Libraries/Sqlite/sqlite3.dll b/src/Libraries/Sqlite/sqlite3.dll index a65d21493..71a7eb91a 100644 Binary files a/src/Libraries/Sqlite/sqlite3.dll and b/src/Libraries/Sqlite/sqlite3.dll differ