You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(base) raphy@raohy:~/kuzu-cpp$ cmake -B builddir
-- The C compiler identification is GNU 13.3.0
-- The CXX compiler identification is GNU 14.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done (0.3s)
-- Generating done (0.0s)
-- Build files have been written to: /home/raphy/kuzu-cpp/builddir
(base) raphy@raohy:~/kuzu-cpp$ cmake --build builddir/
[ 50%] Building CXX object CMakeFiles/MyPrj.dir/src/main.cpp.o
[100%] Linking CXX executable MyPrj
[100%] Built target MyPrj
(base) raphy@raohy:~/kuzu-cpp$ ./builddir/MyPrj
(base) raphy@raohy:~/kuzu-cpp$
CMakeLists.txt file :
cmake_minimum_required(VERSION 3.15...3.31)
project(MyPrj)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
#find_package(kuzu)
add_executable(${PROJECT_NAME}
src/main.cpp
)
target_link_directories(${PROJECT_NAME} PUBLIC
./src/KuzuDB/lib
)
target_include_directories(${PROJECT_NAME} PUBLIC
./src/KuzuDB/include
)
target_link_libraries(${PROJECT_NAME} PUBLIC
kuzu
)
source file :
./src/main.cpp :
#include <iostream>
#include "./KuzuDB/include/kuzu.hpp"
using namespace kuzu::main;
using namespace std;
int main() {
// Create an empty on-disk database and connect to it
SystemConfig systemConfig;
auto database = make_unique<Database>("test", systemConfig);
// Connect to the database.
auto connection = make_unique<Connection>(database.get());
// Create the schema.
connection->query("CREATE NODE TABLE User(name STRING, age INT64, PRIMARY KEY (name))");
connection->query("CREATE NODE TABLE City(name STRING, population INT64, PRIMARY KEY (name))");
connection->query("CREATE REL TABLE Follows(FROM User TO User, since INT64)");
connection->query("CREATE REL TABLE LivesIn(FROM User TO City)");
// Load data.
connection->query("COPY User FROM \"user.csv\"");
connection->query("COPY City FROM \"city.csv\"");
connection->query("COPY Follows FROM \"follows.csv\"");
connection->query("COPY LivesIn FROM \"lives-in.csv\"");
// Execute a simple query.
auto result =
connection->query("MATCH (a:User)-[f:Follows]->(b:User) RETURN a.name, f.since, b.name;");
// Output query result.
while (result->hasNext()) {
auto row = result->getNext();
std::cout << row->getValue(0)->getValue<string>() << " "
<< row->getValue(1)->getValue<int64_t>() << " "
<< row->getValue(2)->getValue<string>() << std::endl;
}
return 0;
}
Folder content :
(base) raphy@raohy:~/kuzu-cpp$ ls -lah ./src
total 44K
drwxrwxr-x 3 raphy raphy 4,0K mar 5 14:16 .
drwxrwxr-x 6 raphy raphy 4,0K mar 5 14:14 ..
-rw-rw-r-- 1 raphy raphy 46 mar 5 14:07 city.csv
-rw-rw-r-- 1 raphy raphy 196 mar 5 14:07 copy.cypher
-rw-rw-r-- 1 raphy raphy 70 mar 5 14:07 follows.csv
drwxrwxr-x 4 raphy raphy 4,0K mar 5 13:54 KuzuDB
-rw-rw-r-- 1 raphy raphy 60 mar 5 14:07 lives-in.csv
-rw-rw-r-- 1 raphy raphy 1,5K mar 5 14:10 main.cpp
-rw-rw-r-- 1 raphy raphy 689 mar 5 14:04 OLDmain.cpp
-rw-rw-r-- 1 raphy raphy 241 mar 5 14:07 schema.cypher
-rw-rw-r-- 1 raphy raphy 37 mar 5 14:08 user.csv
(base) raphy@raohy:~/kuzu-cpp$ ls -lah ./src/KuzuDB/
total 16K
drwxrwxr-x 4 raphy raphy 4,0K mar 5 13:54 .
drwxrwxr-x 3 raphy raphy 4,0K mar 5 14:16 ..
drwxrwxr-x 2 raphy raphy 4,0K mar 5 13:53 include
drwxrwxr-x 2 raphy raphy 4,0K mar 5 13:54 lib
(base) raphy@raohy:~/kuzu-cpp$ ls -lah ./src/KuzuDB/include/
total 392K
drwxrwxr-x 2 raphy raphy 4,0K mar 5 13:53 .
drwxrwxr-x 4 raphy raphy 4,0K mar 5 13:54 ..
-rw-r--r-- 1 raphy raphy 69K feb 15 09:04 kuzu.h
-rw-r--r-- 1 raphy raphy 312K feb 24 16:49 kuzu.hpp
(base) raphy@raohy:~/kuzu-cpp$
(base) raphy@raohy:~/kuzu-cpp$ ls -lah ./src/KuzuDB/lib/
total 22M
drwxrwxr-x 2 raphy raphy 4,0K mar 5 13:54 .
drwxrwxr-x 4 raphy raphy 4,0K mar 5 13:54 ..
-rwxr-xr-x 1 raphy raphy 22M feb 24 16:49 libkuzu.so
While this code
produces this correct output:
I get no output from "Quick start" get-started example: https://docs.kuzudb.com/get-started/
CMakeLists.txt
file :source file :
./src/main.cpp
:Folder content :
OS
:Ubuntu 24.04
gcc
(Ubuntu 13.3.0-6ubuntu2~24.04) :13.3.0
What am I missing and / or doing wrong? How to make it work?
The text was updated successfully, but these errors were encountered: