duckdb 0.7.2-dev333.0 → 0.7.2-dev457.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/binding.gyp +1 -0
- package/lib/duckdb.d.ts +42 -0
- package/package.json +1 -1
- package/src/connection.cpp +1 -2
- package/src/database.cpp +1 -1
- package/src/duckdb/extension/icu/icu-extension.cpp +2 -0
- package/src/duckdb/extension/icu/icu-list-range.cpp +207 -0
- package/src/duckdb/extension/icu/include/icu-list-range.hpp +17 -0
- package/src/duckdb/extension/json/json_functions/read_json.cpp +6 -5
- package/src/duckdb/extension/parquet/include/parquet_timestamp.hpp +0 -1
- package/src/duckdb/extension/parquet/parquet_timestamp.cpp +8 -6
- package/src/duckdb/src/common/exception.cpp +15 -1
- package/src/duckdb/src/common/preserved_error.cpp +7 -5
- package/src/duckdb/src/execution/operator/scan/physical_positional_scan.cpp +20 -5
- package/src/duckdb/src/execution/physical_plan/plan_aggregate.cpp +9 -1
- package/src/duckdb/src/execution/physical_plan/plan_distinct.cpp +5 -8
- package/src/duckdb/src/execution/physical_plan/plan_positional_join.cpp +14 -5
- package/src/duckdb/src/function/aggregate/distributive/bool.cpp +2 -0
- package/src/duckdb/src/function/aggregate/distributive/count.cpp +1 -0
- package/src/duckdb/src/function/aggregate/distributive/minmax.cpp +2 -0
- package/src/duckdb/src/function/aggregate/distributive/sum.cpp +8 -0
- package/src/duckdb/src/function/aggregate/holistic/quantile.cpp +15 -0
- package/src/duckdb/src/function/aggregate/sorted_aggregate_function.cpp +42 -11
- package/src/duckdb/src/function/cast/time_casts.cpp +2 -2
- package/src/duckdb/src/function/function_binder.cpp +1 -8
- package/src/duckdb/src/function/scalar/date/current.cpp +0 -2
- package/src/duckdb/src/function/table/version/pragma_version.cpp +2 -2
- package/src/duckdb/src/include/duckdb/common/exception.hpp +38 -2
- package/src/duckdb/src/include/duckdb/common/preserved_error.hpp +3 -1
- package/src/duckdb/src/include/duckdb/execution/physical_plan_generator.hpp +0 -3
- package/src/duckdb/src/include/duckdb/function/aggregate_function.hpp +6 -3
- package/src/duckdb/src/include/duckdb/function/function_binder.hpp +3 -6
- package/src/duckdb/src/include/duckdb/main/prepared_statement.hpp +2 -0
- package/src/duckdb/src/include/duckdb/main/relation/explain_relation.hpp +2 -1
- package/src/duckdb/src/include/duckdb/main/relation.hpp +2 -1
- package/src/duckdb/src/include/duckdb/optimizer/rule/list.hpp +1 -0
- package/src/duckdb/src/include/duckdb/optimizer/rule/ordered_aggregate_optimizer.hpp +24 -0
- package/src/duckdb/src/include/duckdb/parser/expression/function_expression.hpp +2 -2
- package/src/duckdb/src/include/duckdb/parser/expression/star_expression.hpp +2 -2
- package/src/duckdb/src/include/duckdb/parser/transformer.hpp +2 -0
- package/src/duckdb/src/include/duckdb/planner/binder.hpp +4 -3
- package/src/duckdb/src/include/duckdb/planner/bound_result_modifier.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_aggregate_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression_binder/order_binder.hpp +4 -1
- package/src/duckdb/src/include/duckdb/planner/operator/logical_distinct.hpp +3 -0
- package/src/duckdb/src/main/extension/extension_install.cpp +2 -2
- package/src/duckdb/src/main/prepared_statement.cpp +4 -0
- package/src/duckdb/src/main/relation/explain_relation.cpp +3 -3
- package/src/duckdb/src/main/relation.cpp +3 -2
- package/src/duckdb/src/optimizer/optimizer.cpp +1 -0
- package/src/duckdb/src/optimizer/rule/ordered_aggregate_optimizer.cpp +30 -0
- package/src/duckdb/src/parser/expression/star_expression.cpp +6 -6
- package/src/duckdb/src/parser/parsed_expression_iterator.cpp +7 -1
- package/src/duckdb/src/parser/transform/expression/transform_columnref.cpp +17 -2
- package/src/duckdb/src/parser/transform/expression/transform_function.cpp +45 -40
- package/src/duckdb/src/parser/transform/helpers/transform_groupby.cpp +7 -0
- package/src/duckdb/src/parser/transform/helpers/transform_orderby.cpp +0 -7
- package/src/duckdb/src/planner/bind_context.cpp +2 -25
- package/src/duckdb/src/planner/binder/expression/bind_aggregate_expression.cpp +6 -4
- package/src/duckdb/src/planner/binder/expression/bind_lambda.cpp +3 -2
- package/src/duckdb/src/planner/binder/expression/bind_star_expression.cpp +176 -0
- package/src/duckdb/src/planner/binder/query_node/bind_select_node.cpp +57 -82
- package/src/duckdb/src/planner/binder/query_node/plan_query_node.cpp +11 -0
- package/src/duckdb/src/planner/binder/statement/bind_delete.cpp +1 -1
- package/src/duckdb/src/planner/binder/statement/bind_insert.cpp +2 -2
- package/src/duckdb/src/planner/binder/statement/bind_update.cpp +1 -1
- package/src/duckdb/src/planner/binder.cpp +12 -23
- package/src/duckdb/src/planner/bound_result_modifier.cpp +26 -0
- package/src/duckdb/src/planner/expression/bound_aggregate_expression.cpp +9 -2
- package/src/duckdb/src/planner/expression_iterator.cpp +5 -0
- package/src/duckdb/src/planner/logical_operator_visitor.cpp +5 -0
- package/src/duckdb/src/planner/operator/logical_distinct.cpp +3 -0
- package/src/duckdb/src/storage/storage_info.cpp +1 -1
- package/src/duckdb/third_party/libpg_query/include/nodes/parsenodes.hpp +1 -1
- package/src/duckdb/third_party/libpg_query/src_backend_parser_gram.cpp +8141 -8313
- package/src/duckdb/ub_src_optimizer_rule.cpp +2 -0
- package/src/duckdb/ub_src_planner_binder_expression.cpp +2 -0
- package/src/duckdb_node.hpp +2 -1
- package/src/statement.cpp +5 -5
- package/src/utils.cpp +15 -2
- package/test/syntax_error.test.ts +3 -1
@@ -28,6 +28,8 @@
|
|
28
28
|
|
29
29
|
#include "src/planner/binder/expression/bind_positional_reference_expression.cpp"
|
30
30
|
|
31
|
+
#include "src/planner/binder/expression/bind_star_expression.cpp"
|
32
|
+
|
31
33
|
#include "src/planner/binder/expression/bind_subquery_expression.cpp"
|
32
34
|
|
33
35
|
#include "src/planner/binder/expression/bind_unnest_expression.cpp"
|
package/src/duckdb_node.hpp
CHANGED
@@ -198,7 +198,8 @@ struct TaskHolder {
|
|
198
198
|
|
199
199
|
class Utils {
|
200
200
|
public:
|
201
|
-
static Napi::
|
201
|
+
static Napi::Object CreateError(Napi::Env env, duckdb::PreservedError &e);
|
202
|
+
static Napi::Object CreateError(Napi::Env env, std::string msg);
|
202
203
|
static bool OtherIsInt(Napi::Number source);
|
203
204
|
|
204
205
|
template <class T>
|
package/src/statement.cpp
CHANGED
@@ -78,7 +78,7 @@ struct PrepareTask : public Task {
|
|
78
78
|
|
79
79
|
auto cb = callback.Value();
|
80
80
|
if (statement.statement->HasError()) {
|
81
|
-
cb.MakeCallback(statement.Value(), {Utils::CreateError(env, statement.statement->error
|
81
|
+
cb.MakeCallback(statement.Value(), {Utils::CreateError(env, statement.statement->error)});
|
82
82
|
return;
|
83
83
|
}
|
84
84
|
cb.MakeCallback(statement.Value(), {env.Null(), statement.Value()});
|
@@ -282,11 +282,11 @@ struct RunPreparedTask : public Task {
|
|
282
282
|
return;
|
283
283
|
}
|
284
284
|
if (statement.statement->HasError()) {
|
285
|
-
cb.MakeCallback(statement.Value(), {Utils::CreateError(env, statement.statement->
|
285
|
+
cb.MakeCallback(statement.Value(), {Utils::CreateError(env, statement.statement->GetErrorObject())});
|
286
286
|
return;
|
287
287
|
}
|
288
288
|
if (result->HasError()) {
|
289
|
-
cb.MakeCallback(statement.Value(), {Utils::CreateError(env, result->
|
289
|
+
cb.MakeCallback(statement.Value(), {Utils::CreateError(env, result->GetErrorObject())});
|
290
290
|
return;
|
291
291
|
}
|
292
292
|
|
@@ -427,9 +427,9 @@ struct RunQueryTask : public Task {
|
|
427
427
|
if (!statement.statement) {
|
428
428
|
deferred.Reject(Utils::CreateError(env, "statement was finalized"));
|
429
429
|
} else if (statement.statement->HasError()) {
|
430
|
-
deferred.Reject(Utils::CreateError(env, statement.statement->
|
430
|
+
deferred.Reject(Utils::CreateError(env, statement.statement->GetErrorObject()));
|
431
431
|
} else if (result->HasError()) {
|
432
|
-
deferred.Reject(Utils::CreateError(env, result->
|
432
|
+
deferred.Reject(Utils::CreateError(env, result->GetErrorObject()));
|
433
433
|
} else {
|
434
434
|
auto db = statement.connection_ref->database_ref->Value();
|
435
435
|
auto query_result = QueryResult::constructor.New({db});
|
package/src/utils.cpp
CHANGED
@@ -12,11 +12,24 @@ bool Utils::OtherIsInt(Napi::Number source) {
|
|
12
12
|
}
|
13
13
|
}
|
14
14
|
|
15
|
-
|
15
|
+
static void SetString(Napi::Object &obj, const std::string &key, const std::string &value) {
|
16
|
+
obj.Set(Napi::String::New(obj.Env(), key), Napi::String::New(obj.Env(), value));
|
17
|
+
}
|
18
|
+
|
19
|
+
Napi::Object Utils::CreateError(Napi::Env env, duckdb::PreservedError &error) {
|
20
|
+
auto obj = Utils::CreateError(env, error.Message());
|
21
|
+
|
22
|
+
SetString(obj, "errorType", duckdb::Exception::ExceptionTypeToString(error.Type()));
|
23
|
+
|
24
|
+
return obj;
|
25
|
+
}
|
26
|
+
|
27
|
+
Napi::Object Utils::CreateError(Napi::Env env, std::string msg) {
|
16
28
|
auto err = Napi::Error::New(env, Napi::String::New(env, msg).Utf8Value()).Value();
|
17
29
|
Napi::Object obj = err.As<Napi::Object>();
|
18
30
|
obj.Set(Napi::String::New(env, "errno"), Napi::Number::New(env, Database::DUCKDB_NODEJS_ERROR));
|
19
|
-
obj
|
31
|
+
SetString(obj, "code", "DUCKDB_NODEJS_ERROR");
|
32
|
+
SetString(obj, "errorType", "Invalid");
|
20
33
|
|
21
34
|
return obj;
|
22
35
|
}
|
@@ -8,8 +8,10 @@ describe('exec', function() {
|
|
8
8
|
});
|
9
9
|
|
10
10
|
it("doesn't crash on a syntax error", function(done) {
|
11
|
-
db.exec("syntax error", function(err: null |
|
11
|
+
db.exec("syntax error", function(err: null | duckdb.DuckDbError) {
|
12
12
|
assert.notEqual(err, null, "Expected an error")
|
13
|
+
assert.equal(err?.errorType, 'Parser');
|
14
|
+
assert.ok(err?.message.startsWith('Parser Error: syntax error at or near "syntax"'))
|
13
15
|
done();
|
14
16
|
});
|
15
17
|
});
|