|
Kuzu C++ API
|
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...
#include <connection.h>
Public Member Functions | |
| KUZU_API | Connection (Database *database) |
| Creates a connection to the database. | |
| KUZU_API | ~Connection () |
| Destructs the connection. | |
| KUZU_API void | setMaxNumThreadForExec (uint64_t numThreads) |
| Sets the maximum number of threads to use for execution in the current connection. | |
| KUZU_API uint64_t | getMaxNumThreadForExec () |
| Returns the maximum number of threads to use for execution in the current connection. | |
| KUZU_API std::unique_ptr< QueryResult > | query (std::string_view query) |
| Executes the given query and returns the result. | |
| KUZU_API std::unique_ptr< PreparedStatement > | prepare (std::string_view query) |
| Prepares the given query and returns the prepared statement. | |
| KUZU_API std::unique_ptr< PreparedStatement > | prepareWithParams (std::string_view query, std::unordered_map< std::string, std::unique_ptr< common::Value > > inputParams) |
| Prepares the given query and returns the prepared statement. | |
| template<typename... Args> | |
| std::unique_ptr< QueryResult > | execute (PreparedStatement *preparedStatement, std::pair< std::string, Args >... args) |
| Executes the given prepared statement with args and returns the result. | |
| KUZU_API std::unique_ptr< QueryResult > | executeWithParams (PreparedStatement *preparedStatement, std::unordered_map< std::string, std::unique_ptr< common::Value > > inputParams) |
| Executes the given prepared statement with inputParams and returns the result. | |
| KUZU_API void | interrupt () |
| interrupts all queries currently executing within this connection. | |
| KUZU_API void | setQueryTimeOut (uint64_t timeoutInMS) |
| sets the query timeout value of the current connection. A value of zero (the default) disables the timeout. | |
| template<typename TR, typename... Args> | |
| void | createScalarFunction (std::string name, TR(*udfFunc)(Args...)) |
| template<typename TR, typename... Args> | |
| void | createScalarFunction (std::string name, std::vector< common::LogicalTypeID > parameterTypes, common::LogicalTypeID returnType, TR(*udfFunc)(Args...)) |
| void | addUDFFunctionSet (std::string name, function::function_set func) |
| void | removeUDFFunction (std::string name) |
| template<typename TR, typename... Args> | |
| void | createVectorizedFunction (std::string name, function::scalar_func_exec_t scalarFunc) |
| void | createVectorizedFunction (std::string name, std::vector< common::LogicalTypeID > parameterTypes, common::LogicalTypeID returnType, function::scalar_func_exec_t scalarFunc) |
| ClientContext * | getClientContext () |
Friends | |
| class | testing::BaseGraphTest |
| class | testing::PrivateGraphTest |
| class | testing::TestHelper |
| class | benchmark::Benchmark |
| class | ConnectionExecuteAsyncWorker |
| class | ConnectionQueryAsyncWorker |
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.
Creates a connection to the database.
| database | A pointer to the database instance that this connection will be connected to. |
| KUZU_API kuzu::main::Connection::~Connection | ( | ) |
Destructs the connection.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Executes the given prepared statement with args and returns the result.
| preparedStatement | The prepared statement to execute. |
| args | The parameter pack where each arg is a std::pair with the first element being parameter name and second element being parameter value. |
| KUZU_API std::unique_ptr< QueryResult > kuzu::main::Connection::executeWithParams | ( | PreparedStatement * | preparedStatement, |
| std::unordered_map< std::string, std::unique_ptr< common::Value > > | inputParams ) |
Executes the given prepared statement with inputParams and returns the result.
| preparedStatement | The prepared statement to execute. |
| inputParams | The parameter pack where each arg is a std::pair with the first element being parameter name and second element being parameter value. |
|
inline |
| KUZU_API uint64_t kuzu::main::Connection::getMaxNumThreadForExec | ( | ) |
Returns the maximum number of threads to use for execution in the current connection.
| KUZU_API void kuzu::main::Connection::interrupt | ( | ) |
interrupts all queries currently executing within this connection.
| KUZU_API std::unique_ptr< PreparedStatement > kuzu::main::Connection::prepare | ( | std::string_view | query | ) |
Prepares the given query and returns the prepared statement.
| query | The query to prepare. |
| KUZU_API std::unique_ptr< PreparedStatement > kuzu::main::Connection::prepareWithParams | ( | std::string_view | query, |
| std::unordered_map< std::string, std::unique_ptr< common::Value > > | inputParams ) |
Prepares the given query and returns the prepared statement.
| query | The query to prepare. |
| inputParams | The parameter pack where each arg is a pair with the first element being parameter name and second element being parameter value. The only parameters that are relevant during prepare are ones that will be substituted with a scan source. Any other parameters will either be ignored or will cause an error to be thrown. |
| KUZU_API std::unique_ptr< QueryResult > kuzu::main::Connection::query | ( | std::string_view | query | ) |
Executes the given query and returns the result.
| query | The query to execute. |
|
inline |
| KUZU_API void kuzu::main::Connection::setMaxNumThreadForExec | ( | uint64_t | numThreads | ) |
Sets the maximum number of threads to use for execution in the current connection.
| numThreads | The number of threads to use for execution in the current connection. |
| KUZU_API void kuzu::main::Connection::setQueryTimeOut | ( | uint64_t | timeoutInMS | ) |
sets the query timeout value of the current connection. A value of zero (the default) disables the timeout.
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |