|
| 1 | + |
| 2 | + |
1 | 3 | # Kuzu Godot
|
2 | 4 |
|
3 | 5 | **Godot 4.4 is currently used Version**
|
4 | 6 |
|
5 |
| -Bindings for Kuzu in Godot |
| 7 | +Bindings for [Kuzu](https://github.com/kuzudb/kuzu) in [Godot](https://github.com/godotengine/godot) |
6 | 8 |
|
7 |
| -Embedded property graph database built for speed. Vector search and full-text search built in. Using Graph Query Language of Cypher. |
| 9 | +Embedded property graph database built for speed. Using Graph Query Language of [Cypher](https://opencypher.org/resources/). |
8 | 10 |
|
9 | 11 | # Overview
|
10 | 12 |
|
11 |
| -# Setup |
12 |
| - |
13 |
| -## Binaries |
14 |
| - |
15 |
| -Requires the Kuzu Binaries in the `bin/<platform>/kuzu` folders. |
| 13 | +1. Create an Instance of Kuzu |
| 14 | +1. Set the Database Folder Path |
| 15 | +1. Initialize the Database |
| 16 | +1. Create a Connection to the DB with thread count |
16 | 17 |
|
17 |
| -## Windows |
| 18 | +```gdscript |
18 | 19 |
|
19 |
| -1. Setup a C++ Environment |
20 |
| - 1. Possible Setup for VS Code : https://code.visualstudio.com/docs/cpp/config-mingw |
| 20 | +var myKuzuDB : KuzuGD = KuzuGD.new(); # Instantiate |
| 21 | +var db_path = ProjectSettings.globalize_path("res://data/database/kuzu_db"); |
| 22 | +var success_db = myKuzuDB.kuzu_init(db_path); # Set Path |
| 23 | +var success_connect = myKuzuDB.kuzu_connect(1); # Activate Connection |
21 | 24 |
|
22 |
| -Ensure that C++ can run : |
23 |
| - |
24 |
| -```bash |
25 |
| -gcc --version |
26 |
| -g++ --version |
27 |
| -gdb --version |
28 | 25 | ```
|
29 | 26 |
|
30 |
| -# Godot |
| 27 | +1. Execute Queries |
| 28 | +1. Define Tables |
| 29 | +1. Write Data |
| 30 | +1. Read Data |
31 | 31 |
|
32 |
| -## Godot GDExtension |
| 32 | +```gdscript |
33 | 33 |
|
34 |
| -[This repository uses the Godot quickstart template for GDExtension development with Godot 4.0+.](https://github.com/godotengine/godot-cpp-template) |
| 34 | +# Define Tables |
| 35 | +myKuzuDB.execute_query("CREATE NODE TABLE IF NOT EXISTS person(name STRING, age INT64, PRIMARY KEY(name));"); |
35 | 36 |
|
36 |
| -### Contents |
| 37 | +# Write Data |
| 38 | +myKuzuDB.execute_query("CREATE (:person {name: 'Alice', age: 30});"); |
37 | 39 |
|
38 |
| -- godot-cpp as a submodule (`godot-cpp/`) |
39 |
| -- (`demo/`) Godot 4.4 Project that tests the Extension |
40 |
| -- preconfigured source files for C++ development of the GDExtension (`src/`) |
41 |
| -- setup to automatically generate `.xml` files in a `doc_classes/` directory to be parsed by Godot as [GDExtension built-in documentation](https://docs.godotengine.org/en/stable/tutorials/scripting/gdextension/gdextension_docs_system.html) |
| 40 | +# Read Data |
| 41 | +var queryResult : Array = myKuzuDB.execute_query("MATCH (p:person) RETURN p.*"); |
| 42 | +print(queryResult); |
42 | 43 |
|
43 |
| -## Github |
| 44 | +``` |
44 | 45 |
|
45 |
| -_Currently Commented Out for Base Development_ |
| 46 | +# Setup |
46 | 47 |
|
47 |
| -- GitHub Issues template (`.github/ISSUE_TEMPLATE.yml`) |
48 |
| -- GitHub CI/CD workflows to publish your library packages when creating a release (`.github/workflows/builds.yml`) |
| 48 | +## Building from Source |
49 | 49 |
|
50 |
| -This repository comes with a GitHub action that builds the GDExtension for cross-platform use. It triggers automatically for each pushed change. You can find and edit it in [builds.yml](.github/workflows/builds.yml). |
51 |
| -After a workflow run is complete, you can find the file `godot-cpp-template.zip` on the `Actions` tab on GitHub. |
| 50 | +Requires the Kuzu Binaries in the `bin/<platform>/kuzu` folders, pythons Scons, Godot, g++ compiler. |
0 commit comments