duckdb 0.6.2-dev1226.0 → 0.6.2-dev1234.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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "duckdb",
3
3
  "main": "./lib/duckdb.js",
4
4
  "types": "./lib/duckdb.d.ts",
5
- "version": "0.6.2-dev1226.0",
5
+ "version": "0.6.2-dev1234.0",
6
6
  "description": "DuckDB node.js API",
7
7
  "gypfile": true,
8
8
  "dependencies": {
@@ -22,12 +22,11 @@ string MacroFunction::ValidateArguments(MacroFunction &macro_def, const string &
22
22
 
23
23
  // separate positional and default arguments
24
24
  for (auto &arg : function_expr.children) {
25
- if ((arg->type == ExpressionType::VALUE_CONSTANT || arg->type == ExpressionType::VALUE_PARAMETER) &&
26
- !arg->alias.empty()) {
25
+ if (!arg->alias.empty()) {
27
26
  // default argument
28
- if (macro_def.default_parameters.find(arg->alias) == macro_def.default_parameters.end()) {
27
+ if (!macro_def.default_parameters.count(arg->alias)) {
29
28
  return StringUtil::Format("Macro %s does not have default parameter %s!", name, arg->alias);
30
- } else if (defaults.find(arg->alias) != defaults.end()) {
29
+ } else if (defaults.count(arg->alias)) {
31
30
  return StringUtil::Format("Duplicate default parameters %s!", arg->alias);
32
31
  }
33
32
  defaults[arg->alias] = std::move(arg);
@@ -57,10 +56,13 @@ string MacroFunction::ValidateArguments(MacroFunction &macro_def, const string &
57
56
  return error;
58
57
  }
59
58
 
60
- // fill in default value where this was not supplied
59
+ // Add the default values for parameters that have defaults, that were not explicitly assigned to
61
60
  for (auto it = macro_def.default_parameters.begin(); it != macro_def.default_parameters.end(); it++) {
62
- if (defaults.find(it->first) == defaults.end()) {
63
- defaults[it->first] = it->second->Copy();
61
+ auto &parameter_name = it->first;
62
+ auto &parameter_default = it->second;
63
+ if (!defaults.count(parameter_name)) {
64
+ // This parameter was not set yet, set it with the default value
65
+ defaults[parameter_name] = parameter_default->Copy();
64
66
  }
65
67
  }
66
68
 
@@ -1,8 +1,8 @@
1
1
  #ifndef DUCKDB_VERSION
2
- #define DUCKDB_VERSION "0.6.2-dev1226"
2
+ #define DUCKDB_VERSION "0.6.2-dev1234"
3
3
  #endif
4
4
  #ifndef DUCKDB_SOURCE_ID
5
- #define DUCKDB_SOURCE_ID "5b5c625783"
5
+ #define DUCKDB_SOURCE_ID "995942ef30"
6
6
  #endif
7
7
  #include "duckdb/function/table/system_functions.hpp"
8
8
  #include "duckdb/main/database.hpp"