Lbug C API
Loading...
Searching...
No Matches
lbug.h File Reference
#include <stdbool.h>
#include <stdint.h>
#include <time.h>

Go to the source code of this file.

Data Structures

struct  ArrowSchema
struct  ArrowArray
struct  lbug_system_config
 Stores runtime configuration for creating or opening a Database. More...
struct  lbug_database
 lbug_database manages all database components. More...
struct  lbug_connection
 lbug_connection is used to interact with a Database instance. Each connection is thread-safe. Multiple connections can connect to the same Database instance in a multi-threaded environment. More...
struct  lbug_prepared_statement
 lbug_prepared_statement is a parameterized query which can avoid planning the same query for repeated execution. More...
struct  lbug_query_result
 lbug_query_result stores the result of a query. More...
struct  lbug_flat_tuple
 lbug_flat_tuple stores a vector of values. More...
struct  lbug_logical_type
 lbug_logical_type is the lbug internal representation of data types. More...
struct  lbug_value
 lbug_value is used to represent a value with any lbug internal dataType. More...
struct  lbug_internal_id_t
 lbug internal internal_id type which stores the table_id and offset of a node/rel. More...
struct  lbug_date_t
 lbug internal date type which stores the number of days since 1970-01-01 00:00:00 UTC. More...
struct  lbug_timestamp_ns_t
 lbug internal timestamp_ns type which stores the number of nanoseconds since 1970-01-01 00:00:00 UTC. More...
struct  lbug_timestamp_ms_t
 lbug internal timestamp_ms type which stores the number of milliseconds since 1970-01-01 00:00:00 UTC. More...
struct  lbug_timestamp_sec_t
 lbug internal timestamp_sec_t type which stores the number of seconds since 1970-01-01 00:00:00 UTC. More...
struct  lbug_timestamp_tz_t
 lbug internal timestamp_tz type which stores the number of microseconds since 1970-01-01 with timezone 00:00:00 UTC. More...
struct  lbug_timestamp_t
 lbug internal timestamp type which stores the number of microseconds since 1970-01-01 00:00:00 UTC. More...
struct  lbug_interval_t
 lbug internal interval type which stores the months, days and microseconds. More...
struct  lbug_query_summary
 lbug_query_summary stores the execution time, plan, compiling time and query options of a query. More...
struct  lbug_int128_t

Macros

#define LBUG_HELPER_DLL_IMPORT   __attribute__((visibility("default")))
#define LBUG_HELPER_DLL_EXPORT   __attribute__((visibility("default")))
#define LBUG_HELPER_DLL_LOCAL   __attribute__((visibility("hidden")))
#define LBUG_HELPER_DEPRECATED   __attribute__((__deprecated__))
#define LBUG_API   LBUG_HELPER_DLL_IMPORT
#define LBUG_DEPRECATED   LBUG_HELPER_DEPRECATED
#define LBUG_DEPRECATED_EXPORT   LBUG_API LBUG_DEPRECATED
#define ARROW_C_DATA_INTERFACE
#define ARROW_FLAG_DICTIONARY_ORDERED   1
#define ARROW_FLAG_NULLABLE   2
#define ARROW_FLAG_MAP_KEYS_SORTED   4
#define LBUG_C_API   LBUG_API

Enumerations

enum  lbug_data_type_id {
  LBUG_ANY = 0 , LBUG_NODE = 10 , LBUG_REL = 11 , LBUG_RECURSIVE_REL = 12 ,
  LBUG_SERIAL = 13 , LBUG_BOOL = 22 , LBUG_INT64 = 23 , LBUG_INT32 = 24 ,
  LBUG_INT16 = 25 , LBUG_INT8 = 26 , LBUG_UINT64 = 27 , LBUG_UINT32 = 28 ,
  LBUG_UINT16 = 29 , LBUG_UINT8 = 30 , LBUG_INT128 = 31 , LBUG_DOUBLE = 32 ,
  LBUG_FLOAT = 33 , LBUG_DATE = 34 , LBUG_TIMESTAMP = 35 , LBUG_TIMESTAMP_SEC = 36 ,
  LBUG_TIMESTAMP_MS = 37 , LBUG_TIMESTAMP_NS = 38 , LBUG_TIMESTAMP_TZ = 39 , LBUG_INTERVAL = 40 ,
  LBUG_DECIMAL = 41 , LBUG_INTERNAL_ID = 42 , LBUG_STRING = 50 , LBUG_BLOB = 51 ,
  LBUG_LIST = 52 , LBUG_ARRAY = 53 , LBUG_STRUCT = 54 , LBUG_MAP = 55 ,
  LBUG_UNION = 56 , LBUG_POINTER = 58 , LBUG_UUID = 59
}
 enum class for lbug internal dataTypes. More...
enum  lbug_state { LbugSuccess = 0 , LbugError = 1 }
 enum class for lbug function return state. More...

Functions

LBUG_C_API lbug_state lbug_database_init (const char *database_path, lbug_system_config system_config, lbug_database *out_database)
 Allocates memory and creates a lbug database instance at database_path with bufferPoolSize=buffer_pool_size. Caller is responsible for calling lbug_database_destroy() to release the allocated memory.
LBUG_C_API void lbug_database_destroy (lbug_database *database)
 Destroys the lbug database instance and frees the allocated memory.
LBUG_C_API lbug_system_config lbug_default_system_config ()
LBUG_C_API lbug_state lbug_connection_init (lbug_database *database, lbug_connection *out_connection)
 Allocates memory and creates a connection to the database. Caller is responsible for calling lbug_connection_destroy() to release the allocated memory.
LBUG_C_API void lbug_connection_destroy (lbug_connection *connection)
 Destroys the connection instance and frees the allocated memory.
LBUG_C_API lbug_state lbug_connection_set_max_num_thread_for_exec (lbug_connection *connection, uint64_t num_threads)
 Sets the maximum number of threads to use for executing queries.
LBUG_C_API lbug_state lbug_connection_get_max_num_thread_for_exec (lbug_connection *connection, uint64_t *out_result)
 Returns the maximum number of threads of the connection to use for executing queries.
LBUG_C_API lbug_state lbug_connection_query (lbug_connection *connection, const char *query, lbug_query_result *out_query_result)
 Executes the given query and returns the result.
LBUG_C_API lbug_state lbug_connection_prepare (lbug_connection *connection, const char *query, lbug_prepared_statement *out_prepared_statement)
 Prepares the given query and returns the prepared statement.
LBUG_C_API lbug_state lbug_connection_execute (lbug_connection *connection, lbug_prepared_statement *prepared_statement, lbug_query_result *out_query_result)
 Executes the prepared_statement using connection.
LBUG_C_API void lbug_connection_interrupt (lbug_connection *connection)
 Interrupts the current query execution in the connection.
LBUG_C_API lbug_state lbug_connection_set_query_timeout (lbug_connection *connection, uint64_t timeout_in_ms)
 Sets query timeout value in milliseconds for the connection.
LBUG_C_API void lbug_prepared_statement_destroy (lbug_prepared_statement *prepared_statement)
 Destroys the prepared statement instance and frees the allocated memory.
LBUG_C_API bool lbug_prepared_statement_is_success (lbug_prepared_statement *prepared_statement)
LBUG_C_API char * lbug_prepared_statement_get_error_message (lbug_prepared_statement *prepared_statement)
 Returns the error message if the prepared statement is not prepared successfully. The caller is responsible for freeing the returned string with lbug_destroy_string.
LBUG_C_API lbug_state lbug_prepared_statement_bind_bool (lbug_prepared_statement *prepared_statement, const char *param_name, bool value)
 Binds the given boolean value to the given parameter name in the prepared statement.
LBUG_C_API lbug_state lbug_prepared_statement_bind_int64 (lbug_prepared_statement *prepared_statement, const char *param_name, int64_t value)
 Binds the given int64_t value to the given parameter name in the prepared statement.
LBUG_C_API lbug_state lbug_prepared_statement_bind_int32 (lbug_prepared_statement *prepared_statement, const char *param_name, int32_t value)
 Binds the given int32_t value to the given parameter name in the prepared statement.
LBUG_C_API lbug_state lbug_prepared_statement_bind_int16 (lbug_prepared_statement *prepared_statement, const char *param_name, int16_t value)
 Binds the given int16_t value to the given parameter name in the prepared statement.
LBUG_C_API lbug_state lbug_prepared_statement_bind_int8 (lbug_prepared_statement *prepared_statement, const char *param_name, int8_t value)
 Binds the given int8_t value to the given parameter name in the prepared statement.
LBUG_C_API lbug_state lbug_prepared_statement_bind_uint64 (lbug_prepared_statement *prepared_statement, const char *param_name, uint64_t value)
 Binds the given uint64_t value to the given parameter name in the prepared statement.
LBUG_C_API lbug_state lbug_prepared_statement_bind_uint32 (lbug_prepared_statement *prepared_statement, const char *param_name, uint32_t value)
 Binds the given uint32_t value to the given parameter name in the prepared statement.
LBUG_C_API lbug_state lbug_prepared_statement_bind_uint16 (lbug_prepared_statement *prepared_statement, const char *param_name, uint16_t value)
 Binds the given uint16_t value to the given parameter name in the prepared statement.
LBUG_C_API lbug_state lbug_prepared_statement_bind_uint8 (lbug_prepared_statement *prepared_statement, const char *param_name, uint8_t value)
 Binds the given int8_t value to the given parameter name in the prepared statement.
LBUG_C_API lbug_state lbug_prepared_statement_bind_double (lbug_prepared_statement *prepared_statement, const char *param_name, double value)
 Binds the given double value to the given parameter name in the prepared statement.
LBUG_C_API lbug_state lbug_prepared_statement_bind_float (lbug_prepared_statement *prepared_statement, const char *param_name, float value)
 Binds the given float value to the given parameter name in the prepared statement.
LBUG_C_API lbug_state lbug_prepared_statement_bind_date (lbug_prepared_statement *prepared_statement, const char *param_name, lbug_date_t value)
 Binds the given date value to the given parameter name in the prepared statement.
LBUG_C_API lbug_state lbug_prepared_statement_bind_timestamp_ns (lbug_prepared_statement *prepared_statement, const char *param_name, lbug_timestamp_ns_t value)
 Binds the given timestamp_ns value to the given parameter name in the prepared statement.
LBUG_C_API lbug_state lbug_prepared_statement_bind_timestamp_sec (lbug_prepared_statement *prepared_statement, const char *param_name, lbug_timestamp_sec_t value)
 Binds the given timestamp_sec value to the given parameter name in the prepared statement.
LBUG_C_API lbug_state lbug_prepared_statement_bind_timestamp_tz (lbug_prepared_statement *prepared_statement, const char *param_name, lbug_timestamp_tz_t value)
 Binds the given timestamp_tz value to the given parameter name in the prepared statement.
LBUG_C_API lbug_state lbug_prepared_statement_bind_timestamp_ms (lbug_prepared_statement *prepared_statement, const char *param_name, lbug_timestamp_ms_t value)
 Binds the given timestamp_ms value to the given parameter name in the prepared statement.
LBUG_C_API lbug_state lbug_prepared_statement_bind_timestamp (lbug_prepared_statement *prepared_statement, const char *param_name, lbug_timestamp_t value)
 Binds the given timestamp value to the given parameter name in the prepared statement.
LBUG_C_API lbug_state lbug_prepared_statement_bind_interval (lbug_prepared_statement *prepared_statement, const char *param_name, lbug_interval_t value)
 Binds the given interval value to the given parameter name in the prepared statement.
LBUG_C_API lbug_state lbug_prepared_statement_bind_string (lbug_prepared_statement *prepared_statement, const char *param_name, const char *value)
 Binds the given string value to the given parameter name in the prepared statement.
LBUG_C_API lbug_state lbug_prepared_statement_bind_value (lbug_prepared_statement *prepared_statement, const char *param_name, lbug_value *value)
 Binds the given lbug value to the given parameter name in the prepared statement.
LBUG_C_API void lbug_query_result_destroy (lbug_query_result *query_result)
 Destroys the given query result instance.
LBUG_C_API bool lbug_query_result_is_success (lbug_query_result *query_result)
 Returns true if the query is executed successful, false otherwise.
LBUG_C_API char * lbug_query_result_get_error_message (lbug_query_result *query_result)
 Returns the error message if the query is failed. The caller is responsible for freeing the returned string with lbug_destroy_string.
LBUG_C_API uint64_t lbug_query_result_get_num_columns (lbug_query_result *query_result)
 Returns the number of columns in the query result.
LBUG_C_API lbug_state lbug_query_result_get_column_name (lbug_query_result *query_result, uint64_t index, char **out_column_name)
 Returns the column name at the given index.
LBUG_C_API lbug_state lbug_query_result_get_column_data_type (lbug_query_result *query_result, uint64_t index, lbug_logical_type *out_column_data_type)
 Returns the data type of the column at the given index.
LBUG_C_API uint64_t lbug_query_result_get_num_tuples (lbug_query_result *query_result)
 Returns the number of tuples in the query result.
LBUG_C_API lbug_state lbug_query_result_get_query_summary (lbug_query_result *query_result, lbug_query_summary *out_query_summary)
 Returns the query summary of the query result.
LBUG_C_API bool lbug_query_result_has_next (lbug_query_result *query_result)
 Returns true if we have not consumed all tuples in the query result, false otherwise.
LBUG_C_API lbug_state lbug_query_result_get_next (lbug_query_result *query_result, lbug_flat_tuple *out_flat_tuple)
 Returns the next tuple in the query result. Throws an exception if there is no more tuple. Note that to reduce resource allocation, all calls to lbug_query_result_get_next() reuse the same FlatTuple object. Since its contents will be overwritten, please complete processing a FlatTuple or make a copy of its data before calling lbug_query_result_get_next() again.
LBUG_C_API bool lbug_query_result_has_next_query_result (lbug_query_result *query_result)
 Returns true if we have not consumed all query results, false otherwise. Use this function for loop results of multiple query statements.
LBUG_C_API lbug_state lbug_query_result_get_next_query_result (lbug_query_result *query_result, lbug_query_result *out_next_query_result)
 Returns the next query result. Use this function to loop multiple query statements' results.
LBUG_C_API char * lbug_query_result_to_string (lbug_query_result *query_result)
 Returns the query result as a string.
LBUG_C_API void lbug_query_result_reset_iterator (lbug_query_result *query_result)
 Resets the iterator of the query result to the beginning of the query result.
LBUG_C_API lbug_state lbug_query_result_get_arrow_schema (lbug_query_result *query_result, struct ArrowSchema *out_schema)
 Returns the query result's schema as ArrowSchema.
LBUG_C_API lbug_state lbug_query_result_get_next_arrow_chunk (lbug_query_result *query_result, int64_t chunk_size, struct ArrowArray *out_arrow_array)
 Returns the next chunk of the query result as ArrowArray.
LBUG_C_API void lbug_flat_tuple_destroy (lbug_flat_tuple *flat_tuple)
 Destroys the given flat tuple instance.
LBUG_C_API lbug_state lbug_flat_tuple_get_value (lbug_flat_tuple *flat_tuple, uint64_t index, lbug_value *out_value)
 Returns the value at index of the flat tuple.
LBUG_C_API char * lbug_flat_tuple_to_string (lbug_flat_tuple *flat_tuple)
 Converts the flat tuple to a string.
LBUG_C_API void lbug_data_type_create (lbug_data_type_id id, lbug_logical_type *child_type, uint64_t num_elements_in_array, lbug_logical_type *out_type)
 Creates a data type instance with the given id, childType and num_elements_in_array. Caller is responsible for destroying the returned data type instance.
LBUG_C_API void lbug_data_type_clone (lbug_logical_type *data_type, lbug_logical_type *out_type)
 Creates a new data type instance by cloning the given data type instance.
LBUG_C_API void lbug_data_type_destroy (lbug_logical_type *data_type)
 Destroys the given data type instance.
LBUG_C_API bool lbug_data_type_equals (lbug_logical_type *data_type1, lbug_logical_type *data_type2)
 Returns true if the given data type is equal to the other data type, false otherwise.
LBUG_C_API lbug_data_type_id lbug_data_type_get_id (lbug_logical_type *data_type)
 Returns the enum type id of the given data type.
LBUG_C_API lbug_state lbug_data_type_get_num_elements_in_array (lbug_logical_type *data_type, uint64_t *out_result)
 Returns the number of elements for array.
LBUG_C_API lbug_valuelbug_value_create_null ()
 Creates a NULL value of ANY type. Caller is responsible for destroying the returned value.
LBUG_C_API lbug_valuelbug_value_create_null_with_data_type (lbug_logical_type *data_type)
 Creates a value of the given data type. Caller is responsible for destroying the returned value.
LBUG_C_API bool lbug_value_is_null (lbug_value *value)
 Returns true if the given value is NULL, false otherwise.
LBUG_C_API void lbug_value_set_null (lbug_value *value, bool is_null)
 Sets the given value to NULL or not.
LBUG_C_API lbug_valuelbug_value_create_default (lbug_logical_type *data_type)
 Creates a value of the given data type with default non-NULL value. Caller is responsible for destroying the returned value.
LBUG_C_API lbug_valuelbug_value_create_bool (bool val_)
 Creates a value with boolean type and the given bool value. Caller is responsible for destroying the returned value.
LBUG_C_API lbug_valuelbug_value_create_int8 (int8_t val_)
 Creates a value with int8 type and the given int8 value. Caller is responsible for destroying the returned value.
LBUG_C_API lbug_valuelbug_value_create_int16 (int16_t val_)
 Creates a value with int16 type and the given int16 value. Caller is responsible for destroying the returned value.
LBUG_C_API lbug_valuelbug_value_create_int32 (int32_t val_)
 Creates a value with int32 type and the given int32 value. Caller is responsible for destroying the returned value.
LBUG_C_API lbug_valuelbug_value_create_int64 (int64_t val_)
 Creates a value with int64 type and the given int64 value. Caller is responsible for destroying the returned value.
LBUG_C_API lbug_valuelbug_value_create_uint8 (uint8_t val_)
 Creates a value with uint8 type and the given uint8 value. Caller is responsible for destroying the returned value.
LBUG_C_API lbug_valuelbug_value_create_uint16 (uint16_t val_)
 Creates a value with uint16 type and the given uint16 value. Caller is responsible for destroying the returned value.
LBUG_C_API lbug_valuelbug_value_create_uint32 (uint32_t val_)
 Creates a value with uint32 type and the given uint32 value. Caller is responsible for destroying the returned value.
LBUG_C_API lbug_valuelbug_value_create_uint64 (uint64_t val_)
 Creates a value with uint64 type and the given uint64 value. Caller is responsible for destroying the returned value.
LBUG_C_API lbug_valuelbug_value_create_int128 (lbug_int128_t val_)
 Creates a value with int128 type and the given int128 value. Caller is responsible for destroying the returned value.
LBUG_C_API lbug_valuelbug_value_create_float (float val_)
 Creates a value with float type and the given float value. Caller is responsible for destroying the returned value.
LBUG_C_API lbug_valuelbug_value_create_double (double val_)
 Creates a value with double type and the given double value. Caller is responsible for destroying the returned value.
LBUG_C_API lbug_valuelbug_value_create_internal_id (lbug_internal_id_t val_)
 Creates a value with internal_id type and the given internal_id value. Caller is responsible for destroying the returned value.
LBUG_C_API lbug_valuelbug_value_create_date (lbug_date_t val_)
 Creates a value with date type and the given date value. Caller is responsible for destroying the returned value.
LBUG_C_API lbug_valuelbug_value_create_timestamp_ns (lbug_timestamp_ns_t val_)
 Creates a value with timestamp_ns type and the given timestamp value. Caller is responsible for destroying the returned value.
LBUG_C_API lbug_valuelbug_value_create_timestamp_ms (lbug_timestamp_ms_t val_)
 Creates a value with timestamp_ms type and the given timestamp value. Caller is responsible for destroying the returned value.
LBUG_C_API lbug_valuelbug_value_create_timestamp_sec (lbug_timestamp_sec_t val_)
 Creates a value with timestamp_sec type and the given timestamp value. Caller is responsible for destroying the returned value.
LBUG_C_API lbug_valuelbug_value_create_timestamp_tz (lbug_timestamp_tz_t val_)
 Creates a value with timestamp_tz type and the given timestamp value. Caller is responsible for destroying the returned value.
LBUG_C_API lbug_valuelbug_value_create_timestamp (lbug_timestamp_t val_)
 Creates a value with timestamp type and the given timestamp value. Caller is responsible for destroying the returned value.
LBUG_C_API lbug_valuelbug_value_create_interval (lbug_interval_t val_)
 Creates a value with interval type and the given interval value. Caller is responsible for destroying the returned value.
LBUG_C_API lbug_valuelbug_value_create_string (const char *val_)
 Creates a value with string type and the given string value. Caller is responsible for destroying the returned value.
LBUG_C_API lbug_state lbug_value_create_list (uint64_t num_elements, lbug_value **elements, lbug_value **out_value)
 Creates a list value with the given number of elements and the given elements. The caller needs to make sure that all elements have the same type. The elements are copied into the list value, so destroying the elements after creating the list value is safe. Caller is responsible for destroying the returned value.
LBUG_C_API lbug_state lbug_value_create_struct (uint64_t num_fields, const char **field_names, lbug_value **field_values, lbug_value **out_value)
 Creates a struct value with the given number of fields and the given field names and values. The caller needs to make sure that all field names are unique. The field names and values are copied into the struct value, so destroying the field names and values after creating the struct value is safe. Caller is responsible for destroying the returned value.
LBUG_C_API lbug_state lbug_value_create_map (uint64_t num_fields, lbug_value **keys, lbug_value **values, lbug_value **out_value)
 Creates a map value with the given number of fields and the given keys and values. The caller needs to make sure that all keys are unique, and all keys and values have the same type. The keys and values are copied into the map value, so destroying the keys and values after creating the map value is safe. Caller is responsible for destroying the returned value.
LBUG_C_API lbug_valuelbug_value_clone (lbug_value *value)
 Creates a new value based on the given value. Caller is responsible for destroying the returned value.
LBUG_C_API void lbug_value_copy (lbug_value *value, lbug_value *other)
 Copies the other value to the value.
LBUG_C_API void lbug_value_destroy (lbug_value *value)
 Destroys the value.
LBUG_C_API lbug_state lbug_value_get_list_size (lbug_value *value, uint64_t *out_result)
 Returns the number of elements per list of the given value. The value must be of type ARRAY.
LBUG_C_API lbug_state lbug_value_get_list_element (lbug_value *value, uint64_t index, lbug_value *out_value)
 Returns the element at index of the given value. The value must be of type LIST.
LBUG_C_API lbug_state lbug_value_get_struct_num_fields (lbug_value *value, uint64_t *out_result)
 Returns the number of fields of the given struct value. The value must be of type STRUCT.
LBUG_C_API lbug_state lbug_value_get_struct_field_name (lbug_value *value, uint64_t index, char **out_result)
 Returns the field name at index of the given struct value. The value must be of physical type STRUCT (STRUCT, NODE, REL, RECURSIVE_REL, UNION).
LBUG_C_API lbug_state lbug_value_get_struct_field_value (lbug_value *value, uint64_t index, lbug_value *out_value)
 Returns the field value at index of the given struct value. The value must be of physical type STRUCT (STRUCT, NODE, REL, RECURSIVE_REL, UNION).
LBUG_C_API lbug_state lbug_value_get_map_size (lbug_value *value, uint64_t *out_result)
 Returns the size of the given map value. The value must be of type MAP.
LBUG_C_API lbug_state lbug_value_get_map_key (lbug_value *value, uint64_t index, lbug_value *out_key)
 Returns the key at index of the given map value. The value must be of physical type MAP.
LBUG_C_API lbug_state lbug_value_get_map_value (lbug_value *value, uint64_t index, lbug_value *out_value)
 Returns the field value at index of the given map value. The value must be of physical type MAP.
LBUG_C_API lbug_state lbug_value_get_recursive_rel_node_list (lbug_value *value, lbug_value *out_value)
 Returns the list of nodes for recursive rel value. The value must be of type RECURSIVE_REL.
LBUG_C_API lbug_state lbug_value_get_recursive_rel_rel_list (lbug_value *value, lbug_value *out_value)
 Returns the list of rels for recursive rel value. The value must be of type RECURSIVE_REL.
LBUG_C_API void lbug_value_get_data_type (lbug_value *value, lbug_logical_type *out_type)
 Returns internal type of the given value.
LBUG_C_API lbug_state lbug_value_get_bool (lbug_value *value, bool *out_result)
 Returns the boolean value of the given value. The value must be of type BOOL.
LBUG_C_API lbug_state lbug_value_get_int8 (lbug_value *value, int8_t *out_result)
 Returns the int8 value of the given value. The value must be of type INT8.
LBUG_C_API lbug_state lbug_value_get_int16 (lbug_value *value, int16_t *out_result)
 Returns the int16 value of the given value. The value must be of type INT16.
LBUG_C_API lbug_state lbug_value_get_int32 (lbug_value *value, int32_t *out_result)
 Returns the int32 value of the given value. The value must be of type INT32.
LBUG_C_API lbug_state lbug_value_get_int64 (lbug_value *value, int64_t *out_result)
 Returns the int64 value of the given value. The value must be of type INT64 or SERIAL.
LBUG_C_API lbug_state lbug_value_get_uint8 (lbug_value *value, uint8_t *out_result)
 Returns the uint8 value of the given value. The value must be of type UINT8.
LBUG_C_API lbug_state lbug_value_get_uint16 (lbug_value *value, uint16_t *out_result)
 Returns the uint16 value of the given value. The value must be of type UINT16.
LBUG_C_API lbug_state lbug_value_get_uint32 (lbug_value *value, uint32_t *out_result)
 Returns the uint32 value of the given value. The value must be of type UINT32.
LBUG_C_API lbug_state lbug_value_get_uint64 (lbug_value *value, uint64_t *out_result)
 Returns the uint64 value of the given value. The value must be of type UINT64.
LBUG_C_API lbug_state lbug_value_get_int128 (lbug_value *value, lbug_int128_t *out_result)
 Returns the int128 value of the given value. The value must be of type INT128.
LBUG_C_API lbug_state lbug_int128_t_from_string (const char *str, lbug_int128_t *out_result)
 convert a string to int128 value.
LBUG_C_API lbug_state lbug_int128_t_to_string (lbug_int128_t val, char **out_result)
 convert int128 to corresponding string.
LBUG_C_API lbug_state lbug_value_get_float (lbug_value *value, float *out_result)
 Returns the float value of the given value. The value must be of type FLOAT.
LBUG_C_API lbug_state lbug_value_get_double (lbug_value *value, double *out_result)
 Returns the double value of the given value. The value must be of type DOUBLE.
LBUG_C_API lbug_state lbug_value_get_internal_id (lbug_value *value, lbug_internal_id_t *out_result)
 Returns the internal id value of the given value. The value must be of type INTERNAL_ID.
LBUG_C_API lbug_state lbug_value_get_date (lbug_value *value, lbug_date_t *out_result)
 Returns the date value of the given value. The value must be of type DATE.
LBUG_C_API lbug_state lbug_value_get_timestamp (lbug_value *value, lbug_timestamp_t *out_result)
 Returns the timestamp value of the given value. The value must be of type TIMESTAMP.
LBUG_C_API lbug_state lbug_value_get_timestamp_ns (lbug_value *value, lbug_timestamp_ns_t *out_result)
 Returns the timestamp_ns value of the given value. The value must be of type TIMESTAMP_NS.
LBUG_C_API lbug_state lbug_value_get_timestamp_ms (lbug_value *value, lbug_timestamp_ms_t *out_result)
 Returns the timestamp_ms value of the given value. The value must be of type TIMESTAMP_MS.
LBUG_C_API lbug_state lbug_value_get_timestamp_sec (lbug_value *value, lbug_timestamp_sec_t *out_result)
 Returns the timestamp_sec value of the given value. The value must be of type TIMESTAMP_SEC.
LBUG_C_API lbug_state lbug_value_get_timestamp_tz (lbug_value *value, lbug_timestamp_tz_t *out_result)
 Returns the timestamp_tz value of the given value. The value must be of type TIMESTAMP_TZ.
LBUG_C_API lbug_state lbug_value_get_interval (lbug_value *value, lbug_interval_t *out_result)
 Returns the interval value of the given value. The value must be of type INTERVAL.
LBUG_C_API lbug_state lbug_value_get_decimal_as_string (lbug_value *value, char **out_result)
 Returns the decimal value of the given value as a string. The value must be of type DECIMAL.
LBUG_C_API lbug_state lbug_value_get_string (lbug_value *value, char **out_result)
 Returns the string value of the given value. The value must be of type STRING.
LBUG_C_API lbug_state lbug_value_get_blob (lbug_value *value, uint8_t **out_result)
 Returns the blob value of the given value. The returned buffer is null-terminated similar to a string. The value must be of type BLOB.
LBUG_C_API lbug_state lbug_value_get_uuid (lbug_value *value, char **out_result)
 Returns the uuid value of the given value. to a string. The value must be of type UUID.
LBUG_C_API char * lbug_value_to_string (lbug_value *value)
 Converts the given value to string.
LBUG_C_API lbug_state lbug_node_val_get_id_val (lbug_value *node_val, lbug_value *out_value)
 Returns the internal id value of the given node value as a lbug value.
LBUG_C_API lbug_state lbug_node_val_get_label_val (lbug_value *node_val, lbug_value *out_value)
 Returns the label value of the given node value as a label value.
LBUG_C_API lbug_state lbug_node_val_get_property_size (lbug_value *node_val, uint64_t *out_value)
 Returns the number of properties of the given node value.
LBUG_C_API lbug_state lbug_node_val_get_property_name_at (lbug_value *node_val, uint64_t index, char **out_result)
 Returns the property name of the given node value at the given index.
LBUG_C_API lbug_state lbug_node_val_get_property_value_at (lbug_value *node_val, uint64_t index, lbug_value *out_value)
 Returns the property value of the given node value at the given index.
LBUG_C_API lbug_state lbug_node_val_to_string (lbug_value *node_val, char **out_result)
 Converts the given node value to string.
LBUG_C_API lbug_state lbug_rel_val_get_id_val (lbug_value *rel_val, lbug_value *out_value)
 Returns the internal id value of the rel value as a lbug value.
LBUG_C_API lbug_state lbug_rel_val_get_src_id_val (lbug_value *rel_val, lbug_value *out_value)
 Returns the internal id value of the source node of the given rel value as a lbug value.
LBUG_C_API lbug_state lbug_rel_val_get_dst_id_val (lbug_value *rel_val, lbug_value *out_value)
 Returns the internal id value of the destination node of the given rel value as a lbug value.
LBUG_C_API lbug_state lbug_rel_val_get_label_val (lbug_value *rel_val, lbug_value *out_value)
 Returns the label value of the given rel value.
LBUG_C_API lbug_state lbug_rel_val_get_property_size (lbug_value *rel_val, uint64_t *out_value)
 Returns the number of properties of the given rel value.
LBUG_C_API lbug_state lbug_rel_val_get_property_name_at (lbug_value *rel_val, uint64_t index, char **out_result)
 Returns the property name of the given rel value at the given index.
LBUG_C_API lbug_state lbug_rel_val_get_property_value_at (lbug_value *rel_val, uint64_t index, lbug_value *out_value)
 Returns the property of the given rel value at the given index as lbug value.
LBUG_C_API lbug_state lbug_rel_val_to_string (lbug_value *rel_val, char **out_result)
 Converts the given rel value to string.
LBUG_C_API void lbug_destroy_string (char *str)
 Destroys any string created by the Lbug C API, including both the error message and the values returned by the API functions. This function is provided to avoid the inconsistency between the memory allocation and deallocation across different libraries and is preferred over using the standard C free function.
LBUG_C_API void lbug_destroy_blob (uint8_t *blob)
 Destroys any blob created by the Lbug C API. This function is provided to avoid the inconsistency between the memory allocation and deallocation across different libraries and is preferred over using the standard C free function.
LBUG_C_API void lbug_query_summary_destroy (lbug_query_summary *query_summary)
 Destroys the given query summary.
LBUG_C_API double lbug_query_summary_get_compiling_time (lbug_query_summary *query_summary)
 Returns the compilation time of the given query summary in milliseconds.
LBUG_C_API double lbug_query_summary_get_execution_time (lbug_query_summary *query_summary)
 Returns the execution time of the given query summary in milliseconds.
LBUG_C_API lbug_state lbug_timestamp_ns_to_tm (lbug_timestamp_ns_t timestamp, struct tm *out_result)
 Convert timestamp_ns to corresponding tm struct.
LBUG_C_API lbug_state lbug_timestamp_ms_to_tm (lbug_timestamp_ms_t timestamp, struct tm *out_result)
 Convert timestamp_ms to corresponding tm struct.
LBUG_C_API lbug_state lbug_timestamp_sec_to_tm (lbug_timestamp_sec_t timestamp, struct tm *out_result)
 Convert timestamp_sec to corresponding tm struct.
LBUG_C_API lbug_state lbug_timestamp_tz_to_tm (lbug_timestamp_tz_t timestamp, struct tm *out_result)
 Convert timestamp_tz to corresponding tm struct.
LBUG_C_API lbug_state lbug_timestamp_to_tm (lbug_timestamp_t timestamp, struct tm *out_result)
 Convert timestamp to corresponding tm struct.
LBUG_C_API lbug_state lbug_timestamp_ns_from_tm (struct tm tm, lbug_timestamp_ns_t *out_result)
 Convert tm struct to timestamp_ns value.
LBUG_C_API lbug_state lbug_timestamp_ms_from_tm (struct tm tm, lbug_timestamp_ms_t *out_result)
 Convert tm struct to timestamp_ms value.
LBUG_C_API lbug_state lbug_timestamp_sec_from_tm (struct tm tm, lbug_timestamp_sec_t *out_result)
 Convert tm struct to timestamp_sec value.
LBUG_C_API lbug_state lbug_timestamp_tz_from_tm (struct tm tm, lbug_timestamp_tz_t *out_result)
 Convert tm struct to timestamp_tz value.
LBUG_C_API lbug_state lbug_timestamp_from_tm (struct tm tm, lbug_timestamp_t *out_result)
 Convert timestamp_ns to corresponding string.
LBUG_C_API lbug_state lbug_date_to_string (lbug_date_t date, char **out_result)
 Convert date to corresponding string.
LBUG_C_API lbug_state lbug_date_from_string (const char *str, lbug_date_t *out_result)
 Convert a string to date value.
LBUG_C_API lbug_state lbug_date_to_tm (lbug_date_t date, struct tm *out_result)
 Convert date to corresponding tm struct.
LBUG_C_API lbug_state lbug_date_from_tm (struct tm tm, lbug_date_t *out_result)
 Convert tm struct to date value.
LBUG_C_API void lbug_interval_to_difftime (lbug_interval_t interval, double *out_result)
 Convert interval to corresponding difftime value in seconds.
LBUG_C_API void lbug_interval_from_difftime (double difftime, lbug_interval_t *out_result)
 Convert difftime value in seconds to interval.
LBUG_C_API char * lbug_get_version ()
 Returns the version of the Lbug library.
LBUG_C_API uint64_t lbug_get_storage_version ()
 Returns the storage version of the Lbug library.

Macro Definition Documentation

◆ ARROW_C_DATA_INTERFACE

#define ARROW_C_DATA_INTERFACE

◆ ARROW_FLAG_DICTIONARY_ORDERED

#define ARROW_FLAG_DICTIONARY_ORDERED   1

◆ ARROW_FLAG_MAP_KEYS_SORTED

#define ARROW_FLAG_MAP_KEYS_SORTED   4

◆ ARROW_FLAG_NULLABLE

#define ARROW_FLAG_NULLABLE   2

◆ LBUG_API

#define LBUG_API   LBUG_HELPER_DLL_IMPORT

◆ LBUG_C_API

#define LBUG_C_API   LBUG_API

◆ LBUG_DEPRECATED

#define LBUG_DEPRECATED   LBUG_HELPER_DEPRECATED

◆ LBUG_DEPRECATED_EXPORT

#define LBUG_DEPRECATED_EXPORT   LBUG_API LBUG_DEPRECATED

◆ LBUG_HELPER_DEPRECATED

#define LBUG_HELPER_DEPRECATED   __attribute__((__deprecated__))

◆ LBUG_HELPER_DLL_EXPORT

#define LBUG_HELPER_DLL_EXPORT   __attribute__((visibility("default")))

◆ LBUG_HELPER_DLL_IMPORT

#define LBUG_HELPER_DLL_IMPORT   __attribute__((visibility("default")))

◆ LBUG_HELPER_DLL_LOCAL

#define LBUG_HELPER_DLL_LOCAL   __attribute__((visibility("hidden")))

Enumeration Type Documentation

◆ lbug_data_type_id

enum class for lbug internal dataTypes.

Enumerator
LBUG_ANY 
LBUG_NODE 
LBUG_REL 
LBUG_RECURSIVE_REL 
LBUG_SERIAL 
LBUG_BOOL 
LBUG_INT64 
LBUG_INT32 
LBUG_INT16 
LBUG_INT8 
LBUG_UINT64 
LBUG_UINT32 
LBUG_UINT16 
LBUG_UINT8 
LBUG_INT128 
LBUG_DOUBLE 
LBUG_FLOAT 
LBUG_DATE 
LBUG_TIMESTAMP 
LBUG_TIMESTAMP_SEC 
LBUG_TIMESTAMP_MS 
LBUG_TIMESTAMP_NS 
LBUG_TIMESTAMP_TZ 
LBUG_INTERVAL 
LBUG_DECIMAL 
LBUG_INTERNAL_ID 
LBUG_STRING 
LBUG_BLOB 
LBUG_LIST 
LBUG_ARRAY 
LBUG_STRUCT 
LBUG_MAP 
LBUG_UNION 
LBUG_POINTER 
LBUG_UUID 

◆ lbug_state

enum lbug_state

enum class for lbug function return state.

Enumerator
LbugSuccess 
LbugError 

Function Documentation

◆ lbug_connection_destroy()

LBUG_C_API void lbug_connection_destroy ( lbug_connection * connection)

Destroys the connection instance and frees the allocated memory.

Parameters
connectionThe connection instance to destroy.

◆ lbug_connection_execute()

LBUG_C_API lbug_state lbug_connection_execute ( lbug_connection * connection,
lbug_prepared_statement * prepared_statement,
lbug_query_result * out_query_result )

Executes the prepared_statement using connection.

Parameters
connectionThe connection instance to execute the prepared_statement.
prepared_statementThe prepared statement to execute.
[out]out_query_resultThe output parameter that will hold the result of the query.
Returns
The state indicating the success or failure of the operation.

◆ lbug_connection_get_max_num_thread_for_exec()

LBUG_C_API lbug_state lbug_connection_get_max_num_thread_for_exec ( lbug_connection * connection,
uint64_t * out_result )

Returns the maximum number of threads of the connection to use for executing queries.

Parameters
connectionThe connection instance to return max number of threads for execution.
[out]out_resultThe output parameter that will hold the maximum number of threads to use for executing queries.
Returns
The state indicating the success or failure of the operation.

◆ lbug_connection_init()

LBUG_C_API lbug_state lbug_connection_init ( lbug_database * database,
lbug_connection * out_connection )

Allocates memory and creates a connection to the database. Caller is responsible for calling lbug_connection_destroy() to release the allocated memory.

Parameters
databaseThe database instance to connect to.
[out]out_connectionThe output parameter that will hold the connection instance.
Returns
The state indicating the success or failure of the operation.

◆ lbug_connection_interrupt()

LBUG_C_API void lbug_connection_interrupt ( lbug_connection * connection)

Interrupts the current query execution in the connection.

Parameters
connectionThe connection instance to interrupt.

◆ lbug_connection_prepare()

LBUG_C_API lbug_state lbug_connection_prepare ( lbug_connection * connection,
const char * query,
lbug_prepared_statement * out_prepared_statement )

Prepares the given query and returns the prepared statement.

Parameters
connectionThe connection instance to prepare the query.
queryThe query to prepare.
[out]out_prepared_statementThe output parameter that will hold the prepared statement.
Returns
The state indicating the success or failure of the operation.

◆ lbug_connection_query()

LBUG_C_API lbug_state lbug_connection_query ( lbug_connection * connection,
const char * query,
lbug_query_result * out_query_result )

Executes the given query and returns the result.

Parameters
connectionThe connection instance to execute the query.
queryThe query to execute.
[out]out_query_resultThe output parameter that will hold the result of the query.
Returns
The state indicating the success or failure of the operation.

◆ lbug_connection_set_max_num_thread_for_exec()

LBUG_C_API lbug_state lbug_connection_set_max_num_thread_for_exec ( lbug_connection * connection,
uint64_t num_threads )

Sets the maximum number of threads to use for executing queries.

Parameters
connectionThe connection instance to set max number of threads for execution.
num_threadsThe maximum number of threads to use for executing queries.
Returns
The state indicating the success or failure of the operation.

◆ lbug_connection_set_query_timeout()

LBUG_C_API lbug_state lbug_connection_set_query_timeout ( lbug_connection * connection,
uint64_t timeout_in_ms )

Sets query timeout value in milliseconds for the connection.

Parameters
connectionThe connection instance to set query timeout value.
timeout_in_msThe timeout value in milliseconds.
Returns
The state indicating the success or failure of the operation.

◆ lbug_data_type_clone()

LBUG_C_API void lbug_data_type_clone ( lbug_logical_type * data_type,
lbug_logical_type * out_type )

Creates a new data type instance by cloning the given data type instance.

Parameters
data_typeThe data type instance to clone.
[out]out_typeThe output parameter that will hold the cloned data type instance.
Returns
The state indicating the success or failure of the operation.

◆ lbug_data_type_create()

LBUG_C_API void lbug_data_type_create ( lbug_data_type_id id,
lbug_logical_type * child_type,
uint64_t num_elements_in_array,
lbug_logical_type * out_type )

Creates a data type instance with the given id, childType and num_elements_in_array. Caller is responsible for destroying the returned data type instance.

Parameters
idThe enum type id of the datatype to create.
child_typeThe child type of the datatype to create(only used for nested dataTypes).
num_elements_in_arrayThe number of elements in the array(only used for ARRAY).
[out]out_typeThe output parameter that will hold the data type instance.
Returns
The state indicating the success or failure of the operation.

◆ lbug_data_type_destroy()

LBUG_C_API void lbug_data_type_destroy ( lbug_logical_type * data_type)

Destroys the given data type instance.

Parameters
data_typeThe data type instance to destroy.

◆ lbug_data_type_equals()

LBUG_C_API bool lbug_data_type_equals ( lbug_logical_type * data_type1,
lbug_logical_type * data_type2 )

Returns true if the given data type is equal to the other data type, false otherwise.

Parameters
data_type1The first data type instance to compare.
data_type2The second data type instance to compare.

◆ lbug_data_type_get_id()

LBUG_C_API lbug_data_type_id lbug_data_type_get_id ( lbug_logical_type * data_type)

Returns the enum type id of the given data type.

Parameters
data_typeThe data type instance to return.

◆ lbug_data_type_get_num_elements_in_array()

LBUG_C_API lbug_state lbug_data_type_get_num_elements_in_array ( lbug_logical_type * data_type,
uint64_t * out_result )

Returns the number of elements for array.

Parameters
data_typeThe data type instance to return.
[out]out_resultThe output parameter that will hold the number of elements in the array.
Returns
The state indicating the success or failure of the operation.

◆ lbug_database_destroy()

LBUG_C_API void lbug_database_destroy ( lbug_database * database)

Destroys the lbug database instance and frees the allocated memory.

Parameters
databaseThe database instance to destroy.

◆ lbug_database_init()

LBUG_C_API lbug_state lbug_database_init ( const char * database_path,
lbug_system_config system_config,
lbug_database * out_database )

Allocates memory and creates a lbug database instance at database_path with bufferPoolSize=buffer_pool_size. Caller is responsible for calling lbug_database_destroy() to release the allocated memory.

Parameters
database_pathThe path to the database.
system_configThe runtime configuration for creating or opening the database.
[out]out_databaseThe output parameter that will hold the database instance.
Returns
The state indicating the success or failure of the operation.

◆ lbug_date_from_string()

LBUG_C_API lbug_state lbug_date_from_string ( const char * str,
lbug_date_t * out_result )

Convert a string to date value.

Parameters
strThe string to convert.
[out]out_resultThe output parameter that will hold the date value.
Returns
The state indicating the success or failure of the operation.

◆ lbug_date_from_tm()

LBUG_C_API lbug_state lbug_date_from_tm ( struct tm tm,
lbug_date_t * out_result )

Convert tm struct to date value.

Parameters
tmThe tm struct to convert.
[out]out_resultThe output parameter that will hold the date value.
Returns
The state indicating the success or failure of the operation.

◆ lbug_date_to_string()

LBUG_C_API lbug_state lbug_date_to_string ( lbug_date_t date,
char ** out_result )

Convert date to corresponding string.

Parameters
dateThe date value to convert.
[out]out_resultThe output parameter that will hold the string value.
Returns
The state indicating the success or failure of the operation.

◆ lbug_date_to_tm()

LBUG_C_API lbug_state lbug_date_to_tm ( lbug_date_t date,
struct tm * out_result )

Convert date to corresponding tm struct.

Parameters
dateThe date value to convert.
[out]out_resultThe output parameter that will hold the tm struct.
Returns
The state indicating the success or failure of the operation.

◆ lbug_default_system_config()

LBUG_C_API lbug_system_config lbug_default_system_config ( )

◆ lbug_destroy_blob()

LBUG_C_API void lbug_destroy_blob ( uint8_t * blob)

Destroys any blob created by the Lbug C API. This function is provided to avoid the inconsistency between the memory allocation and deallocation across different libraries and is preferred over using the standard C free function.

Parameters
blobThe blob to destroy.

◆ lbug_destroy_string()

LBUG_C_API void lbug_destroy_string ( char * str)

Destroys any string created by the Lbug C API, including both the error message and the values returned by the API functions. This function is provided to avoid the inconsistency between the memory allocation and deallocation across different libraries and is preferred over using the standard C free function.

Parameters
strThe string to destroy.

◆ lbug_flat_tuple_destroy()

LBUG_C_API void lbug_flat_tuple_destroy ( lbug_flat_tuple * flat_tuple)

Destroys the given flat tuple instance.

Parameters
flat_tupleThe flat tuple instance to destroy.

◆ lbug_flat_tuple_get_value()

LBUG_C_API lbug_state lbug_flat_tuple_get_value ( lbug_flat_tuple * flat_tuple,
uint64_t index,
lbug_value * out_value )

Returns the value at index of the flat tuple.

Parameters
flat_tupleThe flat tuple instance to return.
indexThe index of the value to return.
[out]out_valueThe output parameter that will hold the value at index.
Returns
The state indicating the success or failure of the operation.

◆ lbug_flat_tuple_to_string()

LBUG_C_API char * lbug_flat_tuple_to_string ( lbug_flat_tuple * flat_tuple)

Converts the flat tuple to a string.

Parameters
flat_tupleThe flat tuple instance to convert.
Returns
The flat tuple as a string.

◆ lbug_get_storage_version()

LBUG_C_API uint64_t lbug_get_storage_version ( )

Returns the storage version of the Lbug library.

◆ lbug_get_version()

LBUG_C_API char * lbug_get_version ( )

Returns the version of the Lbug library.

◆ lbug_int128_t_from_string()

LBUG_C_API lbug_state lbug_int128_t_from_string ( const char * str,
lbug_int128_t * out_result )

convert a string to int128 value.

Parameters
strThe string to convert.
[out]out_resultThe output parameter that will hold the int128 value.
Returns
The state indicating the success or failure of the operation.

◆ lbug_int128_t_to_string()

LBUG_C_API lbug_state lbug_int128_t_to_string ( lbug_int128_t val,
char ** out_result )

convert int128 to corresponding string.

Parameters
valThe int128 value to convert.
[out]out_resultThe output parameter that will hold the string value.
Returns
The state indicating the success or failure of the operation.

◆ lbug_interval_from_difftime()

LBUG_C_API void lbug_interval_from_difftime ( double difftime,
lbug_interval_t * out_result )

Convert difftime value in seconds to interval.

Parameters
difftimeThe difftime value to convert.
[out]out_resultThe output parameter that will hold the interval value.

◆ lbug_interval_to_difftime()

LBUG_C_API void lbug_interval_to_difftime ( lbug_interval_t interval,
double * out_result )

Convert interval to corresponding difftime value in seconds.

Parameters
intervalThe interval value to convert.
[out]out_resultThe output parameter that will hold the difftime value.

◆ lbug_node_val_get_id_val()

LBUG_C_API lbug_state lbug_node_val_get_id_val ( lbug_value * node_val,
lbug_value * out_value )

Returns the internal id value of the given node value as a lbug value.

Parameters
node_valThe node value to return.
[out]out_valueThe output parameter that will hold the internal id value.
Returns
The state indicating the success or failure of the operation.

◆ lbug_node_val_get_label_val()

LBUG_C_API lbug_state lbug_node_val_get_label_val ( lbug_value * node_val,
lbug_value * out_value )

Returns the label value of the given node value as a label value.

Parameters
node_valThe node value to return.
[out]out_valueThe output parameter that will hold the label value.
Returns
The state indicating the success or failure of the operation.

◆ lbug_node_val_get_property_name_at()

LBUG_C_API lbug_state lbug_node_val_get_property_name_at ( lbug_value * node_val,
uint64_t index,
char ** out_result )

Returns the property name of the given node value at the given index.

Parameters
node_valThe node value to return.
indexThe index of the property.
[out]out_resultThe output parameter that will hold the property name at index.
Returns
The state indicating the success or failure of the operation.

◆ lbug_node_val_get_property_size()

LBUG_C_API lbug_state lbug_node_val_get_property_size ( lbug_value * node_val,
uint64_t * out_value )

Returns the number of properties of the given node value.

Parameters
node_valThe node value to return.
[out]out_valueThe output parameter that will hold the number of properties.
Returns
The state indicating the success or failure of the operation.

◆ lbug_node_val_get_property_value_at()

LBUG_C_API lbug_state lbug_node_val_get_property_value_at ( lbug_value * node_val,
uint64_t index,
lbug_value * out_value )

Returns the property value of the given node value at the given index.

Parameters
node_valThe node value to return.
indexThe index of the property.
[out]out_valueThe output parameter that will hold the property value at index.
Returns
The state indicating the success or failure of the operation.

◆ lbug_node_val_to_string()

LBUG_C_API lbug_state lbug_node_val_to_string ( lbug_value * node_val,
char ** out_result )

Converts the given node value to string.

Parameters
node_valThe node value to convert.
[out]out_resultThe output parameter that will hold the node value as a string.
Returns
The state indicating the success or failure of the operation.

◆ lbug_prepared_statement_bind_bool()

LBUG_C_API lbug_state lbug_prepared_statement_bind_bool ( lbug_prepared_statement * prepared_statement,
const char * param_name,
bool value )

Binds the given boolean value to the given parameter name in the prepared statement.

Parameters
prepared_statementThe prepared statement instance to bind the value.
param_nameThe parameter name to bind the value.
valueThe boolean value to bind.
Returns
The state indicating the success or failure of the operation.

◆ lbug_prepared_statement_bind_date()

LBUG_C_API lbug_state lbug_prepared_statement_bind_date ( lbug_prepared_statement * prepared_statement,
const char * param_name,
lbug_date_t value )

Binds the given date value to the given parameter name in the prepared statement.

Parameters
prepared_statementThe prepared statement instance to bind the value.
param_nameThe parameter name to bind the value.
valueThe date value to bind.
Returns
The state indicating the success or failure of the operation.

◆ lbug_prepared_statement_bind_double()

LBUG_C_API lbug_state lbug_prepared_statement_bind_double ( lbug_prepared_statement * prepared_statement,
const char * param_name,
double value )

Binds the given double value to the given parameter name in the prepared statement.

Parameters
prepared_statementThe prepared statement instance to bind the value.
param_nameThe parameter name to bind the value.
valueThe double value to bind.
Returns
The state indicating the success or failure of the operation.

◆ lbug_prepared_statement_bind_float()

LBUG_C_API lbug_state lbug_prepared_statement_bind_float ( lbug_prepared_statement * prepared_statement,
const char * param_name,
float value )

Binds the given float value to the given parameter name in the prepared statement.

Parameters
prepared_statementThe prepared statement instance to bind the value.
param_nameThe parameter name to bind the value.
valueThe float value to bind.
Returns
The state indicating the success or failure of the operation.

◆ lbug_prepared_statement_bind_int16()

LBUG_C_API lbug_state lbug_prepared_statement_bind_int16 ( lbug_prepared_statement * prepared_statement,
const char * param_name,
int16_t value )

Binds the given int16_t value to the given parameter name in the prepared statement.

Parameters
prepared_statementThe prepared statement instance to bind the value.
param_nameThe parameter name to bind the value.
valueThe int16_t value to bind.
Returns
The state indicating the success or failure of the operation.

◆ lbug_prepared_statement_bind_int32()

LBUG_C_API lbug_state lbug_prepared_statement_bind_int32 ( lbug_prepared_statement * prepared_statement,
const char * param_name,
int32_t value )

Binds the given int32_t value to the given parameter name in the prepared statement.

Parameters
prepared_statementThe prepared statement instance to bind the value.
param_nameThe parameter name to bind the value.
valueThe int32_t value to bind.
Returns
The state indicating the success or failure of the operation.

◆ lbug_prepared_statement_bind_int64()

LBUG_C_API lbug_state lbug_prepared_statement_bind_int64 ( lbug_prepared_statement * prepared_statement,
const char * param_name,
int64_t value )

Binds the given int64_t value to the given parameter name in the prepared statement.

Parameters
prepared_statementThe prepared statement instance to bind the value.
param_nameThe parameter name to bind the value.
valueThe int64_t value to bind.
Returns
The state indicating the success or failure of the operation.

◆ lbug_prepared_statement_bind_int8()

LBUG_C_API lbug_state lbug_prepared_statement_bind_int8 ( lbug_prepared_statement * prepared_statement,
const char * param_name,
int8_t value )

Binds the given int8_t value to the given parameter name in the prepared statement.

Parameters
prepared_statementThe prepared statement instance to bind the value.
param_nameThe parameter name to bind the value.
valueThe int8_t value to bind.
Returns
The state indicating the success or failure of the operation.

◆ lbug_prepared_statement_bind_interval()

LBUG_C_API lbug_state lbug_prepared_statement_bind_interval ( lbug_prepared_statement * prepared_statement,
const char * param_name,
lbug_interval_t value )

Binds the given interval value to the given parameter name in the prepared statement.

Parameters
prepared_statementThe prepared statement instance to bind the value.
param_nameThe parameter name to bind the value.
valueThe interval value to bind.
Returns
The state indicating the success or failure of the operation.

◆ lbug_prepared_statement_bind_string()

LBUG_C_API lbug_state lbug_prepared_statement_bind_string ( lbug_prepared_statement * prepared_statement,
const char * param_name,
const char * value )

Binds the given string value to the given parameter name in the prepared statement.

Parameters
prepared_statementThe prepared statement instance to bind the value.
param_nameThe parameter name to bind the value.
valueThe string value to bind.
Returns
The state indicating the success or failure of the operation.

◆ lbug_prepared_statement_bind_timestamp()

LBUG_C_API lbug_state lbug_prepared_statement_bind_timestamp ( lbug_prepared_statement * prepared_statement,
const char * param_name,
lbug_timestamp_t value )

Binds the given timestamp value to the given parameter name in the prepared statement.

Parameters
prepared_statementThe prepared statement instance to bind the value.
param_nameThe parameter name to bind the value.
valueThe timestamp value to bind.
Returns
The state indicating the success or failure of the operation.

◆ lbug_prepared_statement_bind_timestamp_ms()

LBUG_C_API lbug_state lbug_prepared_statement_bind_timestamp_ms ( lbug_prepared_statement * prepared_statement,
const char * param_name,
lbug_timestamp_ms_t value )

Binds the given timestamp_ms value to the given parameter name in the prepared statement.

Parameters
prepared_statementThe prepared statement instance to bind the value.
param_nameThe parameter name to bind the value.
valueThe timestamp_ms value to bind.
Returns
The state indicating the success or failure of the operation.

◆ lbug_prepared_statement_bind_timestamp_ns()

LBUG_C_API lbug_state lbug_prepared_statement_bind_timestamp_ns ( lbug_prepared_statement * prepared_statement,
const char * param_name,
lbug_timestamp_ns_t value )

Binds the given timestamp_ns value to the given parameter name in the prepared statement.

Parameters
prepared_statementThe prepared statement instance to bind the value.
param_nameThe parameter name to bind the value.
valueThe timestamp_ns value to bind.
Returns
The state indicating the success or failure of the operation.

◆ lbug_prepared_statement_bind_timestamp_sec()

LBUG_C_API lbug_state lbug_prepared_statement_bind_timestamp_sec ( lbug_prepared_statement * prepared_statement,
const char * param_name,
lbug_timestamp_sec_t value )

Binds the given timestamp_sec value to the given parameter name in the prepared statement.

Parameters
prepared_statementThe prepared statement instance to bind the value.
param_nameThe parameter name to bind the value.
valueThe timestamp_sec value to bind.
Returns
The state indicating the success or failure of the operation.

◆ lbug_prepared_statement_bind_timestamp_tz()

LBUG_C_API lbug_state lbug_prepared_statement_bind_timestamp_tz ( lbug_prepared_statement * prepared_statement,
const char * param_name,
lbug_timestamp_tz_t value )

Binds the given timestamp_tz value to the given parameter name in the prepared statement.

Parameters
prepared_statementThe prepared statement instance to bind the value.
param_nameThe parameter name to bind the value.
valueThe timestamp_tz value to bind.
Returns
The state indicating the success or failure of the operation.

◆ lbug_prepared_statement_bind_uint16()

LBUG_C_API lbug_state lbug_prepared_statement_bind_uint16 ( lbug_prepared_statement * prepared_statement,
const char * param_name,
uint16_t value )

Binds the given uint16_t value to the given parameter name in the prepared statement.

Parameters
prepared_statementThe prepared statement instance to bind the value.
param_nameThe parameter name to bind the value.
valueThe uint16_t value to bind.
Returns
The state indicating the success or failure of the operation.

◆ lbug_prepared_statement_bind_uint32()

LBUG_C_API lbug_state lbug_prepared_statement_bind_uint32 ( lbug_prepared_statement * prepared_statement,
const char * param_name,
uint32_t value )

Binds the given uint32_t value to the given parameter name in the prepared statement.

Parameters
prepared_statementThe prepared statement instance to bind the value.
param_nameThe parameter name to bind the value.
valueThe uint32_t value to bind.
Returns
The state indicating the success or failure of the operation.

◆ lbug_prepared_statement_bind_uint64()

LBUG_C_API lbug_state lbug_prepared_statement_bind_uint64 ( lbug_prepared_statement * prepared_statement,
const char * param_name,
uint64_t value )

Binds the given uint64_t value to the given parameter name in the prepared statement.

Parameters
prepared_statementThe prepared statement instance to bind the value.
param_nameThe parameter name to bind the value.
valueThe uint64_t value to bind.
Returns
The state indicating the success or failure of the operation.

◆ lbug_prepared_statement_bind_uint8()

LBUG_C_API lbug_state lbug_prepared_statement_bind_uint8 ( lbug_prepared_statement * prepared_statement,
const char * param_name,
uint8_t value )

Binds the given int8_t value to the given parameter name in the prepared statement.

Parameters
prepared_statementThe prepared statement instance to bind the value.
param_nameThe parameter name to bind the value.
valueThe int8_t value to bind.
Returns
The state indicating the success or failure of the operation.

◆ lbug_prepared_statement_bind_value()

LBUG_C_API lbug_state lbug_prepared_statement_bind_value ( lbug_prepared_statement * prepared_statement,
const char * param_name,
lbug_value * value )

Binds the given lbug value to the given parameter name in the prepared statement.

Parameters
prepared_statementThe prepared statement instance to bind the value.
param_nameThe parameter name to bind the value.
valueThe lbug value to bind.
Returns
The state indicating the success or failure of the operation.

◆ lbug_prepared_statement_destroy()

LBUG_C_API void lbug_prepared_statement_destroy ( lbug_prepared_statement * prepared_statement)

Destroys the prepared statement instance and frees the allocated memory.

Parameters
prepared_statementThe prepared statement instance to destroy.

◆ lbug_prepared_statement_get_error_message()

LBUG_C_API char * lbug_prepared_statement_get_error_message ( lbug_prepared_statement * prepared_statement)

Returns the error message if the prepared statement is not prepared successfully. The caller is responsible for freeing the returned string with lbug_destroy_string.

Parameters
prepared_statementThe prepared statement instance.
Returns
the error message if the statement is not prepared successfully or null if the statement is prepared successfully.

◆ lbug_prepared_statement_is_success()

LBUG_C_API bool lbug_prepared_statement_is_success ( lbug_prepared_statement * prepared_statement)
Returns
the query is prepared successfully or not.

◆ lbug_query_result_destroy()

LBUG_C_API void lbug_query_result_destroy ( lbug_query_result * query_result)

Destroys the given query result instance.

Parameters
query_resultThe query result instance to destroy.

◆ lbug_query_result_get_arrow_schema()

LBUG_C_API lbug_state lbug_query_result_get_arrow_schema ( lbug_query_result * query_result,
struct ArrowSchema * out_schema )

Returns the query result's schema as ArrowSchema.

Parameters
query_resultThe query result instance to return.
[out]out_schemaThe output parameter that will hold the datatypes of the columns as an arrow schema.
Returns
The state indicating the success or failure of the operation.

It is the caller's responsibility to call the release function to release the underlying data

◆ lbug_query_result_get_column_data_type()

LBUG_C_API lbug_state lbug_query_result_get_column_data_type ( lbug_query_result * query_result,
uint64_t index,
lbug_logical_type * out_column_data_type )

Returns the data type of the column at the given index.

Parameters
query_resultThe query result instance to return.
indexThe index of the column to return data type.
[out]out_column_data_typeThe output parameter that will hold the column data type.
Returns
The state indicating the success or failure of the operation.

◆ lbug_query_result_get_column_name()

LBUG_C_API lbug_state lbug_query_result_get_column_name ( lbug_query_result * query_result,
uint64_t index,
char ** out_column_name )

Returns the column name at the given index.

Parameters
query_resultThe query result instance to return.
indexThe index of the column to return name.
[out]out_column_nameThe output parameter that will hold the column name.
Returns
The state indicating the success or failure of the operation.

◆ lbug_query_result_get_error_message()

LBUG_C_API char * lbug_query_result_get_error_message ( lbug_query_result * query_result)

Returns the error message if the query is failed. The caller is responsible for freeing the returned string with lbug_destroy_string.

Parameters
query_resultThe query result instance to check and return error message.
Returns
The error message if the query has failed, or null if the query is successful.

◆ lbug_query_result_get_next()

LBUG_C_API lbug_state lbug_query_result_get_next ( lbug_query_result * query_result,
lbug_flat_tuple * out_flat_tuple )

Returns the next tuple in the query result. Throws an exception if there is no more tuple. Note that to reduce resource allocation, all calls to lbug_query_result_get_next() reuse the same FlatTuple object. Since its contents will be overwritten, please complete processing a FlatTuple or make a copy of its data before calling lbug_query_result_get_next() again.

Parameters
query_resultThe query result instance to return.
[out]out_flat_tupleThe output parameter that will hold the next tuple.
Returns
The state indicating the success or failure of the operation.

◆ lbug_query_result_get_next_arrow_chunk()

LBUG_C_API lbug_state lbug_query_result_get_next_arrow_chunk ( lbug_query_result * query_result,
int64_t chunk_size,
struct ArrowArray * out_arrow_array )

Returns the next chunk of the query result as ArrowArray.

Parameters
query_resultThe query result instance to return.
chunk_sizeThe number of tuples to return in the chunk.
[out]out_arrow_arrayThe output parameter that will hold the arrow array representation of the query result. The arrow array internally stores an arrow struct with fields for each of the columns.
Returns
The state indicating the success or failure of the operation.

It is the caller's responsibility to call the release function to release the underlying data

◆ lbug_query_result_get_next_query_result()

LBUG_C_API lbug_state lbug_query_result_get_next_query_result ( lbug_query_result * query_result,
lbug_query_result * out_next_query_result )

Returns the next query result. Use this function to loop multiple query statements' results.

Parameters
query_resultThe query result instance to return.
[out]out_next_query_resultThe output parameter that will hold the next query result.
Returns
The state indicating the success or failure of the operation.

◆ lbug_query_result_get_num_columns()

LBUG_C_API uint64_t lbug_query_result_get_num_columns ( lbug_query_result * query_result)

Returns the number of columns in the query result.

Parameters
query_resultThe query result instance to return.

◆ lbug_query_result_get_num_tuples()

LBUG_C_API uint64_t lbug_query_result_get_num_tuples ( lbug_query_result * query_result)

Returns the number of tuples in the query result.

Parameters
query_resultThe query result instance to return.

◆ lbug_query_result_get_query_summary()

LBUG_C_API lbug_state lbug_query_result_get_query_summary ( lbug_query_result * query_result,
lbug_query_summary * out_query_summary )

Returns the query summary of the query result.

Parameters
query_resultThe query result instance to return.
[out]out_query_summaryThe output parameter that will hold the query summary.
Returns
The state indicating the success or failure of the operation.

◆ lbug_query_result_has_next()

LBUG_C_API bool lbug_query_result_has_next ( lbug_query_result * query_result)

Returns true if we have not consumed all tuples in the query result, false otherwise.

Parameters
query_resultThe query result instance to check.

◆ lbug_query_result_has_next_query_result()

LBUG_C_API bool lbug_query_result_has_next_query_result ( lbug_query_result * query_result)

Returns true if we have not consumed all query results, false otherwise. Use this function for loop results of multiple query statements.

Parameters
query_resultThe query result instance to check.

◆ lbug_query_result_is_success()

LBUG_C_API bool lbug_query_result_is_success ( lbug_query_result * query_result)

Returns true if the query is executed successful, false otherwise.

Parameters
query_resultThe query result instance to check.

◆ lbug_query_result_reset_iterator()

LBUG_C_API void lbug_query_result_reset_iterator ( lbug_query_result * query_result)

Resets the iterator of the query result to the beginning of the query result.

Parameters
query_resultThe query result instance to reset iterator.

◆ lbug_query_result_to_string()

LBUG_C_API char * lbug_query_result_to_string ( lbug_query_result * query_result)

Returns the query result as a string.

Parameters
query_resultThe query result instance to return.
Returns
The query result as a string.

◆ lbug_query_summary_destroy()

LBUG_C_API void lbug_query_summary_destroy ( lbug_query_summary * query_summary)

Destroys the given query summary.

Parameters
query_summaryThe query summary to destroy.

◆ lbug_query_summary_get_compiling_time()

LBUG_C_API double lbug_query_summary_get_compiling_time ( lbug_query_summary * query_summary)

Returns the compilation time of the given query summary in milliseconds.

Parameters
query_summaryThe query summary to get compilation time.

◆ lbug_query_summary_get_execution_time()

LBUG_C_API double lbug_query_summary_get_execution_time ( lbug_query_summary * query_summary)

Returns the execution time of the given query summary in milliseconds.

Parameters
query_summaryThe query summary to get execution time.

◆ lbug_rel_val_get_dst_id_val()

LBUG_C_API lbug_state lbug_rel_val_get_dst_id_val ( lbug_value * rel_val,
lbug_value * out_value )

Returns the internal id value of the destination node of the given rel value as a lbug value.

Parameters
rel_valThe rel value to return.
[out]out_valueThe output parameter that will hold the internal id value.
Returns
The state indicating the success or failure of the operation.

◆ lbug_rel_val_get_id_val()

LBUG_C_API lbug_state lbug_rel_val_get_id_val ( lbug_value * rel_val,
lbug_value * out_value )

Returns the internal id value of the rel value as a lbug value.

Parameters
rel_valThe rel value to return.
[out]out_valueThe output parameter that will hold the internal id value.
Returns
The state indicating the success or failure of the operation.

◆ lbug_rel_val_get_label_val()

LBUG_C_API lbug_state lbug_rel_val_get_label_val ( lbug_value * rel_val,
lbug_value * out_value )

Returns the label value of the given rel value.

Parameters
rel_valThe rel value to return.
[out]out_valueThe output parameter that will hold the label value.
Returns
The state indicating the success or failure of the operation.

◆ lbug_rel_val_get_property_name_at()

LBUG_C_API lbug_state lbug_rel_val_get_property_name_at ( lbug_value * rel_val,
uint64_t index,
char ** out_result )

Returns the property name of the given rel value at the given index.

Parameters
rel_valThe rel value to return.
indexThe index of the property.
[out]out_resultThe output parameter that will hold the property name at index.
Returns
The state indicating the success or failure of the operation.

◆ lbug_rel_val_get_property_size()

LBUG_C_API lbug_state lbug_rel_val_get_property_size ( lbug_value * rel_val,
uint64_t * out_value )

Returns the number of properties of the given rel value.

Parameters
rel_valThe rel value to return.
[out]out_valueThe output parameter that will hold the number of properties.
Returns
The state indicating the success or failure of the operation.

◆ lbug_rel_val_get_property_value_at()

LBUG_C_API lbug_state lbug_rel_val_get_property_value_at ( lbug_value * rel_val,
uint64_t index,
lbug_value * out_value )

Returns the property of the given rel value at the given index as lbug value.

Parameters
rel_valThe rel value to return.
indexThe index of the property.
[out]out_valueThe output parameter that will hold the property value at index.
Returns
The state indicating the success or failure of the operation.

◆ lbug_rel_val_get_src_id_val()

LBUG_C_API lbug_state lbug_rel_val_get_src_id_val ( lbug_value * rel_val,
lbug_value * out_value )

Returns the internal id value of the source node of the given rel value as a lbug value.

Parameters
rel_valThe rel value to return.
[out]out_valueThe output parameter that will hold the internal id value.
Returns
The state indicating the success or failure of the operation.

◆ lbug_rel_val_to_string()

LBUG_C_API lbug_state lbug_rel_val_to_string ( lbug_value * rel_val,
char ** out_result )

Converts the given rel value to string.

Parameters
rel_valThe rel value to convert.
[out]out_resultThe output parameter that will hold the rel value as a string.
Returns
The state indicating the success or failure of the operation.

◆ lbug_timestamp_from_tm()

LBUG_C_API lbug_state lbug_timestamp_from_tm ( struct tm tm,
lbug_timestamp_t * out_result )

Convert timestamp_ns to corresponding string.

Parameters
timestampThe timestamp_ns value to convert.
[out]out_resultThe output parameter that will hold the string value.
Returns
The state indicating the success or failure of the operation.

◆ lbug_timestamp_ms_from_tm()

LBUG_C_API lbug_state lbug_timestamp_ms_from_tm ( struct tm tm,
lbug_timestamp_ms_t * out_result )

Convert tm struct to timestamp_ms value.

Parameters
tmThe tm struct to convert.
[out]out_resultThe output parameter that will hold the timestamp_ms value.
Returns
The state indicating the success or failure of the operation.

◆ lbug_timestamp_ms_to_tm()

LBUG_C_API lbug_state lbug_timestamp_ms_to_tm ( lbug_timestamp_ms_t timestamp,
struct tm * out_result )

Convert timestamp_ms to corresponding tm struct.

Parameters
timestampThe timestamp_ms value to convert.
[out]out_resultThe output parameter that will hold the tm struct.
Returns
The state indicating the success or failure of the operation.

◆ lbug_timestamp_ns_from_tm()

LBUG_C_API lbug_state lbug_timestamp_ns_from_tm ( struct tm tm,
lbug_timestamp_ns_t * out_result )

Convert tm struct to timestamp_ns value.

Parameters
tmThe tm struct to convert.
[out]out_resultThe output parameter that will hold the timestamp_ns value.
Returns
The state indicating the success or failure of the operation.

◆ lbug_timestamp_ns_to_tm()

LBUG_C_API lbug_state lbug_timestamp_ns_to_tm ( lbug_timestamp_ns_t timestamp,
struct tm * out_result )

Convert timestamp_ns to corresponding tm struct.

Parameters
timestampThe timestamp_ns value to convert.
[out]out_resultThe output parameter that will hold the tm struct.
Returns
The state indicating the success or failure of the operation.

◆ lbug_timestamp_sec_from_tm()

LBUG_C_API lbug_state lbug_timestamp_sec_from_tm ( struct tm tm,
lbug_timestamp_sec_t * out_result )

Convert tm struct to timestamp_sec value.

Parameters
tmThe tm struct to convert.
[out]out_resultThe output parameter that will hold the timestamp_sec value.
Returns
The state indicating the success or failure of the operation.

◆ lbug_timestamp_sec_to_tm()

LBUG_C_API lbug_state lbug_timestamp_sec_to_tm ( lbug_timestamp_sec_t timestamp,
struct tm * out_result )

Convert timestamp_sec to corresponding tm struct.

Parameters
timestampThe timestamp_sec value to convert.
[out]out_resultThe output parameter that will hold the tm struct.
Returns
The state indicating the success or failure of the operation.

◆ lbug_timestamp_to_tm()

LBUG_C_API lbug_state lbug_timestamp_to_tm ( lbug_timestamp_t timestamp,
struct tm * out_result )

Convert timestamp to corresponding tm struct.

Parameters
timestampThe timestamp value to convert.
[out]out_resultThe output parameter that will hold the tm struct.
Returns
The state indicating the success or failure of the operation.

◆ lbug_timestamp_tz_from_tm()

LBUG_C_API lbug_state lbug_timestamp_tz_from_tm ( struct tm tm,
lbug_timestamp_tz_t * out_result )

Convert tm struct to timestamp_tz value.

Parameters
tmThe tm struct to convert.
[out]out_resultThe output parameter that will hold the timestamp_tz value.
Returns
The state indicating the success or failure of the operation.

◆ lbug_timestamp_tz_to_tm()

LBUG_C_API lbug_state lbug_timestamp_tz_to_tm ( lbug_timestamp_tz_t timestamp,
struct tm * out_result )

Convert timestamp_tz to corresponding tm struct.

Parameters
timestampThe timestamp_tz value to convert.
[out]out_resultThe output parameter that will hold the tm struct.
Returns
The state indicating the success or failure of the operation.

◆ lbug_value_clone()

LBUG_C_API lbug_value * lbug_value_clone ( lbug_value * value)

Creates a new value based on the given value. Caller is responsible for destroying the returned value.

Parameters
valueThe value to create from.

◆ lbug_value_copy()

LBUG_C_API void lbug_value_copy ( lbug_value * value,
lbug_value * other )

Copies the other value to the value.

Parameters
valueThe value to copy to.
otherThe value to copy from.

◆ lbug_value_create_bool()

LBUG_C_API lbug_value * lbug_value_create_bool ( bool val_)

Creates a value with boolean type and the given bool value. Caller is responsible for destroying the returned value.

Parameters
val_The bool value of the value to create.

◆ lbug_value_create_date()

LBUG_C_API lbug_value * lbug_value_create_date ( lbug_date_t val_)

Creates a value with date type and the given date value. Caller is responsible for destroying the returned value.

Parameters
val_The date value of the value to create.

◆ lbug_value_create_default()

LBUG_C_API lbug_value * lbug_value_create_default ( lbug_logical_type * data_type)

Creates a value of the given data type with default non-NULL value. Caller is responsible for destroying the returned value.

Parameters
data_typeThe data type of the value to create.

◆ lbug_value_create_double()

LBUG_C_API lbug_value * lbug_value_create_double ( double val_)

Creates a value with double type and the given double value. Caller is responsible for destroying the returned value.

Parameters
val_The double value of the value to create.

◆ lbug_value_create_float()

LBUG_C_API lbug_value * lbug_value_create_float ( float val_)

Creates a value with float type and the given float value. Caller is responsible for destroying the returned value.

Parameters
val_The float value of the value to create.

◆ lbug_value_create_int128()

LBUG_C_API lbug_value * lbug_value_create_int128 ( lbug_int128_t val_)

Creates a value with int128 type and the given int128 value. Caller is responsible for destroying the returned value.

Parameters
val_The int128 value of the value to create.

◆ lbug_value_create_int16()

LBUG_C_API lbug_value * lbug_value_create_int16 ( int16_t val_)

Creates a value with int16 type and the given int16 value. Caller is responsible for destroying the returned value.

Parameters
val_The int16 value of the value to create.

◆ lbug_value_create_int32()

LBUG_C_API lbug_value * lbug_value_create_int32 ( int32_t val_)

Creates a value with int32 type and the given int32 value. Caller is responsible for destroying the returned value.

Parameters
val_The int32 value of the value to create.

◆ lbug_value_create_int64()

LBUG_C_API lbug_value * lbug_value_create_int64 ( int64_t val_)

Creates a value with int64 type and the given int64 value. Caller is responsible for destroying the returned value.

Parameters
val_The int64 value of the value to create.

◆ lbug_value_create_int8()

LBUG_C_API lbug_value * lbug_value_create_int8 ( int8_t val_)

Creates a value with int8 type and the given int8 value. Caller is responsible for destroying the returned value.

Parameters
val_The int8 value of the value to create.

◆ lbug_value_create_internal_id()

LBUG_C_API lbug_value * lbug_value_create_internal_id ( lbug_internal_id_t val_)

Creates a value with internal_id type and the given internal_id value. Caller is responsible for destroying the returned value.

Parameters
val_The internal_id value of the value to create.

◆ lbug_value_create_interval()

LBUG_C_API lbug_value * lbug_value_create_interval ( lbug_interval_t val_)

Creates a value with interval type and the given interval value. Caller is responsible for destroying the returned value.

Parameters
val_The interval value of the value to create.

◆ lbug_value_create_list()

LBUG_C_API lbug_state lbug_value_create_list ( uint64_t num_elements,
lbug_value ** elements,
lbug_value ** out_value )

Creates a list value with the given number of elements and the given elements. The caller needs to make sure that all elements have the same type. The elements are copied into the list value, so destroying the elements after creating the list value is safe. Caller is responsible for destroying the returned value.

Parameters
num_elementsThe number of elements in the list.
elementsThe elements of the list.
[out]out_valueThe output parameter that will hold a pointer to the created list value.
Returns
The state indicating the success or failure of the operation.

◆ lbug_value_create_map()

LBUG_C_API lbug_state lbug_value_create_map ( uint64_t num_fields,
lbug_value ** keys,
lbug_value ** values,
lbug_value ** out_value )

Creates a map value with the given number of fields and the given keys and values. The caller needs to make sure that all keys are unique, and all keys and values have the same type. The keys and values are copied into the map value, so destroying the keys and values after creating the map value is safe. Caller is responsible for destroying the returned value.

Parameters
num_fieldsThe number of fields in the map.
keysThe keys of the map.
valuesThe values of the map.
[out]out_valueThe output parameter that will hold a pointer to the created map value.
Returns
The state indicating the success or failure of the operation.

◆ lbug_value_create_null()

LBUG_C_API lbug_value * lbug_value_create_null ( )

Creates a NULL value of ANY type. Caller is responsible for destroying the returned value.

◆ lbug_value_create_null_with_data_type()

LBUG_C_API lbug_value * lbug_value_create_null_with_data_type ( lbug_logical_type * data_type)

Creates a value of the given data type. Caller is responsible for destroying the returned value.

Parameters
data_typeThe data type of the value to create.

◆ lbug_value_create_string()

LBUG_C_API lbug_value * lbug_value_create_string ( const char * val_)

Creates a value with string type and the given string value. Caller is responsible for destroying the returned value.

Parameters
val_The string value of the value to create.

◆ lbug_value_create_struct()

LBUG_C_API lbug_state lbug_value_create_struct ( uint64_t num_fields,
const char ** field_names,
lbug_value ** field_values,
lbug_value ** out_value )

Creates a struct value with the given number of fields and the given field names and values. The caller needs to make sure that all field names are unique. The field names and values are copied into the struct value, so destroying the field names and values after creating the struct value is safe. Caller is responsible for destroying the returned value.

Parameters
num_fieldsThe number of fields in the struct.
field_namesThe field names of the struct.
field_valuesThe field values of the struct.
[out]out_valueThe output parameter that will hold a pointer to the created struct value.
Returns
The state indicating the success or failure of the operation.

◆ lbug_value_create_timestamp()

LBUG_C_API lbug_value * lbug_value_create_timestamp ( lbug_timestamp_t val_)

Creates a value with timestamp type and the given timestamp value. Caller is responsible for destroying the returned value.

Parameters
val_The timestamp value of the value to create.

◆ lbug_value_create_timestamp_ms()

LBUG_C_API lbug_value * lbug_value_create_timestamp_ms ( lbug_timestamp_ms_t val_)

Creates a value with timestamp_ms type and the given timestamp value. Caller is responsible for destroying the returned value.

Parameters
val_The timestamp_ms value of the value to create.

◆ lbug_value_create_timestamp_ns()

LBUG_C_API lbug_value * lbug_value_create_timestamp_ns ( lbug_timestamp_ns_t val_)

Creates a value with timestamp_ns type and the given timestamp value. Caller is responsible for destroying the returned value.

Parameters
val_The timestamp_ns value of the value to create.

◆ lbug_value_create_timestamp_sec()

LBUG_C_API lbug_value * lbug_value_create_timestamp_sec ( lbug_timestamp_sec_t val_)

Creates a value with timestamp_sec type and the given timestamp value. Caller is responsible for destroying the returned value.

Parameters
val_The timestamp_sec value of the value to create.

◆ lbug_value_create_timestamp_tz()

LBUG_C_API lbug_value * lbug_value_create_timestamp_tz ( lbug_timestamp_tz_t val_)

Creates a value with timestamp_tz type and the given timestamp value. Caller is responsible for destroying the returned value.

Parameters
val_The timestamp_tz value of the value to create.

◆ lbug_value_create_uint16()

LBUG_C_API lbug_value * lbug_value_create_uint16 ( uint16_t val_)

Creates a value with uint16 type and the given uint16 value. Caller is responsible for destroying the returned value.

Parameters
val_The uint16 value of the value to create.

◆ lbug_value_create_uint32()

LBUG_C_API lbug_value * lbug_value_create_uint32 ( uint32_t val_)

Creates a value with uint32 type and the given uint32 value. Caller is responsible for destroying the returned value.

Parameters
val_The uint32 value of the value to create.

◆ lbug_value_create_uint64()

LBUG_C_API lbug_value * lbug_value_create_uint64 ( uint64_t val_)

Creates a value with uint64 type and the given uint64 value. Caller is responsible for destroying the returned value.

Parameters
val_The uint64 value of the value to create.

◆ lbug_value_create_uint8()

LBUG_C_API lbug_value * lbug_value_create_uint8 ( uint8_t val_)

Creates a value with uint8 type and the given uint8 value. Caller is responsible for destroying the returned value.

Parameters
val_The uint8 value of the value to create.

◆ lbug_value_destroy()

LBUG_C_API void lbug_value_destroy ( lbug_value * value)

Destroys the value.

Parameters
valueThe value to destroy.

◆ lbug_value_get_blob()

LBUG_C_API lbug_state lbug_value_get_blob ( lbug_value * value,
uint8_t ** out_result )

Returns the blob value of the given value. The returned buffer is null-terminated similar to a string. The value must be of type BLOB.

Parameters
valueThe value to return.
[out]out_resultThe output parameter that will hold the blob value.
Returns
The state indicating the success or failure of the operation.

◆ lbug_value_get_bool()

LBUG_C_API lbug_state lbug_value_get_bool ( lbug_value * value,
bool * out_result )

Returns the boolean value of the given value. The value must be of type BOOL.

Parameters
valueThe value to return.
[out]out_resultThe output parameter that will hold the boolean value.
Returns
The state indicating the success or failure of the operation.

◆ lbug_value_get_data_type()

LBUG_C_API void lbug_value_get_data_type ( lbug_value * value,
lbug_logical_type * out_type )

Returns internal type of the given value.

Parameters
valueThe value to return.
[out]out_typeThe output parameter that will hold the internal type of the value.

◆ lbug_value_get_date()

LBUG_C_API lbug_state lbug_value_get_date ( lbug_value * value,
lbug_date_t * out_result )

Returns the date value of the given value. The value must be of type DATE.

Parameters
valueThe value to return.
[out]out_resultThe output parameter that will hold the date value.
Returns
The state indicating the success or failure of the operation.

◆ lbug_value_get_decimal_as_string()

LBUG_C_API lbug_state lbug_value_get_decimal_as_string ( lbug_value * value,
char ** out_result )

Returns the decimal value of the given value as a string. The value must be of type DECIMAL.

Parameters
valueThe value to return.
[out]out_resultThe output parameter that will hold the decimal value.
Returns
The state indicating the success or failure of the operation.

◆ lbug_value_get_double()

LBUG_C_API lbug_state lbug_value_get_double ( lbug_value * value,
double * out_result )

Returns the double value of the given value. The value must be of type DOUBLE.

Parameters
valueThe value to return.
[out]out_resultThe output parameter that will hold the double value.
Returns
The state indicating the success or failure of the operation.

◆ lbug_value_get_float()

LBUG_C_API lbug_state lbug_value_get_float ( lbug_value * value,
float * out_result )

Returns the float value of the given value. The value must be of type FLOAT.

Parameters
valueThe value to return.
[out]out_resultThe output parameter that will hold the float value.
Returns
The state indicating the success or failure of the operation.

◆ lbug_value_get_int128()

LBUG_C_API lbug_state lbug_value_get_int128 ( lbug_value * value,
lbug_int128_t * out_result )

Returns the int128 value of the given value. The value must be of type INT128.

Parameters
valueThe value to return.
[out]out_resultThe output parameter that will hold the int128 value.
Returns
The state indicating the success or failure of the operation.

◆ lbug_value_get_int16()

LBUG_C_API lbug_state lbug_value_get_int16 ( lbug_value * value,
int16_t * out_result )

Returns the int16 value of the given value. The value must be of type INT16.

Parameters
valueThe value to return.
[out]out_resultThe output parameter that will hold the int16 value.
Returns
The state indicating the success or failure of the operation.

◆ lbug_value_get_int32()

LBUG_C_API lbug_state lbug_value_get_int32 ( lbug_value * value,
int32_t * out_result )

Returns the int32 value of the given value. The value must be of type INT32.

Parameters
valueThe value to return.
[out]out_resultThe output parameter that will hold the int32 value.
Returns
The state indicating the success or failure of the operation.

◆ lbug_value_get_int64()

LBUG_C_API lbug_state lbug_value_get_int64 ( lbug_value * value,
int64_t * out_result )

Returns the int64 value of the given value. The value must be of type INT64 or SERIAL.

Parameters
valueThe value to return.
[out]out_resultThe output parameter that will hold the int64 value.
Returns
The state indicating the success or failure of the operation.

◆ lbug_value_get_int8()

LBUG_C_API lbug_state lbug_value_get_int8 ( lbug_value * value,
int8_t * out_result )

Returns the int8 value of the given value. The value must be of type INT8.

Parameters
valueThe value to return.
[out]out_resultThe output parameter that will hold the int8 value.
Returns
The state indicating the success or failure of the operation.

◆ lbug_value_get_internal_id()

LBUG_C_API lbug_state lbug_value_get_internal_id ( lbug_value * value,
lbug_internal_id_t * out_result )

Returns the internal id value of the given value. The value must be of type INTERNAL_ID.

Parameters
valueThe value to return.
[out]out_resultThe output parameter that will hold the internal id value.
Returns
The state indicating the success or failure of the operation.

◆ lbug_value_get_interval()

LBUG_C_API lbug_state lbug_value_get_interval ( lbug_value * value,
lbug_interval_t * out_result )

Returns the interval value of the given value. The value must be of type INTERVAL.

Parameters
valueThe value to return.
[out]out_resultThe output parameter that will hold the interval value.
Returns
The state indicating the success or failure of the operation.

◆ lbug_value_get_list_element()

LBUG_C_API lbug_state lbug_value_get_list_element ( lbug_value * value,
uint64_t index,
lbug_value * out_value )

Returns the element at index of the given value. The value must be of type LIST.

Parameters
valueThe LIST value to return.
indexThe index of the element to return.
[out]out_valueThe output parameter that will hold the element at index.
Returns
The state indicating the success or failure of the operation.

◆ lbug_value_get_list_size()

LBUG_C_API lbug_state lbug_value_get_list_size ( lbug_value * value,
uint64_t * out_result )

Returns the number of elements per list of the given value. The value must be of type ARRAY.

Parameters
valueThe ARRAY value to get list size.
[out]out_resultThe output parameter that will hold the number of elements per list.
Returns
The state indicating the success or failure of the operation.

◆ lbug_value_get_map_key()

LBUG_C_API lbug_state lbug_value_get_map_key ( lbug_value * value,
uint64_t index,
lbug_value * out_key )

Returns the key at index of the given map value. The value must be of physical type MAP.

Parameters
valueThe MAP value to get key.
indexThe index of the field name to return.
[out]out_keyThe output parameter that will hold the key at index.
Returns
The state indicating the success or failure of the operation.

◆ lbug_value_get_map_size()

LBUG_C_API lbug_state lbug_value_get_map_size ( lbug_value * value,
uint64_t * out_result )

Returns the size of the given map value. The value must be of type MAP.

Parameters
valueThe MAP value to get size.
[out]out_resultThe output parameter that will hold the size of the map.
Returns
The state indicating the success or failure of the operation.

◆ lbug_value_get_map_value()

LBUG_C_API lbug_state lbug_value_get_map_value ( lbug_value * value,
uint64_t index,
lbug_value * out_value )

Returns the field value at index of the given map value. The value must be of physical type MAP.

Parameters
valueThe MAP value to get field value.
indexThe index of the field value to return.
[out]out_valueThe output parameter that will hold the field value at index.
Returns
The state indicating the success or failure of the operation.

◆ lbug_value_get_recursive_rel_node_list()

LBUG_C_API lbug_state lbug_value_get_recursive_rel_node_list ( lbug_value * value,
lbug_value * out_value )

Returns the list of nodes for recursive rel value. The value must be of type RECURSIVE_REL.

Parameters
valueThe RECURSIVE_REL value to return.
[out]out_valueThe output parameter that will hold the list of nodes.
Returns
The state indicating the success or failure of the operation.

◆ lbug_value_get_recursive_rel_rel_list()

LBUG_C_API lbug_state lbug_value_get_recursive_rel_rel_list ( lbug_value * value,
lbug_value * out_value )

Returns the list of rels for recursive rel value. The value must be of type RECURSIVE_REL.

Parameters
valueThe RECURSIVE_REL value to return.
[out]out_valueThe output parameter that will hold the list of rels.
Returns
The state indicating the success or failure of the operation.

◆ lbug_value_get_string()

LBUG_C_API lbug_state lbug_value_get_string ( lbug_value * value,
char ** out_result )

Returns the string value of the given value. The value must be of type STRING.

Parameters
valueThe value to return.
[out]out_resultThe output parameter that will hold the string value.
Returns
The state indicating the success or failure of the operation.

◆ lbug_value_get_struct_field_name()

LBUG_C_API lbug_state lbug_value_get_struct_field_name ( lbug_value * value,
uint64_t index,
char ** out_result )

Returns the field name at index of the given struct value. The value must be of physical type STRUCT (STRUCT, NODE, REL, RECURSIVE_REL, UNION).

Parameters
valueThe STRUCT value to get field name.
indexThe index of the field name to return.
[out]out_resultThe output parameter that will hold the field name at index.
Returns
The state indicating the success or failure of the operation.

◆ lbug_value_get_struct_field_value()

LBUG_C_API lbug_state lbug_value_get_struct_field_value ( lbug_value * value,
uint64_t index,
lbug_value * out_value )

Returns the field value at index of the given struct value. The value must be of physical type STRUCT (STRUCT, NODE, REL, RECURSIVE_REL, UNION).

Parameters
valueThe STRUCT value to get field value.
indexThe index of the field value to return.
[out]out_valueThe output parameter that will hold the field value at index.
Returns
The state indicating the success or failure of the operation.

◆ lbug_value_get_struct_num_fields()

LBUG_C_API lbug_state lbug_value_get_struct_num_fields ( lbug_value * value,
uint64_t * out_result )

Returns the number of fields of the given struct value. The value must be of type STRUCT.

Parameters
valueThe STRUCT value to get number of fields.
[out]out_resultThe output parameter that will hold the number of fields.
Returns
The state indicating the success or failure of the operation.

◆ lbug_value_get_timestamp()

LBUG_C_API lbug_state lbug_value_get_timestamp ( lbug_value * value,
lbug_timestamp_t * out_result )

Returns the timestamp value of the given value. The value must be of type TIMESTAMP.

Parameters
valueThe value to return.
[out]out_resultThe output parameter that will hold the timestamp value.
Returns
The state indicating the success or failure of the operation.

◆ lbug_value_get_timestamp_ms()

LBUG_C_API lbug_state lbug_value_get_timestamp_ms ( lbug_value * value,
lbug_timestamp_ms_t * out_result )

Returns the timestamp_ms value of the given value. The value must be of type TIMESTAMP_MS.

Parameters
valueThe value to return.
[out]out_resultThe output parameter that will hold the timestamp_ms value.
Returns
The state indicating the success or failure of the operation.

◆ lbug_value_get_timestamp_ns()

LBUG_C_API lbug_state lbug_value_get_timestamp_ns ( lbug_value * value,
lbug_timestamp_ns_t * out_result )

Returns the timestamp_ns value of the given value. The value must be of type TIMESTAMP_NS.

Parameters
valueThe value to return.
[out]out_resultThe output parameter that will hold the timestamp_ns value.
Returns
The state indicating the success or failure of the operation.

◆ lbug_value_get_timestamp_sec()

LBUG_C_API lbug_state lbug_value_get_timestamp_sec ( lbug_value * value,
lbug_timestamp_sec_t * out_result )

Returns the timestamp_sec value of the given value. The value must be of type TIMESTAMP_SEC.

Parameters
valueThe value to return.
[out]out_resultThe output parameter that will hold the timestamp_sec value.
Returns
The state indicating the success or failure of the operation.

◆ lbug_value_get_timestamp_tz()

LBUG_C_API lbug_state lbug_value_get_timestamp_tz ( lbug_value * value,
lbug_timestamp_tz_t * out_result )

Returns the timestamp_tz value of the given value. The value must be of type TIMESTAMP_TZ.

Parameters
valueThe value to return.
[out]out_resultThe output parameter that will hold the timestamp_tz value.
Returns
The state indicating the success or failure of the operation.

◆ lbug_value_get_uint16()

LBUG_C_API lbug_state lbug_value_get_uint16 ( lbug_value * value,
uint16_t * out_result )

Returns the uint16 value of the given value. The value must be of type UINT16.

Parameters
valueThe value to return.
[out]out_resultThe output parameter that will hold the uint16 value.
Returns
The state indicating the success or failure of the operation.

◆ lbug_value_get_uint32()

LBUG_C_API lbug_state lbug_value_get_uint32 ( lbug_value * value,
uint32_t * out_result )

Returns the uint32 value of the given value. The value must be of type UINT32.

Parameters
valueThe value to return.
[out]out_resultThe output parameter that will hold the uint32 value.
Returns
The state indicating the success or failure of the operation.

◆ lbug_value_get_uint64()

LBUG_C_API lbug_state lbug_value_get_uint64 ( lbug_value * value,
uint64_t * out_result )

Returns the uint64 value of the given value. The value must be of type UINT64.

Parameters
valueThe value to return.
[out]out_resultThe output parameter that will hold the uint64 value.
Returns
The state indicating the success or failure of the operation.

◆ lbug_value_get_uint8()

LBUG_C_API lbug_state lbug_value_get_uint8 ( lbug_value * value,
uint8_t * out_result )

Returns the uint8 value of the given value. The value must be of type UINT8.

Parameters
valueThe value to return.
[out]out_resultThe output parameter that will hold the uint8 value.
Returns
The state indicating the success or failure of the operation.

◆ lbug_value_get_uuid()

LBUG_C_API lbug_state lbug_value_get_uuid ( lbug_value * value,
char ** out_result )

Returns the uuid value of the given value. to a string. The value must be of type UUID.

Parameters
valueThe value to return.
[out]out_resultThe output parameter that will hold the uuid value.
Returns
The state indicating the success or failure of the operation.

◆ lbug_value_is_null()

LBUG_C_API bool lbug_value_is_null ( lbug_value * value)

Returns true if the given value is NULL, false otherwise.

Parameters
valueThe value instance to check.

◆ lbug_value_set_null()

LBUG_C_API void lbug_value_set_null ( lbug_value * value,
bool is_null )

Sets the given value to NULL or not.

Parameters
valueThe value instance to set.
is_nullTrue if sets the value to NULL, false otherwise.

◆ lbug_value_to_string()

LBUG_C_API char * lbug_value_to_string ( lbug_value * value)

Converts the given value to string.

Parameters
valueThe value to convert.
Returns
The value as a string.