Generic JSON logs select function.
Returns logs in JSON format in allocatable string type array
strings.
If no logs have been found, the array will be empty, and the
function returns E_DB_NO_ROWS.
The function returns the following error codes:
E_ALLOC if memory allocation failed.E_DB_BIND if value binding failed.E_DB_FINALIZE if statement finalisation failed.E_DB_NO_ROWS if no rows are returned.E_DB_PREPARE if statement preparation failed.E_DB_TYPE if returned columns are unexpected.| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(db_type), | intent(inout) | :: | db |
Database type. |
||
| type(string_type), | intent(out), | allocatable | :: | strings(:) |
Returned JSON array. |
|
| character(len=*), | intent(in), | optional | :: | node_id |
Node id. |
|
| character(len=*), | intent(in), | optional | :: | sensor_id |
Sensor id. |
|
| character(len=*), | intent(in), | optional | :: | target_id |
Target id. |
|
| character(len=*), | intent(in), | optional | :: | source |
Source name. |
|
| character(len=*), | intent(in), | optional | :: | from |
Begin of time range. |
|
| character(len=*), | intent(in), | optional | :: | to |
End of time range. |
|
| integer, | intent(in), | optional | :: | min_level |
Minimum log level. |
|
| integer, | intent(in), | optional | :: | max_level |
Maximum log level. |
|
| integer, | intent(in), | optional | :: | error |
Error code. |
|
| logical, | intent(in), | optional | :: | desc |
Descending order. |
|
| integer(kind=i8), | intent(in), | optional | :: | limit |
Max. numbers of logs. |
|
| integer(kind=i8), | intent(out), | optional | :: | nlogs |
Number of logs. |
Iterator function that returns logs in JSON format in allocatable
character json. The statement dbs must be finalised once
finished.
If no logs have been found, the string will be empty, and the
function returns E_DB_NO_ROWS.
The function returns the following error codes:
E_DB_BIND if value binding failed.E_DB_DONE if statement finished.E_DB_PREPARE if statement preparation failed.E_DB_TYPE if returned columns are unexpected.| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(db_type), | intent(inout) | :: | db |
Database type. |
||
| type(db_stmt_type), | intent(inout) | :: | dbs |
Database statement type. |
||
| character(len=:), | intent(out), | allocatable | :: | json |
Returned JSON. |
|
| character(len=*), | intent(in), | optional | :: | node_id |
Node id. |
|
| character(len=*), | intent(in), | optional | :: | sensor_id |
Sensor id. |
|
| character(len=*), | intent(in), | optional | :: | target_id |
Target id. |
|
| character(len=*), | intent(in), | optional | :: | source |
Source name. |
|
| character(len=*), | intent(in), | optional | :: | from |
Begin of time range. |
|
| character(len=*), | intent(in), | optional | :: | to |
End of time range. |
|
| integer, | intent(in), | optional | :: | min_level |
Minimum log level. |
|
| integer, | intent(in), | optional | :: | max_level |
Maximum log level. |
|
| integer, | intent(in), | optional | :: | error |
Error code. |
|
| logical, | intent(in), | optional | :: | desc |
Descending order. |
|
| integer(kind=i8), | intent(in), | optional | :: | limit |
Max. numbers of logs. |
|
| logical, | intent(in), | optional | :: | validate |
Validate column types. |