Skip to content

Keepup libchdb.so/chdb.h with main repo #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
node_modules
build
/metadata
/user_defined
/user_defined
.vscode/
libchdb.so
25 changes: 23 additions & 2 deletions binding.gyp
Original file line number Diff line number Diff line change
@@ -1,13 +1,34 @@
{
"variables": {
"openssl_fips": "",
},
"targets": [
{
"target_name": "action_before_build",
"type": "none",
"hard_dependency": 1,
"actions": [
{
"action_name": "update_libchdb",
"inputs": [],
"outputs": [
"<(module_root_dir)/libchdb.so"
],
"action": ["./update_libchdb.sh"]
}
]
},
{
"target_name": "addon",
"sources": [ "src/addon.cc" ],
"dependencies": [
"action_before_build"
],
"include_dirs": [
"<!(node -p \"require('node-addon-api').include\")",
"<!@(node -p \"require('node-addon-api').include\")",
"include/"
],
"libraries": [ "-L/usr/src/chdb-node-addon/lib", "-lchdb" ],
"libraries": [ "-L<(module_root_dir)", "-lchdb" ],
"cflags!": [ "-fno-exceptions" ],
"cflags_cc!": [ "-fno-exceptions" ],
"defines": [ "NAPI_DISABLE_CPP_EXCEPTIONS" ]
Expand Down
28 changes: 28 additions & 0 deletions include/chdb.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#pragma once

#ifdef __cplusplus
# include <cstddef>
# include <cstdint>
extern "C" {
#else
# include <stddef.h>
# include <stdint.h>
#endif

#define CHDB_EXPORT __attribute__((visibility("default")))
struct CHDB_EXPORT local_result
{
char * buf;
size_t len;
void * _vec; // std::vector<char> *, for freeing
double elapsed;
uint64_t rows_read;
uint64_t bytes_read;
};

CHDB_EXPORT struct local_result * query_stable(int argc, char ** argv);
CHDB_EXPORT void free_result(struct local_result * result);

#ifdef __cplusplus
}
#endif
25 changes: 0 additions & 25 deletions include/libchdb.h

This file was deleted.

192 changes: 0 additions & 192 deletions include/napi-inl.deprecated.h

This file was deleted.

Loading