69 std::unordered_map<std::string, std::unique_ptr<common::Value>> inputParams);
78 template<
typename... Args>
80 std::pair<std::string, Args>... args) {
81 std::unordered_map<std::string, std::unique_ptr<common::Value>> inputParameters;
92 std::unordered_map<std::string, std::unique_ptr<common::Value>> inputParams);
104 template<
typename TR,
typename... Args>
109 template<
typename TR,
typename... Args>
113 std::move(parameterTypes), returnType));
117 addScalarFunction(name, std::move(func));
122 template<
typename TR,
typename... Args>
124 addScalarFunction(name,
132 std::move(parameterTypes), returnType));
138 template<
typename T,
typename... Args>
140 std::unordered_map<std::string, std::unique_ptr<common::Value>> params,
141 std::pair<std::string, T> arg, std::pair<std::string, Args>... args) {
142 return clientContext->executeWithParams(preparedStatement, std::move(params), arg, args...);
146 LBUG_API void removeScalarFunction(std::string name);
148 std::unique_ptr<QueryResult> queryWithID(std::string_view
query, uint64_t queryID);
150 std::unique_ptr<QueryResult> executeWithParamsWithID(PreparedStatement* preparedStatement,
151 std::unordered_map<std::string, std::unique_ptr<common::Value>> inputParams,
156 std::unique_ptr<ClientContext> clientContext;
157 std::shared_ptr<common::DatabaseLifeCycleManager> dbLifeCycleManager;
#define LBUG_API
Definition api.h:25
Contain client side configuration. We make profiler associated per query, so the profiler is not main...
Definition client_context.h:72
friend class ConnectionExecuteAsyncWorker
Definition connection.h:19
void removeUDFFunction(std::string name)
Definition connection.h:120
LBUG_API void setMaxNumThreadForExec(uint64_t numThreads)
Sets the maximum number of threads to use for execution in the current connection.
LBUG_API std::unique_ptr< PreparedStatement > prepare(std::string_view query)
Prepares the given query and returns the prepared statement.
friend class testing::PrivateGraphTest
Definition connection.h:16
LBUG_API Connection(Database *database)
Creates a connection to the database.
void createVectorizedFunction(std::string name, function::scalar_func_exec_t scalarFunc)
Definition connection.h:123
void createScalarFunction(std::string name, TR(*udfFunc)(Args...))
Definition connection.h:105
LBUG_API std::unique_ptr< QueryResult > queryAsArrow(std::string_view query, int64_t chunkSize)
LBUG_API void setQueryTimeOut(uint64_t timeoutInMS)
sets the query timeout value of the current connection. A value of zero (the default) disables the ti...
LBUG_API ~Connection()
Destructs the connection.
std::unique_ptr< QueryResult > execute(PreparedStatement *preparedStatement, std::pair< std::string, Args >... args)
Executes the given prepared statement with args and returns the result.
Definition connection.h:79
void addUDFFunctionSet(std::string name, function::function_set func)
Definition connection.h:116
friend class testing::TestHelper
Definition connection.h:17
friend class benchmark::Benchmark
Definition connection.h:18
LBUG_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.
LBUG_API std::unique_ptr< QueryResult > query(std::string_view query)
Executes the given query and returns the result.
LBUG_API void interrupt()
interrupts all queries currently executing within this connection.
ClientContext * getClientContext()
Definition connection.h:135
friend class testing::BaseGraphTest
Definition connection.h:15
void createScalarFunction(std::string name, std::vector< common::LogicalTypeID > parameterTypes, common::LogicalTypeID returnType, TR(*udfFunc)(Args...))
Definition connection.h:110
friend class ConnectionQueryAsyncWorker
Definition connection.h:20
LBUG_API uint64_t getMaxNumThreadForExec()
Returns the maximum number of threads to use for execution in the current connection.
void createVectorizedFunction(std::string name, std::vector< common::LogicalTypeID > parameterTypes, common::LogicalTypeID returnType, function::scalar_func_exec_t scalarFunc)
Definition connection.h:128
LBUG_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.
Database class is the main class of Lbug. It manages all database components.
Definition database.h:95
A prepared statement is a parameterized query which can avoid planning the same query for repeated ex...
Definition prepared_statement.h:46
LogicalTypeID
Definition types.h:184
std::function< void(const std::vector< std::shared_ptr< common::ValueVector > > &, const std::vector< common::SelectionVector * > &, common::ValueVector &, common::SelectionVector *, void *)> scalar_func_exec_t
Definition scalar_function.h:18
std::vector< std::unique_ptr< Function > > function_set
Definition function.h:44
Definition bind_input.h:16
Definition array_utils.h:7
static function_set getVectorizedFunction(std::string name, scalar_func_exec_t execFunc)
Definition udf_function.h:266
static function_set getFunction(std::string name, TR(*udfFunc)(Args...), std::vector< common::LogicalTypeID > parameterTypes, common::LogicalTypeID returnType)
Definition udf_function.h:246