Skip to content

Commit b749099

Browse files
committed
Rough draft for Kuzu 0.11.2, conversion to c++ api
Transition to using the C++ api, previously using the C api. Write a rough draft to bind Kuzu 0.11.2
1 parent 73ec2d3 commit b749099

File tree

9 files changed

+1604
-1432
lines changed

9 files changed

+1604
-1432
lines changed

.github/workflows/builds.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,19 +60,19 @@
6060
# run: |
6161
# case "${{ matrix.target.platform }}-${{ matrix.target.arch }}" in
6262
# linux-x86_64)
63-
# KUZU_URL="https://github.com/kuzudb/kuzu/releases/download/v0.10.0/libkuzu-linux-x86_64.tar.gz"
63+
# KUZU_URL="https://github.com/kuzudb/kuzu/releases/download/v0.11.2/libkuzu-linux-x86_64.tar.gz"
6464
# ;;
6565
# linux-aarch64)
66-
# KUZU_URL="https://github.com/kuzudb/kuzu/releases/download/v0.10.0/libkuzu-linux-aarch64.tar.gz"
66+
# KUZU_URL="https://github.com/kuzudb/kuzu/releases/download/v0.11.2/libkuzu-linux-aarch64.tar.gz"
6767
# ;;
6868
# windows-x86_64)
69-
# KUZU_URL="https://github.com/kuzudb/kuzu/releases/download/v0.10.0/libkuzu-windows-x86_64.zip"
69+
# KUZU_URL="https://github.com/kuzudb/kuzu/releases/download/v0.11.2/libkuzu-windows-x86_64.zip"
7070
# ;;
7171
# macos-universal)
72-
# KUZU_URL="https://github.com/kuzudb/kuzu/releases/download/v0.10.0/libkuzu-osx-universal.tar.gz"
72+
# KUZU_URL="https://github.com/kuzudb/kuzu/releases/download/v0.11.2/libkuzu-osx-universal.tar.gz"
7373
# ;;
7474
# android-armv8a)
75-
# KUZU_URL="https://github.com/kuzudb/kuzu/releases/download/v0.10.0/libkuzu-android-armv8a.tar.gz"
75+
# KUZU_URL="https://github.com/kuzudb/kuzu/releases/download/v0.11.2/libkuzu-android-armv8a.tar.gz"
7676
# ;;
7777
# *)
7878
# echo "Unsupported platform: ${{ matrix.target.platform }}-${{ matrix.target.arch }}"

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.11.2
2+
3+
Upgrade to Kuzu 0.11.2
4+
15
# 0.10.0
26

37
Initial Setup

Documentation/README_ARCHITECTURE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ gdb --version
3535
Install Gdb && Valgrind
3636

3737
1. Build for Linux
38-
1. `scons target=linux debug_symbols=yes`
38+
1. `scons target=template_debug debug_symbols=yes`
3939
1. Run Godot Demo Project with Debugger
4040
1. `gdb --args ./Godot_v4.4.1-stable_linux.x86_64 --path /<path to >/KuzuGD/demo/`
4141
1. Memory Issues run Valgrind
4242
1. `valgrind --tool=memcheck --track-origins=yes ./Godot_v4.4.1-stable_linux.x86_64 --path /mnt/<path to>/KuzuGD/demo`
43-
1. `valgrind --tool=memcheck --track-origins=yes --show-leak-kinds=all ./Godot_v4.4.1-stable_linux.x86_64 --path /mnt/<path to>/KuzuGD/demo | grep libkuzu`
43+
1. `valgrind -s --tool=memcheck --track-origins=yes --show-leak-kinds=all ./Godot_v4.4.1-stable_linux.x86_64 --path /mnt/<path to>/KuzuGD/demo | grep libkuzu`
4444

4545
## Debugging Windows
4646

demo/kuzu_test.gd

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@ func _ready():
1111
if success_db:
1212
print("Database initialized successfully!");
1313
else:
14-
print("Failed to initialize database.");
14+
print("KuzuGD ERROR | Failed to initialize database.");
1515

16+
# Kuzu Connection must be established before you can run any queries are connection related functions
1617
var success_connect = myKuzuDB.kuzu_connect(1);
1718

1819
if success_connect:
1920
print("Database Connection Established!");
2021
else:
21-
print("Failed to create a connection to the database.");
22+
print("KuzuGD ERROR | Failed to create a connection to the database.");
2223

2324
#
2425
# Validate Simple queries
@@ -73,3 +74,32 @@ func _ready():
7374
# Breaking
7475
# Test Prepared Query Result
7576
# [{ "p.name": "Jessica" }]
77+
78+
79+
#
80+
#
81+
# Testing Prepare Queries
82+
#
83+
#
84+
85+
var stmt = KuzuGD.prepare_statement("MATCH (p:Person) WHERE p.age > $min_age RETURN p.name, p.age")
86+
var results = KuzuGD.execute_prepared(stmt, {"min_age": 30})
87+
for row in results:
88+
print(row["p.name"], row["p.age"])
89+
90+
# Test prepare_with_params
91+
var stmt = KuzuGD.prepare_with_params(
92+
"MATCH (p:Person) USING INDEX p.name = $name RETURN p",
93+
{"name": "Alice"}
94+
)
95+
96+
var results = KuzuGD.execute_prepared(stmt, {})
97+
for row in results:
98+
print(row)
99+
100+
# Test Query Summary
101+
102+
var result = kuzu.query_result("MATCH (n) RETURN n")
103+
print(result.get_summary().get_execution_time())
104+
for row in result.to_array():
105+
print(row)

0 commit comments

Comments
 (0)