Retrieves runtime status information about this database connection.
Arguments: |
The arguments are:
opt [required] |
A DB status parameter DB Status Parameter Constants that specifies what status information is
requested.
|
result [required] |
ADirectoryobject whose indexes will hold the requestion information on return. On
success the following indexes in the object will be valid:
CURRENT |
This index will contain the current value for the status information queried.
|
HIGHWATER |
This index will hold the high water mark for the status information queried.
|
|
reset [optional] |
Must be true or false to specify whether the high water mark should be reset, or not. The default if this argument is
omitted is false, do not reset the high water mark.
|
|
Return value: |
Returns a SQLite result Result Code Constants ,OKon success
otherwise an error code on failure.
|
Remarks: |
If the high water mark is reset, it is reset to the current value of the status information. The ooSQLite DB status
constants reflect the currently available SQLite DB status options. The set of SQLilte DB status options is likely to
grow in future releases of SQLite. When, or if, those options grow, the ooSQLite constants will be updated to reflect the
new options
|
Details: |
The functionality of thedbStatusmethod is similar to that of the SQLite
sqlite3_db_status API.
|
Example: |
This example checks the values of the page memory useed by the caches for the database connection and does not reset the
high water mark:
dbName = 'ooFoods.rdbx' |
|
dbConn = .ooSQLiteConnection~new(dbName, .ooSQLite~OPEN_READWRITE) |
|
if dbConn~initCode >.<. 0 then do |
-- do error handling and return |
end |
|
values = .directory~new |
|
ret = dbConn~dbStatus(.ooSQLite~DBSTATUS_CACHE_USED, values, .false) |
if ret == .dbConn~OK then do |
say 'Bytes of page memory used by all caches on this database connection:' |
say ' Current:' values~current ' High water:' values~highWater |
say |
end |
else do |
say 'Error returned from dbStatus():' ret |
say |
end |
|
/* Output might be: |
|
Bytes of page memory used by all caches on this database connection: |
Current: 16824 High water: 0 |
|
*/
|
|