diff --git a/.gitignore b/.gitignore index 177a9eeed..66d7ef29f 100644 --- a/.gitignore +++ b/.gitignore @@ -19,7 +19,6 @@ src/**/[Oo]bj/ *.meta *.obj *.pch -*.pdb *.pgc *.pgd *.rsp @@ -98,7 +97,6 @@ App_Data/*.ldf *.orig # Tools -_NCrunch_* _TeamCity* # Radarr diff --git a/src/Libraries/Sqlite/System.Data.SQLite.dll b/src/Libraries/Sqlite/System.Data.SQLite.dll index 1e7145a8d..a48da8d3a 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.pdb b/src/Libraries/Sqlite/System.Data.SQLite.pdb new file mode 100644 index 000000000..cac1e4b05 Binary files /dev/null and b/src/Libraries/Sqlite/System.Data.SQLite.pdb differ diff --git a/src/Libraries/Sqlite/System.Data.SQLite.xml b/src/Libraries/Sqlite/System.Data.SQLite.xml index 6e533f0a6..80952780b 100644 --- a/src/Libraries/Sqlite/System.Data.SQLite.xml +++ b/src/Libraries/Sqlite/System.Data.SQLite.xml @@ -102,7 +102,20 @@ - The value of the OLE Automation epoch represented as a Julian day. + The value of the OLE Automation epoch represented as a Julian day. This + field cannot be removed as the test suite relies upon it. + + + + + This is the minimum Julian Day value supported by this library + (148731163200000). + + + + + This is the maximum Julian Day value supported by this library + (464269060799000). @@ -184,6 +197,104 @@ 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, @@ -302,7 +413,7 @@ The DateTimeKind to use. A .NET DateTime - + Converts the specified number of seconds from the Unix epoch into a value. @@ -317,7 +428,7 @@ The new value. - + Converts the specified number of ticks since the epoch into a value. @@ -497,13 +608,19 @@ - Convert a string to true or false. + Attempts to convert a into a . - A string representing true or false - + + The to convert, cannot be null. + + + The converted value. + - "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. + 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. @@ -639,6 +756,22 @@ 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 @@ -712,6 +845,11 @@ code. + + + Returns non-zero if this connection to the database is read-only. + + Sets the status of the memory usage tracking subsystem in the SQLite core library. By default, this is enabled. @@ -741,7 +879,20 @@ 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. @@ -750,6 +901,7 @@ 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 @@ -820,6 +972,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 +995,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 +1009,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 @@ -921,9 +1093,24 @@ A standard SQLite return code. + + + Enables or disables a configuration option for the database. + connection. + + + The database configuration option to enable or disable. + + + True to enable loading of extensions, false to disable. + + + 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. @@ -1042,15 +1229,6 @@ 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 @@ -1088,6 +1266,11 @@ Returns non-zero if the underlying native connection handle is owned by this instance. + + + Returns the logical list of functions associated with this connection. + + Returns non-zero if the given database connection is in autocommit mode. @@ -1105,6 +1288,25 @@ The user-defined functions registered on this connection + + + This is the name of the native library file that contains the + "vtshim" extension [wrapper]. + + + + + 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. + + + + + This is the name of the native entry point for the "vtshim" + extension [wrapper]. + + The modules created using this connection. @@ -1144,6 +1346,30 @@ object instances currently associated with the native database connection. + + + Returns the number of times the method has been + called. + + + + + 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). + + + + + Resets the value of the field. + + Attempts to interrupt the query currently executing on the associated @@ -1166,6 +1392,19 @@ The flags associated with the parent connection object. + + + This function binds a user-defined function to 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 and removed. + Attempts to free as much heap memory as possible for the database connection. @@ -1232,6 +1471,79 @@ Non-zero if the associated native connection handle 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. + + + + + Has the sqlite3_errstr() core library API been checked for yet? + If so, is it present? + + + + + 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. + + + + Has the sqlite3_stmt_readonly() core library API been checked for yet? + If so, is it present? + + + + + Returns non-zero if the specified statement is read-only in nature. + + The statement to check. + True if the outer query is read-only. + + + + 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. + + + + + Determines if all calls to prepare a SQL query will be logged, + regardless of the flags for the associated connection. + + + Non-zero to log all calls to prepare a SQL query. + + + + + Determines the file name of the native library containing the native + "vtshim" extension -AND- whether it should be dynamically loaded by + this class. + + + 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. + + Calls the native SQLite core library in order to create a disposable @@ -1303,9 +1615,24 @@ A standard SQLite return code. + + + Enables or disables a configuration option for the database. + connection. + + + The database configuration option to enable or disable. + + + True to enable loading of extensions, false to disable. + + + 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. @@ -1436,6 +1763,11 @@ by this instance. + + + Returns the logical list of functions associated with this connection. + + Alternate SQLite3 object, overriding many text behaviors to support UTF-16 (Unicode) @@ -1537,9 +1869,9 @@ - + - + @@ -1761,6 +2093,93 @@ should be set. + + + When binding parameter values with the + type, take their into account as + well as that of the associated . + + + + + 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. + + + + + 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. + + + + + If an exception is caught when raising the + event, the operation + should be interrupted. If this is not specified, the operation + will simply continue. + + + + + Attempt to unbind all functions provided by other managed assemblies + when closing the connection. + + + + + When returning column values as a , skip + verifying their affinity. + + + + + Enable using per-connection mappings between type names and + values. Also see the + , + , and + methods. + + + + + Enable using per-connection mappings between type names and + values. Also see the + , + , and + methods. + + + + + If the database type name has not been explicitly set for the + parameter specified, fallback to using the parameter name. + + + + + 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. + + + + + When returning column values, skip verifying their affinity. + + + + + 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. + + When binding parameter values or returning column values, always @@ -1791,6 +2210,17 @@ or from strings. + + + Enables use of all per-connection value handling callbacks. + + + + + Enables use of all applicable + properties as fallbacks for the database type name. + + Enable all logging. @@ -1806,61 +2236,235 @@ The default extra flags for new connections with all logging enabled. - + - SQLite implementation of DbCommand. + These are the supported configuration verbs for use with the native + SQLite library. They are used with the + method. - + - The default connection string to be used when creating a temporary - connection to execute a command via the static - or - - methods. + This value represents an unknown (or invalid) option, do not use it. - + - The command text this command is based on + This option is not currently supported by System.Data.SQLite. It + may be supported in the future. - + - The connection the command is associated with + This option is used to enable or disable the enforcement of + foreign key constraints. - + - The version of the connection the command is associated with + This option is used to enable or disable triggers. - + - Indicates whether or not a DataReader is active on the command. + 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. - + - The timeout for the command, kludged because SQLite doesn't support per-command timeout values + This option is used to enable or disable the loading of extensions. - + - Designer support + Represents a single SQL blob in SQLite. - + - Used by DbDataAdapter to determine updating behavior + The underlying SQLite object this blob is bound to. - + - The collection of parameters for the command + 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. + + + + + 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. + + + + + SQLite implementation of DbCommand. + + + + + The default connection string to be used when creating a temporary + connection to execute a command via the static + or + + methods. + + + + + The command text this command is based on + + + + + The connection the command is associated with + + + + + The version of the connection the command is associated with + + + + + Indicates whether or not a DataReader is active on the command. + + + + + The timeout for the command, kludged because SQLite doesn't support per-command timeout values + + + + + Designer support + + + + + Used by DbDataAdapter to determine updating behavior + + + + + The collection of parameters for the command + + + The SQL command text, broken into individual SQL statements as they are executed @@ -1957,6 +2561,13 @@ + + + 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 +2613,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 +2654,7 @@ A SQLiteDataReader - + Called by the SQLiteDataReader when the data reader is closed. @@ -2076,6 +2687,27 @@ The flags to be associated with the reader. The first column of the first row of the first resultset from the query. + + + This method resets all the prepared statements held by this instance + back to their initial states, ready to be re-executed. + + + + + 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. + + Does nothing. Commands are prepared as they are executed the first time, and kept in prepared state afterwards. @@ -2159,6 +2791,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 @@ -2286,824 +2926,1846 @@ Overridden to hide its property from the designer - + + + 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. + + + - Event data for connection event handlers. + The value to be returned from the + method -OR- null to + indicate an error. - + - 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. - + - 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. - + - 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 -OR- null to + indicate an error. - 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 -OR- null to + indicate an error. - The connection involved. - Extra information about the event. - + - SQLite implentation of DbConnection. + The value to be returned from the + method -OR- null to + indicate an error. - - 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. + The value to be returned from the + method -OR- null to + indicate an error. - + - 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 value to be returned from the + method -OR- null to + indicate an error. - + - The managed assembly containing this type. + The value to be returned from the + method. - + - Object used to synchronize access to the static instance data - for this class. + The value to be returned from the + method. - + - The extra connection flags to be used for all opened connections. + This class represents the parameters that are provided + to the methods, with + the exception of the column index (provided separately). - + - Used to hold the active library version number of SQLite. + This class represents the parameters that are provided to + the method, with + the exception of the column index (provided separately). - + - State of the current connection + Provides the underlying storage for the + property. - + - The connection string + 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. + - + - Nesting level of the transactions open on the connection + The value that was originally specified for the "readOnly" + parameter to the method. - + - If set, then the connection is currently being disposed. + This class represents the parameters that are provided + to the and + methods, with + the exception of the column index (provided separately). - + - The default isolation level for new transactions + Provides the underlying storage for the + property. - + - Whether or not the connection is enlisted in a distrubuted transaction + Provides the underlying storage for the + property. - + - The per-connection mappings between type names and - values. These mappings override the corresponding global mappings. + Provides the underlying storage for the + property. - + - The base SQLite object to interop with + Provides the underlying storage for the + property. - + - The database filename minus path and extension + Provides the underlying storage for the + property. - + - Temporary password storage, emptied after the database has been opened + 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 "stub" (i.e. placeholder) base schema name to use when returning - column schema information. + 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 extra behavioral flags for this connection, if any. See the - enumeration for a list of - possible values. + The value that was originally specified for the "dataOffset" + parameter to the or + 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. + The value that was originally specified for the "buffer" + parameter to the + method. - + - The default databse type for this connection. This value will only - be used if the - flag is set. + The value that was originally specified for the "buffer" + parameter to the + method. - + - The default databse type name for this connection. This value will only - be used if the - flag is set. + The value that was originally specified for the "bufferOffset" + parameter to the or + methods. - + - Default command timeout + The value that was originally specified for the "length" + parameter to the or + methods. - + - Non-zero if the built-in (i.e. framework provided) connection string - parser should be used when opening the connection. + This class represents the parameters and return values for the + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , and + methods. - - - Constructs a new SQLiteConnection object - - - Default constructor - + + + Provides the underlying storage for the + property. + - + - Initializes the connection with the specified connection string. + Provides the underlying storage for the + property. - 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. + Provides the underlying storage for the + property. - - 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. + Constructs a new instance of this class. Depending on the method + being called, the and/or + parameters may be null. - - The connection string to use. + + The name of the method that was + responsible for invoking this callback. - - Non-zero to parse the connection string using the built-in (i.e. - framework provided) parser when opening the connection. + + 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. - + - 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 name of the method that was + responsible for invoking this callback. - The connection to copy the settings from. - + - Raises the event. + 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. - - 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. + This may be used by the callback to set the return value for the + called method. - - 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. + 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 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 instance in use. - - The method to invoke between each step of the backup process. This - parameter may be null (i.e. no callbacks will be performed). + + The instance in use. - - 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. + + The flags associated with the instance + in use. - - - - 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 instance being bound to the command. - - The value to be returned if the setting has not been set explicitly - or cannot be determined. + + The database type name associated with this callback. - - The value of the cached setting is stored here if found; otherwise, - the value of is stored here. + + The ordinal of the parameter being bound to the command. - - 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 data originally used when registering this callback. - - The new value of the cached setting. + + 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. - - - 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. + 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 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 instance in use. - - The value that should be associated with the - specified type name. + + The instance in use. - - Non-zero if this mapping should be considered to be the primary one - for the specified . + + The flags associated with the instance + in use. - - 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 object instance containing - the metadata for the function to be bound. + + The parameter and return type data for the column being read from the + data reader. - - The object instance that implements the - function to be bound. + + 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. - + - 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. + This class represents the custom data type handling callbacks + for a single type name. - - + - Creates a database file. This just creates a zero-byte file which SQLite - will turn into a database when the file is opened properly. + Provides the underlying storage for the + property. - The file to create - + - Raises the state change event when the state of the connection changes + Provides the underlying storage for the + property. - 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. + Provides the underlying storage for the + property. - - 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. + Provides the underlying storage for the + property. - - 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. + Provides the underlying storage for the + property. - 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. + Constructs an instance of this class. - 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. + + The custom paramater binding callback. This parameter may be null. + + + 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. + - + - Creates a new if one isn't already active on the connection. + Creates an instance of the class. - 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. + + The custom paramater binding callback. This parameter may be null. + + + 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. + - + - Creates a new if one isn't already - active on the connection. + The database type name that the callbacks contained in this class + will apply to. This value may not be null. - Returns the new transaction object. - + - Forwards to the local function + The custom paramater binding callback. This value may be null. - Supported isolation levels are Unspecified, Serializable, and ReadCommitted - - + - This method is not implemented; however, the - event will still be raised. + The custom data reader value callback. This value may be null. - - + - When the database connection is closed, all commands linked to this connection are automatically reset. + The extra data to pass into the parameter binding callback. This + value may be null. - + - 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. + The extra data to pass into the data reader value callback. This + value may be null. - - + - Clears all connection pools. Any active connections will be discarded instead of sent to the pool when they are closed. + This class represents the mappings between database type names + and their associated custom data type handling callbacks. - + - Create a new and associate it with this connection. + Constructs an (empty) instance of this class. - Returns a new command object already assigned to this connection. - + - Forwards to the local function. + Event data for connection event handlers. - - + - Parses the connection string into component parts using the custom - connection string parser. + The type of event being raised. - 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. + The associated with this event, if any. - - 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 + The transaction associated with this event, if any. - The distributed transaction to enlist in - + - Looks for a key in the array of key/values of the parameter string. If not found, return the specified default value + The command associated with this event, if any. - 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 data reader associated with this event, if any. - 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 critical handle associated with this event, if any. - - 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. - - + - Enables or disabled extension loading. + Command or message text associated with this event, if any. - - True to enable loading of extensions, false to disable. - - + - Loads a SQLite extension library from the named dynamic link library file. + Extra data associated with this event, if any. - - The name of the dynamic link library file containing the extension. - - + - Loads a SQLite extension library from the named dynamic link library file. + 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 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 +
+ + BusyTimeout + {time in milliseconds}
Sets the busy timeout for the core library.
+ N + 0 +
+ + 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. + + + + + 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 + + + + + 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 + + + + + Temporary password storage, emptied after the database has been opened + + + + + 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 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. + + + + + 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. + + + + 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. + + + + + 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 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. + + + 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. + + + + + 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. + + + + + Create a new and associate it with this connection. + + Returns a new command object already assigned to this connection. + + + + Forwards to the local function. + + + + + + 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 + + + + 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. + + + + + Enables or disables a configuration option for the database. + + + The database configuration option to enable or disable. + + + True to enable loading of extensions, false to disable. + + + + + Enables or disabled 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. @@ -3215,6 +4877,21 @@ returns.
+ + + 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 various global memory statistics for the SQLite core library via @@ -3275,6 +4952,27 @@ Non-zero to enable memory usage tracking, zero otherwise. A standard SQLite return code (i.e. zero for success and non-zero for failure). + + + Queries and returns the value of the specified setting, using the + cached setting names and values for the last connection that used + by 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. + + Passes a shutdown request to the SQLite core library. Does not throw @@ -3331,443 +5029,290 @@ 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. - - 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. - - 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. - - 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. - - - - - 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 - 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, must not 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 + + The new password to assign to the database - + - Retrieves foreign key information from the specified set of filters + Sets the password for a password-protected database. A password-protected database is + unusable for any operation until the password has been set. - 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 + The password for the database - + - Static variable to store the connection event handlers to call. + Sets the password for a password-protected database. A password-protected database is + unusable for any operation until the password has been set. + The password for the database - + - This event is raised whenever the database is opened or closed. + 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. - + - This event is raised when events related to the lifecycle of a - SQLiteConnection object occur. + 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. + - + - 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. + 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. + - + - Returns the number of pool entries for the file name associated with this connection. + 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. + - + - The connection string containing the parameters for the connection + Expand the filename of the data source, resolving the |DataDirectory| + macro as appropriate. - - - - 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 - + 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 + - Default IsolationLevel - The default transaciton isolation level - N - Serializable + 0 + The database (or catalog) name, if applicable. - Foreign Keys - Enable foreign key constraints - N - False + 1 + The schema name. This is not used by this provider. - Flags - Extra behavioral flags for the connection. See the enumeration for possible values. - N - Default + 2 + The table name, if applicable. - SetDefaults + 3 - True - Apply the default connection settings to the opened database.
- False - Skip applying the default connection settings to the opened database. + Depends on . + When "IndexColumns", it is the index name; otherwise, it is the column name.
- N - True
- ToFullPath + 4 - 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. + Depends on . + When "IndexColumns", it is the column name; otherwise, it is not used.
- N - True
+ + 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, must not 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 + + + + Static variable to store the connection event handlers to call. + + + + + This event is raised whenever the database is opened or closed. + + + + + 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. + + + + + Returns the number of pool entries for the file name associated with this connection. + + + + + The connection string containing the parameters for the connection + + + For the complete list of supported connection string properties, + please see . @@ -3775,6 +5320,12 @@ 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". @@ -3787,6 +5338,28 @@ 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. + + + + + 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 @@ -3812,6 +5385,12 @@ 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 @@ -3915,6 +5494,12 @@ cannot be obtained for any reason, a null value may be returned. + + + 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. @@ -3925,6 +5510,16 @@ Returns the state of the connection. + + + 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 @@ -3983,6 +5578,16 @@ 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 @@ -4048,6 +5653,38 @@ 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. @@ -4554,10 +6191,30 @@ - Gets/sets the default command timeout for newly-created commands. This is especially useful for + 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. + + + + + 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 @@ -4648,11 +6305,29 @@ 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. @@ -4669,6 +6344,11 @@ full path before opening. + + + If enabled, skip using the configured default connection flags. + + If enabled, skip using the configured shared connection flags. @@ -4810,6 +6490,16 @@ 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 @@ -5218,6 +6908,21 @@ 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. @@ -5337,6 +7042,14 @@ 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. + + Raised by the underlying DbDataAdapter when a row is being updated @@ -5511,6 +7224,11 @@ from the underlying connection. + + + 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 @@ -5526,25 +7244,74 @@ 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 to retrieve + The index of the column. bool Retrieves the column as a single byte value - The index of the column to retrieve + The index of the column. byte Retrieves a column as an array of bytes (blob) - The index of the column to retrieve + 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 @@ -5558,14 +7325,14 @@ Returns the column as a single character - The index of the column to retrieve + The index of the column. char Retrieves a column as an array of chars (blob) - The index of the column to retrieve + 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 @@ -5579,77 +7346,98 @@ Retrieves the name of the back-end datatype of the column - The index of the column to retrieve + The index of the column. string Retrieve the column as a date/time value - The index of the column to retrieve + The index of the column. DateTime Retrieve the column as a decimal value - The index of the column to retrieve + The index of the column. decimal Returns the column as a double - The index of the column to retrieve + The index of the column. double Returns the .NET type of a given column - The index of the column to retrieve + The index of the column. Type Returns a column as a float value - The index of the column to retrieve + The index of the column. float Returns the column as a Guid - The index of the column to retrieve + The index of the column. Guid Returns the column as a short - The index of the column to retrieve + The index of the column. Int16 Retrieves the column as an int - The index of the column to retrieve + The index of the column. Int32 Retrieves the column as a long - The index of the column to retrieve + The index of the column. Int64 Retrieves the name of the column - The index of the column to retrieve + 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 @@ -5670,14 +7458,14 @@ Retrieves the column as a string - The index of the column to retrieve + The index of the column. string Retrieves the column as an object corresponding to the underlying datatype of the column - The index of the column to retrieve + The index of the column. object @@ -5703,7 +7491,7 @@ Returns True if the specified column is null - The index of the column to retrieve + The index of the column. True or False @@ -5741,7 +7529,7 @@ Retrieves the SQLiteType for a given column, and caches it to avoid repetetive interop calls. The flags associated with the parent connection object. - The index of the column to retrieve + The index of the column. A SQLiteType structure @@ -5782,7 +7570,12 @@ - Retrieve the count of records affected by an update/insert command. Only valid once the data reader is closed! + 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. @@ -5796,7 +7589,7 @@ Indexer to retrieve data from a column given its i - The index of the column to retrieve + The index of the column. The value contained in the column @@ -5900,170 +7693,451 @@ something of a misnomer. - + + + The error code is unknown. This error code + is only used by the managed wrapper itself. + + + + + Successful result + + + + + SQL error or missing database + + + + + Internal logic error in SQLite + + + + + Access permission denied + + + + + Callback routine requested an abort + + + + + The database file is locked + + + + + A table in the database is locked + + + + + A malloc() failed + + + + + Attempt to write a readonly database + + + + + Operation terminated by sqlite3_interrupt() + + + + + Some kind of disk I/O error occurred + + + + + The database disk image is malformed + + + + + Unknown opcode in sqlite3_file_control() + + + + + Insertion failed because database is full + + + + + Unable to open the database file + + + + + Database lock protocol error + + + + + Database is empty + + + + + The database schema changed + + + + + String or BLOB exceeds size limit + + + + + Abort due to constraint violation + + + + + Data type mismatch + + + + + Library used incorrectly + + + + + Uses OS features not supported on host + + + + + Authorization denied + + + + + Auxiliary database format error + + + + + 2nd parameter to sqlite3_bind out of range + + + + + File opened that is not a database file + + + + + Notifications from sqlite3_log() + + + + + Warnings from sqlite3_log() + + + + + sqlite3_step() has another row ready + + + + + sqlite3_step() has finished executing + + + + + Used to mask off extended result codes + + + + + A file read operation failed. + + + + + A file read operation returned less data than requested. + + + + + A file write operation failed. + + + + + A file synchronization operation failed. + + + + + A directory synchronization operation failed. + + + + + A file truncate operation failed. + + + + + A file metadata operation failed. + + + + + A file unlock operation failed. + + + + + A file lock operation failed. + + + + + A file delete operation failed. + + + + + Not currently used. + + + + + Out-of-memory during a file operation. + + + + + A file existence/status operation failed. + + + + + A check for a reserved lock failed. + + + + + A file lock operation failed. + + + + + A file close operation failed. + + + + + A directory close operation failed. + + + + + A shared memory open operation failed. + + + + + A shared memory size operation failed. + + + + + A shared memory lock operation failed. + + + + + A shared memory map operation failed. + + + + + A file seek operation failed. + + + + + A file delete operation failed because it does not exist. + + + - The error code is unknown. This error code - is only used by the managed wrapper itself. + A file memory mapping operation failed. - + - Successful result + The temporary directory path could not be obtained. - + - SQL error or missing database + A path string conversion operation failed. - + - Internal logic error in SQLite + Reserved. - + - Access permission denied + An attempt to authenticate failed. - + - Callback routine requested an abort + A database table is locked in shared-cache mode. - + - The database file is locked + A database file is locked due to a recovery operation. - + - A table in the database is locked + A database file is locked due to snapshot semantics. - + - A malloc() failed + A database file cannot be opened because no temporary directory is available. - + - Attempt to write a readonly database + A database file cannot be opened because its path represents a directory. - + - Operation terminated by sqlite3_interrupt() + A database file cannot be opened because its full path could not be obtained. - + - Some kind of disk I/O error occurred + A database file cannot be opened because a path string conversion operation failed. - + - The database disk image is malformed + A virtual table is malformed. - + - Unknown opcode in sqlite3_file_control() + A database file is read-only due to a recovery operation. - + - Insertion failed because database is full + A database file is read-only because a lock could not be obtained. - + - Unable to open the database file + A database file is read-only because it needs rollback processing. - + - Database lock protocol error + A database file is read-only because it was moved while open. - + - Database is empty + An operation is being aborted due to rollback processing. - + - The database schema changed + A CHECK constraint failed. - + - String or BLOB exceeds size limit + A commit hook produced a unsuccessful return code. - + - Abort due to constraint violation + A FOREIGN KEY constraint failed. - + - Data type mismatch + Not currently used. - + - Library used incorrectly + A NOT NULL constraint failed. - + - Uses OS features not supported on host + A PRIMARY KEY constraint failed. - + - Authorization denied + The RAISE function was used by a trigger-program. - + - Auxiliary database format error + A UNIQUE constraint failed. - + - 2nd parameter to sqlite3_bind out of range + Not currently used. - + - File opened that is not a database file + A ROWID constraint failed. - + - Notifications from sqlite3_log() + Frames were recovered from the WAL log file. - + - Warnings from sqlite3_log() + Pages were recovered from the journal file. - + - sqlite3_step() has another row ready + An automatic index was created to process a query. - + - sqlite3_step() has finished executing + User authentication failed. - + - Used to mask off extended result codes + Success. Prevents the extension from unloading until the process + terminates. @@ -6079,6 +8153,16 @@ Constructs a new instance. + + + Cleans up resources (native and managed) associated with the current instance. + + + + + Cleans up resources associated with the current instance. + + Static instance member which returns an instanced class. @@ -6186,7 +8270,7 @@ - Holds a reference to the callback function for collation sequences + Holds a reference to the callback function for collating sequences @@ -6196,7 +8280,9 @@ - This static list contains all the user-defined functions declared using the proper attributes. + 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. @@ -6238,6 +8324,11 @@ True if the object is being disposed explicitly + + + Cleans up resources associated with the current instance. + + Scalar functions override this method to do their magic. @@ -6283,11 +8374,11 @@ - User-defined collation sequences override this method to provide a custom string sorting algorithm. + 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 + 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. @@ -6320,7 +8411,7 @@ - Internal collation sequence function, which wraps up the raw string pointers and executes the Compare() virtual function. + Internal collating sequence function, which wraps up the raw string pointers and executes the Compare() virtual function. WARNING: Must not throw exceptions. Not used @@ -6333,7 +8424,7 @@ - Internal collation sequence function, which wraps up the raw string pointers and executes the Compare() virtual function. + Internal collating sequence function, which wraps up the raw string pointers and executes the Compare() virtual function. WARNING: Must not throw exceptions. Not used @@ -6378,9 +8469,74 @@ The type of the function to register + + + 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. + + + + + 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. + + + + + 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. + + - Called by SQLiteBase derived classes, this function binds all user-defined functions to a connection. + 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). @@ -6388,13 +8544,46 @@ 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 + 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. + + + 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 function binds a user-defined functions to a connection. + 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. + + + + + This function unbinds a user-defined functions from a connection. The object instance associated with the @@ -6411,11 +8600,317 @@ The flags associated with the parent connection object. + Non-zero if the function was unbound. + + + + 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. + + + + + This type is used with the + method. + + + This is always the string literal "Invoke". + + + The arguments for the scalar function. + + + The result of the scalar function. + + + + + 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. + + + + + This type is used with the + method. + + + This is always the string literal "Final". + + + A placeholder for implementers to store contextual data pertaining + to the current context. + + + The result of the aggregate function. + + + + + This type is used with the + method. + + + This is always the string literal "Compare". + + + The first string to compare. + + + The second strnig to compare. + + + 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 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 error message is used by the overridden virtual methods when + a required property (e.g. + or ) has not been + set. + + + + + This error message is used by the overridden + method when the result does not have a type of . + + + + + Constructs an empty instance of this class. + + + + + 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. + + + + + 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 . + + + + + 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 . + + + + + 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 original arguments received by the method. + + + 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 . + + + + + 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. + + + Non-zero if the returned arguments are going to be used with the + type; otherwise, zero. + + + 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 "Compare". + + + 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 . + + + + + This virtual method is the implementation for scalar functions. + See the method for more + details. + + + The arguments for the scalar function. + + + 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 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. + + + + + This virtual method is part of the implementation for aggregate + functions. See the method + for more details. + + + A placeholder for implementers to store contextual data pertaining + to the current context. + + + 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 second strnig to compare. + + + 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. + - + - 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 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. @@ -6432,6 +8927,14 @@ + + + Cleans up resources (native and managed) associated with the current instance. + + + Zero when being disposed via garbage collection; otherwise, non-zero. + + The type of user-defined function to declare @@ -6450,7 +8953,7 @@ - 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 + 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. @@ -6471,7 +8974,7 @@ - Internal callback delegate for implementing collation sequences + Internal callback delegate for implementing collating sequences Not used Length of the string pv1 @@ -6580,7 +9083,9 @@ - Constructs an instance of this class. + 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. @@ -6611,7 +9116,23 @@ The object instance that describes the class - containing the implementation for the associated function. + 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. + + + + + 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. + + + + + 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. @@ -6658,6 +9179,11 @@ Used to support CommandBehavior.KeyInfo + + + Used to keep track of the per-table RowId column metadata. + + A single sub-query for a given table/database. @@ -6901,6 +9427,16 @@ SQLite implementation of DbParameter. + + + This value represents an "unknown" . + + + + + The command associated with this parameter. + + The data type of the parameter @@ -6931,6 +9467,19 @@ The data size, unused by SQLite + + + The database type name associated with this parameter, if any. + + + + + Constructor used when creating for use with a specific command. + + + The command associated with this parameter. + + Default constructor @@ -7093,6 +9642,11 @@ A new, unassociated SQLiteParameter + + + The command associated with this parameter. + + Whether or not the parameter can contain a null value @@ -7138,6 +9692,11 @@ Gets and sets the parameter value. If no datatype was specified, the datatype will assume the type from the value given. + + + The database type name associated with this parameter, if any. + + SQLite implementation of DbParameterCollection. @@ -7375,142 +9934,490 @@ The index of the parameter to get/set The specified SQLite parameter - + + + Represents a single SQL statement in SQLite. + + + + + The underlying SQLite object this statement is bound to + + + + + The command text of this SQL statement + + + + + The actual statement pointer + + + + + An index from which unnamed parameters begin + + + + + Names of the parameters as SQLite understands them to be + + + + + Parameters for this statement + + + + + Command this statement belongs to (if any) + + + + + The flags associated with the parent connection object. + + + + + 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 + + + + Disposes and finalizes the statement + + + + + 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. + + + + 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 parameter name to map + The parameter to assign it + + + + Bind all parameters, making sure the caller didn't miss any + + + + + 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. + + + + + 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. + + + + + Perform the bind operation for an individual parameter + + The index of the parameter to bind + The parameter we're binding + + + + SQLite implementation of DbTransaction that does not support nested transactions. + + + + + Base class used by to implement DbTransaction for SQLite. + + + + + The connection to which this transaction is bound. + + + + + Matches the version of the connection. + + + + + The isolation level for this transaction. + + + + + 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 + + + + Disposes the transaction. If it is currently active, any changes are rolled back. + + + + + Rolls back the active transaction. + + + + + Attempts to start a transaction. An exception will be thrown if the transaction cannot + be started for any reason. + + TRUE to defer the writelock, or FALSE to lock immediately + + + + Issue a ROLLBACK command against the database connection, + optionally re-throwing any caught exception. + + + Non-zero to re-throw caught exceptions. + + + + + Checks the state of this transaction, optionally throwing an exception if a state + inconsistency is found. + + + Non-zero to throw an exception if a state inconsistency is found. + + + Non-zero if this transaction is valid; otherwise, false. + + + + + Gets the isolation level of the transaction. SQLite only supports Serializable transactions. + + + + + Returns the underlying connection to which this transaction applies. + + + + + Forwards to the local Connection property + + + + + 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 + + + + Disposes the transaction. If it is currently active, any changes are rolled back. + + + + + Commits the current transaction. + + + + + Attempts to start a transaction. An exception will be thrown if the transaction cannot + be started for any reason. + + TRUE to defer the writelock, or FALSE to lock immediately + + + + Issue a ROLLBACK command against the database connection, + optionally re-throwing any caught exception. + + + Non-zero to re-throw caught exceptions. + + + + + SQLite implementation of DbTransaction that does support nested transactions. + + + + + The original transaction level for the associated connection + when this transaction was created (i.e. begun). + + + + + The SAVEPOINT name for this transaction, if any. This will + only be non-null if this transaction is a nested one. + + + + + 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 + + + + Disposes the transaction. If it is currently active, any changes are rolled back. + + + + + Commits the current transaction. + + + + + Attempts to start a transaction. An exception will be thrown if the transaction cannot + be started for any reason. + + TRUE to defer the writelock, or FALSE to lock immediately + + - Represents a single SQL statement in SQLite. + Issue a ROLLBACK command against the database connection, + optionally re-throwing any caught exception. + + Non-zero to re-throw caught exceptions. + - + - The underlying SQLite object this statement is bound to + Constructs the name of a new savepoint for this transaction. It + should only be called from the constructor of this class. + + The name of the new savepoint -OR- null if it cannot be constructed. + - + - The command text of this SQL statement + This static class provides some methods that are shared between the + native library pre-loader and other classes. - + - The actual statement pointer + This lock is used to protect the static field. - + - An index from which unnamed parameters begin + This type is only present when running on Mono. - + - Names of the parameters as SQLite understands them to be + 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. - + - Parameters for this statement + Determines whether or not this assembly is running on Mono. + + Non-zero if this assembly is running on Mono. + - + - Command this statement belongs to (if any) + Determines if the current process is running on one of the Windows + [sub-]platforms. + + Non-zero when running on Windows; otherwise, zero. + - + - The flags associated with the parent connection object. + 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. + - + - Initializes the statement and attempts to get all information about parameters in the statement + This static class provides a thin wrapper around the native library + loading features of the underlying platform. - 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 + 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. + - + - If the underlying database connection is open, fetches the number of changed rows - resulting from the most recent query; otherwise, does nothing. + Attempts to load the specified native library file using the POSIX + API. - - The number of changes when true is returned. - Undefined if false is returned. + + The file name of the native library to load. - Non-zero if the number of changed rows was fetched. + + The native module handle upon success -OR- IntPtr.Zero on failure. + - + - 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. + Attempts to load the specified native library file. - The parameter name to map - The parameter to assign it + + The file name of the native library to load. + + + The native module handle upon success -OR- IntPtr.Zero on failure. + - + - Bind all parameters, making sure the caller didn't miss any + 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. + - + - Perform the bind operation for an individual parameter + This class declares P/Invoke methods to call native POSIX APIs. - The index of the parameter to bind - The parameter we're binding - + - SQLite implementation of DbTransaction. + For use with dlopen(), bind function calls lazily. - + - The connection to which this transaction is bound + For use with dlopen(), bind function calls immediately. - + - Constructs the transaction object, binding it to the supplied connection + For use with dlopen(), make symbols globally available. - The connection to open a transaction on - TRUE to defer the writelock, or FALSE to lock immediately - + - Disposes the transaction. If it is currently active, any changes are rolled back. + For use with dlopen(), opposite of RTLD_GLOBAL, and the default. - + - Commits the current transaction. + For use with dlopen(), the defaults used by this class. - + - Rolls back the active transaction. + 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. + - + - Returns the underlying connection to which this transaction applies. + This class declares P/Invoke methods to call native Win32 APIs. - + - Forwards to the local Connection property + 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. + - + - Gets the isolation level of the transaction. SQLite only supports Serializable transactions. + This class declares P/Invoke methods to call native SQLite APIs. @@ -7529,6 +10436,26 @@ System.Data.SQLite assembly. + + + This is the XML configuratrion file token that will be replaced with + the qualified path to the directory containing the XML configuration + file. + + + + + This is the environment variable token that will be replaced with + the qualified path to the directory containing this assembly. + + + + + This is the environment variable token that will be replaced with an + abbreviation of the target framework attribute value associated with + this assembly. + + This lock is used to protect the static _SQLiteNativeModuleFileName, @@ -7557,6 +10484,21 @@ library for the processor architecture of the current process. + + + Combines two path strings. + + + 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. + + Queries and returns the XML configuration file name for the assembly @@ -7567,6 +10509,94 @@ or does not exist. + + + 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. + + + + + 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. + + + + + 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. + + + + + 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. + + + + + 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. + + Queries and returns the value of the specified setting, using the XML @@ -7606,19 +10636,6 @@ architecture of the current process. - - - 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. - - The native module file name for the native SQLite library or null. @@ -7630,6 +10647,16 @@ IntPtr.Zero. + + + Determines the base file name (without any directory information) + for the native SQLite library to be pre-loaded by this class. + + + The base file name for the native SQLite library to be pre-loaded by + this class -OR- null if its value cannot be determined. + + Searches for the native SQLite library in the directory containing @@ -7780,1981 +10807,2392 @@ <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 interface represents a native handle provided by the SQLite core - library. - - - - - The native handle value. - - - + - The native context handle. + This interface represents a virtual table implementation written in + native code. - + - Constructs an instance of this class using the specified native - context handle. + + int (*xCreate)(sqlite3 *db, void *pAux, + int argc, char **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 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). Furthermore, since the + xUpdate method depends on having a valid rowid, the xUpdate method + must be NULL for a WITHOUT ROWID virtual table. That in turn means that + WITHOUT ROWID virtual tables must be read-only. + - - The native context handle to use. + + The native database connection handle. - - - - Sets the context result to NULL. - - - - - Sets the context result to the specified - value. - - - The value to use. + + The original native pointer value that was provided to the + sqlite3_create_module(), sqlite3_create_module_v2() or + sqlite3_create_disposable_module() functions. - - - - Sets the context result to the specified - value. - - - The value to use. + + The number of arguments from the CREATE VIRTUAL TABLE statement. - - - - Sets the context result to the specified - value. - - - The value to use. + + The array of string arguments from the CREATE VIRTUAL TABLE + statement. - - - - 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. + + 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. + - + - Sets the context result to the specified - value containing an error message. + + int (*xConnect)(sqlite3*, void *pAux, + int argc, char **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 value containing the error message text. - This value will be converted to the UTF-8 encoding prior to being - used. + + 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. + - + - Sets the context result to the specified - value. + + 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 only */ + #define SQLITE_INDEX_CONSTRAINT_GLOB 66 /* 3.10.0 and later only */ + #define SQLITE_INDEX_CONSTRAINT_REGEXP 67 /* 3.10.0 and later only */ + #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 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. + + + 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. + + + 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. + + + 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 value to use. + + The native pointer to the sqlite3_vtab derived structure. + + + The native pointer to the sqlite3_index_info structure. + + A standard SQLite return code. + - + - Sets the context result to contain the error code SQLITE_TOOBIG. + + 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. + - + - Sets the context result to contain the error code SQLITE_NOMEM. + + 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. + - + - Sets the context result to the specified array - value. + + 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 array value to use. + + The native pointer to the sqlite3_vtab derived structure. - - - - 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. + + Upon success, this parameter must be modified to point to the newly + created native sqlite3_vtab_cursor derived structure. + + A standard SQLite return code. + - + - Sets the context result to the specified . + + 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 to use. + + The native pointer to the sqlite3_vtab_cursor derived structure. + + A standard SQLite return code. + - + - Returns the underlying SQLite native handle associated with this - object instance. + + 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. + - + - This class represents a value from the SQLite core library that can be - passed to the sqlite3_value_*() and associated functions. + + 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 native value handle. + + 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. + - + - Constructs an instance of this class using the specified native - value handle. + + 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 value handle to use. + + 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. + - + - Invalidates the native value handle, thereby preventing further - access to it from this object instance. + + 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. + - + - Converts a logical array of native pointers to native sqlite3_value - structures into a managed array of - object instances. + + 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), 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]]> + ]]>]]>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. + + + The native pointer to the sqlite3_vtab derived structure. + - The number of elements in the logical array of native sqlite3_value - structures. + The number of new or modified column values contained in + . - The native pointer to the logical array of native sqlite3_value - structures to convert. + 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. - The managed array of object instances or - null upon failure. + A standard SQLite return code. - + - Gets and returns the type affinity associated with this value. + + 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. + - The type affinity associated with this value. + A standard SQLite return code. - + - Gets and returns the number of bytes associated with this value, if - it refers to a UTF-8 encoded string. + + 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. + - The number of bytes associated with this value. The returned value - may be zero. + A standard SQLite return code. - + - Gets and returns the associated with this - value. + + 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. + - The associated with this value. + A standard SQLite return code. - + - Gets and returns the associated with - this value. + + 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 native pointer to the sqlite3_vtab derived structure. + - The associated with this value. + A standard SQLite return code. - + - Gets and returns the associated with this - value. + + 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 1. + + + 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 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 + . + - The associated with this value. + Non-zero if the specified function was found; zero otherwise. - + - Gets and returns the associated with this - value. + + 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 required for every virtual table implementation. + + + 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. + - The associated with this value. The value is - converted from the UTF-8 encoding prior to being returned. + A standard SQLite return code. - + - Gets and returns the array associated with this - value. + + 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. + - The array associated with this value. + A standard SQLite return code. - + - 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. + + 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 used to indicate that any saved states with an + identifier greater than or equal to this should be deleted by the + virtual table. + - Non-zero if the native value was persisted successfully. + A standard SQLite return code. - - - Returns the underlying SQLite native handle associated with this - object instance. - - - - - 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). - - - - - 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. - - - + - 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. + + 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. + - + - This value represents the equality operator. + This class represents a context from the SQLite core library that can + be passed to the sqlite3_result_*() and associated functions. - + - This value represents the greater than operator. + This interface represents a native handle provided by the SQLite core + library. - + - This value represents the less than or equal to operator. + The native handle value. - + - This value represents the less than operator. + The native context handle. - + - This value represents the greater than or equal to operator. + Constructs an instance of this class using the specified native + context handle. + + The native context handle to use. + - + - This value represents the MATCH operator. + Sets the context result to NULL. - + - This class represents the native sqlite3_index_constraint structure - from the SQLite core library. + Sets the context result to the specified + value. + + The value to use. + - + - Constructs an instance of this class using the specified native - sqlite3_index_constraint structure. + Sets the context result to the specified + value. - - The native sqlite3_index_constraint structure to use. + + The value to use. - + - Constructs an instance of this class using the specified field - values. + Sets the context result to the specified + value. - - Column on left-hand side of constraint. - - - Constraint operator (). - - - True if this constraint is usable. - - - Used internally - - should ignore. + + The value to use. - + - Column on left-hand side of constraint. + 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. + - + - Constraint operator (). + 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. + - + - True if this constraint is usable. + Sets the context result to the specified + value. + + The value to use. + - + - Used internally - - should ignore. + Sets the context result to contain the error code SQLITE_TOOBIG. - + - This class represents the native sqlite3_index_orderby structure from - the SQLite core library. + Sets the context result to contain the error code SQLITE_NOMEM. - + - Constructs an instance of this class using the specified native - sqlite3_index_orderby structure. + Sets the context result to the specified array + value. - - The native sqlite3_index_orderby structure to use. + + The array value to use. - + - Constructs an instance of this class using the specified field - values. + Sets the context result to a BLOB of zeros of the specified size. - - Column number. - - - True for DESC. False for ASC. + + The number of zero bytes to use for the BLOB context result. - + - Column number. + Sets the context result to the specified . + + The to use. + - + - True for DESC. False for ASC. + Returns the underlying SQLite native handle associated with this + object instance. - + - This class represents the native sqlite3_index_constraint_usage - structure from the SQLite core library. + This class represents a value from the SQLite core library that can be + passed to the sqlite3_value_*() and associated functions. - + - Constructs an instance of this class using the specified native - sqlite3_index_constraint_usage structure. + The native value handle. - - The native sqlite3_index_constraint_usage structure to use. - - + - Constructs an instance of this class using the specified field - values. + Constructs an instance of this class using the specified native + value handle. - - If greater than 0, constraint is part of argv to xFilter. - - - Do not code a test for this constraint. + + The native value handle to use. - + - If greater than 0, constraint is part of argv to xFilter. + Invalidates the native value handle, thereby preventing further + access to it from this object instance. - + - Do not code a test for this constraint. + 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. + - + - This class represents the various inputs provided by the SQLite core - library to the method. + Gets and returns the type affinity associated with this value. + + The type affinity associated with this value. + - + - Constructs an instance of this class. + Gets and returns the number of bytes associated with this value, if + it refers to a UTF-8 encoded string. - - The number of instances to - pre-allocate space for. - - - The number of instances to - pre-allocate space for. - + + The number of bytes associated with this value. The returned value + may be zero. + - + - An array of object instances, - each containing information supplied by the SQLite core library. + Gets and returns the associated with this + value. + + The associated with this value. + - + - An array of object instances, - each containing information supplied by the SQLite core library. + Gets and returns the associated with + this value. + + The associated with this value. + - + - This class represents the various outputs provided to the SQLite core - library by the method. + Gets and returns the associated with this + value. + + The associated with this value. + - + - Constructs an instance of this class. + Gets and returns the associated with this + value. - - The number of instances - to pre-allocate space for. - + + The associated with this value. The value is + converted from the UTF-8 encoding prior to being returned. + - + - Determines if the native estimatedRows field can be used, based on - the available version of the SQLite core library. + Gets and returns the array associated with this + value. - Non-zero if the property is supported - by the SQLite core library. + The array associated with this value. - + - An array of object - instances, each containing information to be supplied to the SQLite - core library. + 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. + - + - Number used to help identify the selected index. This value will - later be provided to the - method. + Returns the underlying SQLite native handle associated with this + object instance. - + - String used to help identify the selected index. This value will - later be provided to the - method. + 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). - + - Non-zero if the index string must be freed by the SQLite core - library. + 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. - + - True if output is already ordered. + 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. - + - Estimated cost of using this index. Using a null value here - indicates that a default estimated cost value should be used. + This value represents the equality operator. - + - Estimated number of rows returned. Using a null value here - indicates that a default estimated rows value should be used. + This value represents the greater than operator. - + - This class represents the various inputs and outputs used with the - method. + This value represents the less than or equal to operator. - + - Constructs an instance of this class. + This value represents the less than operator. - - The number of (and - ) instances to - pre-allocate space for. - - - The number of instances to - pre-allocate space for. - - + - Converts a native pointer to a native sqlite3_index_info structure - into a new object instance. + This value represents the greater than or equal to operator. - - 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. - - - - Populates the outputs of a pre-allocated native sqlite3_index_info - structure using an existing object - instance. - - - The existing object instance containing - the output data to use. - - - The native pointer to the pre-allocated native sqlite3_index_info - structure. - + + + This value represents the MATCH operator. + - + - The object instance containing - the inputs to the - method. + This value represents the LIKE operator. - + - The object instance containing - the outputs from the - method. + This value represents the GLOB operator. - + - 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. + This value represents the REGEXP operator. - + - The index within the array of strings provided to the - and - methods containing the - name of the module implementing this virtual table. + These are the allowed values for the index flags from the + method. - + - The index within the array of strings provided to the - and - methods containing the - name of the database containing this virtual table. + No special handling. This is the default. - + - The index within the array of strings provided to the - and - methods containing the - name of the virtual table. + This value indicates that the scan of the index will visit at + most one row. - + - Constructs an instance of this class. + This class represents the native sqlite3_index_constraint structure + from the SQLite core library. - - The original array of strings provided to the - and - methods. - - + - 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. + Constructs an instance of this class using the specified native + sqlite3_index_constraint structure. - - The object instance containing all the - data for the inputs and outputs relating to index selection. + + The native sqlite3_index_constraint structure to use. - - Non-zero upon success. - - + - Attempts to record the renaming of the virtual table associated - with this object instance. + Constructs an instance of this class using the specified field + values. - - The new name for the virtual table. + + Column on left-hand side of constraint. + + + Constraint operator (). + + + True if this constraint is usable. + + + Used internally - + should ignore. - - Non-zero upon success. - - + - Disposes of this object instance. + Column on left-hand side of constraint. - + - Throws an if this object - instance has been disposed. + Constraint operator (). - + - Disposes of this object instance. + True if this constraint is usable. - - Non-zero if this method is being called from the - method. Zero if this method is being called - from the finalizer. + + + + Used internally - + should ignore. + + + + + This class represents the native sqlite3_index_orderby structure from + the SQLite core library. + + + + + Constructs an instance of this class using the specified native + sqlite3_index_orderby structure. + + + The native sqlite3_index_orderby structure to use. - + - Finalizes this object instance. + Constructs an instance of this class using the specified field + values. + + Column number. + + + True for DESC. False for ASC. + - + - The original array of strings provided to the - and - methods. + Column number. - + - The name of the module implementing this virtual table. + True for DESC. False for ASC. - + - The name of the database containing this virtual table. + This class represents the native sqlite3_index_constraint_usage + structure from the SQLite core library. - + - The name of the virtual table. + Constructs a default instance of this class. - + - The object instance containing all the - data for the inputs and outputs relating to the most recent index - selection. + Constructs an instance of this class using the specified native + sqlite3_index_constraint_usage structure. + + The native sqlite3_index_constraint_usage structure to use. + - + - Returns the underlying SQLite native handle associated with this - object instance. + Constructs an instance of this class using the specified field + values. + + If greater than 0, constraint is part of argv to xFilter. + + + Do not code a test for this constraint. + - + - 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. + If greater than 0, constraint is part of argv to xFilter. - + - This value represents an invalid integer row sequence number. + Do not code a test for this constraint. - + - The field holds the integer row sequence number for the current row - pointed to by this cursor object instance. + This class represents the various inputs provided by the SQLite core + library to the method. - + Constructs an instance of this class. - - The object instance associated - with this object instance. + + The number of instances to + pre-allocate space for. + + + The number of instances to + pre-allocate space for. - + - Constructs an instance of this class. + An array of object instances, + each containing information supplied by the SQLite core library. - + - Attempts to persist the specified object - instances in order to make them available after the - method returns. + An array of object instances, + each containing information supplied by the SQLite core library. - - The array of object instances to be - persisted. + + + + This class represents the various outputs provided to the SQLite core + library by the method. + + + + + Constructs an instance of this class. + + + 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. + - The number of object instances that were - successfully persisted. + Non-zero if the property is supported + by the SQLite core library. - + - 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. + Determines if the native flags field can be used, based on the + available version of 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. - + + Non-zero if the property is supported by + the SQLite core library. + - + - Determines the integer row sequence number for the current row. + Determines if the native flags field can be used, based on the + available version of the SQLite core library. - The integer row sequence number for the current row -OR- zero if - it cannot be determined. + Non-zero if the property is supported by + the SQLite core library. - + - Adjusts the integer row sequence number so that it refers to the - next row. + An array of object + instances, each containing information to be supplied to the SQLite + core library. - + - Disposes of this object instance. + Number used to help identify the selected index. This value will + later be provided to the + method. - + - Throws an if this object - instance has been disposed. + String used to help identify the selected index. This value will + later be provided to the + method. - + - Disposes of this object instance. + Non-zero if the index string must be freed 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. - - + - Finalizes this object instance. + True if output is already ordered. - + - The object instance associated - with this object instance. + Estimated cost of using this index. Using a null value here + indicates that a default estimated cost value should be used. - + - Number used to help identify the selected index. This value will - be set via the method. + 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. - + - String used to help identify the selected index. This value will - be set via the method. + 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 values used to filter the rows returned via this cursor object - instance. This value will be set via the - method. + + 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. + - + - Returns the underlying SQLite native handle associated with this - object instance. + This class represents the various inputs and outputs used with the + method. - + - This interface represents a virtual table implementation written in - native code. + 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. + - + - - 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. - + Attempts to determine the structure sizes needed to create and + populate a native + + structure. - - The native database connection handle. + + The size of the native + + structure is stored here. - - The original native pointer value that was provided to the - sqlite3_create_module(), sqlite3_create_module_v2() or - sqlite3_create_disposable_module() functions. + + The size of the native + + structure is stored here. - - The number of arguments from the CREATE VIRTUAL TABLE statement. + + The size of the native + + structure is stored here. - - The array of string arguments from the CREATE VIRTUAL TABLE - statement. + + The size of the native + + structure is stored here. - - Upon success, this parameter must be modified to point to the newly - created native sqlite3_vtab derived structure. + + + + Attempts to allocate and initialize a native + + structure. + + + The number of instances to + pre-allocate space for. - - 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 number of instances to + pre-allocate space for. - A standard SQLite return code. + The newly allocated native + structure + -OR- if it could not be fully allocated. - + - - 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. - + Frees all the memory associated with a native + + structure. - - 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 native pointer to the native sqlite3_index_info structure to + free. - - The array of string arguments from the CREATE VIRTUAL TABLE - statement. + + + + Converts a native pointer to a native sqlite3_index_info structure + into a new object instance. + + + The native pointer to the native sqlite3_index_info structure to + convert. - - Upon success, this parameter must be modified to point to the newly - created native sqlite3_vtab derived structure. + + Non-zero to include fields from the outputs portion of the native + structure; otherwise, the "output" fields will not be read. - - 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. + + Upon success, this parameter will be modified to contain the newly + created object instance. - - A standard SQLite return code. - - + - - 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. - + Populates the outputs of a pre-allocated native sqlite3_index_info + structure using an existing object + instance. - - The native pointer to the sqlite3_vtab derived structure. + + The existing object instance containing + the output data to use. - The native pointer to the sqlite3_index_info structure. + 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. - - A standard SQLite return code. - - + - - 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 object instance containing + the inputs to the + method. - - The native pointer to the sqlite3_vtab derived structure. - - - A standard SQLite return code. - - + - - 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 object instance containing + the outputs from the + method. - - The native pointer to the sqlite3_vtab derived structure. - - - A standard SQLite return code. - - + - - 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. - + 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 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. + + + + The index within the array of strings provided to the + and + methods containing the + name of the module implementing this virtual table. + + + + + The index within the array of strings provided to the + and + methods containing the + name of the database containing this virtual table. + + + + + The index within the array of strings provided to the + and + methods containing the + name of the virtual table. + + + + + Constructs an instance of this class. + + + The original array of strings provided to the + and + methods. - - A standard SQLite return code. - - + - - 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. - + 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 native pointer to the sqlite3_vtab_cursor derived structure. + + The object instance containing all the + data for the inputs and outputs relating to index selection. - A standard SQLite return code. + Non-zero upon success. - + - - 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. - + Attempts to record the renaming of the virtual table associated + with this object instance. - - 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. + + The new name for the virtual table. - A standard SQLite return code. + Non-zero upon success. - + - - 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. - + Disposes of this object instance. - - The native pointer to the sqlite3_vtab_cursor derived structure. + + + + 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. - - A standard SQLite return code. - - + + + Finalizes this object instance. + + + + + The original array of strings provided to the + and + methods. + + + + + The name of the module implementing this virtual table. + + + + + The name of the database containing this virtual table. + + + + + The name of the virtual table. + + + + + The object instance containing all the + data for the inputs and outputs relating to the most recent index + selection. + + + + + Returns the underlying SQLite native handle associated with this + object instance. + + + + + 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. + + + + + This value represents an invalid integer row sequence number. + + + + + The field holds the integer row sequence number for the current row + pointed to by this cursor object instance. + + + - - 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. - + Constructs an instance of this class. - - The native pointer to the sqlite3_vtab_cursor derived structure. + + The object instance associated + with this object instance. - - Non-zero if no more rows are available; zero otherwise. - - + - - 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. - + Constructs an instance of this class. - - 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 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. - + Attempts to persist the specified object + instances in order to make them available after the + method returns. - - 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. + + The array of object instances to be + persisted. - A standard SQLite return code. + The number of object instances that were + successfully persisted. - + - - 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. - + 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. - - The native pointer to the sqlite3_vtab derived structure. - - - The number of new or modified column values contained in - . + + Number used to help identify the selected index. - - The array of native pointers to sqlite3_value structures containing - the new or modified column values, if any. + + String used to help identify the selected index. - - Upon success, this parameter must be modified to contain the unique - integer row identifier for the row that was inserted, if any. + + The values corresponding to each column in the selected index. - - A standard SQLite return code. - - + - - 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. - + Determines the integer row sequence number for the current row. - - The native pointer to the sqlite3_vtab derived structure. - - A standard SQLite return code. + The integer row sequence number for the current row -OR- zero if + it cannot be determined. - + - - 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. - + Adjusts the integer row sequence number so that it refers to the + next row. - - The native pointer to the sqlite3_vtab derived structure. - - - A standard SQLite return code. - - + - - 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. - + Disposes of this object instance. - - The native pointer to the sqlite3_vtab derived structure. - - - A standard SQLite return code. - - + - - 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. - + Throws an if this object + instance has been disposed. - - The native pointer to the sqlite3_vtab derived structure. - - - A standard SQLite return code. - - + - - 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. - + Disposes of this object instance. - - 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 this method is being called from the + method. Zero if this method is being called + from the finalizer. - - Non-zero if the specified function was found; zero otherwise. - - + - - 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. - + Finalizes this object instance. + + + + + The object instance associated + with this object instance. + + + + + Number used to help identify the selected index. This value will + be set via the method. - - 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. - - + - - 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(). - + String used to help identify the selected index. This value will + be set via the method. - - 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. - - + - - 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(). - + The values used to filter the rows returned via this cursor object + instance. This value will be set via the + method. - - The native pointer to the sqlite3_vtab derived structure. - - - 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. - - + - - 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(). - + Returns the underlying SQLite native handle associated with this + object instance. - - 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. - @@ -10458,6 +13896,23 @@ The value at the specified memory location. + + + 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. + + Reads a value from the specified memory @@ -11222,6 +14677,34 @@ Non-zero upon success. + + + Modifies the specified object instance + to contain the specified flags. + + + The object instance to modify. + + + The index flags 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 index flags. + + + The object instance to modify. + + + Non-zero upon success. + + See the method. @@ -12445,162 +15928,24 @@ 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 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 instance provided when this cursor - was created. - - - - - This value will be non-zero if false has been returned 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. - - - Non-zero if the current row is valid; zero otherwise. If zero is - returned, no further rows are available. - - - - - 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. - - - - - 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. - - - - - Returns the value for the current row of the virtual table cursor - using the property 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. - - - - - 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(); - } - } - } - - + + + 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. + @@ -13043,55 +16388,41 @@ being called from the finalizer. - + The CREATE TABLE statement used to declare the schema for the virtual table. - - - The instance containing the backing data - 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. - - The instance to expose as a virtual - table. This parameter cannot be null. - - + 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. - 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 @@ -13102,7 +16433,7 @@ cannot be determined. - + Sets the table error message to one that indicates the virtual table cursor is of the wrong type. @@ -13110,23 +16441,14 @@ The object instance. - - The value of . - - - - - Sets the table error message to one that indicates the virtual - table cursor has no current row. - - - The object instance. + + The that the virtual table cursor should be. The value of . - + Determines the string to return as the column value for the object instance value. @@ -13144,25 +16466,25 @@ 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 + second value must contain the hash code of the key column value for the current row. The integer row sequence number for the current row. - The hash code of the enumerator value for the current row. + The hash code of the key column value for the current row. The unique row identifier or zero upon failure. - + Determines the unique row identifier for the current row. @@ -13178,6 +16500,221 @@ The unique row identifier or zero upon failure. + + + 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 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 instance provided when this cursor + was created. + + + + + This value will be non-zero if false has been returned 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. + + + Non-zero if the current row is valid; zero otherwise. If zero is + returned, no further rows are available. + + + + + 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. + + + + + 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. + + + + + Returns the value for the current row of the virtual table cursor + using the property 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. + + + + + 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(); + } + } + } + + + + + + The instance containing the backing data + 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. + + + The instance to expose as a virtual + table. This parameter cannot be null. + + + + + 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. + + + 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. + + + + + Sets the table error message to one that indicates the virtual + table cursor has no current row. + + + The object instance. + + + The value of . + + See the method. diff --git a/src/NzbDrone.Api/NzbDrone.Api.csproj b/src/NzbDrone.Api/NzbDrone.Api.csproj index 6a61d84fc..b6879b7a9 100644 --- a/src/NzbDrone.Api/NzbDrone.Api.csproj +++ b/src/NzbDrone.Api/NzbDrone.Api.csproj @@ -84,7 +84,7 @@ - + False ..\Libraries\Sqlite\System.Data.SQLite.dll diff --git a/src/NzbDrone.Core/NzbDrone.Core.csproj b/src/NzbDrone.Core/NzbDrone.Core.csproj index 1c5d20daf..2aeebb290 100644 --- a/src/NzbDrone.Core/NzbDrone.Core.csproj +++ b/src/NzbDrone.Core/NzbDrone.Core.csproj @@ -98,6 +98,10 @@ + + False + ..\Libraries\Sqlite\System.Data.SQLite.dll + @@ -108,9 +112,6 @@ ..\packages\Prowlin.0.9.4456.26422\lib\net40\Prowlin.dll - - ..\Libraries\Sqlite\System.Data.SQLite.dll -