quasardb C API: Time series operations

quasardb C API

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Data Structures | Macros | Typedefs | Enumerations | Functions
Time series operations

## Data Structures
struct | qdb_ts_double_point
| A timestamped data with a double-precision floating-point value. More...
struct | qdb_ts_blob_point
| A timestamped data with a binary content. More...
struct | qdb_ts_int64_point
| A timestamped data with a signed 64-bit integer value. More...
struct | qdb_ts_timestamp_point
| A timestamped data with a signed 64-bit integer value. More...
struct | qdb_ts_string_point
| A timestamped data with a string content. More...
struct | qdb_ts_range_t
| Time interval. More...
struct | qdb_ts_blob_aggregation_t
| Aggregation input and result for columns of blobs. More...
struct | qdb_ts_double_aggregation_t
| Aggregation input and result for columns of numeric floating-point values. More...
struct | qdb_ts_int64_aggregation_t
| Aggregation input and result for columns of numeric integer values. More...
struct | qdb_ts_string_aggregation_t
| Aggregation input and result for columns of strings. More...
struct | qdb_ts_timestamp_aggregation_t
| Aggregation input and result for columns of timestamp values. More...
struct | qdb_ts_column_info_t
| Description of a time series column. More...
struct | qdb_ts_column_info_ex_t
| Description of a time series column, perhaps with its symtable. More...
struct | qdb_ts_batch_column_info_t
| Description of a batch column info. More...
struct | qdb_ts_batch_unchecked_column_info_t
| Description of a batch column that will not be checked. More...
struct | qdb_blob_t
| A representation of binary data. More...
struct | qdb_exp_batch_push_column_t
| Column sent to the server in a batch. More...
struct | qdb_exp_batch_push_column_schema_t
| Schema of a column sent to the server in a batch. More...
struct | qdb_exp_batch_push_table_data_t
| Data of a table sent to the server in a batch. More...
struct | qdb_string_array_t
| String array. More...
struct | qdb_exp_batch_push_table_t
| Data and metadata of a table sent to the server in a batch. More...
struct | qdb_exp_batch_push_table_schema_t
| Schema of a table sent to the server in a batch. Indexed by the table and column names given in qdb_exp_batch_push_table_t. More...
struct | qdb_arrow_column_t
| Holds a column in Arrow format. More...
struct | qdb_exp_batch_push_arrow_data_t
| Holds the table in Arrow format. More...
struct | qdb_exp_batch_push_arrow_table_t
| Data and metadata of a table sent to the server in a batch. More...

## Macros
#define | QDB_IS_NULL_DOUBLE(pt) (isnan(pt.value))
| True if and only if the qdb_ts_double_point represents a null value.
#define | QDB_IS_NULL_BLOB(pt) (pt.content_length == 0)
| True if and only if the qdb_ts_blob_point represents a null value.
#define | QDB_IS_NULL_INT64(pt) (pt.value == ((qdb_int_t)0x8000000000000000ll))
| True if and only if the qdb_ts_int64_point represents a null value.
#define | QDB_IS_NULL_TIMESTAMP(pt)
| True if and only if the qdb_ts_timestamp_point represents a null value.
#define | QDB_IS_NULL_STRING(pt) (pt.content_length == 0)
| True if and only if the qdb_ts_string_point represents a null value.

## Typedefs
typedef enum qdb_ts_aggregation_type_t | qdb_ts_aggregation_type_t
| Types of aggregations that can be computed on a time series.
typedef enum qdb_ts_column_type_t | qdb_ts_column_type_t
| Types of time series columns.
typedef qdb_uint_t | qdb_ts_column_index_t
| Index of a time series columns. Does not necessarily match the column position at table creation due to modifications to the table schema (by adding, renaming or removing columns).
typedef struct qdb_local_table_internal * | qdb_local_table_t
| An opaque local table structure used for bulk insertions.
typedef struct qdb_batch_table_internal * | qdb_batch_table_t
| An opaque batch table structure used for bulk insertions.

## Enumerations
enum | qdb_ts_aggregation_type_t { qdb_agg_first = 0, qdb_agg_last = 1, qdb_agg_min = 2, qdb_agg_max = 3, qdb_agg_arithmetic_mean = 4, qdb_agg_harmonic_mean = 5, qdb_agg_geometric_mean = 6, qdb_agg_quadratic_mean = 7, qdb_agg_count = 8, qdb_agg_sum = 9, qdb_agg_sum_of_squares = 10, qdb_agg_spread = 11, qdb_agg_sample_variance = 12, qdb_agg_sample_stddev = 13, qdb_agg_population_variance = 14, qdb_agg_population_stddev = 15, qdb_agg_abs_min = 16, qdb_agg_abs_max = 17, qdb_agg_product = 18, qdb_agg_skewness = 19, qdb_agg_kurtosis = 20, qdb_agg_none = 21, qdb_agg_distinct_count = 22, qdb_agg_adjacent_count = 29, qdb_agg_sum_of_abs = 32, qdb_agg_sum_of_abs_changes }
| Types of aggregations that can be computed on a time series. More...
enum | qdb_ts_column_type_t { , qdb_ts_column_double = 0, qdb_ts_column_blob = 1, qdb_ts_column_int64 = 2, qdb_ts_column_timestamp, qdb_ts_column_string = 4, qdb_ts_column_symbol }
| Types of time series columns. More...
enum | qdb_exp_batch_push_options_t { qdb_exp_batch_option_standard = 0, qdb_exp_batch_option_unique = 1 }
| Ways of working with duplicated data in qdb_exp_batch_push. More...
enum | qdb_exp_batch_push_mode_t { qdb_exp_batch_push_transactional = 0, qdb_exp_batch_push_truncate = 1, qdb_exp_batch_push_fast = 2, qdb_exp_batch_push_async = 3 }
| Ways of pushing data to timeseries with qdb_exp_batch_push. More...

## Functions
QDB_API_LINKAGE qdb_error_t | qdb_ts_create (qdb_handle_t handle, const char *alias, qdb_uint_t shard_size_ms, const qdb_ts_column_info_t *columns, qdb_size_t column_count)
| Creates a time series. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_create_ex (qdb_handle_t handle, const char *alias, qdb_uint_t shard_size_ms, const qdb_ts_column_info_ex_t *columns, qdb_size_t column_count)
| Creates a time series. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_insert_columns (qdb_handle_t handle, const char *alias, const qdb_ts_column_info_t *columns, qdb_size_t column_count)
| Appends columns to an existing time series. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_insert_columns_ex (qdb_handle_t handle, const char *alias, const qdb_ts_column_info_ex_t *columns, qdb_size_t column_count)
| Appends columns to an existing time series. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_list_columns (qdb_handle_t handle, const char *alias, qdb_ts_column_info_t **columns, qdb_size_t *column_count)
| Returns all the columns of a time series. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_list_columns_ex (qdb_handle_t handle, const char *alias, qdb_ts_column_info_ex_t **columns, qdb_size_t *column_count)
| Returns all the columns of a time series. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_shard_size (qdb_handle_t handle, const char *alias, qdb_uint_t *shard_size)
| Returns the shard size of a time series. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_blob_insert (qdb_handle_t handle, const char *alias, const char *column, const qdb_ts_blob_point *values, qdb_size_t value_count)
| Inserts blob points in a time series column. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_blob_insert_truncate (qdb_handle_t handle, const char *alias, const char *column, const qdb_ts_range_t *ranges, qdb_size_t range_count, const qdb_ts_blob_point *values, qdb_size_t value_count)
| Inserts blob points in a time series and erases given ranges in the same transaction. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_double_insert (qdb_handle_t handle, const char *alias, const char *column, const qdb_ts_double_point *values, qdb_size_t value_count)
| Inserts double points in a time series. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_double_insert_truncate (qdb_handle_t handle, const char *alias, const char *column, const qdb_ts_range_t *ranges, qdb_size_t range_count, const qdb_ts_double_point *values, qdb_size_t value_count)
| Inserts double points in a time series and erases given ranges in the same transaction. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_int64_insert (qdb_handle_t handle, const char *alias, const char *column, const qdb_ts_int64_point *values, qdb_size_t value_count)
| Inserts int64 points in a time series. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_int64_insert_truncate (qdb_handle_t handle, const char *alias, const char *column, const qdb_ts_range_t *ranges, qdb_size_t range_count, const qdb_ts_int64_point *values, qdb_size_t value_count)
| Inserts int64 points in a time series and erases given ranges in the same transaction. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_string_insert (qdb_handle_t handle, const char *alias, const char *column, const qdb_ts_string_point *values, qdb_size_t value_count)
| Inserts string points in a time series column. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_string_insert_truncate (qdb_handle_t handle, const char *alias, const char *column, const qdb_ts_range_t *ranges, qdb_size_t range_count, const qdb_ts_string_point *values, qdb_size_t value_count)
| Inserts string points in a time series and erases given ranges in the same transaction. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_timestamp_insert (qdb_handle_t handle, const char *alias, const char *column, const qdb_ts_timestamp_point *values, qdb_size_t value_count)
| Inserts timestamp points in a time series. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_timestamp_insert_truncate (qdb_handle_t handle, const char *alias, const char *column, const qdb_ts_range_t *ranges, qdb_size_t range_count, const qdb_ts_timestamp_point *values, qdb_size_t value_count)
| Inserts timestamp points in a time series and erases given ranges in the same transaction. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_blob_get_ranges (qdb_handle_t handle, const char *alias, const char *column, const qdb_ts_range_t *ranges, qdb_size_t range_count, qdb_ts_blob_point **points, qdb_size_t *point_count)
| Retrieves blobs in the specified range of the time series column. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_blob_get_ranges_no_copy (qdb_handle_t handle, const char *alias, const char *column, const qdb_ts_range_t *ranges, qdb_size_t range_count, qdb_ts_blob_point *points, qdb_size_t *point_count)
| Retrieves blobs in the specified range of the time series column. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_double_get_ranges (qdb_handle_t handle, const char *alias, const char *column, const qdb_ts_range_t *ranges, qdb_size_t range_count, qdb_ts_double_point **points, qdb_size_t *point_count)
| Retrieves doubles in the specified range of the time series column. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_double_get_ranges_no_copy (qdb_handle_t handle, const char *alias, const char *column, const qdb_ts_range_t *ranges, qdb_size_t range_count, qdb_ts_double_point *points, qdb_size_t *point_count)
| Retrieves doubles in the specified range of the time series column. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_int64_get_ranges (qdb_handle_t handle, const char *alias, const char *column, const qdb_ts_range_t *ranges, qdb_size_t range_count, qdb_ts_int64_point **points, qdb_size_t *point_count)
| Retrieves 64-bit integers in the specified range of the time series column. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_int64_get_ranges_no_copy (qdb_handle_t handle, const char *alias, const char *column, const qdb_ts_range_t *ranges, qdb_size_t range_count, qdb_ts_int64_point *points, qdb_size_t *point_count)
| Retrieves 64-bit integers in the specified range of the time series column. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_string_get_ranges (qdb_handle_t handle, const char *alias, const char *column, const qdb_ts_range_t *ranges, qdb_size_t range_count, qdb_ts_string_point **points, qdb_size_t *point_count)
| Retrieves strings in the specified range of the time series column. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_string_get_ranges_no_copy (qdb_handle_t handle, const char *alias, const char *column, const qdb_ts_range_t *ranges, qdb_size_t range_count, qdb_ts_string_point *points, qdb_size_t *point_count)
| Retrieves strings in the specified range of the time series column. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_timestamp_get_ranges (qdb_handle_t handle, const char *alias, const char *column, const qdb_ts_range_t *ranges, qdb_size_t range_count, qdb_ts_timestamp_point **points, qdb_size_t *point_count)
| Retrieves timestamps in the specified range of the time series column. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_timestamp_get_ranges_no_copy (qdb_handle_t handle, const char *alias, const char *column, const qdb_ts_range_t *ranges, qdb_size_t range_count, qdb_ts_timestamp_point *points, qdb_size_t *point_count)
| Retrieves timestamps in the specified range of the time series column. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_blob_aggregate (qdb_handle_t handle, const char *alias, const char *column, qdb_ts_blob_aggregation_t *aggregations, qdb_size_t aggregation_count)
| Aggregate a sub-part of a blob column of the time series. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_double_aggregate (qdb_handle_t handle, const char *alias, const char *column, qdb_ts_double_aggregation_t *aggregations, qdb_size_t aggregation_count)
| Aggregate a sub-part of the double column of the time series. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_int64_aggregate (qdb_handle_t handle, const char *alias, const char *column, qdb_ts_int64_aggregation_t *aggregations, qdb_size_t aggregation_count)
| Aggregate a sub-part of the int64 column of the time series. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_string_aggregate (qdb_handle_t handle, const char *alias, const char *column, qdb_ts_string_aggregation_t *aggregations, qdb_size_t aggregation_count)
| Aggregate a sub-part of a string column of the time series. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_timestamp_aggregate (qdb_handle_t handle, const char *alias, const char *column, qdb_ts_timestamp_aggregation_t *aggregations, qdb_size_t aggregation_count)
| Aggregate a sub-part of the timestamp column of the time series. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_get_timestamps (qdb_handle_t handle, const char *alias, const char *column, const qdb_ts_range_t *ranges, qdb_size_t range_count, qdb_timespec_t **timestamps, qdb_size_t *timestamp_count)
| Retrieves the timestamps, not the values, for a given timeseries column or the aggregation of all columns. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_erase_ranges (qdb_handle_t handle, const char *alias, const char *column, const qdb_ts_range_t *ranges, qdb_size_t range_count, qdb_uint_t *erased_count)
| Erase all points in the specified range (left inclusive). More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_local_table_init (qdb_handle_t handle, const char *alias, const qdb_ts_column_info_t *columns, qdb_size_t column_count, qdb_local_table_t *table)
| Initialize a local table for bulk insertion in time series. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_row_get_blob (qdb_local_table_t table, qdb_size_t column_index, const void **content, qdb_size_t *content_length)
| Retrieves blob data from the current row at the specified column. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_row_get_blob_no_copy (qdb_local_table_t table, qdb_size_t column_index, const void **content, qdb_size_t *content_length)
| Retrieves blob data from the current row at the specified column without performing copy of data internal to data. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_row_get_string (qdb_local_table_t table, qdb_size_t column_index, const char **content, qdb_size_t *content_length)
| Retrieves string data from the current row at the specified column. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_row_get_string_no_copy (qdb_local_table_t table, qdb_size_t column_index, const char **content, qdb_size_t *content_length)
| Retrieves string data from the current row at the specified column without performing copy of data internal to data. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_row_get_double (qdb_local_table_t table, qdb_size_t column_index, double *value)
| Retrieves double value from the current row at the specified column. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_row_get_int64 (qdb_local_table_t table, qdb_size_t column_index, qdb_int_t *value)
| Retrieves signed 64-bit integer value from the current row at the specified column. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_row_get_timestamp (qdb_local_table_t table, qdb_size_t column_index, qdb_timespec_t *value)
| Retrieves timestamp value from the current row at the specified column. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_table_next_row (qdb_local_table_t table, qdb_timespec_t *timestamp)
| Fetch data and advance to the next row. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_table_get_ranges (qdb_local_table_t table, const qdb_ts_range_t *ranges, qdb_size_t range_count)
| Retrieve all the specified rows from the database. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_table_stream_ranges (qdb_local_table_t table, const qdb_ts_range_t *ranges, qdb_size_t range_count)
| Retrieve shard by shard the specified rows from the database. The table is then seen as it was then this function was called. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_batch_table_init (qdb_handle_t handle, const qdb_ts_batch_column_info_t *columns, qdb_size_t column_count, qdb_batch_table_t *table)
| Initialize a batch table for bulk insertion in time series. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_batch_table_unchecked_init (qdb_handle_t handle, const qdb_ts_batch_unchecked_column_info_t *columns, qdb_size_t column_count, qdb_batch_table_t *table)
| Initialize a batch table for bulk insertion in time series. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_batch_table_extra_columns (qdb_batch_table_t table, const qdb_ts_batch_column_info_t *columns, qdb_size_t column_count)
| Add extra columns to a batch table for bulk insertion in time series. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_batch_table_unchecked_extra_columns (qdb_batch_table_t table, const qdb_ts_batch_unchecked_column_info_t *columns, qdb_size_t column_count)
| Add extra columns to a batch table for bulk insertion in time series. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_batch_start_row (qdb_batch_table_t table, const qdb_timespec_t *timestamp)
| Start a new row to the outcoming data buffer. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_batch_row_set_blob (qdb_batch_table_t table, qdb_size_t index, const void *content, qdb_size_t content_length)
| Set a value in the current row in a column of blobs. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_batch_row_set_blob_no_copy (qdb_batch_table_t table, qdb_size_t index, const void *content, qdb_size_t content_length)
| Set a value in the current row in a column of blobs without copying data. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_batch_row_set_string (qdb_batch_table_t table, qdb_size_t index, const char *content, qdb_size_t content_length)
| Set a value in the current row in a column of strings. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_batch_row_set_string_no_copy (qdb_batch_table_t table, qdb_size_t index, const char *content, qdb_size_t content_length)
| Set a value in the current row in a column of strings without copying data. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_batch_row_set_double (qdb_batch_table_t table, qdb_size_t index, double value)
| Set a value in the current row in a column of doubles. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_batch_row_set_int64 (qdb_batch_table_t table, qdb_size_t index, qdb_int_t value)
| Set a value in the current row in a column of integers. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_batch_row_set_timestamp (qdb_batch_table_t table, qdb_size_t index, const qdb_timespec_t *value)
| Set a value in the current row in a column of timestamps. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_batch_pin_blob_column (qdb_batch_table_t table, qdb_size_t index, qdb_size_t capacity, qdb_timespec_t *timestamp, qdb_time_t **timeoffsets, qdb_blob_t **data)
| Resize and get direct access to a blob column. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_batch_pin_double_column (qdb_batch_table_t table, qdb_size_t index, qdb_size_t capacity, qdb_timespec_t *timestamp, qdb_time_t **timeoffsets, double **data)
| Resize and get direct access to a double column. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_batch_pin_int64_column (qdb_batch_table_t table, qdb_size_t index, qdb_size_t capacity, qdb_timespec_t *timestamp, qdb_time_t **timeoffsets, qdb_int_t **data)
| Resize and get direct access to a int64 column. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_batch_pin_string_column (qdb_batch_table_t table, qdb_size_t index, qdb_size_t capacity, qdb_timespec_t *timestamp, qdb_time_t **timeoffsets, qdb_string_t **data)
| Resize and get direct access to a string column. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_batch_pin_timestamp_column (qdb_batch_table_t table, qdb_size_t index, qdb_size_t capacity, qdb_timespec_t *timestamp, qdb_time_t **timeoffsets, qdb_timespec_t **data)
| Resize and get direct access to a timestamp column. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_batch_shrink_pinned_column (qdb_batch_table_t table, qdb_size_t index, qdb_size_t size)
| Resize the column without invalidating the pointers. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_batch_unsafe_resize_pinned_column (qdb_batch_table_t table, qdb_size_t index, qdb_size_t size)
| Resize the column with no guarantee the pointers will not be invalidated. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_batch_release_columns_memory (qdb_batch_table_t table)
| Release memory of all cached columns. The tables metadata are kept. More...
qdb_time_t | qdb_ts_bucket_base_time (qdb_timespec_t timestamp, qdb_duration_t shard_size)
| Returns the base time of the bucket given a timestamp and the shard_size of the timeseries. More...
qdb_time_t | qdb_ts_bucket_offset (qdb_timespec_t timestamp, qdb_duration_t shard_size)
| Returns the offset of the bucket (from its base time) given a timestamp and the shard_size of the timeseries. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_batch_push (qdb_batch_table_t table)
| Push the current batch table. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_batch_push_fast (qdb_batch_table_t table)
| Push the current batch table, non transactional. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_batch_push_async (qdb_batch_table_t table)
| Push asynchronously the current batch table. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_batch_push_truncate (qdb_batch_table_t table, const qdb_ts_range_t *ranges, qdb_size_t range_count)
| Push the current batch table, erasing previously stored points in the given ranges, transactionally. More...
QDB_API_LINKAGE qdb_error_t | qdb_exp_batch_push (qdb_handle_t handle, qdb_exp_batch_push_mode_t mode, const qdb_exp_batch_push_table_t *tables, const qdb_exp_batch_push_table_schema_t **table_schemas, qdb_size_t table_count)
| Push the tables content to the server. Sort given rows if needed. Write table info if asked. More...
QDB_API_LINKAGE qdb_error_t | qdb_exp_batch_push_arrow (qdb_handle_t handle, qdb_exp_batch_push_mode_t mode, qdb_exp_batch_push_arrow_table_t *tables, const qdb_exp_batch_push_table_schema_t **table_schemas, qdb_size_t table_count)
| Push the tables content to the server in Arrow format. If needed, data rows will be sorted. Optionally, export table schemas. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_expire_by_size (qdb_handle_t handle, const char *alias, qdb_uint_t size)
| Trim the timeseries, so that it uses approximately the provided size. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_bucket_nuke_by_id (qdb_handle_t handle, const char *bucket_id)
| Remove the given shard. More...
QDB_API_LINKAGE qdb_error_t | qdb_ts_bucket_nuke_by_name (qdb_handle_t handle, const char *table, qdb_time_t shard_base_time)
| Remove the given shard. More...

## Detailed Description

Warning
  Time series are under development. Performance and compatibility are not guaranteed.

## Enumeration Type Documentation

enum qdb_exp_batch_push_mode_t

Ways of pushing data to timeseries with qdb_exp_batch_push.

Enumerator
qdb_exp_batch_push_transactional | Standard way of pushing values, as a fully transactional operation.
qdb_exp_batch_push_truncate | Truncate previous data in the given ranges from qdb_exp_batch_push_table_t during the batch push transaction. Works otherwise like qdb_exp_batch_push_transactional.
qdb_exp_batch_push_fast | Update timeseries buckets inplace. Faster than qdb_exp_batch_push_transactional for small incremental writes. However, does not modify different tables at once and partial modifications are not rolled back.
qdb_exp_batch_push_async | Sent data are asynchronously updated by the server using qdb_exp_batch_push_fast strategy. Faster than qdb_exp_batch_push_fast when multiple clients are modifying the same tables simultaneously. However, the data are generally not yet inserted when the call returns.

enum qdb_exp_batch_push_options_t

Ways of working with duplicated data in qdb_exp_batch_push.

Enumerator
qdb_exp_batch_option_standard | Standard way of pushing values.
qdb_exp_batch_option_unique | Operation works with the duplicated data removing.

enum qdb_ts_aggregation_type_t

Types of aggregations that can be computed on a time series.

Enumerator
qdb_agg_first | The first (earliest) data point.
qdb_agg_last | The last (latest) data point.
qdb_agg_min | The data point with the smallest value.
qdb_agg_max | The data point with the largest value.
qdb_agg_arithmetic_mean | The arithmetic mean (average).
qdb_agg_harmonic_mean | The harmonic mean.
qdb_agg_geometric_mean | The geometric mean.
qdb_agg_quadratic_mean | The quadratic mean (root mean squaer).
qdb_agg_count | The number of data points.
qdb_agg_sum | The sum of values.
qdb_agg_sum_of_squares | The sum of squares of values.
qdb_agg_spread | The difference between the maximum value and the minimum value.
qdb_agg_sample_variance | The sample variance.
qdb_agg_sample_stddev | The sample standard deviation.
qdb_agg_population_variance | The population variance.
qdb_agg_population_stddev | The population standard deviation.
qdb_agg_abs_min | The value with the smallest absolute value.
qdb_agg_abs_max | The value with the largest absolute value.
qdb_agg_product | The product.
qdb_agg_skewness | The skewness (shape parameter).
qdb_agg_kurtosis | The kurtosis (shape parameter).
qdb_agg_none | Scalar (no aggregation).
qdb_agg_distinct_count | The number of data points with distinct values.
qdb_agg_adjacent_count | The number of different adjacent values.
qdb_agg_sum_of_abs | The sum of absolute values.
qdb_agg_sum_of_abs_changes | The sum of absolute changes between consecutive values.

enum qdb_ts_column_type_t

Types of time series columns.

Enumerator
qdb_ts_column_double | Column of floating point values.
qdb_ts_column_blob | Column of binary data.
qdb_ts_column_int64 | Column of signed 64-bit integer values.
qdb_ts_column_timestamp | Column of nanosecond-precision timestamps.
qdb_ts_column_string | Column of string data.
qdb_ts_column_symbol | Column of strings stored as 64-bit integers.

## Function Documentation

QDB_API_LINKAGE qdb_error_t qdb_exp_batch_push | ( | qdb_handle_t | handle,
|  | qdb_exp_batch_push_mode_t | mode,
|  | const qdb_exp_batch_push_table_t * | tables,
|  | const qdb_exp_batch_push_table_schema_t ** | table_schemas,
|  | qdb_size_t | table_count
| ) |  |

Push the tables content to the server. Sort given rows if needed. Write table info if asked.

Parameters

  handle | A valid handle previously initialized by qdb_open or qdb_open_tcp.
  tables | The tables to send.
  table_schemas | An optional pointer to the tables schema: if it's null, the tables schema will be retrieved from the server. if the underlying pointer is null, the tables schema will also be retrieved from the server, and exported to the given pointer. It must then released with qdb_release. it the underlying pointer is not null, it will assume the given schema and not verifying it with the server before sending tables content.
  table_count | The number of tables.
  mode | Specifies how the data are pushed.

Returns
  A qdb_error_t code indicating success or failure.

QDB_API_LINKAGE qdb_error_t qdb_exp_batch_push_arrow | ( | qdb_handle_t | handle,
|  | qdb_exp_batch_push_mode_t | mode,
|  | qdb_exp_batch_push_arrow_table_t * | tables,
|  | const qdb_exp_batch_push_table_schema_t ** | table_schemas,
|  | qdb_size_t | table_count
| ) |  |

Push the tables content to the server in Arrow format. If needed, data rows will be sorted. Optionally, export table schemas.

Parameters

  handle | A valid handle previously initialized by qdb_open or qdb_open_tcp.
  tables | The tables to send.

Warning
  This parameter used "Move" logic like "C++ std::move". Inside the function call all data fields will be grabbed.

Parameters

  table_schemas | An optional pointer to the tables schemas: if it's null, the tables schemas will be retrieved from the server. if the underlying pointer is null, the tables schemas will be retrieved from the server and exported to the given pointer. It must then be released with qdb_release. if the underlying pointer is not null, it will assume the given schemas without verifying it with the server before sending tables content.
  table_count | The number of tables (and table schemas if present).
  mode | Specifies how the data are pushed.

Returns
  A qdb_error_t code indicating success or failure.

QDB_API_LINKAGE qdb_error_t qdb_ts_batch_pin_blob_column | ( | qdb_batch_table_t | table,
|  | qdb_size_t | index,
|  | qdb_size_t | capacity,
|  | qdb_timespec_t * | timestamp,
|  | qdb_time_t ** | timeoffsets,
|  | qdb_blob_t ** | data
| ) |  |

Resize and get direct access to a blob column.

Parameters

  | table | A valid batch table previously initialized by qdb_ts_batch_table_init.
  | index | A valid index to the column you want to access.
  | capacity | A valid capacity to resize to.
  | timestamp | A valid timestamp in the shard you wish to pin.
  [out] | timeoffsets | A pointer to access the time offsets of the column.
  [out] | data | A pointer to access the blob data of the column.

Returns
  A qdb_error_t code indicating success or failure.

QDB_API_LINKAGE qdb_error_t qdb_ts_batch_pin_double_column | ( | qdb_batch_table_t | table,
|  | qdb_size_t | index,
|  | qdb_size_t | capacity,
|  | qdb_timespec_t * | timestamp,
|  | qdb_time_t ** | timeoffsets,
|  | double ** | data
| ) |  |

Resize and get direct access to a double column.

Parameters

  | table | A valid batch table previously initialized by qdb_ts_batch_table_init.
  | index | A valid index to the column you want to access.
  | capacity | A valid capacity to resize to.
  | timestamp | A valid timestamp in the shard you wish to pin.
  [out] | timeoffsets | A pointer to access the time offsets of the column.
  [out] | data | A pointer to access the double data of the column.

Returns
  A qdb_error_t code indicating success or failure.

QDB_API_LINKAGE qdb_error_t qdb_ts_batch_pin_int64_column | ( | qdb_batch_table_t | table,
|  | qdb_size_t | index,
|  | qdb_size_t | capacity,
|  | qdb_timespec_t * | timestamp,
|  | qdb_time_t ** | timeoffsets,
|  | qdb_int_t ** | data
| ) |  |

Resize and get direct access to a int64 column.

Parameters

  | table | A valid batch table previously initialized by qdb_ts_batch_table_init.
  | index | A valid index to the column you want to access.
  | capacity | A valid capacity to resize to.
  | timestamp | A valid timestamp in the shard you wish to pin.
  [out] | timeoffsets | A pointer to access the time offsets of the column.
  [out] | data | A pointer to access the int64 data of the column.

Returns
  A qdb_error_t code indicating success or failure.

QDB_API_LINKAGE qdb_error_t qdb_ts_batch_pin_string_column | ( | qdb_batch_table_t | table,
|  | qdb_size_t | index,
|  | qdb_size_t | capacity,
|  | qdb_timespec_t * | timestamp,
|  | qdb_time_t ** | timeoffsets,
|  | qdb_string_t ** | data
| ) |  |

Resize and get direct access to a string column.

Parameters

  | table | A valid batch table previously initialized by qdb_ts_batch_table_init.
  | index | A valid index to the column you want to access.
  | capacity | A valid capacity to resize to.
  | timestamp | A valid timestamp in the shard you wish to pin.
  [out] | timeoffsets | A pointer to access the time offsets of the column.
  [out] | data | A pointer to access the string data of the column.

Returns
  A qdb_error_t code indicating success or failure.

QDB_API_LINKAGE qdb_error_t qdb_ts_batch_pin_timestamp_column | ( | qdb_batch_table_t | table,
|  | qdb_size_t | index,
|  | qdb_size_t | capacity,
|  | qdb_timespec_t * | timestamp,
|  | qdb_time_t ** | timeoffsets,
|  | qdb_timespec_t ** | data
| ) |  |

Resize and get direct access to a timestamp column.

Parameters

  | table | A valid batch table previously initialized by qdb_ts_batch_table_init.
  | index | A valid index to the column you want to access.
  | capacity | A valid capacity to resize to.
  | timestamp | A valid timestamp in the shard you wish to pin.
  [out] | timeoffsets | A pointer to access the time offsets of the column.
  [out] | data | A pointer to access the timestamp data of the column.

Returns
  A qdb_error_t code indicating success or failure.

QDB_API_LINKAGE qdb_error_t qdb_ts_batch_push | ( | qdb_batch_table_t | table | ) |

Push the current batch table.

Parameters

  table | A valid batch table previously initialized by qdb_ts_batch_table_init.

Returns
  A qdb_error_t code indicating success or failure.

QDB_API_LINKAGE qdb_error_t qdb_ts_batch_push_async | ( | qdb_batch_table_t | table | ) |

Push asynchronously the current batch table.

Parameters

  table | A valid batch table previously initialized by qdb_ts_batch_table_init.

Returns
  A qdb_error_t code indicating success or failure.

QDB_API_LINKAGE qdb_error_t qdb_ts_batch_push_fast | ( | qdb_batch_table_t | table | ) |

Push the current batch table, non transactional.

Parameters

  table | A valid batch table previously initialized by qdb_ts_batch_table_init.

Returns
  A qdb_error_t code indicating success or failure.

QDB_API_LINKAGE qdb_error_t qdb_ts_batch_push_truncate | ( | qdb_batch_table_t | table,
|  | const qdb_ts_range_t * | ranges,
|  | qdb_size_t | range_count
| ) |  |

Push the current batch table, erasing previously stored points in the given ranges, transactionally.

Parameters

  table | A valid batch table previously initialized by qdb_ts_batch_table_init.
  ranges | An array of ranges (intervals) for which data should be erased.
  range_count | The number of ranges.

Returns
  A qdb_error_t code indicating success or failure.

QDB_API_LINKAGE qdb_error_t qdb_ts_batch_release_columns_memory | ( | qdb_batch_table_t | table | ) |

Release memory of all cached columns. The tables metadata are kept.

Parameters

  table | A valid batch table previously initialized by qdb_ts_batch_table_init.

Returns
  A qdb_error_t code indicating success or failure.

QDB_API_LINKAGE qdb_error_t qdb_ts_batch_row_set_blob | ( | qdb_batch_table_t | table,
|  | qdb_size_t | index,
|  | const void * | content,
|  | qdb_size_t | content_length
| ) |  |

Set a value in the current row in a column of blobs.

Parameters

  table | A valid local table previously initialized by qdb_ts_batch_table_init.
  index | A valid index to the value you want to modify.
  content | A pointer to the data to be set in the chosen column.
  content_length | Length, in bytes, of the data pointed to by `content`.

Returns
  A qdb_error_t code indicating success or failure.

Note
  The data pointed to by `content` must be kept alive until the following qdb_ts_batch_push call returns.

QDB_API_LINKAGE qdb_error_t qdb_ts_batch_row_set_blob_no_copy | ( | qdb_batch_table_t | table,
|  | qdb_size_t | index,
|  | const void * | content,
|  | qdb_size_t | content_length
| ) |  |

Set a value in the current row in a column of blobs without copying data.

The data will NOT be copied and the user must ensure that the buffer pointed by `content` is kept alive until the end of the corresponding call to qdb_ts_batch_push.

Parameters

  table | A valid local table previously initialized by qdb_ts_batch_table_init.
  index | A valid index to the value you want to modify.
  content | A pointer to the data to be set in the chosen column in the current row. The pointed data must be kept alive until the following qdb_ts_batch_push call returns.
  content_length | Length, in bytes, of the data pointed to by `content`.

Returns
  A qdb_error_t code indicating success or failure.

Note
  The data pointed to by `content` must be kept alive until the following qdb_ts_batch_push call returns.

QDB_API_LINKAGE qdb_error_t qdb_ts_batch_row_set_double | ( | qdb_batch_table_t | table,
|  | qdb_size_t | index,
|  | double | value
| ) |  |

Set a value in the current row in a column of doubles.

Parameters

  table | A valid batch table previously initialized by qdb_ts_batch_table_init.
  index | A valid index to the value you want to modify.
  value | A value to be set in the chosen column in the current row.

Returns
  A qdb_error_t code indicating success or failure.

QDB_API_LINKAGE qdb_error_t qdb_ts_batch_row_set_int64 | ( | qdb_batch_table_t | table,
|  | qdb_size_t | index,
|  | qdb_int_t | value
| ) |  |

Set a value in the current row in a column of integers.

Parameters

  table | A valid batch table previously initialized by qdb_ts_batch_table_init.
  index | A valid index to the value you want to modify.
  value | A value to be set in the chosen column in the current row.

Returns
  A qdb_error_t code indicating success or failure.

QDB_API_LINKAGE qdb_error_t qdb_ts_batch_row_set_string | ( | qdb_batch_table_t | table,
|  | qdb_size_t | index,
|  | const char * | content,
|  | qdb_size_t | content_length
| ) |  |

Set a value in the current row in a column of strings.

Parameters

  table | A valid local table previously initialized by qdb_ts_batch_table_init.
  index | A valid index to the value you want to modify.
  content | A pointer to the data to be set in the chosen column.
  content_length | Length, in bytes, of the data pointed to by `content`.

Returns
  A qdb_error_t code indicating success or failure.

Note
  The data pointed to by `content` must be kept alive until the following qdb_ts_batch_push call returns.

QDB_API_LINKAGE qdb_error_t qdb_ts_batch_row_set_string_no_copy | ( | qdb_batch_table_t | table,
|  | qdb_size_t | index,
|  | const char * | content,
|  | qdb_size_t | content_length
| ) |  |

Set a value in the current row in a column of strings without copying data.

The data will NOT be copied and the user must ensure that the buffer pointed by `content` is kept alive until the end of the corresponding call to qdb_ts_batch_push.

Parameters

  table | A valid local table previously initialized by qdb_ts_batch_table_init.
  index | A valid index to the value you want to modify.
  content | A pointer to the data to be set in the chosen column in the current row. The pointed data must be kept alive until the following qdb_ts_batch_push call returns.
  content_length | Length, in bytes, of the data pointed to by `content`.

Returns
  A qdb_error_t code indicating success or failure.

Note
  The data pointed to by `content` must be kept alive until the following qdb_ts_batch_push call returns.

QDB_API_LINKAGE qdb_error_t qdb_ts_batch_row_set_timestamp | ( | qdb_batch_table_t | table,
|  | qdb_size_t | index,
|  | const qdb_timespec_t * | value
| ) |  |

Set a value in the current row in a column of timestamps.

Parameters

  table | A valid batch table previously initialized by qdb_ts_batch_table_init.
  index | A valid index to the value you want to modify.
  value | A pointer to the value to be set in the chosen column in the current row.

Returns
  A qdb_error_t code indicating success or failure.

QDB_API_LINKAGE qdb_error_t qdb_ts_batch_shrink_pinned_column | ( | qdb_batch_table_t | table,
|  | qdb_size_t | index,
|  | qdb_size_t | size
| ) |  |

Resize the column without invalidating the pointers.

Parameters

  table | A valid batch table previously initialized by qdb_ts_batch_table_init.
  index | A valid index to the column you want to access.
  size | A valid size to shrink to.

Returns
  A qdb_error_t code indicating success or failure.

QDB_API_LINKAGE qdb_error_t qdb_ts_batch_start_row | ( | qdb_batch_table_t | table,
|  | const qdb_timespec_t * | timestamp
| ) |  |

Start a new row to the outcoming data buffer.

Parameters

  table | A valid batch table previously initialized by qdb_ts_batch_table_init.
  timestamp | The timestamp used while appending values.

Returns
  A qdb_error_t code indicating success or failure.

QDB_API_LINKAGE qdb_error_t qdb_ts_batch_table_extra_columns | ( | qdb_batch_table_t | table,
|  | const qdb_ts_batch_column_info_t * | columns,
|  | qdb_size_t | column_count
| ) |  |

Add extra columns to a batch table for bulk insertion in time series.

It is an error to call this function on a nonexisting time series.

Parameters

  table | A valid batch table previously initialized by qdb_ts_batch_table_init.
  columns | An array of columns descriptions to which data will be inserted.
  column_count | The number of columns.

Returns
  A qdb_error_t code indicating success or failure.

See Also
  qdb_release

QDB_API_LINKAGE qdb_error_t qdb_ts_batch_table_init | ( | qdb_handle_t | handle,
|  | const qdb_ts_batch_column_info_t * | columns,
|  | qdb_size_t | column_count,
|  | qdb_batch_table_t * | table
| ) |  |

Initialize a batch table for bulk insertion in time series.

It is an error to call this function on a nonexisting time series.

Parameters

  | handle | A valid handle previously initialized by qdb_open or qdb_open_tcp.
  | columns | An array of columns descriptions to which data will be inserted.
  | column_count | The number of columns.
  [out] | table | A pointer to a batch table that will be initialized if the function returns successfully.

Returns
  A qdb_error_t code indicating success or failure.

See Also
  qdb_release

QDB_API_LINKAGE qdb_error_t qdb_ts_batch_table_unchecked_extra_columns | ( | qdb_batch_table_t | table,
|  | const qdb_ts_batch_unchecked_column_info_t * | columns,
|  | qdb_size_t | column_count
| ) |  |

Add extra columns to a batch table for bulk insertion in time series.

It is an error to call this function on a nonexisting time series.

Parameters

  table | A valid batch table previously initialized by qdb_ts_batch_table_init.
  columns | An array of columns descriptions to which data will be inserted.
  column_count | The number of columns.

Returns
  A qdb_error_t code indicating success or failure.

See Also
  qdb_release

QDB_API_LINKAGE qdb_error_t qdb_ts_batch_table_unchecked_init | ( | qdb_handle_t | handle,
|  | const qdb_ts_batch_unchecked_column_info_t * | columns,
|  | qdb_size_t | column_count,
|  | qdb_batch_table_t * | table
| ) |  |

Initialize a batch table for bulk insertion in time series.

The given information are assumed to be correct and describing existing timseries columns.

Parameters

  | handle | A valid handle previously initialized by qdb_open or qdb_open_tcp.
  | columns | An array of unchecked columns descriptions to which data will be inserted.
  | column_count | The number of columns.
  [out] | table | A pointer to a batch table that will be initialized if the function returns successfully.

Returns
  A qdb_error_t code indicating success or failure.

See Also
  qdb_release

QDB_API_LINKAGE qdb_error_t qdb_ts_batch_unsafe_resize_pinned_column | ( | qdb_batch_table_t | table,
|  | qdb_size_t | index,
|  | qdb_size_t | size
| ) |  |

Resize the column with no guarantee the pointers will not be invalidated.

Parameters

  table | A valid batch table previously initialized by qdb_ts_batch_table_init.
  index | A valid index to the column you want to access.
  size | A valid size to resize to.

Returns
  A qdb_error_t code indicating success or failure.

QDB_API_LINKAGE qdb_error_t qdb_ts_blob_aggregate | ( | qdb_handle_t | handle,
|  | const char * | alias,
|  | const char * | column,
|  | qdb_ts_blob_aggregation_t * | aggregations,
|  | qdb_size_t | aggregation_count
| ) |  |

Aggregate a sub-part of a blob column of the time series.

It is an error to call this function on a nonexisting time series.

Parameters

  | handle | A valid handle previously initialized by qdb_open or qdb_open_tcp.
  | alias | A pointer to a null-terminated UTF-8 string representing the alias of the time series.
  | column | A pointer to a null-terminated UTF-8 string representing the name of the column to work on.
  [in,out] | aggregations | An array of structures representing the aggregations to compute and their results.
  | aggregation_count | The number of elements in the aggregations array.

Returns
  A qdb_error_t code indicating success or failure.

See Also
  qdb_ts_aggregation_type_t
  qdb_release

QDB_API_LINKAGE qdb_error_t qdb_ts_blob_get_ranges | ( | qdb_handle_t | handle,
|  | const char * | alias,
|  | const char * | column,
|  | const qdb_ts_range_t * | ranges,
|  | qdb_size_t | range_count,
|  | qdb_ts_blob_point ** | points,
|  | qdb_size_t * | point_count
| ) |  |

Retrieves blobs in the specified range of the time series column.

It is an error to call this function on a nonexisting time series.

Parameters

  | handle | A valid handle previously initialized by qdb_open or qdb_open_tcp.
  | alias | A pointer to a null-terminated UTF-8 string representing the alias of the time series.
  | column | A pointer to a null-terminated UTF-8 string representing the name of the column to work on.
  | ranges | An array of ranges (intervals) for which data should be retrieved.
  | range_count | The number of ranges.
  [out] | points | A pointer to an array that will contain data points from all given ranges.
  [out] | point_count | A pointer to an integer that will receive the number of returned points.

Returns
  A qdb_error_t code indicating success or failure.

See Also
  qdb_release

QDB_API_LINKAGE qdb_error_t qdb_ts_blob_get_ranges_no_copy | ( | qdb_handle_t | handle,
|  | const char * | alias,
|  | const char * | column,
|  | const qdb_ts_range_t * | ranges,
|  | qdb_size_t | range_count,
|  | qdb_ts_blob_point * | points,
|  | qdb_size_t * | point_count
| ) |  |

Retrieves blobs in the specified range of the time series column.

It is an error to call this function on a nonexisting time series.

Parameters

  | handle | A valid handle previously initialized by qdb_open or qdb_open_tcp.
  | alias | A pointer to a null-terminated UTF-8 string representing the alias of the time series.
  | column | A pointer to a null-terminated UTF-8 string representing the name of the column to work on.
  | ranges | An array of ranges (intervals) for which data should be retrieved.
  | range_count | The number of ranges.
  | points | An array in which the data points from all given ranges will be placed.
  [in,out] | point_count | A pointer to an integer containing the size of the given array on entry, will receive the number of retrieved data points.

Returns
  A qdb_error_t code indicating success or failure. Returns qdb_e_buffer_too_small when the given array is not big enough to store all retrieved data points, in which case point_count will contain the necessary size for a successfull call.

QDB_API_LINKAGE qdb_error_t qdb_ts_blob_insert | ( | qdb_handle_t | handle,
|  | const char * | alias,
|  | const char * | column,
|  | const qdb_ts_blob_point * | values,
|  | qdb_size_t | value_count
| ) |  |

Inserts blob points in a time series column.

It is an error to call this function on a nonexisting time series.

Parameters

  handle | A valid handle previously initialized by qdb_open or qdb_open_tcp.
  alias | A pointer to a null-terminated UTF-8 string representing the alias of the time series.
  column | A pointer to a null-terminated UTF-8 string representing the name of the column to work on.
  values | An array of data points to be inserted.
  value_count | The number of data points to insert.

Returns
  A qdb_error_t code indicating success or failure.

Note
  The caller must ensure that all columns in the timeseries are properly aligned (for any given timestamp, all columns have the same number of corresponding cells).

QDB_API_LINKAGE qdb_error_t qdb_ts_blob_insert_truncate | ( | qdb_handle_t | handle,
|  | const char * | alias,
|  | const char * | column,
|  | const qdb_ts_range_t * | ranges,
|  | qdb_size_t | range_count,
|  | const qdb_ts_blob_point * | values,
|  | qdb_size_t | value_count
| ) |  |

Inserts blob points in a time series and erases given ranges in the same transaction.

Time series are distributed across the cluster and support efficient insertion anywhere within the time series as well as efficient lookup based on time.

Parameters

  handle | A valid handle previously initialized by qdb_open or qdb_open_tcp.
  alias | A pointer to a null-terminated UTF-8 string representing the alias of the time series.
  column | A pointer to a null-terminated UTF-8 string representing the name of the column to work on.
  ranges | An array of ranges (intervals) for which data should be erased.
  range_count | The number of ranges.
  values | An array of data points to be inserted.
  value_count | The number of data points to insert.

Returns
  A qdb_error_t code indicating success or failure.

Note
  The caller must ensure that all columns in the timeseries are properly aligned (for any given timestamp, all columns have the same number of corresponding cells).

qdb_time_t qdb_ts_bucket_base_time | ( | qdb_timespec_t | timestamp,
|  | qdb_duration_t | shard_size
| ) |  |
| inline

Returns the base time of the bucket given a timestamp and the shard_size of the timeseries.

Parameters

  timestamp | A timestamp for which the base time should be computed.
  shard_size | The shard_size of the timeseries in ms.

Returns
  A base time of the bucket in milliseconds.

QDB_API_LINKAGE qdb_error_t qdb_ts_bucket_nuke_by_id | ( | qdb_handle_t | handle,
|  | const char * | bucket_id
| ) |  |

Remove the given shard.

Parameters

  handle | A valid handle previously initialized by qdb_open or qdb_open_tcp.
  bucket_id | A pointer to a null-terminated UTF-8 string representing the bucket ID

Returns
  A qdb_error_t code indicating success or failure.

See Also
  qdb_ts_bucket_base_time, qdb_ts_bucket_nuke_by_name

QDB_API_LINKAGE qdb_error_t qdb_ts_bucket_nuke_by_name | ( | qdb_handle_t | handle,
|  | const char * | table,
|  | qdb_time_t | shard_base_time
| ) |  |

Remove the given shard.

Parameters

  handle | A valid handle previously initialized by qdb_open or qdb_open_tcp.
  table | A pointer to a null-terminated UTF-8 string representing the alias of the time series.
  shard_base_time | The base time of the shard to remove, in milliseconds.

Returns
  A qdb_error_t code indicating success or failure.

See Also
  qdb_ts_bucket_base_time, qdb_ts_bucket_nuke_by_id

qdb_time_t qdb_ts_bucket_offset | ( | qdb_timespec_t | timestamp,
|  | qdb_duration_t | shard_size
| ) |  |
| inline

Returns the offset of the bucket (from its base time) given a timestamp and the shard_size of the timeseries.

Parameters

  timestamp | A timestamp for which the offset should be computed.
  shard_size | The shard_size of the timeseries in ms.

Returns
  An offset in nanoseconds.

QDB_API_LINKAGE qdb_error_t qdb_ts_create | ( | qdb_handle_t | handle,
|  | const char * | alias,
|  | qdb_uint_t | shard_size_ms,
|  | const qdb_ts_column_info_t * | columns,
|  | qdb_size_t | column_count
| ) |  |

Creates a time series.

Parameters

  handle | A valid handle previously initialized by qdb_open or qdb_open_tcp.
  alias | A pointer to a null-terminated UTF-8 string representing the alias of the time series.
  shard_size_ms | A duration representing the time-span of a single shard (bucket) of the time series, in milliseconds.
  columns | An array of column descriptions that are to be added to the time series.
  column_count | The number of columns to add.

Returns
  A qdb_error_t code indicating success or failure.

QDB_API_LINKAGE qdb_error_t qdb_ts_create_ex | ( | qdb_handle_t | handle,
|  | const char * | alias,
|  | qdb_uint_t | shard_size_ms,
|  | const qdb_ts_column_info_ex_t * | columns,
|  | qdb_size_t | column_count
| ) |  |

Creates a time series.

Parameters

  handle | A valid handle previously initialized by qdb_open or qdb_open_tcp.
  alias | A pointer to a null-terminated UTF-8 string representing the alias of the time series.
  shard_size_ms | A duration representing the time-span of a single shard (bucket) of the time series, in milliseconds.
  columns | An array of column descriptions that are to be added to the time series, along with their symbol tables.
  column_count | The number of columns to add.

Returns
  A qdb_error_t code indicating success or failure.

QDB_API_LINKAGE qdb_error_t qdb_ts_double_aggregate | ( | qdb_handle_t | handle,
|  | const char * | alias,
|  | const char * | column,
|  | qdb_ts_double_aggregation_t * | aggregations,
|  | qdb_size_t | aggregation_count
| ) |  |

Aggregate a sub-part of the double column of the time series.

It is an error to call this function on a nonexisting time series.

Parameters

  | handle | A valid handle previously initialized by qdb_open or qdb_open_tcp.
  | alias | A pointer to a null-terminated UTF-8 string representing the alias of the time series.
  | column | A pointer to a null-terminated UTF-8 string representing the name of the column to work on.
  [in,out] | aggregations | An array of structures representing the aggregations to compute and their results.
  | aggregation_count | The number of elements in the aggregations array.

Returns
  A qdb_error_t code indicating success or failure.

See Also
  qdb_ts_aggregation_type_t

QDB_API_LINKAGE qdb_error_t qdb_ts_double_get_ranges | ( | qdb_handle_t | handle,
|  | const char * | alias,
|  | const char * | column,
|  | const qdb_ts_range_t * | ranges,
|  | qdb_size_t | range_count,
|  | qdb_ts_double_point ** | points,
|  | qdb_size_t * | point_count
| ) |  |

Retrieves doubles in the specified range of the time series column.

It is an error to call this function on a nonexisting time series.

Parameters

  | handle | A valid handle previously initialized by qdb_open or qdb_open_tcp.
  | alias | A pointer to a null-terminated UTF-8 string representing the alias of the time series.
  | column | A pointer to a null-terminated UTF-8 string representing the name of the column to work on.
  | ranges | An array of ranges (intervals) for which data should be retrieved.
  | range_count | The number of ranges.
  [out] | points | A pointer to an array that will contain data points from all given ranges.
  [out] | point_count | A pointer to an integer that will receive the number of returned points.

Returns
  A qdb_error_t code indicating success or failure.

See Also
  qdb_release

QDB_API_LINKAGE qdb_error_t qdb_ts_double_get_ranges_no_copy | ( | qdb_handle_t | handle,
|  | const char * | alias,
|  | const char * | column,
|  | const qdb_ts_range_t * | ranges,
|  | qdb_size_t | range_count,
|  | qdb_ts_double_point * | points,
|  | qdb_size_t * | point_count
| ) |  |

Retrieves doubles in the specified range of the time series column.

It is an error to call this function on a nonexisting time series.

Parameters

  | handle | A valid handle previously initialized by qdb_open or qdb_open_tcp.
  | alias | A pointer to a null-terminated UTF-8 string representing the alias of the time series.
  | column | A pointer to a null-terminated UTF-8 string representing the name of the column to work on.
  | ranges | An array of ranges (intervals) for which data should be retrieved.
  | range_count | The number of ranges.
  | points | An array in which the data points from all given ranges will be placed.
  [in,out] | point_count | A pointer to an integer containing the size of the given array on entry, will receive the number of retrieved data points.

Returns
  A qdb_error_t code indicating success or failure. Returns qdb_e_buffer_too_small when the given array is not big enough to store all retrieved data points, in which case point_count will contain the necessary size for a successfull call.

QDB_API_LINKAGE qdb_error_t qdb_ts_double_insert | ( | qdb_handle_t | handle,
|  | const char * | alias,
|  | const char * | column,
|  | const qdb_ts_double_point * | values,
|  | qdb_size_t | value_count
| ) |  |

Inserts double points in a time series.

Time series are distributed across the cluster and support efficient insertion anywhere within the time series as well as efficient lookup based on time.

Parameters

  handle | A valid handle previously initialized by qdb_open or qdb_open_tcp.
  alias | A pointer to a null-terminated UTF-8 string representing the alias of the time series.
  column | A pointer to a null-terminated UTF-8 string representing the name of the column to work on.
  values | An array of data points to be inserted.
  value_count | The number of data points to insert.

Returns
  A qdb_error_t code indicating success or failure.

Note
  The caller must ensure that all columns in the timeseries are properly aligned (for any given timestamp, all columns have the same number of corresponding cells).

QDB_API_LINKAGE qdb_error_t qdb_ts_double_insert_truncate | ( | qdb_handle_t | handle,
|  | const char * | alias,
|  | const char * | column,
|  | const qdb_ts_range_t * | ranges,
|  | qdb_size_t | range_count,
|  | const qdb_ts_double_point * | values,
|  | qdb_size_t | value_count
| ) |  |

Inserts double points in a time series and erases given ranges in the same transaction.

Time series are distributed across the cluster and support efficient insertion anywhere within the time series as well as efficient lookup based on time.

Parameters

  handle | A valid handle previously initialized by qdb_open or qdb_open_tcp.
  alias | A pointer to a null-terminated UTF-8 string representing the alias of the time series.
  column | A pointer to a null-terminated UTF-8 string representing the name of the column to work on.
  ranges | An array of ranges (intervals) for which data should be erased.
  range_count | The number of ranges.
  values | An array of data points to be inserted.
  value_count | The number of data points to insert.

Returns
  A qdb_error_t code indicating success or failure.

Note
  The caller must ensure that all columns in the timeseries are properly aligned (for any given timestamp, all columns have the same number of corresponding cells).

QDB_API_LINKAGE qdb_error_t qdb_ts_erase_ranges | ( | qdb_handle_t | handle,
|  | const char * | alias,
|  | const char * | column,
|  | const qdb_ts_range_t * | ranges,
|  | qdb_size_t | range_count,
|  | qdb_uint_t * | erased_count
| ) |  |

Erase all points in the specified range (left inclusive).

It is an error to call this function on a nonexisting time series.

Parameters

  | handle | A valid handle previously initialized by qdb_open or qdb_open_tcp.
  | alias | A pointer to a null-terminated UTF-8 string representing the alias of the time series.
  | column | A pointer to a null-terminated UTF-8 string representing the name of the column to work on.
  | ranges | An array of ranges (intervals) for which data should be erased.
  | range_count | The number of ranges.
  [out] | erased_count | A pointer to an integer that will receive the number of erased points.

Returns
  A qdb_error_t code indicating success or failure.

See Also
  qdb_release

QDB_API_LINKAGE qdb_error_t qdb_ts_expire_by_size | ( | qdb_handle_t | handle,
|  | const char * | alias,
|  | qdb_uint_t | size
| ) |  |

Trim the timeseries, so that it uses approximately the provided size.

Trimming is done starting from the oldest entries, so that the most recent shards are retained in the database.

Parameters

  handle | A valid handle previously initialized by qdb_open or qdb_open_tcp.
  alias | A pointer to a null-terminated UTF-8 string representing the alias of the time series.
  size | The desired disk usage size after the operation, in bytes.

Returns
  A qdb_error_t code indicating success or failure.

QDB_API_LINKAGE qdb_error_t qdb_ts_get_timestamps | ( | qdb_handle_t | handle,
|  | const char * | alias,
|  | const char * | column,
|  | const qdb_ts_range_t * | ranges,
|  | qdb_size_t | range_count,
|  | qdb_timespec_t ** | timestamps,
|  | qdb_size_t * | timestamp_count
| ) |  |

Retrieves the timestamps, not the values, for a given timeseries column or the aggregation of all columns.

It is an error to call this function on a nonexisting time series.

Parameters

  | handle | A valid handle previously initialized by qdb_open or qdb_open_tcp.
  | alias | A pointer to a null-terminated UTF-8 string representing the alias of the time series.
  | column | A pointer to a null-terminated UTF-8 string representing the name of the column to work on. If this pointer is NULL, all columns will be aggregated in a single range.
  | ranges | An array of ranges (intervals) for which timestamps should be retrieved.
  | range_count | The number of ranges.
  [out] | timestamps | A pointer to an array that will contain timestamps from all given ranges.
  [out] | timestamp_count | A pointer to an integer that will receive the number of returned timestamps.

Returns
  A qdb_error_t code indicating success or failure.

See Also
  qdb_release

QDB_API_LINKAGE qdb_error_t qdb_ts_insert_columns | ( | qdb_handle_t | handle,
|  | const char * | alias,
|  | const qdb_ts_column_info_t * | columns,
|  | qdb_size_t | column_count
| ) |  |

Appends columns to an existing time series.

Parameters

  handle | A valid handle previously initialized by qdb_open or qdb_open_tcp.
  alias | A pointer to a null-terminated UTF-8 string representing the alias of the time series.
  columns | An array of column descriptions that are to be added to the time series.
  column_count | The number of columns to append.

Returns
  A qdb_error_t code indicating success or failure.

Note
  The caller must ensure that all columns in the timeseries are properly aligned (for any given timestamp, all columns have the same number of corresponding cells).

QDB_API_LINKAGE qdb_error_t qdb_ts_insert_columns_ex | ( | qdb_handle_t | handle,
|  | const char * | alias,
|  | const qdb_ts_column_info_ex_t * | columns,
|  | qdb_size_t | column_count
| ) |  |

Appends columns to an existing time series.

Parameters

  handle | A valid handle previously initialized by qdb_open or qdb_open_tcp.
  alias | A pointer to a null-terminated UTF-8 string representing the alias of the time series.
  columns | An array of column descriptions that are to be added to the time series, along with their symbol tables.
  column_count | The number of columns to append.

Returns
  A qdb_error_t code indicating success or failure.

Note
  The caller must ensure that all columns in the timeseries are properly aligned (for any given timestamp, all columns have the same number of corresponding cells).

QDB_API_LINKAGE qdb_error_t qdb_ts_int64_aggregate | ( | qdb_handle_t | handle,
|  | const char * | alias,
|  | const char * | column,
|  | qdb_ts_int64_aggregation_t * | aggregations,
|  | qdb_size_t | aggregation_count
| ) |  |

Aggregate a sub-part of the int64 column of the time series.

It is an error to call this function on a nonexisting time series.

Parameters

  | handle | A valid handle previously initialized by qdb_open or qdb_open_tcp.
  | alias | A pointer to a null-terminated UTF-8 string representing the alias of the time series.
  | column | A pointer to a null-terminated UTF-8 string representing the name of the column to work on.
  [in,out] | aggregations | An array of structures representing the aggregations to compute and their results.
  | aggregation_count | The number of elements in the aggregations array.

Returns
  A qdb_error_t code indicating success or failure.

See Also
  qdb_ts_aggregation_type_t

QDB_API_LINKAGE qdb_error_t qdb_ts_int64_get_ranges | ( | qdb_handle_t | handle,
|  | const char * | alias,
|  | const char * | column,
|  | const qdb_ts_range_t * | ranges,
|  | qdb_size_t | range_count,
|  | qdb_ts_int64_point ** | points,
|  | qdb_size_t * | point_count
| ) |  |

Retrieves 64-bit integers in the specified range of the time series column.

It is an error to call this function on a nonexisting time series.

Parameters

  | handle | A valid handle previously initialized by qdb_open or qdb_open_tcp.
  | alias | A pointer to a null-terminated UTF-8 string representing the alias of the time series.
  | column | A pointer to a null-terminated UTF-8 string representing the name of the column to work on.
  | ranges | An array of ranges (intervals) for which data should be retrieved.
  | range_count | The number of ranges.
  [out] | points | A pointer to an array that will contain data points from all given ranges.
  [out] | point_count | A pointer to an integer that will receive the number of returned points.

Returns
  A qdb_error_t code indicating success or failure.

See Also
  qdb_release

QDB_API_LINKAGE qdb_error_t qdb_ts_int64_get_ranges_no_copy | ( | qdb_handle_t | handle,
|  | const char * | alias,
|  | const char * | column,
|  | const qdb_ts_range_t * | ranges,
|  | qdb_size_t | range_count,
|  | qdb_ts_int64_point * | points,
|  | qdb_size_t * | point_count
| ) |  |

Retrieves 64-bit integers in the specified range of the time series column.

It is an error to call this function on a nonexisting time series.

Parameters

  | handle | A valid handle previously initialized by qdb_open or qdb_open_tcp.
  | alias | A pointer to a null-terminated UTF-8 string representing the alias of the time series.
  | column | A pointer to a null-terminated UTF-8 string representing the name of the column to work on.
  | ranges | An array of ranges (intervals) for which data should be retrieved.
  | range_count | The number of ranges.
  | points | An array in which the data points from all given ranges will be placed.
  [in,out] | point_count | A pointer to an integer containing the size of the given array on entry, will receive the number of retrieved data points.

Returns
  A qdb_error_t code indicating success or failure. Returns qdb_e_buffer_too_small when the given array is not big enough to store all retrieved data points, in which case point_count will contain the necessary size for a successfull call.

QDB_API_LINKAGE qdb_error_t qdb_ts_int64_insert | ( | qdb_handle_t | handle,
|  | const char * | alias,
|  | const char * | column,
|  | const qdb_ts_int64_point * | values,
|  | qdb_size_t | value_count
| ) |  |

Inserts int64 points in a time series.

Time series are distributed across the cluster and support efficient insertion anywhere within the time series as well as efficient lookup based on time.

Parameters

  handle | A valid handle previously initialized by qdb_open or qdb_open_tcp.
  alias | A pointer to a null-terminated UTF-8 string representing the alias of the time series.
  column | A pointer to a null-terminated UTF-8 string representing the name of the column to work on.
  values | An array of data points to be inserted.
  value_count | The number of data points to insert.

Returns
  A qdb_error_t code indicating success or failure.

Note
  The caller must ensure that all columns in the timeseries are properly aligned (for any given timestamp, all columns have the same number of corresponding cells).

QDB_API_LINKAGE qdb_error_t qdb_ts_int64_insert_truncate | ( | qdb_handle_t | handle,
|  | const char * | alias,
|  | const char * | column,
|  | const qdb_ts_range_t * | ranges,
|  | qdb_size_t | range_count,
|  | const qdb_ts_int64_point * | values,
|  | qdb_size_t | value_count
| ) |  |

Inserts int64 points in a time series and erases given ranges in the same transaction.

Time series are distributed across the cluster and support efficient insertion anywhere within the time series as well as efficient lookup based on time.

Parameters

  handle | A valid handle previously initialized by qdb_open or qdb_open_tcp.
  alias | A pointer to a null-terminated UTF-8 string representing the alias of the time series.
  column | A pointer to a null-terminated UTF-8 string representing the name of the column to work on.
  ranges | An array of ranges (intervals) for which data should be erased.
  range_count | The number of ranges.
  values | An array of data points to be inserted.
  value_count | The number of data points to insert.

Returns
  A qdb_error_t code indicating success or failure.

Note
  The caller must ensure that all columns in the timeseries are properly aligned (for any given timestamp, all columns have the same number of corresponding cells).

QDB_API_LINKAGE qdb_error_t qdb_ts_list_columns | ( | qdb_handle_t | handle,
|  | const char * | alias,
|  | qdb_ts_column_info_t ** | columns,
|  | qdb_size_t * | column_count
| ) |  |

Returns all the columns of a time series.

Parameters

  | handle | A valid handle previously initialized by qdb_open or qdb_open_tcp.
  | alias | A pointer to a null-terminated UTF-8 string representing the alias of the time series.
  [out] | columns | A pointer to an array that will contain descriptions of columns present in the time series.
  [out] | column_count | A pointer to an integer that will receive the number of columns.

Returns
  A qdb_error_t code indicating success or failure.

QDB_API_LINKAGE qdb_error_t qdb_ts_list_columns_ex | ( | qdb_handle_t | handle,
|  | const char * | alias,
|  | qdb_ts_column_info_ex_t ** | columns,
|  | qdb_size_t * | column_count
| ) |  |

Returns all the columns of a time series.

Parameters

  | handle | A valid handle previously initialized by qdb_open or qdb_open_tcp.
  | alias | A pointer to a null-terminated UTF-8 string representing the alias of the time series.
  [out] | columns | A pointer to an array that will contain descriptions of columns present in the time series, along with their symbol tables.
  [out] | column_count | A pointer to an integer that will receive the number of columns.

Returns
  A qdb_error_t code indicating success or failure.

QDB_API_LINKAGE qdb_error_t qdb_ts_local_table_init | ( | qdb_handle_t | handle,
|  | const char * | alias,
|  | const qdb_ts_column_info_t * | columns,
|  | qdb_size_t | column_count,
|  | qdb_local_table_t * | table
| ) |  |

Initialize a local table for bulk insertion in time series.

It is an error to call this function on a nonexisting time series.

Parameters

  | handle | A valid handle previously initialized by qdb_open or qdb_open_tcp.
  | alias | A pointer to a null-terminated UTF-8 string representing the alias of the time series.
  | columns | An array of column descriptions to which data will be inserted.
  | column_count | The number of columns.
  [out] | table | A pointer to a local table that will be initialized if the function returns successfully.

Returns
  A qdb_error_t code indicating success or failure.

Warning
  This function is still under development. Performance and compatibility are not guaranteed.

See Also
  qdb_release

QDB_API_LINKAGE qdb_error_t qdb_ts_row_get_blob | ( | qdb_local_table_t | table,
|  | qdb_size_t | column_index,
|  | const void ** | content,
|  | qdb_size_t * | content_length
| ) |  |

Retrieves blob data from the current row at the specified column.

The retrieved data will be the copy of the internal data stored in qdb_local_table_t, so the user must ensure to call qdb_release when she/he no longer needs it in order to clean up the memory.

Parameters

  table | A valid local table previously initialized by qdb_ts_local_table_init.
  column_index | A zero-based index of the column from which the value should be retrieved. The index is based on the order of columns in the call to qdb_ts_local_table_init used to initialize table.

Returns
  A qdb_error_t code indicating success or failure. Returns qdb_e_invalid_iterator when qdb_ts_table_get_ranges has not been called before calling this function.

Parameters

  [out] | content | A non-null pointer to a variable that will hold the retrieved data.
  [out] | content_length | A non-null pointer to a variable that will hold the size of the retrieved data.

Warning
  This function is still under development. Performance and compatibility are not guaranteed.

See Also
  qdb_release

QDB_API_LINKAGE qdb_error_t qdb_ts_row_get_blob_no_copy | ( | qdb_local_table_t | table,
|  | qdb_size_t | column_index,
|  | const void ** | content,
|  | qdb_size_t * | content_length
| ) |  |

Retrieves blob data from the current row at the specified column without performing copy of data internal to data.

The retrieved data will be valid only until the next call of qdb_ts_table_get_ranges on the same qdb_local_table_t or until the deallocation thereof. If you want to keep the retrieved data for a longer time, you may call qdb_ts_row_get_blob instead or copy the data yourself.

Parameters

  table | A valid local table previously initialized by qdb_ts_local_table_init.
  column_index | A zero-based index of the column from which the value should be retrieved. The index is based on the order of columns in the call to qdb_ts_local_table_init used to initialize table.

Returns
  A qdb_error_t code indicating success or failure. Returns qdb_e_invalid_iterator when qdb_ts_table_get_ranges has not been called before calling this function.

Parameters

  [out] | content | A non-null pointer to a variable that will hold the retrieved data.
  [out] | content_length | A non-null pointer to a variable that will hold the size of the retrieved data.

Warning
  This function is still under development. Performance and compatibility are not guaranteed.

See Also
  qdb_ts_table_get_ranges
  qdb_ts_row_get_blob

QDB_API_LINKAGE qdb_error_t qdb_ts_row_get_double | ( | qdb_local_table_t | table,
|  | qdb_size_t | column_index,
|  | double * | value
| ) |  |

Retrieves double value from the current row at the specified column.

Parameters

  | table | A valid local table previously initialized by qdb_ts_local_table_init.
  | column_index | A zero-based index of the column from which the value should be retrieved. The index is based on the order of columns in the call to qdb_ts_local_table_init used to initialize table.
  [out] | value | A non-null pointer to a double that will hold the retrieved value.

Returns
  A qdb_error_t code indicating success or failure. Returns qdb_e_invalid_iterator when qdb_ts_table_get_ranges has not been called before calling this function.

Warning
  This function is still under development. Performance and compatibility are not guaranteed.

QDB_API_LINKAGE qdb_error_t qdb_ts_row_get_int64 | ( | qdb_local_table_t | table,
|  | qdb_size_t | column_index,
|  | qdb_int_t * | value
| ) |  |

Retrieves signed 64-bit integer value from the current row at the specified column.

Parameters

  | table | A valid local table previously initialized by qdb_ts_local_table_init.
  | column_index | A zero-based index of the column from which the value should be retrieved. The index is based on the order of columns in the call to qdb_ts_local_table_init used to initialize table.
  [out] | value | A non-null pointer to a signed 64-bit integer that will hold the retrieved value.

Returns
  A qdb_error_t code indicating success or failure. Returns qdb_e_invalid_iterator when qdb_ts_table_get_ranges has not been called before calling this function.

Warning
  This function is still under development. Performance and compatibility are not guaranteed.

QDB_API_LINKAGE qdb_error_t qdb_ts_row_get_string | ( | qdb_local_table_t | table,
|  | qdb_size_t | column_index,
|  | const char ** | content,
|  | qdb_size_t * | content_length
| ) |  |

Retrieves string data from the current row at the specified column.

The retrieved data will be the copy of the internal data stored in qdb_local_table_t, so the user must ensure to call qdb_release when she/he no longer needs it in order to clean up the memory.

Parameters

  table | A valid local table previously initialized by qdb_ts_local_table_init.
  column_index | A zero-based index of the column from which the value should be retrieved. The index is based on the order of columns in the call to qdb_ts_local_table_init used to initialize table.

Returns
  A qdb_error_t code indicating success or failure. Returns qdb_e_invalid_iterator when qdb_ts_table_get_ranges has not been called before calling this function.

Parameters

  [out] | content | A non-null pointer to a variable that will hold the retrieved data.
  [out] | content_length | A non-null pointer to a variable that will hold the size of the retrieved data.

Warning
  This function is still under development. Performance and compatibility are not guaranteed.

See Also
  qdb_release

QDB_API_LINKAGE qdb_error_t qdb_ts_row_get_string_no_copy | ( | qdb_local_table_t | table,
|  | qdb_size_t | column_index,
|  | const char ** | content,
|  | qdb_size_t * | content_length
| ) |  |

Retrieves string data from the current row at the specified column without performing copy of data internal to data.

The retrieved data will be valid only until the next call of qdb_ts_table_get_ranges on the same qdb_local_table_t or until the deallocation thereof. If you want to keep the retrieved data for a longer time, you may call qdb_ts_row_get_string instead or copy the data yourself.

Parameters

  table | A valid local table previously initialized by qdb_ts_local_table_init.
  column_index | A zero-based index of the column from which the value should be retrieved. The index is based on the order of columns in the call to qdb_ts_local_table_init used to initialize table.

Returns
  A qdb_error_t code indicating success or failure. Returns qdb_e_invalid_iterator when qdb_ts_table_get_ranges has not been called before calling this function.

Parameters

  [out] | content | A non-null pointer to a variable that will hold the retrieved data.
  [out] | content_length | A non-null pointer to a variable that will hold the size of the retrieved data.

Warning
  This function is still under development. Performance and compatibility are not guaranteed.

See Also
  qdb_ts_table_get_ranges
  qdb_ts_row_get_string

QDB_API_LINKAGE qdb_error_t qdb_ts_row_get_timestamp | ( | qdb_local_table_t | table,
|  | qdb_size_t | column_index,
|  | qdb_timespec_t * | value
| ) |  |

Retrieves timestamp value from the current row at the specified column.

Parameters

  | table | A valid local table previously initialized by qdb_ts_local_table_init.
  | column_index | A zero-based index of the column from which the value should be retrieved. The index is based on the order of columns in the call to qdb_ts_local_table_init used to initialize table.
  [out] | value | A non-null pointer to a timestamp that will hold the retrieved value.

Returns
  A qdb_error_t code indicating success or failure. Returns qdb_e_invalid_iterator when qdb_ts_table_get_ranges has not been called before calling this function.

Warning
  This function is still under development. Performance and compatibility are not guaranteed.

QDB_API_LINKAGE qdb_error_t qdb_ts_shard_size | ( | qdb_handle_t | handle,
|  | const char * | alias,
|  | qdb_uint_t * | shard_size
| ) |  |

Returns the shard size of a time series.

Parameters

  | handle | A valid handle previously initialized by qdb_open or qdb_open_tcp.
  | alias | A pointer to a null-terminated UTF-8 string representing the alias of the time series.
  [out] | shard_size | shard size of the timeseries, in ms.

Returns
  A qdb_error_t code indicating success or failure.

QDB_API_LINKAGE qdb_error_t qdb_ts_string_aggregate | ( | qdb_handle_t | handle,
|  | const char * | alias,
|  | const char * | column,
|  | qdb_ts_string_aggregation_t * | aggregations,
|  | qdb_size_t | aggregation_count
| ) |  |

Aggregate a sub-part of a string column of the time series.

It is an error to call this function on a nonexisting time series.

Parameters

  | handle | A valid handle previously initialized by qdb_open or qdb_open_tcp.
  | alias | A pointer to a null-terminated UTF-8 string representing the alias of the time series.
  | column | A pointer to a null-terminated UTF-8 string representing the name of the column to work on.
  [in,out] | aggregations | An array of structures representing the aggregations to compute and their results.
  | aggregation_count | The number of elements in the aggregations array.

Returns
  A qdb_error_t code indicating success or failure.

See Also
  qdb_ts_aggregation_type_t
  qdb_release

QDB_API_LINKAGE qdb_error_t qdb_ts_string_get_ranges | ( | qdb_handle_t | handle,
|  | const char * | alias,
|  | const char * | column,
|  | const qdb_ts_range_t * | ranges,
|  | qdb_size_t | range_count,
|  | qdb_ts_string_point ** | points,
|  | qdb_size_t * | point_count
| ) |  |

Retrieves strings in the specified range of the time series column.

It is an error to call this function on a nonexisting time series.

Parameters

  | handle | A valid handle previously initialized by qdb_open or qdb_open_tcp.
  | alias | A pointer to a null-terminated UTF-8 string representing the alias of the time series.
  | column | A pointer to a null-terminated UTF-8 string representing the name of the column to work on.
  | ranges | An array of ranges (intervals) for which data should be retrieved.
  | range_count | The number of ranges.
  [out] | points | A pointer to an array that will contain data points from all given ranges.
  [out] | point_count | A pointer to an integer that will receive the number of returned points.

Returns
  A qdb_error_t code indicating success or failure.

See Also
  qdb_release

QDB_API_LINKAGE qdb_error_t qdb_ts_string_get_ranges_no_copy | ( | qdb_handle_t | handle,
|  | const char * | alias,
|  | const char * | column,
|  | const qdb_ts_range_t * | ranges,
|  | qdb_size_t | range_count,
|  | qdb_ts_string_point * | points,
|  | qdb_size_t * | point_count
| ) |  |

Retrieves strings in the specified range of the time series column.

It is an error to call this function on a nonexisting time series.

Parameters

  | handle | A valid handle previously initialized by qdb_open or qdb_open_tcp.
  | alias | A pointer to a null-terminated UTF-8 string representing the alias of the time series.
  | column | A pointer to a null-terminated UTF-8 string representing the name of the column to work on.
  | ranges | An array of ranges (intervals) for which data should be retrieved.
  | range_count | The number of ranges.
  | points | An array in which the data points from all given ranges will be placed.
  [in,out] | point_count | A pointer to an integer containing the size of the given array on entry, will receive the number of retrieved data points.

Returns
  A qdb_error_t code indicating success or failure. Returns qdb_e_buffer_too_small when the given array is not big enough to store all retrieved data points, in which case point_count will contain the necessary size for a successfull call.

QDB_API_LINKAGE qdb_error_t qdb_ts_string_insert | ( | qdb_handle_t | handle,
|  | const char * | alias,
|  | const char * | column,
|  | const qdb_ts_string_point * | values,
|  | qdb_size_t | value_count
| ) |  |

Inserts string points in a time series column.

It is an error to call this function on a nonexisting time series.

Parameters

  handle | A valid handle previously initialized by qdb_open or qdb_open_tcp.
  alias | A pointer to a null-terminated UTF-8 string representing the alias of the time series.
  column | A pointer to a null-terminated UTF-8 string representing the name of the column to work on.
  values | An array of data points to be inserted.
  value_count | The number of data points to insert.

Returns
  A qdb_error_t code indicating success or failure.

Note
  The caller must ensure that all columns in the timeseries are properly aligned (for any given timestamp, all columns have the same number of corresponding cells).

QDB_API_LINKAGE qdb_error_t qdb_ts_string_insert_truncate | ( | qdb_handle_t | handle,
|  | const char * | alias,
|  | const char * | column,
|  | const qdb_ts_range_t * | ranges,
|  | qdb_size_t | range_count,
|  | const qdb_ts_string_point * | values,
|  | qdb_size_t | value_count
| ) |  |

Inserts string points in a time series and erases given ranges in the same transaction.

Time series are distributed across the cluster and support efficient insertion anywhere within the time series as well as efficient lookup based on time.

Parameters

  handle | A valid handle previously initialized by qdb_open or qdb_open_tcp.
  alias | A pointer to a null-terminated UTF-8 string representing the alias of the time series.
  column | A pointer to a null-terminated UTF-8 string representing the name of the column to work on.
  ranges | An array of ranges (intervals) for which data should be erased.
  range_count | The number of ranges.
  values | An array of data points to be inserted.
  value_count | The number of data points to insert.

Returns
  A qdb_error_t code indicating success or failure.

Note
  The caller must ensure that all columns in the timeseries are properly aligned (for any given timestamp, all columns have the same number of corresponding cells).

QDB_API_LINKAGE qdb_error_t qdb_ts_table_get_ranges | ( | qdb_local_table_t | table,
|  | const qdb_ts_range_t * | ranges,
|  | qdb_size_t | range_count
| ) |  |

Retrieve all the specified rows from the database.

Parameters

  table | A valid local table previously initialized by qdb_ts_local_table_init.
  ranges | An array of ranges (intervals) for which data should be retrieved.
  range_count | The number of ranges.

Returns
  A qdb_error_t code indicating success or failure. Returns qdb_e_iterator_end when there are no more rows in the specified ranges.

Warning
  This function is still under development. Performance and compatibility are not guaranteed.

QDB_API_LINKAGE qdb_error_t qdb_ts_table_next_row | ( | qdb_local_table_t | table,
|  | qdb_timespec_t * | timestamp
| ) |  |

Fetch data and advance to the next row.

Parameters

  | table | A valid local table previously initialized by qdb_ts_local_table_init.
  [out] | timestamp | A non-null pointer to a variable that will hold a timestamp for the fetched row.

Returns
  A qdb_error_t code indicating success or failure. Returns qdb_e_iterator_end when there are no more rows in the specified ranges.

Warning
  This function is still under development. Performance and compatibility are not guaranteed.

QDB_API_LINKAGE qdb_error_t qdb_ts_table_stream_ranges | ( | qdb_local_table_t | table,
|  | const qdb_ts_range_t * | ranges,
|  | qdb_size_t | range_count
| ) |  |

Retrieve shard by shard the specified rows from the database. The table is then seen as it was then this function was called.

Parameters

  table | A valid local table previously initialized by qdb_ts_local_table_init.
  ranges | An array of ranges (intervals) for which data should be retrieved.
  range_count | The number of ranges.

Returns
  A qdb_error_t code indicating success or failure. Returns qdb_e_iterator_end when there are no more rows in the specified ranges.

Warning
  This function is still under development. Performance and compatibility are not guaranteed.

QDB_API_LINKAGE qdb_error_t qdb_ts_timestamp_aggregate | ( | qdb_handle_t | handle,
|  | const char * | alias,
|  | const char * | column,
|  | qdb_ts_timestamp_aggregation_t * | aggregations,
|  | qdb_size_t | aggregation_count
| ) |  |

Aggregate a sub-part of the timestamp column of the time series.

It is an error to call this function on a nonexisting time series.

Parameters

  | handle | A valid handle previously initialized by qdb_open or qdb_open_tcp.
  | alias | A pointer to a null-terminated UTF-8 string representing the alias of the time series.
  | column | A pointer to a null-terminated UTF-8 string representing the name of the column to work on.
  [in,out] | aggregations | An array of structures representing the aggregations to compute and their results.
  | aggregation_count | The number of elements in the aggregations array.

Returns
  A qdb_error_t code indicating success or failure.

See Also
  qdb_ts_aggregation_type_t

QDB_API_LINKAGE qdb_error_t qdb_ts_timestamp_get_ranges | ( | qdb_handle_t | handle,
|  | const char * | alias,
|  | const char * | column,
|  | const qdb_ts_range_t * | ranges,
|  | qdb_size_t | range_count,
|  | qdb_ts_timestamp_point ** | points,
|  | qdb_size_t * | point_count
| ) |  |

Retrieves timestamps in the specified range of the time series column.

It is an error to call this function on a nonexisting time series.

Parameters

  | handle | A valid handle previously initialized by qdb_open or qdb_open_tcp.
  | alias | A pointer to a null-terminated UTF-8 string representing the alias of the time series.
  | column | A pointer to a null-terminated UTF-8 string representing the name of the column to work on.
  | ranges | An array of ranges (intervals) for which data should be retrieved.
  | range_count | The number of ranges.
  [out] | points | A pointer to an array that will contain data points from all given ranges.
  [out] | point_count | A pointer to an integer that will receive the number of returned points.

Returns
  A qdb_error_t code indicating success or failure.

See Also
  qdb_release

QDB_API_LINKAGE qdb_error_t qdb_ts_timestamp_get_ranges_no_copy | ( | qdb_handle_t | handle,
|  | const char * | alias,
|  | const char * | column,
|  | const qdb_ts_range_t * | ranges,
|  | qdb_size_t | range_count,
|  | qdb_ts_timestamp_point * | points,
|  | qdb_size_t * | point_count
| ) |  |

Retrieves timestamps in the specified range of the time series column.

It is an error to call this function on a nonexisting time series.

Parameters

  | handle | A valid handle previously initialized by qdb_open or qdb_open_tcp.
  | alias | A pointer to a null-terminated UTF-8 string representing the alias of the time series.
  | column | A pointer to a null-terminated UTF-8 string representing the name of the column to work on.
  | ranges | An array of ranges (intervals) for which data should be retrieved.
  | range_count | The number of ranges.
  | points | An array in which the data points from all given ranges will be placed.
  [in,out] | point_count | A pointer to an integer containing the size of the given array on entry, will receive the number of retrieved data points.

Returns
  A qdb_error_t code indicating success or failure. Returns qdb_e_buffer_too_small when the given array is not big enough to store all retrieved data points, in which case point_count will contain the necessary size for a successfull call.

QDB_API_LINKAGE qdb_error_t qdb_ts_timestamp_insert | ( | qdb_handle_t | handle,
|  | const char * | alias,
|  | const char * | column,
|  | const qdb_ts_timestamp_point * | values,
|  | qdb_size_t | value_count
| ) |  |

Inserts timestamp points in a time series.

Time series are distributed across the cluster and support efficient insertion anywhere within the time series as well as efficient lookup based on time.

Parameters

  handle | A valid handle previously initialized by qdb_open or qdb_open_tcp.
  alias | A pointer to a null-terminated UTF-8 string representing the alias of the time series.
  column | A pointer to a null-terminated UTF-8 string representing the name of the column to work on.
  values | An array of data points to be inserted.
  value_count | The number of data points to insert.

Returns
  A qdb_error_t code indicating success or failure.

Note
  The caller must ensure that all columns in the timeseries are properly aligned (for any given timestamp, all columns have the same number of corresponding cells).

QDB_API_LINKAGE qdb_error_t qdb_ts_timestamp_insert_truncate | ( | qdb_handle_t | handle,
|  | const char * | alias,
|  | const char * | column,
|  | const qdb_ts_range_t * | ranges,
|  | qdb_size_t | range_count,
|  | const qdb_ts_timestamp_point * | values,
|  | qdb_size_t | value_count
| ) |  |

Inserts timestamp points in a time series and erases given ranges in the same transaction.

Time series are distributed across the cluster and support efficient insertion anywhere within the time series as well as efficient lookup based on time.

Parameters

  handle | A valid handle previously initialized by qdb_open or qdb_open_tcp.
  alias | A pointer to a null-terminated UTF-8 string representing the alias of the time series.
  column | A pointer to a null-terminated UTF-8 string representing the name of the column to work on.
  ranges | An array of ranges (intervals) for which data should be erased.
  range_count | The number of ranges.
  values | An array of data points to be inserted.
  value_count | The number of data points to insert.

Returns
  A qdb_error_t code indicating success or failure.

Note
  The caller must ensure that all columns in the timeseries are properly aligned (for any given timestamp, all columns have the same number of corresponding cells).