Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
beicause committed Aug 5, 2024
1 parent aa07abe commit 2265558
Show file tree
Hide file tree
Showing 7 changed files with 3,959 additions and 18 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ jobs:
needs: static-checks
uses: ./.github/workflows/windows_builds.yml

web-build:
if: ${{ vars.DISABLE_GODOT_CI == '' }}
name: 🌐 Web
needs: static-checks
uses: ./.github/workflows/web_builds.yml
# web-build:
# if: ${{ vars.DISABLE_GODOT_CI == '' }}
# name: 🌐 Web
# needs: static-checks
# uses: ./.github/workflows/web_builds.yml

# Third stage: Run auxiliary tests using build artifacts from previous jobs.

Expand Down
2 changes: 1 addition & 1 deletion SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ opts.Add(BoolVariable("opengl3", "Enable the OpenGL/GLES3 rendering driver", Tru
opts.Add(BoolVariable("d3d12", "Enable the Direct3D 12 rendering driver", False))
opts.Add(BoolVariable("openxr", "Enable the OpenXR driver", True))
opts.Add(BoolVariable("use_volk", "Use the volk library to load the Vulkan loader dynamically", True))
opts.Add(BoolVariable("disable_exceptions", "Force disabling exception handling code", True))
opts.Add(BoolVariable("disable_exceptions", "Force disabling exception handling code", False))
opts.Add("custom_modules", "A list of comma-separated directory paths containing custom modules to build.", "")
opts.Add(BoolVariable("custom_modules_recursive", "Detect custom modules recursively for each specified path.", True))

Expand Down
29 changes: 23 additions & 6 deletions modules/a_duckdb/gd_duckdb.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,41 @@

#include "core/config/project_settings.h"
#include "core/object/ref_counted.h"
#include "thirdparty/duckdb.hpp"
#include "core/os/os.h"
#include "thirdparty/duckdb.h"

class DuckDB : public RefCounted {
GDCLASS(DuckDB, RefCounted);

duckdb::DuckDB db = duckdb::DuckDB(nullptr);
duckdb::Connection con = duckdb::Connection(db);
duckdb_database db = nullptr;
duckdb_connection con = nullptr;

String get_res_path(String path) {
if (OS::get_singleton()->has_feature("editor")) {
return ProjectSettings::get_singleton()->globalize_path(path);
} else {
return OS::get_singleton()->get_executable_path().get_base_dir().path_join(path);
}
}

protected:
static void _bind_methods();

public:
void open_file(String path) {
db = duckdb::DuckDB(ProjectSettings::get_singleton()->globalize_path(path).utf8().get_data());
con = duckdb::Connection(db);
String abs_path = path;
String res_path = get_res_path(path);
if (path.begins_with("res://")) {
abs_path = res_path;
} else if (path.begins_with("user://")) {
abs_path = ProjectSettings::get_singleton()->globalize_path(path);
} else {
abs_path = res_path.path_join(path);
}
duckdb_open(path.utf8().get_data(), &db);
duckdb_connect(db, &con);
}
void query(String sql) {
std::unique_ptr<duckdb::MaterializedQueryResult> res = con.Query(sql.utf8().get_data());
}
};
#endif // GD_DUCKDB_H
Loading

0 comments on commit 2265558

Please sign in to comment.