Generic database select function.
Returns heatbeats from database in array beats. An optional limit
may be passed in limit.
The function returns the following error codes:
E_ALLOC if memory allocation failed.E_DB_BIND if value binding 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(beat_type), | intent(out), | allocatable | :: | beats(:) |
Returned beat types. |
|
| integer(kind=i8), | intent(in), | optional | :: | limit |
Max. number of beats. |
|
| integer(kind=i8), | intent(out), | optional | :: | nbeats |
Total number of beats in database. |
Iterator function that returns heatbeats from database in beat. An
optional limit may be passed in limit. The statement db_stmt
must be finalised once finished.
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. |
||
| type(beat_type), | intent(out) | :: | beat |
Returned beat type. |
||
| integer(kind=i8), | intent(in), | optional | :: | limit |
Max. number of beats. |
|
| logical, | intent(in), | optional | :: | validate |
Validate column types. |
Returns data points from observations database in dps. This
function selects only responses of error E_NONE, unless argument
error is passed, then only of the given error code.
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_STEP if step execution failed.E_DB_TYPE if returned columns are unexpected.| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(db_type), | intent(inout) | :: | db |
Database type. |
||
| type(dp_type), | intent(out), | allocatable | :: | dps(:) |
Returned data points. |
|
| character(len=*), | intent(in) | :: | node_id |
Node id. |
||
| character(len=*), | intent(in) | :: | sensor_id |
Sensor id. |
||
| character(len=*), | intent(in) | :: | target_id |
Target id. |
||
| character(len=*), | intent(in) | :: | response_name |
Response name. |
||
| character(len=*), | intent(in), | optional | :: | from |
Beginning of time span. |
|
| character(len=*), | intent(in), | optional | :: | to |
End of time span. |
|
| integer, | intent(in), | optional | :: | error |
Response error code. |
|
| logical, | intent(in), | optional | :: | desc |
Descending order. |
|
| integer(kind=i8), | intent(in), | optional | :: | limit |
Max. number of data points. |
|
| integer(kind=i8), | intent(out), | optional | :: | ndps |
Number of data points. |
Iterator function that returns data points from observations
database in dp. This function selects only responses of error
E_NONE, unless argument error is passed, then only of the given
error code. The statement db_stmt must be finalised once finished.
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. |
||
| type(dp_type), | intent(out) | :: | dp |
Returned data point. |
||
| character(len=*), | intent(in) | :: | node_id |
Node id. |
||
| character(len=*), | intent(in) | :: | sensor_id |
Sensor id. |
||
| character(len=*), | intent(in) | :: | target_id |
Target id. |
||
| character(len=*), | intent(in) | :: | response_name |
Response name. |
||
| character(len=*), | intent(in), | optional | :: | from |
Beginning of time span. |
|
| character(len=*), | intent(in), | optional | :: | to |
End of time span. |
|
| integer, | intent(in), | optional | :: | error |
Response error code. |
|
| logical, | intent(in), | optional | :: | desc |
Descending order. |
|
| integer(kind=i8), | intent(in), | optional | :: | limit |
Max. number of data points. |
|
| logical, | intent(in), | optional | :: | validate |
Validate column types. |
Returns images in allocatable array images.
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(image_type), | intent(out), | allocatable | :: | images(:) |
Returned image data 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 | :: | from |
Begin of time range. |
|
| character(len=*), | intent(in), | optional | :: | to |
End of time range. |
|
| logical, | intent(in), | optional | :: | desc |
Descending order. |
|
| integer(kind=i8), | intent(in), | optional | :: | limit |
Max. numbers of images. |
|
| integer(kind=i8), | intent(out), | optional | :: | nimages |
Total number of images. |
Iterator function that returns images in images. The statement
db_stmt must be finalised once finished.
The function returns the following error codes:
E_DB_BIND if value binding failed.E_DB_DONE if statement finished.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(db_stmt_type), | intent(inout) | :: | dbs |
Database statement type. |
||
| type(image_type), | intent(out) | :: | image |
Returned image type. |
||
| 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 | :: | from |
Begin of time range. |
|
| character(len=*), | intent(in), | optional | :: | to |
End of time range. |
|
| logical, | intent(in), | optional | :: | desc |
Descending order. |
|
| integer(kind=i8), | intent(in), | optional | :: | limit |
Max. numbers of images. |
|
| logical, | intent(in), | optional | :: | validate |
Validate column types. |
Returns logs in allocatable array logs.
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(log_type), | intent(out), | allocatable | :: | logs(:) |
Returned log data 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 | :: | observ_id |
Observation 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 |
Total number of logs. |
Iterator function that returns logs in logs. The statement
db_stmt must be finalised once finished.
The function returns the following error codes:
E_DB_BIND if value binding failed.E_DB_DONE if statement finished.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(db_stmt_type), | intent(inout) | :: | dbs |
Database statement type. |
||
| type(log_type), | intent(out) | :: | log |
Returned log type. |
||
| 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 | :: | observ_id |
Observation 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. |
Returns all sensor nodes in allocatable array nodes.
The function returns the following error codes:
E_ALLOC if memory allocation 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(node_type), | intent(out), | allocatable | :: | nodes(:) |
Returned node data array. |
|
| integer(kind=i8), | intent(out), | optional | :: | nnodes |
Number of nodes. |
Iterator function that returns all sensor nodes in node. The
statement db_stmt must be finalised once finished.
The function returns the following error codes:
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. |
||
| type(node_type), | intent(out) | :: | node |
Returned node data. |
||
| logical, | intent(in), | optional | :: | validate |
Validate column types. |
Returns observations in observs, with optional node id, sensor id,
target id, from, to. By default, observations are returned in
ascending order, unless desc is passed and .true.. The maximum
number of observations may be passed in limit.
The stub is .true., neither receivers nor requests are read from
database.
The total number of observations is returned in optional argument
nobservs.
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(observ_type), | intent(out), | allocatable | :: | observs(:) |
Returned observation data. |
|
| 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 | :: | from |
Beginning of time span. |
|
| character(len=*), | intent(in), | optional | :: | to |
End of time span. |
|
| logical, | intent(in), | optional | :: | desc |
Descending order. |
|
| integer(kind=i8), | intent(in), | optional | :: | limit |
Max. number of observations. |
|
| logical, | intent(in), | optional | :: | stub |
Without receivers, requests, responses. |
|
| integer(kind=i8), | intent(out), | optional | :: | nobservs |
Number of observations. |
Iterator function that returns observations in observ, with
optional node id, sensor id, target id, from, to. By default,
observations are returned in ascending order, unless desc is
passed and .true.. The maximum number of observations may be
passed in limit. The statement db_stmt must be finalised once
finished.
The stub is .true., neither receivers nor requests are read from
database.
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. |
||
| type(observ_type), | intent(out) | :: | observ |
Returned observation type. |
||
| 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 | :: | from |
Beginning of time span. |
|
| character(len=*), | intent(in), | optional | :: | to |
End of time span. |
|
| logical, | intent(in), | optional | :: | desc |
Descending order. |
|
| integer(kind=i8), | intent(in), | optional | :: | limit |
Max. number of observations. |
|
| logical, | intent(in), | optional | :: | stub |
Without receivers, requests, responses. |
|
| logical, | intent(in), | optional | :: | validate |
Validate column types. |
Returns all sensors in allocatable array sensors. If argument
node_id is passed, returns only sensors of this node.
The function returns the following error codes:
E_ALLOC if memory allocation 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.E_INVALID if node id is empty.| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(db_type), | intent(inout) | :: | db |
Database type. |
||
| type(sensor_type), | intent(out), | allocatable | :: | sensors(:) |
Returned sensor data array. |
|
| character(len=*), | intent(in), | optional | :: | node_id |
Node id. |
|
| integer(kind=i8), | intent(out), | optional | :: | nsensors |
Number of returned sensors. |
Iterator function that returns all sensors in sensor. The
statement db_stmt must be finalised once finished.
The function returns the following error codes:
E_DB_DONE if statement finished.E_DB_PREPARE if statement preparation failed.E_DB_TYPE if returned columns are unexpected.E_INVALID if node id is empty.| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(db_type), | intent(inout) | :: | db |
Database type. |
||
| type(db_stmt_type), | intent(inout) | :: | dbs |
Database statement type. |
||
| type(sensor_type), | intent(out) | :: | sensor |
Returned sensor data. |
||
| character(len=*), | intent(in), | optional | :: | node_id |
Node id. |
|
| logical, | intent(in), | optional | :: | validate |
Validate column types. |
Returns number of targets and array of target data in allocatable
array targets, if query was successful.
The function returns the following error codes:
E_ALLOC if memory allocation 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(target_type), | intent(out), | allocatable | :: | targets(:) |
Target data array. |
|
| integer(kind=i8), | intent(out), | optional | :: | ntargets |
Number of selected targets. |
Iterator function that returns all targets in target. The
statement db_stmt must be finalised once finished.
The function returns the following error codes:
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. |
||
| type(target_type), | intent(out) | :: | target |
Target data. |
||
| logical, | intent(in), | optional | :: | validate |
Validate column types. |
Returns heartbeat associated with given node id in beat.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(db_type), | intent(inout) | :: | db |
Database type. |
||
| type(beat_type), | intent(out) | :: | beat |
Returned beat type. |
||
| character(len=*), | intent(in) | :: | node_id |
Node id. |
Returns image data associated with given image id from images table.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(db_type), | intent(inout) | :: | db |
Database type. |
||
| type(image_type), | intent(out) | :: | image |
Returned image data. |
||
| character(len=*), | intent(in) | :: | image_id |
Image id. |
Returns log associated with given id in log.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(db_type), | intent(inout) | :: | db |
Database type. |
||
| type(log_type), | intent(out) | :: | log |
Returned log data. |
||
| character(len=*), | intent(in) | :: | log_id |
Log id. |
Returns node data associated with given id in node.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(db_type), | intent(inout) | :: | db |
Database type. |
||
| type(node_type), | intent(out) | :: | node |
Returned node data. |
||
| character(len=*), | intent(in) | :: | node_id |
Node id. |
Returns observation referenced by the given id from database.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(db_type), | intent(inout) | :: | db |
Database type. |
||
| type(observ_type), | intent(out) | :: | observ |
Selected observation. |
||
| character(len=*), | intent(in) | :: | observ_id |
Observation id (UUID). |
Returns sensor data associated with given sensor id from database.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(db_type), | intent(inout) | :: | db |
Database type. |
||
| type(sensor_type), | intent(out) | :: | sensor |
Returned sensor data. |
||
| character(len=*), | intent(in) | :: | sensor_id |
Sensor id. |
Returns target data associated with given target id from database.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(db_type), | intent(inout) | :: | db |
Database type. |
||
| type(target_type), | intent(out) | :: | target |
Returned target data. |
||
| character(len=*), | intent(in) | :: | target_id |
Target id. |
Returns transfer data associated with given transfer id and/or type_id from transfer database.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(db_type), | intent(inout) | :: | db |
Database type. |
||
| type(transfer_type), | intent(out) | :: | transfer |
Returned transfer data. |
||
| character(len=*), | intent(in), | optional | :: | transfer_id |
Transfer id. |
|
| character(len=*), | intent(in), | optional | :: | type_id |
Transfer type id. |