Method | Description | |
---|---|---|
Compare ( string param1, string param2 ) : int |
User-defined collation sequences override this method to provide a custom string sorting algorithm.
|
|
Dispose ( ) : void |
Disposes of any active contextData variables that were not automatically cleaned up. Sometimes this can happen if someone closes the connection while a DataReader is open.
|
|
Final ( object contextData ) : object |
Aggregate functions override this method to finish their aggregate processing. If you implemented your aggregate function properly, you've been recording and keeping track of your data in the contextData object provided, and now at this stage you should have all the information you need in there to figure out what to return. NOTE: It is possible to arrive here without receiving a previous call to Step(), in which case the contextData will be null. This can happen when no rows were returned. You can either return null, or 0 or some other custom return value if that is the case. |
|
Invoke ( object args ) : object |
Scalar functions override this method to do their magic. Parameters passed to functions have only an affinity for a certain data type, there is no underlying schema available to force them into a certain type. Therefore the only types you will ever see as parameters are DBNull.Value, Int64, Double, String or byte[] array. |
|
RegisterFunction ( |
Manual method of registering a function. The type must still have the SqliteFunctionAttributes in order to work properly, but this is a workaround for the Compact Framework where enumerating assemblies is not currently supported.
|
|
Step ( object args, int stepNumber, object &contextData ) : void |
Aggregate functions override this method to do their magic. Typically you'll be updating whatever you've placed in the contextData field and returning as quickly as possible. |
Method | Description | |
---|---|---|
Dispose ( bool disposing ) : void |
Placeholder for a user-defined disposal routine
|
|
SqliteFunction ( ) : System |
Internal constructor, initializes the function's internal variables.
|
Method | Description | |
---|---|---|
BindFunctions ( |
Called by SqliteBase derived classes, this function binds all user-defined functions to a connection. It is done this way so that all user-defined functions will access the database using the same encoding scheme as the connection (UTF-8 or UTF-16).
|
|
CompareCallback ( int len1, |
Internal collation sequence function, which wraps up the raw string pointers and executes the Compare() virtual function.
|
|
ConvertParams ( int nArgs, |
Converts an IntPtr array of context arguments to an object array containing the resolved parameters the pointers point to. Parameters passed to functions have only an affinity for a certain data type, there is no underlying schema available to force them into a certain type. Therefore the only types you will ever see as parameters are DBNull.Value, Int64, Double, String or byte[] array. |
|
FinalCallback ( |
An internal aggregate Final function callback, which wraps the context pointer and calls the virtual Final() method.
|
|
ScalarCallback ( |
Internal scalar callback function, which wraps the raw context pointer and calls the virtual Invoke() method.
|
|
SetReturnValue ( |
Takes the return value from Invoke() and Final() and figures out how to return it to Sqlite's context.
|
|
StepCallback ( |
The internal aggregate Step function callback, which wraps the raw context pointer and calls the virtual Step() method. This function takes care of doing the lookups and getting the important information put together to call the Step() function. That includes pulling out the user's contextData and updating it after the call is made. We use a sorted list for this so binary searches can be done to find the data. |
public Compare ( string param1, string param2 ) : int | ||
param1 | string | The first string to compare |
param2 | string | The second strnig to compare |
return | int |
protected Dispose ( bool disposing ) : void | ||
disposing | bool | True if the object is being disposed explicitly |
return | void |
public Final ( object contextData ) : object | ||
contextData | object | Your own assigned contextData, provided for you so you can return your final results. |
return | object |
public Invoke ( object args ) : object | ||
args | object | The arguments for the command to process |
return | object |
public static RegisterFunction ( |
||
typ | The type of the function to register | |
return | void |
public Step ( object args, int stepNumber, object &contextData ) : void | ||
args | object | The arguments for the command to process |
stepNumber | int | The 1-based step number. This is incrememted each time the step method is called. |
contextData | object | A placeholder for implementers to store contextual data pertaining to the current context. |
return | void |