Skip to content
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
all: build

./node_modules:
npm install --build-from-source
npm install --ignore-scripts

build: ./node_modules
./node_modules/.bin/node-pre-gyp build -j max --loglevel=silent
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"gypfile": true,
"dependencies": {
"@mapbox/node-pre-gyp": "^1.0.0",
"node-addon-api": "*",
"node-addon-api": "^7.0.0",
"node-gyp": "^9.3.0"
},
"binary": {
Expand Down
8 changes: 4 additions & 4 deletions src/statement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,10 +377,10 @@ struct RunPreparedTask : public Task {
// query results, the string data is owned by the QueryResult
auto result_ref_ptr = new std::shared_ptr<duckdb::QueryResult>(result_ptr);

auto array_buffer =
Napi::ArrayBuffer::New(env, (void *)blob.GetData(), blob.GetSize(), deleter, result_ref_ptr);
auto array_buffer = Napi::Buffer<char>::NewOrCopy(env, (char *)blob.GetData(), blob.GetSize(),
deleter, result_ref_ptr);

auto typed_array = Napi::Uint8Array::New(env, blob.GetSize(), array_buffer, 0);
auto typed_array = Napi::TypedArrayOf<char>(env, array_buffer);

// TODO we should handle this in duckdb probably
if (is_header) {
Expand Down Expand Up @@ -708,7 +708,7 @@ struct GetNextArrowIpcTask : public Task {
delete static_cast<unique_ptr<duckdb::DataChunk> *>(hint);
};
auto array_buffer =
Napi::ArrayBuffer::New(env, (void *)blob.GetData(), blob.GetSize(), deleter, data_chunk_ptr);
Napi::Buffer<char>::NewOrCopy(env, (char *)blob.GetData(), blob.GetSize(), deleter, data_chunk_ptr);

deferred.Resolve(array_buffer);
}
Expand Down