Repository navigation
Basic UDF support for Node API - #3092
Conversation
samansmink
left a comment
There was a problem hiding this comment.
My node API experience is very limited but I added two small comments. The rest looks good to me!
|
I seem to have broken something wrt prepare(). Will have a look tomorrow. |
| for (let i = 0; i < descr.rows; ++i) { | ||
| const res = fun(); | ||
| out_data[i] = res; | ||
| out_validity[i] = res == undefined ? 0 : 1; |
There was a problem hiding this comment.
I'd prefer null over undefined here as return type for nulls.
Maybe res === undefined || res === null ?
There was a problem hiding this comment.
So what happens if we get undefined then?
There was a problem hiding this comment.
maybe out_validity[i] = (res == undefined || res === null)? 0 : 1; ?
I just thought that supporting an actual null as return value might be semantically better.
|
The Node 14 crash seems related to node-ffi-napi/ref-napi#54 |
| python3 scripts/format.py --all --check --silent | ||
|
|
||
| format-fix: | ||
| rm -rf src/amalgamation/* |
There was a problem hiding this comment.
Should these files not be ignored by the format script already?
| include_directories(/usr/local/lib/node_modules/node-addon-api/) | ||
| include_directories(/usr/local/Cellar/node/14.12.0/include/node/) | ||
| include_directories(/opt/homebrew/lib/node_modules/node-addon-api) | ||
| include_directories(/opt/homebrew/Cellar/node/17.4.0/include/node) |
There was a problem hiding this comment.
Is there a better way of getting these include directories?
This PR adds basic JS UDFs for the Node API. Here is a minimal example: