duckdb 0.3.3-dev6.0 → 0.3.3-dev683.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Makefile +2 -0
- package/binding.gyp +8 -8
- package/lib/duckdb.js +108 -20
- package/package.json +1 -1
- package/src/connection.cpp +274 -1
- package/src/database.cpp +1 -0
- package/src/duckdb.cpp +27044 -21585
- package/src/duckdb.hpp +5556 -5090
- package/src/duckdb_node.hpp +9 -0
- package/src/parquet-amalgamation.cpp +36686 -36681
- package/test/udf.test.js +149 -0
package/src/duckdb_node.hpp
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
#define NODE_ADDON_API_DISABLE_DEPRECATED
|
|
3
3
|
#include <napi.h>
|
|
4
4
|
#include <queue>
|
|
5
|
+
#include <unordered_map>
|
|
5
6
|
|
|
6
7
|
#include "duckdb.hpp"
|
|
7
8
|
|
|
@@ -76,6 +77,11 @@ private:
|
|
|
76
77
|
static Napi::FunctionReference constructor;
|
|
77
78
|
};
|
|
78
79
|
|
|
80
|
+
struct JSArgs;
|
|
81
|
+
void DuckDBNodeUDFLauncher(Napi::Env env, Napi::Function jsudf, nullptr_t *, JSArgs *data);
|
|
82
|
+
|
|
83
|
+
typedef Napi::TypedThreadSafeFunction<nullptr_t, JSArgs, DuckDBNodeUDFLauncher> DuckDBNodeUDFFUnction;
|
|
84
|
+
|
|
79
85
|
class Connection : public Napi::ObjectWrap<Connection> {
|
|
80
86
|
public:
|
|
81
87
|
Connection(const Napi::CallbackInfo &info);
|
|
@@ -85,6 +91,8 @@ public:
|
|
|
85
91
|
public:
|
|
86
92
|
Napi::Value Prepare(const Napi::CallbackInfo &info);
|
|
87
93
|
Napi::Value Exec(const Napi::CallbackInfo &info);
|
|
94
|
+
Napi::Value Register(const Napi::CallbackInfo &info);
|
|
95
|
+
Napi::Value Unregister(const Napi::CallbackInfo &info);
|
|
88
96
|
|
|
89
97
|
static bool HasInstance(Napi::Value val) {
|
|
90
98
|
Napi::Env env = val.Env();
|
|
@@ -99,6 +107,7 @@ public:
|
|
|
99
107
|
static Napi::FunctionReference constructor;
|
|
100
108
|
std::unique_ptr<duckdb::Connection> connection;
|
|
101
109
|
Database *database_ref;
|
|
110
|
+
std::unordered_map<std::string, DuckDBNodeUDFFUnction> udfs;
|
|
102
111
|
};
|
|
103
112
|
|
|
104
113
|
struct StatementParam;
|