profileCallBack



The profileCallBack method is an example of a user callback method for the profile method. Here the method name of profileCallBack is used, because it is the default method name if the programmer does not specify his own name in the profile method. Any method name can be used by specifying it as the second argument to the profile method.

The profile callback is invoked as each SQL statement finishes executing.

Note: there is no profileCallBack method in any ooSQLite class. This method is just used to illustrate how to define a user callback method to be used with when profiling.

Arguments: The arguments sent to the callback method are:
sql [required] The original SQL statement text.
nanoSeconds [required] The wall clock time it took to execute the SQL statement. See the remarks section.
userData [required] The user data object specified by the programmer as the third argument to thetracemethod. If the programmer did not specify a user data argument, this will be the .nilobject.
Return value: The programmer must return a whole number value from the callback, the exact number does not matter.
Remarks; Although the wall clock time is in nanoseconds, the current SQLite implementation is only capable of millisecond resolution making the six least significant digits in the time are meaningless. Future versions of SQLite might provide greater resolution on the profiler callback. The sqlite3_profile() function is considered experimental and is subject to change in future versions of SQLite.
Details: The implementation of aprofilecallback method is is discussed on the SQLite sqlite3_profile page.