C gRPC driver

Connection

driver

driver_close

void driver_close(struct TypeDBDriver* driver)

Closes the driver. Before instantiating a new driver, the driver that’s currently open should first be closed. Closing a driver frees the underlying Rust object.

Returns

void

driver_force_close

void driver_force_close(struct TypeDBDriver* driver)

Forcibly closes the driver. To be used in exceptional cases.

Returns

void

driver_is_open

bool driver_is_open(const struct TypeDBDriver* driver)

Checks whether this connection is presently open.

Returns

bool

driver_open

struct TypeDBDriver* driver_open(const char* address, const struct Credentials* credentials, const struct DriverOptions* driver_options)

Open a TypeDB C Driver to a TypeDB server available at the provided address.

Input parameters
Name Description Type

address

The address (host:port) on which the TypeDB Server is running

const char*

credentials

The Credentials to connect with

const struct Credentials*

driver_options

The DriverOptions to connect with

const struct DriverOptions*

Returns

struct TypeDBDriver*

driver_open_with_description

struct TypeDBDriver* driver_open_with_description(const char* address, const struct Credentials* credentials, const struct DriverOptions* driver_options, const char* driver_lang)

Open a TypeDB Driver to a TypeDB server available at the provided address. This method allows driver language specification for drivers built on top of the native C layer.

Input parameters
Name Description Type

address

The address (host:port) on which the TypeDB Server is running

const char*

credentials

The Credentials to connect with

const struct Credentials*

driver_options

The DriverOptions to connect with

const struct DriverOptions*

driver_lang

The language of the driver connecting to the server

const char*

Returns

struct TypeDBDriver*

init_logging

void init_logging(void)

Enables logging in the TypeDB driver.

This function sets up tracing with two environment variables:

``TYPEDB_DRIVER_LOG``: Fine-grained control using the same syntax as ``RUST_LOG``. Example: ``TYPEDB_DRIVER_LOG=typedb_driver=debug,typedb_driver_clib=trace``
``TYPEDB_DRIVER_LOG_LEVEL``: Simple log level that applies to both ``typedb_driver`` and ``typedb_driver_clib`` crates. Overrides any settings from ``TYPEDB_DRIVER_LOG``. Example: ``TYPEDB_DRIVER_LOG_LEVEL=debug``

If neither is set, the default level is INFO for driver crates.

The logging is initialized only once to prevent multiple initializations in applications that create multiple drivers.

Returns

void

typedbdriver

Struct TypeDBDriver

class

A connection to a TypeDB server which serves as the starting point for all interaction.

credential

Struct Credentials

class

User credentials for connecting to TypeDB

driveroptions

Struct DriverOptions

class

User connection settings for connecting to TypeDB.

databases

database_schema

char* database_schema(const struct Database* database)

A full schema text as a valid TypeQL define query string.

Returns

char*

databases_all

struct DatabaseIterator* databases_all(struct TypeDBDriver* driver)

Returns a DatabaseIterator over all databases present on the TypeDB server.

Returns

struct DatabaseIterator*

databases_contains

bool databases_contains(struct TypeDBDriver* driver, const char* name)

Checks if a database with the given name exists.

Returns

bool

databases_create

void databases_create(struct TypeDBDriver* driver, const char* name)

Create a database with the given name.

Returns

void

databases_get

const struct Database* databases_get(struct TypeDBDriver* driver, const char* name)

Retrieve the database with the given name.

Returns

const struct Database*

databases_import_from_file

void databases_import_from_file(struct TypeDBDriver* driver, const char* name, const char* schema, const char* data_file)

Create a database with the given name based on previously exported another database’s data loaded from a file. This is a blocking operation and may take a significant amount of time depending on the database size.

Input parameters
Name Description Type

driver

The TypeDBDriver object.

struct TypeDBDriver*

name

The name of the database to be created.

const char*

schema

The schema definition query string for the database.

const char*

data_file

The exported database file path to import the data from.

const char*

Returns

void

database

Struct Database

class

A TypeDB database

database_close

void database_close(const struct Database* database)

Frees the native rust Database object

Returns

void

database_delete

void database_delete(const struct Database* database)

Deletes this database.

Returns

void

database_export_to_file

void database_export_to_file(const struct Database* database, const char* schema_file, const char* data_file)

Export a database into a schema definition and a data files saved to the disk. This is a blocking operation and may take a significant amount of time depending on the database size.

Input parameters
Name Description Type

database

The Database object to export from.

const struct Database*

schema_file

The path to the schema definition file to be created.

const char*

data_file

The path to the data file to be created.

const char*

Returns

void

database_get_name

char* database_get_name(const struct Database* database)

The database name as a string.

Returns

char*

database_type_schema

char* database_type_schema(const struct Database* database)

The types in the schema as a valid TypeQL define query string.

Returns

char*

databaseiterator

Struct DatabaseIterator

class

An Iterator over databases present on the TypeDB server.

database_iterator_drop

void database_iterator_drop(struct DatabaseIterator* it)

Frees the native rust DatabaseIterator object.

Returns

void

database_iterator_next

const struct Database* database_iterator_next(struct DatabaseIterator* it)

Forwards the DatabaseIterator and returns the next Database if it exists, or null if there are no more elements.

Returns

const struct Database*

users

users_all

struct UserIterator* users_all(const struct TypeDBDriver* driver)

Retrieves all users which exist on the TypeDB server.

Returns

struct UserIterator*

users_contains

bool users_contains(const struct TypeDBDriver* driver, const char* username)

Checks if a user with the given name exists.

Returns

bool

users_create

void users_create(const struct TypeDBDriver* driver, const char* username, const char* password)

Creates a user with the given name & password.

Returns

void

users_get

struct User* users_get(const struct TypeDBDriver* driver, const char* username)

Retrieves a user with the given name.

Returns

struct User*

users_get_current_user

struct User* users_get_current_user(const struct TypeDBDriver* driver)

Retrieves the username of the user who opened this connection

Returns

struct User*

user

user_delete

void user_delete(struct User* user)

Deletes this database.

Returns

void

user_drop

void user_drop(struct User* user)

Frees the native rust User object.

Returns

void

user_get_name

char* user_get_name(struct User* user)

Returns the name of this user.

Returns

char*

user_update_password

void user_update_password(struct User* user, const char* password)

Updates the password for the current authenticated user.

Input parameters
Name Description Type

user

The user to update the password of - must be the current user.

struct User*

user_manager

The UserManager object on this connection.

password_old

The current password of this user

password_new

The new password

Returns

void

useriterator

Struct UserIterator

class

Iterator over a set of Users

user_iterator_drop

void user_iterator_drop(struct UserIterator* it)

Frees the native rust UserIterator object

Returns

void

user_iterator_next

struct User* user_iterator_next(struct UserIterator* it)

Forwards the UserIterator and returns the next User if it exists, or null if there are no more elements.

Returns

struct User*

Transaction

transaction

Struct Transaction

class

A transaction with a TypeDB database.

transaction_analyze

struct AnalyzedQueryPromise* transaction_analyze(struct Transaction* transaction, const char* query)

Analyzes a TypeQL query in the transaction.

Input parameters
Name Description Type

transaction

The Transaction to analyze the query within.

struct Transaction*

query

The query string.

const char*

Returns

struct AnalyzedQueryPromise*

transaction_close

struct VoidPromise* transaction_close(struct Transaction* txn)

Forcibly closes this transaction. To be used in exceptional cases.

Returns

struct VoidPromise*

transaction_commit

struct VoidPromise* transaction_commit(struct Transaction* txn)

Commits the changes made via this transaction to the TypeDB database. Whether or not the transaction is commited successfully, the transaction is closed after the commit call and the native rust object is freed.

Returns

struct VoidPromise*

transaction_is_open

bool transaction_is_open(const struct Transaction* txn)

Checks whether this transaction is open.

Returns

bool

transaction_new

struct Transaction* transaction_new(struct TypeDBDriver* driver, const char* database_name, enum TransactionType type_, const struct TransactionOptions* options)

Opens a transaction to perform read or write queries on the database connected to the session.

Input parameters
Name Description Type

databases

The DatabaseManager object on this connection.

database_name

The name of the database with which the transaction connects.

const char*

type_

The type of transaction to be created (Write / Read / Schema).

enum TransactionType

options

TransactionOptions to configure the opened transaction.

const struct TransactionOptions*

Returns

struct Transaction*

transaction_on_close

struct VoidPromise* transaction_on_close(const struct Transaction* txn, uintptr_t callback_id, void(*)(uintptr_t, struct Error*) callback)

Registers a callback function which will be executed when this transaction is closed.

Input parameters
Name Description Type

txn

The transaction on which to register the callback

const struct Transaction*

callback_id

The argument to be passed to the callback function when it is executed.

uintptr_t

callback

The function to be called

Returns

struct VoidPromise*

transaction_query

struct QueryAnswerPromise* transaction_query(struct Transaction* transaction, const char* query, const struct QueryOptions* options)

Performs a TypeQL query in the transaction.

Input parameters
Name Description Type

transaction

The Transaction to execute the query within.

struct Transaction*

query

The query string.

const char*

options

QueryOptions to configure the executed query.

const struct QueryOptions*

Returns

struct QueryAnswerPromise*

transaction_rollback

struct VoidPromise* transaction_rollback(const struct Transaction* txn)

Rolls back the uncommitted changes made via this transaction.

Returns

struct VoidPromise*

transaction_submit_close

void transaction_submit_close(struct Transaction* txn)

Closes the transaction and frees the native rust object.

Returns

void

transactiontype

Struct TransactionType

class

This enum is used to specify the type of transaction.

Enum TransactionType

class

This enum is used to specify the type of transaction.

Enum constants
Name

Read = 0

Schema = 2

Write = 1

transactionoptions

Struct TransactionOptions

class

TypeDB transaction options. TransactionOptions object can be used to override the default server behaviour for opened transactions.

transaction_options_drop

void transaction_options_drop(struct TransactionOptions* options)

Frees the native Rust TransactionOptions object.

Returns

void

transaction_options_get_schema_lock_acquire_timeout_millis

int64_t transaction_options_get_schema_lock_acquire_timeout_millis(const struct TransactionOptions* options)

Returns the value set for the schema lock acquire timeout in this TransactionOptions object. If set, specifies how long the driver should wait if opening a transaction is blocked by an exclusive schema write lock.

Returns

int64_t

transaction_options_get_transaction_timeout_millis

int64_t transaction_options_get_transaction_timeout_millis(const struct TransactionOptions* options)

Returns the value set for the transaction timeout in this TransactionOptions object. If set, specifies a timeout for killing transactions automatically, preventing memory leaks in unclosed transactions.

Returns

int64_t

transaction_options_has_schema_lock_acquire_timeout_millis

bool transaction_options_has_schema_lock_acquire_timeout_millis(const struct TransactionOptions* options)

Checks whether the option for schema lock acquire timeout was explicitly set for this TransactionOptions object.

Returns

bool

transaction_options_has_transaction_timeout_millis

bool transaction_options_has_transaction_timeout_millis(const struct TransactionOptions* options)

Checks whether the option for transaction timeout was explicitly set for this TransactionOptions object.

Returns

bool

transaction_options_new

struct TransactionOptions* transaction_options_new(void)

Produces a new TransactionOptions object.

Returns

struct TransactionOptions*

transaction_options_set_schema_lock_acquire_timeout_millis

void transaction_options_set_schema_lock_acquire_timeout_millis(struct TransactionOptions* options, int64_t timeout_millis)

Explicitly sets schema lock acquire timeout. If set, specifies how long the driver should wait if opening a transaction is blocked by an exclusive schema write lock.

Returns

void

transaction_options_set_transaction_timeout_millis

void transaction_options_set_transaction_timeout_millis(struct TransactionOptions* options, int64_t timeout_millis)

Explicitly set a transaction timeout. If set, specifies a timeout for killing transactions automatically, preventing memory leaks in unclosed transactions.

Returns

void

queryoptions

Struct QueryOptions

class

TypeDB query options. QueryOptions object can be used to override the default server behaviour for executed queries.

query_options_drop

void query_options_drop(struct QueryOptions* options)

Frees the native Rust QueryOptions object.

Returns

void

query_options_get_include_instance_types

bool query_options_get_include_instance_types(const struct QueryOptions* options)

Returns the value set for the "include instance types" flag in this QueryOptions object. If set, specifies if types should be included in instance structs returned in ConceptRow answers. This option allows reducing the amount of unnecessary data transmitted.

Returns

bool

query_options_get_include_query_structure

bool query_options_get_include_query_structure(const struct QueryOptions* options)

Returns the value set for 'include query structure' in this QueryOptions object.

Returns

bool

query_options_get_prefetch_size

int64_t query_options_get_prefetch_size(const struct QueryOptions* options)

Returns the value set for the prefetch size in this QueryOptions object. If set, specifies the number of extra query responses sent before the client side has to re-request more responses. Increasing this may increase performance for queries with a huge number of answers, as it can reduce the number of network round-trips at the cost of more resources on the server side. Minimal value: 1.

Returns

int64_t

query_options_has_include_instance_types

bool query_options_has_include_instance_types(const struct QueryOptions* options)

Checks whether the "include instance types" flag was explicitly set for this QueryOptions object.

Returns

bool

query_options_has_include_query_structure

bool query_options_has_include_query_structure(const struct QueryOptions* options)

Checks whether the prefetch size was explicitly set for this QueryOptions object.

Returns

bool

query_options_has_prefetch_size

bool query_options_has_prefetch_size(const struct QueryOptions* options)

Checks whether the prefetch size was explicitly set for this QueryOptions object.

Returns

bool

query_options_new

struct QueryOptions* query_options_new(void)

Produces a new QueryOptions object.

Returns

struct QueryOptions*

query_options_set_include_instance_types

void query_options_set_include_instance_types(struct QueryOptions* options, bool include_instance_types)

Explicitly set the "include instance types" flag. If set, specifies if types should be included in instance structs returned in ConceptRow answers. This option allows reducing the amount of unnecessary data transmitted.

Returns

void

query_options_set_include_query_structure

void query_options_set_include_query_structure(struct QueryOptions* options, bool include_query_structure)

Explicitly set the prefetch size. If set, it requests the server to include the query structure in the answer header.

Returns

void

query_options_set_prefetch_size

void query_options_set_prefetch_size(struct QueryOptions* options, int64_t prefetch_size)

Explicitly set the prefetch size. If set, specifies the number of extra query responses sent before the client side has to re-request more responses. Increasing this may increase performance for queries with a huge number of answers, as it can reduce the number of network round-trips at the cost of more resources on the server side. Minimal value: 1.

Returns

void

Answer

queryanswer

query_answer_drop

void query_answer_drop(struct QueryAnswer* query_answer)

Frees the native rust QueryAnswer object.

Returns

void

query_answer_get_query_type

enum QueryType query_answer_get_query_type(const struct QueryAnswer* query_answer)

Retrieve the executed query’s type of the QueryAnswer.

Returns

enum QueryType

query_answer_into_documents

struct StringIterator* query_answer_into_documents(struct QueryAnswer* query_answer)

Produces an Iterator over all JSON ConceptDocuments in this QueryAnswer.

Returns

struct StringIterator*

query_answer_into_rows

struct ConceptRowIterator* query_answer_into_rows(struct QueryAnswer* query_answer)

Produces an Iterator over all ConceptRows in this QueryAnswer.

Returns

struct ConceptRowIterator*

query_answer_is_concept_document_stream

bool query_answer_is_concept_document_stream(const struct QueryAnswer* query_answer)

Checks if the query answer is a ConceptDocumentStream.

Returns

bool

query_answer_is_concept_row_stream

bool query_answer_is_concept_row_stream(const struct QueryAnswer* query_answer)

Checks if the query answer is a ConceptRowStream.

Returns

bool

query_answer_is_ok

bool query_answer_is_ok(const struct QueryAnswer* query_answer)

Checks if the query answer is an Ok.

Returns

bool

queryanswerpromise

Struct QueryAnswerPromise

class

Promise object representing the result of an asynchronous operation. Use query_answer_promise_resolve(QueryAnswerPromise*) to wait for and retrieve the resulting boolean value.

query_answer_promise_drop

void query_answer_promise_drop(struct QueryAnswerPromise* promise)

Frees the native rust QueryAnswerPromise object.

Returns

void

query_answer_promise_resolve

struct QueryAnswer* query_answer_promise_resolve(struct QueryAnswerPromise* promise)

Waits for and returns the result of the operation represented by the QueryAnswer object. In case the operation failed, the error flag will only be set when the promise is resolved. The native promise object is freed when it is resolved.

Returns

struct QueryAnswer*

querytype

Struct QueryType

class

This enum is used to specify the type of the query resulted in this answer.

Enum QueryType

class

This enum is used to specify the type of the query resulted in this answer.

Enum constants
Name

ReadQuery

SchemaQuery

WriteQuery

conceptrow

Struct ConceptRow

class

A single row of concepts representing substitutions for variables in the query. Contains a Header (column names and query type), and the row of optional concepts. An empty concept in a column means the variable does not have a substitution in this answer.

concept_row_drop

void concept_row_drop(struct ConceptRow* concept_row)

Frees the native rust ConceptRow object.

Returns

void

concept_row_equals

bool concept_row_equals(const struct ConceptRow* lhs, const struct ConceptRow* rhs)

Checks whether the provided ConceptRow objects are equal

Returns

bool

concept_row_get

struct Concept* concept_row_get(const struct ConceptRow* concept_row, const char* column_name)

Retrieves a concept for a given column name.

Returns

struct Concept*

concept_row_get_column_names

struct StringIterator* concept_row_get_column_names(const struct ConceptRow* concept_row)

Produces an Iterator over all String column names of the ConceptRow's header.

Returns

struct StringIterator*

concept_row_get_concepts

struct ConceptIterator* concept_row_get_concepts(const struct ConceptRow* concept_row)

Produces an Iterator over all Concepts in this ConceptRow.

Returns

struct ConceptIterator*

concept_row_get_index

struct Concept* concept_row_get_index(const struct ConceptRow* concept_row, uintptr_t column_index)

Retrieves a concept for a given column index.

Returns

struct Concept*

concept_row_get_query_structure

struct Pipeline* concept_row_get_query_structure(const struct ConceptRow* concept_row)

Retrieve the executed query’s structure from the ConceptRow's header, if set. It must be requested via "include query structure" in QueryOptions

Returns

struct Pipeline*

concept_row_get_query_type

enum QueryType concept_row_get_query_type(const struct ConceptRow* concept_row)

Retrieve the executed query’s type of the ConceptRow's header.

Returns

enum QueryType

concept_row_involved_conjunctions

struct ConjunctionIDIterator* concept_row_involved_conjunctions(const struct ConceptRow* concept_row)

Retrieve the ConjunctionIDs of Conjunctions that answered this row. May be null.

Returns

struct ConjunctionIDIterator*

concept_row_to_string

char* concept_row_to_string(const struct ConceptRow* concept_row)

A string representation of this ConceptRow.

Returns

char*

conceptrowiterator

Struct ConceptRowIterator

class

Iterator over the ConceptRows returned by an API method or query.

concept_row_iterator_drop

void concept_row_iterator_drop(struct ConceptRowIterator* it)

Frees the native rust ConceptRowIterator object

Returns

void

concept_row_iterator_next

struct ConceptRow* concept_row_iterator_next(struct ConceptRowIterator* it)

Forwards the ConceptRowIterator and returns the next ConceptRow if it exists, or null if there are no more elements.

Returns

struct ConceptRow*

voidpromise

Struct VoidPromise

class

Promise object representing the result of an asynchronous operation. A VoidPromise does not return a value, but must be resolved using void_promise_resolve(VoidPromise*) to ensure the operation has completed, or for a failed operation to set the error.

void_promise_drop

void void_promise_drop(struct VoidPromise* promise)

Frees the native rust VoidPromise object.

Returns

void

void_promise_resolve

void void_promise_resolve(struct VoidPromise* promise)

Waits for the operation represented by the VoidPromise to complete. In case the operation failed, the error flag will only be set when the promise is resolved. The native promise object is freed when it is resolved.

Returns

void

boolpromise

Struct BoolPromise

class

Promise object representing the result of an asynchronous operation. Use bool_promise_resolve(BoolPromise*) to wait for and retrieve the resulting boolean value.

bool_promise_drop

void bool_promise_drop(struct BoolPromise* promise)

Frees the native rust BoolPromise object.

Returns

void

bool_promise_resolve

bool bool_promise_resolve(struct BoolPromise* promise)

Waits for and returns the result of the operation represented by the BoolPromise object. In case the operation failed, the error flag will only be set when the promise is resolved. The native promise object is freed when it is resolved.

Returns

bool

stringpromise

Struct StringPromise

class

Promise object representing the result of an asynchronous operation. Use string_promise_resolve(StringPromise*) to wait for and retrieve the resulting string.

string_promise_drop

void string_promise_drop(struct StringPromise* promise)

Frees the native rust StringPromise object.

Returns

void

string_promise_resolve

char* string_promise_resolve(struct StringPromise* promise)

Waits for and returns the result of the operation represented by the BoolPromise object. In case the operation failed, the error flag will only be set when the promise is resolved. The native promise object is freed when it is resolved.

Returns

char*

conceptpromise

Struct ConceptPromise

class

Promise object representing the result of an asynchronous operation. Use concept_promise_resolve(ConceptPromise*) to wait for and retrieve the resulting boolean value.

concept_promise_drop

void concept_promise_drop(struct ConceptPromise* promise)

Frees the native rust ConceptPromise object.

Returns

void

concept_promise_resolve

struct Concept* concept_promise_resolve(struct ConceptPromise* promise)

Waits for and returns the result of the operation represented by the ConceptPromise object. In case the operation failed, the error flag will only be set when the promise is resolved. The native promise object is freed when it is resolved.

Returns

struct Concept*

string

string_free

void string_free(char* str)

Frees a native rust string. WARNING: Always use this function to free strings returned by the driver. Using the standard C free function will create a dangling reference on the rust side.

Returns

void

stringiterator

Struct StringIterator

class

Iterator over the strings in the result of a request or a TypeQL Fetch query.

string_iterator_drop

void string_iterator_drop(struct StringIterator* it)

Frees the native rust StringIterator object

Returns

void

string_iterator_next

char* string_iterator_next(struct StringIterator* it)

Forwards the StringIterator and returns the next string if it exists, or null if there are no more elements.

Returns

char*

Concept

concept

Struct Concept

class

The fundamental TypeQL object.

concept_drop

void concept_drop(struct Concept* concept)

Frees the native rust Concept object

Returns

void

concept_equals

bool concept_equals(const struct Concept* lhs, const struct Concept* rhs)

Checks whether the provided Concept objects are equal

Returns

bool

concept_get_boolean

bool concept_get_boolean(const struct Concept* concept)

Returns a boolean value of this value concept. If the value has another type, the error is set.

Returns

bool

concept_get_date_as_seconds

int64_t concept_get_date_as_seconds(const struct Concept* concept)

Returns the value of this date value concept as seconds since the start of the UNIX epoch. If the value has another type, the error is set.

Returns

int64_t

concept_get_datetime

struct DatetimeInNanos concept_get_datetime(const struct Concept* concept)

Returns the value of this datetime value concept as seconds and nanoseconds parts since the start of the UNIX epoch. If the value has another type, the error is set.

Returns

struct DatetimeInNanos

concept_get_datetime_tz

struct DatetimeAndTimeZone concept_get_datetime_tz(const struct Concept* concept)

Returns the value of this datetime-tz value concept as seconds and nanoseconds parts since the start of the UNIX epoch and timezone information. If the value has another type, the error is set.

Returns

struct DatetimeAndTimeZone

concept_get_decimal

struct Decimal concept_get_decimal(const struct Concept* concept)

Returns the decimal value of this value concept. If the value has another type, the error is set.

Returns

struct Decimal

concept_get_double

double concept_get_double(const struct Concept* concept)

Returns the double value of this value concept. If the value has another type, the error is set.

Returns

double

concept_get_duration

struct Duration concept_get_duration(const struct Concept* concept)

Returns the value of this duration value. If the value has another type, the error is set.

Returns

struct Duration

concept_get_integer

int64_t concept_get_integer(const struct Concept* concept)

Returns the integer value of this value concept. If the value has another type, the error is set.

Returns

int64_t

concept_get_label

char* concept_get_label(const struct Concept* concept)

Retrieves the label of this Concept. If this is an Instance, returns the label of the type of this instance ("unknown" if type fetching is disabled). If this is a Value, returns the label of the value type of the value. If this is a Type, returns the label of the type.

Returns

char*

concept_get_string

char* concept_get_string(const struct Concept* concept)

Returns the string value of this value concept. If the value has another type, the error is set.

Returns

char*

concept_get_struct

struct StringAndOptValueIterator* concept_get_struct(const struct Concept* concept)

Returns the value of this struct value concept represented as an iterator of {field_name: value?} pairs. If the value has another type, the error is set.

Returns

struct StringAndOptValueIterator*

concept_is_attribute

bool concept_is_attribute(const struct Concept* concept)

Checks if this Concept is an Attribute.

Returns

bool

concept_is_attribute_type

bool concept_is_attribute_type(const struct Concept* concept)

Checks if this Concept is an AttributeType.

Returns

bool

concept_is_boolean

bool concept_is_boolean(const struct Concept* concept)

Returns true if the value which this Concept holds is of type boolean. Otherwise, returns false.

Returns

bool

concept_is_date

bool concept_is_date(const struct Concept* concept)

Returns true if the value which this Concept holds is of type date. Otherwise, returns false.

Returns

bool

concept_is_datetime

bool concept_is_datetime(const struct Concept* concept)

Returns true if the value which this Concept holds is of type datetime. Otherwise, returns false.

Returns

bool

concept_is_datetime_tz

bool concept_is_datetime_tz(const struct Concept* concept)

Returns true if the value which this Concept holds is of type datetime-tz. Otherwise, returns false.

Returns

bool

concept_is_decimal

bool concept_is_decimal(const struct Concept* concept)

Returns true if the value which this Concept holds is of type decimal. Otherwise, returns false.

Returns

bool

concept_is_double

bool concept_is_double(const struct Concept* concept)

Returns true if the value which this Concept holds is of type double. Otherwise, returns false.

Returns

bool

concept_is_duration

bool concept_is_duration(const struct Concept* concept)

Returns true if the value which this Concept holds is of type duration. Otherwise, returns false.

Returns

bool

concept_is_entity

bool concept_is_entity(const struct Concept* concept)

Checks if this Concept is an Entity.

Returns

bool

concept_is_entity_type

bool concept_is_entity_type(const struct Concept* concept)

Checks if this Concept is an EntityType.

Returns

bool

concept_is_integer

bool concept_is_integer(const struct Concept* concept)

Returns true if the value which this Concept holds is of type integer. Otherwise, returns false.

Returns

bool

concept_is_relation

bool concept_is_relation(const struct Concept* concept)

Checks if this Concept is a Relation.

Returns

bool

concept_is_relation_type

bool concept_is_relation_type(const struct Concept* concept)

Checks if this Concept is a RelationType.

Returns

bool

concept_is_role_type

bool concept_is_role_type(const struct Concept* concept)

Checks if this Concept is a RoleType.

Returns

bool

concept_is_string

bool concept_is_string(const struct Concept* concept)

Returns true if the value which this Concept holds is of type string. Otherwise, returns false.

Returns

bool

concept_is_struct

bool concept_is_struct(const struct Concept* concept)

Returns true if the value which this Concept holds is of type struct. Otherwise, returns false.

Returns

bool

concept_is_value

bool concept_is_value(const struct Concept* concept)

Checks if this Concept is a Value.

Returns

bool

concept_to_string

char* concept_to_string(const struct Concept* concept)

A string representation of this Concept object.

Returns

char*

concept_try_get_iid

char* concept_try_get_iid(struct Concept* instance)

Retrieves the unique id (IID) of this Concept. If this is an Entity or Relation Instance, returns the IID of the instance. Otherwise, returns null.

Returns

char*

concept_try_get_label

char* concept_try_get_label(const struct Concept* concept)

Retrieves the optional label of this Concept. If this is an Instance, returns the label of the type of this instance (None if type fetching is disabled). If this is a Value, returns the label of the value type of the value. If this is a Type, returns the label of the type.

Returns

char*

concept_try_get_value

struct Concept* concept_try_get_value(const struct Concept* concept)

Retrieves the value of this Concept, if it exists. If this is an Attribute instance, returns the value of this instance. If this a Value, returns the value. Otherwise, returns null.

Returns

struct Concept*

concept_try_get_value_type

char* concept_try_get_value_type(const struct Concept* concept)

Retrieves the value type of this Concept, if it exists. If this is an Attribute instance, returns the value type of this instance. If this is a Value, returns its value type. If this is an AttributeType, returns the value type that the schema permits for the attribute type, if one is defined. Otherwise, returns null.

Returns

char*

conceptiterator

Struct ConceptIterator

class

Iterator over the Conceptss returned by an API method or query.

concept_iterator_drop

void concept_iterator_drop(struct ConceptIterator* it)

Frees the native rust ConceptIterator object

Returns

void

concept_iterator_next

struct Concept* concept_iterator_next(struct ConceptIterator* it)

Forwards the ConceptIterator and returns the next Concept if it exists, or null if there are no more elements.

Returns

struct Concept*

kind

Struct Kind

class

Kind represents the base of a defined type to describe its capabilities. For example, "define entity person;" defines a type "person" of a kind "entity".

Enum Kind

class

Kind represents the base of a defined type to describe its capabilities. For example, "define entity person;" defines a type "person" of a kind "entity".

Enum constants
Name

Attribute

Entity

Relation

Role

entity

entity_get_type

struct Concept* entity_get_type(const struct Concept* entity)

Retrieves the type which this Entity belongs to.

Returns

struct Concept*

relation

relation_get_type

struct Concept* relation_get_type(const struct Concept* relation)

Retrieves the type which this Relation belongs to.

Returns

struct Concept*

attribute

attribute_get_type

struct Concept* attribute_get_type(const struct Concept* attribute)

Retrieves the type which this Attribute belongs to.

Returns

struct Concept*

datetimeinnanos

Struct DatetimeInNanos

class

A DatetimeInNanos used to represent datetime as a pair of seconds part and a number of nanoseconds since the last seconds boundary.

datetimeandtimezone

Struct DatetimeAndTimeZone

class

A DatetimeAndTimeZone used to represent time zoned datetime in FFI. Time zone can be represented either as an IANA Tz or as a FixedOffset. Either the zone_name (is_fixed_offset == false) or offset (is_fixed_offset == true) is set.

datetime_and_time_zone_drop

void datetime_and_time_zone_drop(struct DatetimeAndTimeZone* datetime_tz)

Frees the native rust DatetimeAndTimeZone object

Returns

void

stringandoptvalue

Struct StringAndOptValue

class

A StringAndOptValue used to represent the pair of variables involved in an ownership. _0 and _1 are the owner and attribute variables respectively.

string_and_opt_value_drop

void string_and_opt_value_drop(struct StringAndOptValue* string_and_opt_value)

Frees the native rust StringAndOptValue object

Returns

void

stringandoptvalueiterator

Struct StringAndOptValueIterator

class

Iterator over the StringAndOptValues representing struct value {field_name: value?} info.

string_and_opt_value_iterator_drop

void string_and_opt_value_iterator_drop(struct StringAndOptValueIterator* it)

Frees the native rust StringAndOptValueIterator object

Returns

void

string_and_opt_value_iterator_next

struct StringAndOptValue* string_and_opt_value_iterator_next(struct StringAndOptValueIterator* it)

Forwards the StringAndOptValueIterator and returns the next StringAndOptValue if it exists, or null if there are no more elements.

Returns

struct StringAndOptValue*

Value

decimal

Struct Decimal

class

A fixed-point decimal number. Holds exactly 19 digits after the decimal point and a 64-bit value before the decimal point.

duration

Struct Duration

class

A relative duration, which contains months, days, and nanoseconds. Can be used for calendar-relative durations (eg 7 days forward), or for absolute durations using the nanosecond component When used as an absolute duration, convertible to chrono::Duration

Analyze

analyzed

analyzed_fetch

struct Fetch* analyzed_fetch(const struct AnalyzedQuery* analyzed_query)

Returns the analyzed fetch

Returns

struct Fetch*

analyzed_preamble

struct FunctionIterator* analyzed_preamble(const struct AnalyzedQuery* analyzed_query)

Returns the analyzed functions in the preamble of the query.

Returns

struct FunctionIterator*

analyzedquery

Struct AnalyzedQuery

class

An AnalyzedQuery contains the server’s representation of the query and preamble functions; as well as the result of types inferred for each variable by type-inference.

analyzed_query_drop

void analyzed_query_drop(struct AnalyzedQuery* obj)

Frees the native rust AnalyzedQuery object.

Returns

void

analyzed_query_pipeline

struct Pipeline* analyzed_query_pipeline(const struct AnalyzedQuery* analyzed_query)

Returns the structure of the query pipeline in the analyzed query.

Returns

struct Pipeline*

analyzedquerypromise

analyzed_query_promise_drop

void analyzed_query_promise_drop(struct AnalyzedQueryPromise* promise)

Frees the native rust AnalyzePromise object.

Returns

void

analyzed_query_promise_resolve

struct AnalyzedQuery* analyzed_query_promise_resolve(struct AnalyzedQueryPromise* promise)

Waits for and returns the result of the Analyze request. In case the operation failed, the error flag will only be set when the promise is resolved. The native promise object is freed when it is resolved.

Returns

struct AnalyzedQuery*

pipeline

Struct Pipeline

class

A representation of a query pipeline.

pipeline_drop

void pipeline_drop(struct Pipeline* obj)

Frees the native rust Pipeline object.

Returns

void

pipeline_get_conjunction

struct Conjunction* pipeline_get_conjunction(const struct Pipeline* pipeline, const struct ConjunctionID* conjunction_id)

Returns the Conjunction corresponding to the ConjunctionID. The Pipeline must be the one that contains the Conjunction & ConjunctionID.

Returns

struct Conjunction*

pipelinestage

Struct PipelineStage

class

Representation of a stage in a Pipeline.

pipeline_stage_delete_get_deleted_variables

struct VariableIterator* pipeline_stage_delete_get_deleted_variables(const struct PipelineStage* stage)

Unwraps the PipelineStage instance as a Delete stage, and returns the variables deleted. Will panic if the stage is not a Delete.

Returns

struct VariableIterator*

pipeline_stage_drop

void pipeline_stage_drop(struct PipelineStage* obj)

Frees the native rust PipelineStage object.

Returns

void

pipeline_stage_get_block

struct ConjunctionID* pipeline_stage_get_block(const struct PipelineStage* stage)

Returns the block of the pipeline stage - this is the ConjunctionID of the root conjunction. Will panic if the stage does not have a block.

Returns

struct ConjunctionID*

pipeline_stage_limit_get_limit

int64_t pipeline_stage_limit_get_limit(const struct PipelineStage* stage)

Unwraps the PipelineStage instance as a Limit stage, and returns the limit applied. Will panic if the stage is not a Limit stage.

Returns

int64_t

pipeline_stage_offset_get_offset

int64_t pipeline_stage_offset_get_offset(const struct PipelineStage* stage)

Unwraps the PipelineStage instance as an Offset stage, and returns the offset applied. Will panic if the stage is not an Offset stage.

Returns

int64_t

pipeline_stage_reduce_get_groupby

struct VariableIterator* pipeline_stage_reduce_get_groupby(const struct PipelineStage* stage)

Unwraps the PipelineStage instance as a Reduce stage, and returns the variables being grouped on. Will panic if the stage is not a Reduce stage.

Returns

struct VariableIterator*

pipeline_stage_reduce_get_reducer_assignments

struct ReduceAssignmentIterator* pipeline_stage_reduce_get_reducer_assignments(const struct PipelineStage* stage)

Unwraps the PipelineStage instance as a Reduce stage, and returns the reducers applied and the variables their results are assigned to. Will panic if the stage is not a Reduce stage.

Returns

struct ReduceAssignmentIterator*

pipeline_stage_require_get_variables

struct VariableIterator* pipeline_stage_require_get_variables(const struct PipelineStage* stage)

Unwraps the PipelineStage instance as a Require stage, and returns the required variables. Will panic if the stage is not a Require stage.

Returns

struct VariableIterator*

pipeline_stage_select_get_variables

struct VariableIterator* pipeline_stage_select_get_variables(const struct PipelineStage* stage)

Unwraps the PipelineStage instance as a Select stage, and returns the variables selected. Will panic if the stage is not a Select.

Returns

struct VariableIterator*

pipeline_stage_sort_get_sort_variables

struct SortVariableIterator* pipeline_stage_sort_get_sort_variables(const struct PipelineStage* stage)

Unwraps the PipelineStage instance as a Sort stage, and returns the SortVariable. Will panic if the stage is not a Sort stage.

Returns

struct SortVariableIterator*

pipeline_stage_string_repr

char* pipeline_stage_string_repr(const struct PipelineStage* stage)

Returns a string representation of the pipeline stage

Returns

char*

pipeline_stage_variant

enum PipelineStageVariant pipeline_stage_variant(const struct PipelineStage* stage)

Returns the variant of the Pipeline stage.

Returns

enum PipelineStageVariant

pipeline_stages

struct PipelineStageIterator* pipeline_stages(const struct Pipeline* pipeline)

Returns an iterator over the stages making up the Pipeline

Returns

struct PipelineStageIterator*

pipelinestageiterator

pipeline_stage_iterator_drop

void pipeline_stage_iterator_drop(struct PipelineStageIterator* it)

Frees the native rust PipelineStageIterator object.

Returns

void

pipeline_stage_iterator_next

struct PipelineStage* pipeline_stage_iterator_next(struct PipelineStageIterator* it)

Forwards the PipelineStageIterator and returns the next PipelineStage if it exists, or null if there are no more elements.

Returns

struct PipelineStage*

conjunction

Struct Conjunction

class

A representation of the constraints involved in the query, and types inferred for each variable.

conjunction_drop

void conjunction_drop(struct Conjunction* obj)

Frees the native rust Conjunction object.

Returns

void

conjunction_get_annotated_variables

struct VariableIterator* conjunction_get_annotated_variables(const struct Conjunction* conjunction)

Returns the variables in the current conjunction for which type annotations are available

Returns

struct VariableIterator*

conjunction_get_constraints

struct ConstraintWithSpanIterator* conjunction_get_constraints(const struct Conjunction* conjunction)

Returns the Constraints in the given conjunction.

Returns

struct ConstraintWithSpanIterator*

conjunction_get_variable_annotations

struct VariableAnnotations* conjunction_get_variable_annotations(const struct Conjunction* conjunction, const struct Variable* variable)

Returns the inferred types for the specified variable in the specified conjunction.

Returns

struct VariableAnnotations*

conjunctionid

Struct ConjunctionID

class

Holds the index of the conjunction in a Pipeline's conjunctions field. Used as indirection in the representation of a pipeline.

conjunction_id_as_u32

uint32_t conjunction_id_as_u32(const struct ConjunctionID* conjunction_id)

Returns the ConjunctionID as u32 to use in hash, equality etc.

Returns

uint32_t

conjunction_id_drop

void conjunction_id_drop(struct ConjunctionID* obj)

Frees the native rust ConjunctionID object.

Returns

void

conjunction_id_string_repr

char* conjunction_id_string_repr(const struct ConjunctionID* conjunction_id)

Returns a string representation of the ConjunctionID.

Returns

char*

conjunctioniditerator

conjunction_id_iterator_drop

void conjunction_id_iterator_drop(struct ConjunctionIDIterator* it)

Frees the native rust ConjunctionIDIterator object.

Returns

void

conjunction_id_iterator_next

struct ConjunctionID* conjunction_id_iterator_next(struct ConjunctionIDIterator* it)

Forwards the ConjunctionIDIterator and returns the next ConjunctionID if it exists, or null if there are no more elements.

Returns

struct ConjunctionID*

constraint

constraint_comparison_get_comparator

enum Comparator constraint_comparison_get_comparator(const struct ConstraintWithSpan* constraint)

Unwraps the Constraint instance as a Comparison constraint, and returns the comparator used in the comparison. Will panic if the Constraint is not a Comparison constraint.

Returns

enum Comparator

constraint_comparison_get_lhs

struct ConstraintVertex* constraint_comparison_get_lhs(const struct ConstraintWithSpan* constraint)

Unwraps the Constraint instance as a Comparison constraint, and returns the left-hand side vertex. Will panic if the Constraint is not a Comparison constraint.

Returns

struct ConstraintVertex*

constraint_comparison_get_rhs

struct ConstraintVertex* constraint_comparison_get_rhs(const struct ConstraintWithSpan* constraint)

Unwraps the Constraint instance as a Comparison constraint, and returns the right-hand side vertex. Will panic if the Constraint is not a Comparison constraint.

Returns

struct ConstraintVertex*

constraint_expression_get_arguments

struct ConstraintVertexIterator* constraint_expression_get_arguments(const struct ConstraintWithSpan* constraint)

Unwraps the Constraint instance as an Expression constraint, and returns the expression arguments - These are any variables used in the right-hand side of the expression. Will panic if the Constraint is not an Expression constraint.

Returns

struct ConstraintVertexIterator*

constraint_expression_get_assigned

struct ConstraintVertex* constraint_expression_get_assigned(const struct ConstraintWithSpan* constraint)

Unwraps the Constraint instance as an Expression constraint, and returns the variable assigned by the expression. Will panic if the Constraint is not an Expression constraint.

Returns

struct ConstraintVertex*

constraint_expression_get_text

char* constraint_expression_get_text(const struct ConstraintWithSpan* constraint)

Unwraps the Constraint instance as an Expression constraint, and returns the expression text. Will panic if the Constraint is not an Expression constraint.

Returns

char*

constraint_function_call_get_arguments

struct ConstraintVertexIterator* constraint_function_call_get_arguments(const struct ConstraintWithSpan* constraint)

Unwraps the Constraint instance as a FunctionCall constraint, and returns the variables passed as arguments to the function call . Will panic if the Constraint is not a FunctionCall constraint.

Returns

struct ConstraintVertexIterator*

constraint_function_call_get_assigned

struct ConstraintVertexIterator* constraint_function_call_get_assigned(const struct ConstraintWithSpan* constraint)

Unwraps the Constraint instance as a FunctionCall constraint, and returns the variables assigned by the function call. Will panic if the Constraint is not a FunctionCall constraint.

Returns

struct ConstraintVertexIterator*

constraint_function_call_get_name

char* constraint_function_call_get_name(const struct ConstraintWithSpan* constraint)

Unwraps the Constraint instance as a FunctionCall constraint, and returns the function name. Will panic if the Constraint is not a FunctionCall constraint.

Returns

char*

constraint_has_get_attribute

struct ConstraintVertex* constraint_has_get_attribute(const struct ConstraintWithSpan* constraint)

Unwraps the Constraint instance as a Has constraint, and returns the attribute vertex. Will panic if the Constraint is not a Has constraint.

Returns

struct ConstraintVertex*

constraint_has_get_exactness

enum ConstraintExactness constraint_has_get_exactness(const struct ConstraintWithSpan* constraint)

(FUTURE-USE: Currently always ConstraintExactness::Subtypes) Unwraps the Constraint instance as a Has constraint, and returns the exactness of the attribute match. Will panic if the Constraint is not a Has constraint.

Returns

enum ConstraintExactness

constraint_has_get_owner

struct ConstraintVertex* constraint_has_get_owner(const struct ConstraintWithSpan* constraint)

Unwraps the Constraint instance as a Has constraint, and returns the owner vertex. Will panic if the Constraint is not a Has constraint.

Returns

struct ConstraintVertex*

constraint_iid_get_iid

char* constraint_iid_get_iid(const struct ConstraintWithSpan* constraint)

Unwraps the Constraint instance as an Iid constraint, and returns the iid value as a string. Will panic if the Constraint is not an Iid constraint.

Returns

char*

constraint_iid_get_variable

struct ConstraintVertex* constraint_iid_get_variable(const struct ConstraintWithSpan* constraint)

Unwraps the Constraint instance as an Iid constraint, and returns the concept (variable) the iid applies to. Will panic if the Constraint is not an Iid constraint.

Returns

struct ConstraintVertex*

constraint_is_get_lhs

struct ConstraintVertex* constraint_is_get_lhs(const struct ConstraintWithSpan* constraint)

Unwraps the Constraint instance as an Is constraint, and returns the left-hand side vertex. Will panic if the Constraint is not an Is constraint.

Returns

struct ConstraintVertex*

constraint_is_get_rhs

struct ConstraintVertex* constraint_is_get_rhs(const struct ConstraintWithSpan* constraint)

Unwraps the Constraint instance as an Is constraint, and returns the right-hand side vertex. Will panic if the Constraint is not an Is constraint.

Returns

struct ConstraintVertex*

constraint_isa_get_exactness

enum ConstraintExactness constraint_isa_get_exactness(const struct ConstraintWithSpan* constraint)

Unwraps the Constraint instance as an Isa constraint, and returns the exactness of the type match. Will panic if the Constraint is not an Isa constraint.

Returns

enum ConstraintExactness

constraint_isa_get_instance

struct ConstraintVertex* constraint_isa_get_instance(const struct ConstraintWithSpan* constraint)

Unwraps the Constraint instance as an Isa constraint, and returns the instance vertex. Will panic if the Constraint is not an Isa constraint.

Returns

struct ConstraintVertex*

constraint_isa_get_type

struct ConstraintVertex* constraint_isa_get_type(const struct ConstraintWithSpan* constraint)

Unwraps the Constraint instance as an Isa constraint, and returns the type vertex. Will panic if the Constraint is not an Isa constraint.

Returns

struct ConstraintVertex*

constraint_kind_get_kind

enum Kind constraint_kind_get_kind(const struct ConstraintWithSpan* constraint)

Unwraps the Constraint instance as a Kind constraint, and returns the Kind of the type-vertex. Will panic if the Constraint is not a Kind constraint.

Returns

enum Kind

constraint_kind_get_type

struct ConstraintVertex* constraint_kind_get_type(const struct ConstraintWithSpan* constraint)

Unwraps the Constraint instance as a Kind constraint, and returns the associated type vertex. Will panic if the Constraint is not a Kind constraint.

Returns

struct ConstraintVertex*

constraint_label_get_label

char* constraint_label_get_label(const struct ConstraintWithSpan* constraint)

Unwraps the Constraint instance as a Label constraint, and returns the label string. Will panic if the Constraint is not a Label constraint.

Returns

char*

constraint_label_get_variable

struct ConstraintVertex* constraint_label_get_variable(const struct ConstraintWithSpan* constraint)

Unwraps the Constraint instance as a Label constraint, and returns the type-vertex the label applies to. Will panic if the Constraint is not a Label constraint.

Returns

struct ConstraintVertex*

enum ConstraintExactness constraint_links_get_exactness(const struct ConstraintWithSpan* constraint)

(FUTURE-USE: Currently always ConstraintExactness::Subtypes) Unwraps the Constraint instance as a Links constraint, and returns the exactness of the role-type match. Will panic if the Constraint is not a Links constraint.

Returns

enum ConstraintExactness

struct ConstraintVertex* constraint_links_get_player(const struct ConstraintWithSpan* constraint)

Unwraps the Constraint instance as a Links constraint, and returns the player vertex. Will panic if the Constraint is not a Links constraint.

Returns

struct ConstraintVertex*

struct ConstraintVertex* constraint_links_get_relation(const struct ConstraintWithSpan* constraint)

Unwraps the Constraint instance as a Links constraint, and returns the relation vertex. Will panic if the Constraint is not a Links constraint.

Returns

struct ConstraintVertex*

struct ConstraintVertex* constraint_links_get_role(const struct ConstraintWithSpan* constraint)

Unwraps the Constraint instance as a Links constraint, and returns the role vertex. Will panic if the Constraint is not a Links constraint.

Returns

struct ConstraintVertex*

constraint_not_get_conjunction

struct ConjunctionID* constraint_not_get_conjunction(const struct ConstraintWithSpan* constraint)

Unwraps the Constraint instance as a Not constraint, and returns the ConjunctionID of the negated conjunction. Will panic if the Constraint is not a Not constraint.

Returns

struct ConjunctionID*

constraint_or_get_branches

struct ConjunctionIDIterator* constraint_or_get_branches(const struct ConstraintWithSpan* constraint)

Unwraps the Constraint instance as an Or constraint, and returns the ConjunctionIDs of the conjunction in each of the branches. Will panic if the Constraint is not an Or constraint.

Returns

struct ConjunctionIDIterator*

constraint_owns_get_attribute

struct ConstraintVertex* constraint_owns_get_attribute(const struct ConstraintWithSpan* constraint)

Unwraps the Constraint instance as an Owns constraint, and returns the attribute-type vertex. Will panic if the Constraint is not an Owns constraint.

Returns

struct ConstraintVertex*

constraint_owns_get_exactness

enum ConstraintExactness constraint_owns_get_exactness(const struct ConstraintWithSpan* constraint)

(FUTURE-USE: Currently always ConstraintExactness::Subtypes) Will panic if the Constraint is not an Owns constraint.

Returns

enum ConstraintExactness

constraint_owns_get_owner

struct ConstraintVertex* constraint_owns_get_owner(const struct ConstraintWithSpan* constraint)

Unwraps the Constraint instance as an Owns constraint, and returns the owner-type vertex. Will panic if the Constraint is not an Owns constraint.

Returns

struct ConstraintVertex*

constraint_plays_get_exactness

enum ConstraintExactness constraint_plays_get_exactness(const struct ConstraintWithSpan* constraint)

(FUTURE-USE: Currently always ConstraintExactness::Subtypes)

Returns

enum ConstraintExactness

constraint_plays_get_player

struct ConstraintVertex* constraint_plays_get_player(const struct ConstraintWithSpan* constraint)

Unwraps the Constraint instance as a Plays constraint, and returns the player type vertex. Will panic if the Constraint is not a Plays constraint.

Returns

struct ConstraintVertex*

constraint_plays_get_role

struct ConstraintVertex* constraint_plays_get_role(const struct ConstraintWithSpan* constraint)

Unwraps the Constraint instance as a Plays constraint, and returns the role-type vertex. Will panic if the Constraint is not a Plays constraint.

Returns

struct ConstraintVertex*

constraint_relates_get_exactness

enum ConstraintExactness constraint_relates_get_exactness(const struct ConstraintWithSpan* constraint)

Unwraps the Constraint instance as a Relates constraint, and returns the exactness of the relation match. Will panic if the Constraint is not a Relates constraint.

Returns

enum ConstraintExactness

constraint_relates_get_relation

struct ConstraintVertex* constraint_relates_get_relation(const struct ConstraintWithSpan* constraint)

Unwraps the Constraint instance as a Relates constraint, and returns the relation-type vertex. Will panic if the Constraint is not a Relates constraint.

Returns

struct ConstraintVertex*

constraint_relates_get_role

struct ConstraintVertex* constraint_relates_get_role(const struct ConstraintWithSpan* constraint)

Unwraps the Constraint instance as a Relates constraint, and returns the role-type vertex. Will panic if the Constraint is not a Relates constraint.

Returns

struct ConstraintVertex*

constraint_string_repr

char* constraint_string_repr(const struct ConstraintWithSpan* constraint)

Returns a string representation of the constraint

Returns

char*

constraint_sub_get_exactness

enum ConstraintExactness constraint_sub_get_exactness(const struct ConstraintWithSpan* constraint)

Unwraps the Constraint instance as a Sub constraint, and returns the exactness of the subtype match. If Exact (i.e. sub!), only the immediate subtype is returned else, (i.e. sub) the type itself and all subtypes are returned. Will panic if the Constraint is not a Sub constraint.

Returns

enum ConstraintExactness

constraint_sub_get_subtype

struct ConstraintVertex* constraint_sub_get_subtype(const struct ConstraintWithSpan* constraint)

Unwraps the Constraint instance as a Sub constraint, and returns the subtype vertex. Will panic if the Constraint is not a Sub constraint.

Returns

struct ConstraintVertex*

constraint_sub_get_supertype

struct ConstraintVertex* constraint_sub_get_supertype(const struct ConstraintWithSpan* constraint)

Unwraps the Constraint instance as a Sub constraint, and returns the supertype vertex. Will panic if the Constraint is not a Sub constraint.

Returns

struct ConstraintVertex*

constraint_try_get_conjunction

struct ConjunctionID* constraint_try_get_conjunction(const struct ConstraintWithSpan* constraint)

Unwraps the Constraint instance as a Try constraint, and returns the ConjunctionID of the optionally matched conjunction. Will panic if the Constraint is not a Try constraint.

Returns

struct ConjunctionID*

constraint_value_get_attribute_type

struct ConstraintVertex* constraint_value_get_attribute_type(const struct ConstraintWithSpan* constraint)

Unwraps the Constraint instance as a Value constraint, and returns the attribute type vertex. Will panic if the Constraint is not a Value constraint.

Returns

struct ConstraintVertex*

constraint_value_get_value_type

char* constraint_value_get_value_type(const struct ConstraintWithSpan* constraint)

Unwraps the Constraint instance as a Value constraint, and returns the specified ValueType as a string. Will panic if the Constraint is not a Value constraint.

Returns

char*

constraint_variant

enum ConstraintVariant constraint_variant(const struct ConstraintWithSpan* constraint)

The variant of the specified constraint

Returns

enum ConstraintVariant

constraintexactness

Struct ConstraintExactness

class

Tells apart exact variants of constraints from the ones allowing subtype-polymorphism. e.g. isa! would be represented as an Constraint::Isa with its exactness field ConstraintExactness::Exact.

Enum ConstraintExactness

class

Tells apart exact variants of constraints from the ones allowing subtype-polymorphism. e.g. isa! would be represented as an Constraint::Isa with its exactness field ConstraintExactness::Exact.

Enumerator
Exact 

Indicates the constraint matches exactly the specified type - e.g. isa! or sub!

Subtypes 

Indicates the constraint matches the specified type and its subtypes - e.g. isa! or sub!

Enum constants
Name

Exact

Subtypes

constraintspan

constraint_span_begin

int64_t constraint_span_begin(const struct ConstraintWithSpan* constraint)

The offset of the first character of the specified constraint in the source query .

Returns

int64_t

constraint_span_end

int64_t constraint_span_end(const struct ConstraintWithSpan* constraint)

The offset after the last character of the specified constraint in the source query .

Returns

int64_t

constraintwithspan

constraint_with_span_drop

void constraint_with_span_drop(struct ConstraintWithSpan* obj)

Frees the native rust Constraint object.

Returns

void

constraintwithspaniterator

constraint_with_span_iterator_drop

void constraint_with_span_iterator_drop(struct ConstraintWithSpanIterator* it)

Frees the native rust ConstraintWithSpanIterator object.

Returns

void

constraint_with_span_iterator_next

struct ConstraintWithSpan* constraint_with_span_iterator_next(struct ConstraintWithSpanIterator* it)

Forwards the ConstraintWithSpanIterator and returns the next ConstraintWithSpan if it exists, or null if there are no more elements.

Returns

struct ConstraintWithSpan*

constraintvertex

Struct ConstraintVertex

class

The answer to a TypeDB query is a set of concepts which satisfy the Constraints in the query. A ConstraintVertex is either a variable, or some identifier of the concept.

A ``Variable`` is a vertex the query must match and return.
A ``Label`` uniquely identifies a type
A ``Value`` represents a primitive value literal in TypeDB.
A ``NamedRole`` vertex is used in links & relates constraints, as multiple relations may have roles with the same name. The types inferred for ``Variable``, ``Label`` and ``NamedRole`` vertices can be read from the ``variable_annotations`` field of the ``Conjunction`` it is in.

constraint_vertex_as_label

struct Concept* constraint_vertex_as_label(const struct ConstraintVertex* vertex)

Unwraps the ConstraintVertex instance as a Label. Will panic if the instance is not a Label variant.

Returns

struct Concept*

constraint_vertex_as_named_role

struct NamedRole* constraint_vertex_as_named_role(const struct ConstraintVertex* vertex)

Unwraps the ConstraintVertex instance as a NamedRole. 'links' & 'relates' constraints accept unscoped role names. Since an unscoped role-name does not uniquely identify a role-type, (Different role-types belonging to different relation types may share the same name) an internal variable is introduced to handle the ambiguity Will panic if the instance is not a NamedRole variant.

Returns

struct NamedRole*

constraint_vertex_as_value

struct Concept* constraint_vertex_as_value(const struct ConstraintVertex* vertex)

Unwraps the ConstraintVertex instance as a Value. Will panic if the instance is not a Value variant.

Returns

struct Concept*

constraint_vertex_as_variable

struct Variable* constraint_vertex_as_variable(const struct ConstraintVertex* vertex)

Unwraps the ConstraintVertex instance as a Variable. Will panic if the instance is not a Variable variant.

Returns

struct Variable*

constraint_vertex_drop

void constraint_vertex_drop(struct ConstraintVertex* obj)

Frees the native rust ConstraintVertex object.

Returns

void

constraint_vertex_variant

enum ConstraintVertexVariant constraint_vertex_variant(const struct ConstraintVertex* vertex)

Returns the variant of the constraint

Returns

enum ConstraintVertexVariant

constraintvertexiterator

constraint_vertex_iterator_drop

void constraint_vertex_iterator_drop(struct ConstraintVertexIterator* it)

Frees the native rust ConstraintVertexIterator object.

Returns

void

constraint_vertex_iterator_next

struct ConstraintVertex* constraint_vertex_iterator_next(struct ConstraintVertexIterator* it)

Forwards the ConstraintVertexIterator and returns the next ConstraintVertex if it exists, or null if there are no more elements.

Returns

struct ConstraintVertex*

variable

Struct Variable

class

Uniquely identifies a variable in a Pipelinepipeline. Its name (if any) can be retrieved from the variable_names field in Pipeline

variable_drop

void variable_drop(struct Variable* obj)

Frees the native rust Variable object.

Returns

void

variable_get_name

char* variable_get_name(const struct Pipeline* pipeline_structure, const struct Variable* variable)

Returns the name of the specified variable if it has one, and null otherwise. The Pipeline must be the one that contains the variable.

Returns

char*

variable_id_as_u32

uint32_t variable_id_as_u32(const struct Variable* variable)

Returns the Variable id as u32 to use in hash, equality etc.

Returns

uint32_t

variable_string_repr

char* variable_string_repr(const struct Variable* variable)

Returns a string representation of the variable. Does not resolve the name.

Returns

char*

variableannotations

variable_annotations_drop

void variable_annotations_drop(struct VariableAnnotations* obj)

Frees the native rust VariableAnnotations object.

Returns

void

variable_annotations_instance

struct ConceptIterator* variable_annotations_instance(const struct VariableAnnotations* annotations)

Unwraps the VariableAnnotations instance as annotations for an Instance variable, and returns the possible types of the instances the variable may hold. Will panic if the variable is not an Instance variable.

Returns

struct ConceptIterator*

variable_annotations_type

struct ConceptIterator* variable_annotations_type(const struct VariableAnnotations* annotations)

Unwraps the VariableAnnotations instance as annotations for a Type variable, and returns the possible types the variable may be. Will panic if the variable is not a Type variable.

Returns

struct ConceptIterator*

variable_annotations_value

struct StringIterator* variable_annotations_value(const struct VariableAnnotations* annotations)

Unwraps the VariableAnnotations instance as annotations for a Value variable, and returns the possible ValueTypes the value may be. Will panic if the variable is not a Value variable.

Returns

struct StringIterator*

variable_annotations_variant

enum VariableAnnotationsVariant variable_annotations_variant(const struct VariableAnnotations* annotations)

Returns the variant of the specified VariableAnnotations. This tells us whether the variable holds an instance, a type or a raw value.

Returns

enum VariableAnnotationsVariant

variableannotationsiterator

variable_annotations_iterator_drop

void variable_annotations_iterator_drop(struct VariableAnnotationsIterator* it)

Frees the native rust VariableAnnotationsIterator object.

Returns

void

variable_annotations_iterator_next

struct VariableAnnotations* variable_annotations_iterator_next(struct VariableAnnotationsIterator* it)

Forwards the VariableAnnotationsIterator and returns the next VariableAnnotations if it exists, or null if there are no more elements.

Returns

struct VariableAnnotations*

variableiterator

variable_iterator_drop

void variable_iterator_drop(struct VariableIterator* it)

Frees the native rust VariableIterator object.

Returns

void

variable_iterator_next

struct Variable* variable_iterator_next(struct VariableIterator* it)

Forwards the VariableIterator and returns the next Variable if it exists, or null if there are no more elements.

Returns

struct Variable*

fetch

Struct Fetch

class

A representation of the 'fetch' stage of a query

fetch_drop

void fetch_drop(struct Fetch* obj)

Frees the native rust Fetch object.

Returns

void

fetch_leaf_annotations

struct StringIterator* fetch_leaf_annotations(const struct Fetch* fetch)

Unwraps the Fetch instance as a Leaf variant, and returns an iterator over possible value types. Will panic if the instance is not a Leaf variant.

Returns

struct StringIterator*

fetch_list_element

struct Fetch* fetch_list_element(const struct Fetch* fetch)

Unwraps the Fetch instance as a List variant, and returns the Fetch for an element of the list. Will panic if the instance is not a List variant.

Returns

struct Fetch*

fetch_object_fields

struct StringIterator* fetch_object_fields(const struct Fetch* fetch)

Unwraps the Fetch instance as an Object variant, and returns the available fields. Will panic if the instance is not an Object variant.

Returns

struct StringIterator*

fetch_object_get_field

struct Fetch* fetch_object_get_field(const struct Fetch* fetch, const char* field)

Unwraps the Fetch instance as an Object variant, and returns the value of the specified field. Will panic if the instance is not an Object variant.

Returns

struct Fetch*

fetch_variant

enum FetchVariant fetch_variant(const struct Fetch* fetch)

Returns the variant of the Fetch instance.

Returns

enum FetchVariant

function

Struct Function

class

Holds a representation of the function, and the result of type-inference for each variable.

function_argument_annotations

struct VariableAnnotationsIterator* function_argument_annotations(const struct Function* function)

Returns the inferred type for each argument of the function.

Returns

struct VariableAnnotationsIterator*

function_argument_variables

struct VariableIterator* function_argument_variables(const struct Function* function)

Returns the Variables which are the arguments of the function.

Returns

struct VariableIterator*

function_body

struct Pipeline* function_body(const struct Function* function)

A representation of the Pipeline which forms the body of the function.

Returns

struct Pipeline*

function_drop

void function_drop(struct Function* obj)

Frees the native rust Function object.

Returns

void

function_return_annotations

struct VariableAnnotationsIterator* function_return_annotations(const struct Function* function)

Returns the inferred type for each concept returned by the function.

Returns

struct VariableAnnotationsIterator*

function_return_operation

struct ReturnOperation* function_return_operation(const struct Function* function)

A representation of the ReturnOperation of the function.

Returns

struct ReturnOperation*

functioniterator

function_iterator_drop

void function_iterator_drop(struct FunctionIterator* it)

Frees the native rust FunctionIterator object.

Returns

void

function_iterator_next

struct Function* function_iterator_next(struct FunctionIterator* it)

Forwards the FunctionIterator and returns the next Function if it exists, or null if there are no more elements.

Returns

struct Function*

returnoperation

Struct ReturnOperation

class

A representation of the return operation of the function

return_operation_drop

void return_operation_drop(struct ReturnOperation* obj)

Frees the native rust ReturnOperation object.

Returns

void

return_operation_reducers

struct ReducerIterator* return_operation_reducers(const struct ReturnOperation* return_operation)

Unwraps the ReturnOperation instance as a Reduce variant, and returns the reducers applied. Will panic if the instance is not a Reduce variant.

Returns

struct ReducerIterator*

return_operation_single_selector

char* return_operation_single_selector(const struct ReturnOperation* return_operation)

Unwraps the ReturnOperation instance as a Single variant, and returns the selector applied. Will panic if the instance is not a Single variant.

Returns

char*

return_operation_single_variables

struct VariableIterator* return_operation_single_variables(const struct ReturnOperation* return_operation)

Unwraps the ReturnOperation instance as a Single variant, and returns the returned variables. Will panic if the instance is not a Single variant.

Returns

struct VariableIterator*

return_operation_stream_variables

struct VariableIterator* return_operation_stream_variables(const struct ReturnOperation* return_operation)

Unwraps the ReturnOperation instance as a Stream variant, and returns the returned variables. Will panic if the instance is not a Stream variant.

Returns

struct VariableIterator*

return_operation_variant

enum ReturnOperationVariant return_operation_variant(const struct ReturnOperation* return_operation)

Returns the variant of the ReturnOperation.

Returns

enum ReturnOperationVariant

reducer

Struct Reducer

class

Representation of a reducer used either in a PipelineStage::Reduce or in a function’s ReturnOperation.

reducer_drop

void reducer_drop(struct Reducer* obj)

Frees the native rust Reducer object.

Returns

void

reducer_get_arguments

struct VariableIterator* reducer_get_arguments(const struct Reducer* reducer)

The arguments to this Reducer. e.g. $x in sum($x)

Returns

struct VariableIterator*

reducer_get_name

char* reducer_get_name(const struct Reducer* reducer)

The name of the operation applied by this Reducer. e.g. sum in sum($x)

Returns

char*

reduceriterator

reducer_iterator_drop

void reducer_iterator_drop(struct ReducerIterator* it)

Frees the native rust ReducerIterator object.

Returns

void

reducer_iterator_next

struct Reducer* reducer_iterator_next(struct ReducerIterator* it)

Forwards the ReducerIterator and returns the next Reducer if it exists, or null if there are no more elements.

Returns

struct Reducer*

reduceassignment

Struct ReduceAssignment

class

Representation of an assignment from a reduction in a PipelineStage::Reduce, such as reduce $c = sum($x);

reduce_assignment_drop

void reduce_assignment_drop(struct ReduceAssignment* obj)

Frees the native rust ReduceAssignment object.

Returns

void

reduce_assignment_get_assigned

struct Variable* reduce_assignment_get_assigned(const struct ReduceAssignment* reduce_assignment)

The variable being assigned to in this ReduceAssignment. e.g. $c in $c = sum($x)

Returns

struct Variable*

reduce_assignment_get_reducer

struct Reducer* reduce_assignment_get_reducer(const struct ReduceAssignment* reduce_assignment)

The reducer applied in this ReduceAssignment. e.g. sum($x) in $c = sum($x)

Returns

struct Reducer*

reduceassignmentiterator

reduce_assignment_iterator_drop

void reduce_assignment_iterator_drop(struct ReduceAssignmentIterator* it)

Frees the native rust ReduceAssignmentIterator object.

Returns

void

reduce_assignment_iterator_next

struct ReduceAssignment* reduce_assignment_iterator_next(struct ReduceAssignmentIterator* it)

Forwards the ReduceAssignmentIterator and returns the next ReduceAssignment if it exists, or null if there are no more elements.

Returns

struct ReduceAssignment*

sortvariable

Struct SortVariable

class

The variable being sorted on and the ordering of the sort, as used in a PipelineStage::Sort, e.g. sort $v desc

sort_variable_drop

void sort_variable_drop(struct SortVariable* obj)

Frees the native rust SortVariable object.

Returns

void

sort_variable_get_order

enum SortOrder sort_variable_get_order(const struct SortVariable* sort_variable)

Returns the sort order for the variable being sorted on.

Returns

enum SortOrder

sort_variable_get_variable

struct Variable* sort_variable_get_variable(const struct SortVariable* sort_variable)

Returns the variable being sorted on.

Returns

struct Variable*

sortvariableiterator

sort_variable_iterator_drop

void sort_variable_iterator_drop(struct SortVariableIterator* it)

Frees the native rust SortVariableIterator object.

Returns

void

sort_variable_iterator_next

struct SortVariable* sort_variable_iterator_next(struct SortVariableIterator* it)

Forwards the SortVariableIterator and returns the next SortVariable if it exists, or null if there are no more elements.

Returns

struct SortVariable*

sortorder

Struct SortOrder

class

The order of a variable being sorted on in a PipelineStage::Sort

Enum SortOrder

class

The order of a variable being sorted on in a PipelineStage::Sort

Enum constants
Name

Ascending

Descending

namedrole

Struct NamedRole

class

A NamedRole vertex is used in links & relates constraints, as multiple relations may have roles with the same name.

named_role_as_u32

uint32_t named_role_as_u32(const struct NamedRole* named_role)

Returns a u32 identifying the named role instance. Meant to be used to implement hash, equality etc.

Returns

uint32_t

named_role_drop

void named_role_drop(struct NamedRole* obj)

Frees the native rust NamedRole object.

Returns

void

named_role_get_name

char* named_role_get_name(const struct NamedRole* named_role)

Returns the role name associated with the NamedRole.

Returns

char*

named_role_get_variable

struct Variable* named_role_get_variable(const struct NamedRole* named_role)

Returns the role-type variable associated with the NamedRole.

Returns

struct Variable*

named_role_string_repr

char* named_role_string_repr(const struct NamedRole* named_role)

Returns a string representation of the NamedRole

Returns

char*

comparator

Struct Comparator

class

A representation of the comparator used in a comparison constraint.

Enum Comparator

class

A representation of the comparator used in a comparison constraint.

Enum constants
Name

Contains

Equal

Greater

GreaterOrEqual

LessOrEqual

LessThan

Like

NotEqual

comparator_get_name

char* comparator_get_name(enum Comparator comparator)

Unwraps the Comparator and returns its name (or symbol).

Returns

char*

Errors

error

Struct Error

class

Represents errors encountered during operation.

check_error

bool check_error(void)

Checks if the error flag was set by the last operation. If true, the error can be retrieved using get_last_error(void)

Returns

bool

error_code

char* error_code(const struct Error* error)

Returns the error code of the Error object

Returns

char*

error_drop

void error_drop(struct Error* error)

Frees the native rust Error object

Returns

void

error_message

char* error_message(const struct Error* error)

Returns the error message of the Error object

Returns

char*

get_last_error

struct Error* get_last_error(void)

Returns the error which set the error flag.

Returns

struct Error*