duckdb 0.6.2-dev1922.0 → 0.6.2-dev1968.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-dev1922.0",
5
+ "version": "0.6.2-dev1968.0",
6
6
  "description": "DuckDB node.js API",
7
7
  "gypfile": true,
8
8
  "dependencies": {
@@ -19,6 +19,7 @@
19
19
  "install": "node-pre-gyp install --fallback-to-build",
20
20
  "pretest": "node test/support/createdb.js",
21
21
  "test": "mocha -R spec --timeout 480000 --expose-gc",
22
+ "test-path": "mocha -R spec --timeout 480000 --exclude 'test/*.ts'",
22
23
  "pack": "node-pre-gyp package"
23
24
  },
24
25
  "directories": {
package/src/database.cpp CHANGED
@@ -368,8 +368,9 @@ Napi::Value Database::RegisterReplacementScan(const Napi::CallbackInfo &info) {
368
368
  return env.Null();
369
369
  }
370
370
  Napi::Function rs_callback = info[0].As<Napi::Function>();
371
- auto rs = duckdb_node_rs_function_t::New(env, rs_callback, "duckdb_node_rs_" + (replacement_scan_count++), 0, 1,
372
- nullptr, [](Napi::Env, void *, std::nullptr_t *ctx) {});
371
+ auto rs =
372
+ duckdb_node_rs_function_t::New(env, rs_callback, "duckdb_node_rs_" + std::to_string(replacement_scan_count++),
373
+ 0, 1, nullptr, [](Napi::Env, void *, std::nullptr_t *ctx) {});
373
374
  rs.Unref(env);
374
375
 
375
376
  Schedule(info.Env(), duckdb::make_unique<RegisterRsTask>(*this, rs, deferred));
@@ -945,11 +945,13 @@ static bool IntegerCastLoop(const char *buf, idx_t len, T &result, bool strict)
945
945
  ExponentData exponent {0, false};
946
946
  int negative = buf[pos] == '-';
947
947
  if (negative) {
948
- if (!IntegerCastLoop<ExponentData, true, false>(buf + pos, len - pos, exponent, strict)) {
948
+ if (!IntegerCastLoop<ExponentData, true, false, IntegerCastOperation>(buf + pos, len - pos,
949
+ exponent, strict)) {
949
950
  return false;
950
951
  }
951
952
  } else {
952
- if (!IntegerCastLoop<ExponentData, false, false>(buf + pos, len - pos, exponent, strict)) {
953
+ if (!IntegerCastLoop<ExponentData, false, false, IntegerCastOperation>(buf + pos, len - pos,
954
+ exponent, strict)) {
953
955
  return false;
954
956
  }
955
957
  }
@@ -151,6 +151,7 @@ void GroupedAggregateHashTable::VerifyInternal() {
151
151
  count++;
152
152
  }
153
153
  }
154
+ (void)count;
154
155
  D_ASSERT(count == entries);
155
156
  }
156
157
 
@@ -31,8 +31,8 @@ PhysicalInsert::PhysicalInsert(vector<LogicalType> types_p, TableCatalogEntry *t
31
31
  : PhysicalOperator(PhysicalOperatorType::INSERT, std::move(types_p), estimated_cardinality),
32
32
  column_index_map(std::move(column_index_map)), insert_table(table), insert_types(table->GetTypes()),
33
33
  bound_defaults(std::move(bound_defaults)), return_chunk(return_chunk), parallel(parallel),
34
- action_type(action_type), set_expressions(std::move(set_expressions)), set_columns(move(set_columns)),
35
- set_types(move(set_types)), on_conflict_condition(std::move(on_conflict_condition_p)),
34
+ action_type(action_type), set_expressions(std::move(set_expressions)), set_columns(std::move(set_columns)),
35
+ set_types(std::move(set_types)), on_conflict_condition(std::move(on_conflict_condition_p)),
36
36
  do_update_condition(std::move(do_update_condition_p)), conflict_target(std::move(conflict_target_p)),
37
37
  columns_to_fetch(std::move(columns_to_fetch_p)) {
38
38
 
@@ -12,7 +12,7 @@ unique_ptr<BoundCastData> MapBoundCastData::BindMapToMapCast(BindCastInput &inpu
12
12
  auto target_val = MapType::ValueType(target);
13
13
  auto key_cast = input.GetCastFunction(source_key, target_key);
14
14
  auto value_cast = input.GetCastFunction(source_val, target_val);
15
- return make_unique<MapBoundCastData>(move(key_cast), move(value_cast));
15
+ return make_unique<MapBoundCastData>(std::move(key_cast), std::move(value_cast));
16
16
  }
17
17
 
18
18
  static bool MapToVarcharCast(Vector &source, Vector &result, idx_t count, CastParameters &parameters) {
@@ -1,8 +1,8 @@
1
1
  #ifndef DUCKDB_VERSION
2
- #define DUCKDB_VERSION "0.6.2-dev1922"
2
+ #define DUCKDB_VERSION "0.6.2-dev1968"
3
3
  #endif
4
4
  #ifndef DUCKDB_SOURCE_ID
5
- #define DUCKDB_SOURCE_ID "bc37e4517c"
5
+ #define DUCKDB_SOURCE_ID "c1f2d10c78"
6
6
  #endif
7
7
  #include "duckdb/function/table/system_functions.hpp"
8
8
  #include "duckdb/main/database.hpp"
@@ -116,7 +116,7 @@ public:
116
116
 
117
117
  struct MapBoundCastData : public BoundCastData {
118
118
  MapBoundCastData(BoundCastInfo key_cast, BoundCastInfo value_cast)
119
- : key_cast(move(key_cast)), value_cast(move(value_cast)) {
119
+ : key_cast(std::move(key_cast)), value_cast(std::move(value_cast)) {
120
120
  }
121
121
 
122
122
  BoundCastInfo key_cast;
@@ -27,7 +27,7 @@ typedef unique_ptr<TableFunctionRef> (*create_database_t)(ClientContext &context
27
27
  struct CreateDatabaseExtension {
28
28
  explicit CreateDatabaseExtension(create_database_t function,
29
29
  unique_ptr<CreateDatabaseExtensionData> data_p = nullptr)
30
- : function(function), data(move(data_p)) {
30
+ : function(function), data(std::move(data_p)) {
31
31
  }
32
32
 
33
33
  create_database_t function;
@@ -79,6 +79,9 @@ struct ClientConfig {
79
79
  //! Callback to create a progress bar display
80
80
  progress_bar_display_create_func_t display_create_func = nullptr;
81
81
 
82
+ //! Override for the default extension repository
83
+ string custom_extension_repo = "";
84
+
82
85
  //! The explain output type used when none is specified (default: PHYSICAL_ONLY)
83
86
  ExplainOutputType explain_output_type = ExplainOutputType::PHYSICAL_ONLY;
84
87
 
@@ -142,6 +142,15 @@ struct AllowUnsignedExtensionsSetting {
142
142
  static Value GetSetting(ClientContext &context);
143
143
  };
144
144
 
145
+ struct CustomExtensionRepository {
146
+ static constexpr const char *Name = "custom_extension_repository";
147
+ static constexpr const char *Description = "Overrides the custom endpoint for remote extension installation";
148
+ static constexpr const LogicalTypeId InputType = LogicalTypeId::VARCHAR;
149
+ static void SetLocal(ClientContext &context, const Value &parameter);
150
+ static void ResetLocal(ClientContext &context);
151
+ static Value GetSetting(ClientContext &context);
152
+ };
153
+
145
154
  struct EnableObjectCacheSetting {
146
155
  static constexpr const char *Name = "enable_object_cache";
147
156
  static constexpr const char *Description = "Whether or not object cache is used to cache e.g. Parquet metadata";
@@ -60,7 +60,7 @@ struct ColumnScanState {
60
60
  //! The version of the column data that we are scanning.
61
61
  //! This is used to detect if the ColumnData has been changed out from under us during a scan
62
62
  //! If this is the case, we re-initialize the scan
63
- idx_t version;
63
+ idx_t version = 0;
64
64
  //! We initialize one SegmentScanState per segment, however, if scanning a DataChunk requires us to scan over more
65
65
  //! than one Segment, we need to keep the scan states of the previous segments around
66
66
  vector<unique_ptr<SegmentScanState>> previous_states;
@@ -59,6 +59,7 @@ static ConfigurationOption internal_options[] = {DUCKDB_GLOBAL(AccessModeSetting
59
59
  DUCKDB_GLOBAL(EnableExternalAccessSetting),
60
60
  DUCKDB_GLOBAL(EnableFSSTVectors),
61
61
  DUCKDB_GLOBAL(AllowUnsignedExtensionsSetting),
62
+ DUCKDB_LOCAL(CustomExtensionRepository),
62
63
  DUCKDB_GLOBAL(EnableObjectCacheSetting),
63
64
  DUCKDB_GLOBAL(EnableHTTPMetadataCacheSetting),
64
65
  DUCKDB_LOCAL(EnableProfilingSetting),
@@ -78,6 +78,11 @@
78
78
  #include "inet-extension.hpp"
79
79
  #endif
80
80
 
81
+ // Load the generated header file containing our list of extension headers
82
+ #if defined(OOTE_HEADERS_AVAILABLE) && OOTE_HEADERS_AVAILABLE
83
+ #include "extension_oote_loader.hpp"
84
+ #endif
85
+
81
86
  namespace duckdb {
82
87
 
83
88
  //===--------------------------------------------------------------------===//
@@ -118,6 +123,12 @@ void ExtensionHelper::LoadAllExtensions(DuckDB &db) {
118
123
  for (auto &ext : extensions) {
119
124
  LoadExtensionInternal(db, ext, true);
120
125
  }
126
+
127
+ #if defined(OOTE_HEADERS_AVAILABLE) && OOTE_HEADERS_AVAILABLE
128
+ for (auto &ext : OOT_EXTENSIONS) {
129
+ LoadExtensionInternal(db, ext, true);
130
+ }
131
+ #endif
121
132
  }
122
133
 
123
134
  ExtensionLoadResult ExtensionHelper::LoadExtension(DuckDB &db, const std::string &extension) {
@@ -226,7 +237,12 @@ ExtensionLoadResult ExtensionHelper::LoadExtensionInternal(DuckDB &db, const std
226
237
  return ExtensionLoadResult::NOT_LOADED;
227
238
  #endif
228
239
  } else {
229
- // unknown extension
240
+
241
+ #if defined(OOTE_HEADERS_AVAILABLE) && OOTE_HEADERS_AVAILABLE
242
+ if (TryLoadLinkedExtension(db, extension)) {
243
+ return ExtensionLoadResult::LOADED_EXTENSION;
244
+ }
245
+ #endif
230
246
  return ExtensionLoadResult::EXTENSION_UNKNOWN;
231
247
  }
232
248
  return ExtensionLoadResult::LOADED_EXTENSION;
@@ -120,7 +120,12 @@ void ExtensionHelper::InstallExtension(ClientContext &context, const string &ext
120
120
  #ifdef DISABLE_DUCKDB_REMOTE_INSTALL
121
121
  throw BinderException("Remote extension installation is disabled through configuration");
122
122
  #else
123
- string url_template = "http://extensions.duckdb.org/${REVISION}/${PLATFORM}/${NAME}.duckdb_extension.gz";
123
+
124
+ string default_endpoint = "http://extensions.duckdb.org";
125
+ string versioned_path = "/${REVISION}/${PLATFORM}/${NAME}.duckdb_extension.gz";
126
+ string &custom_endpoint = ClientConfig::GetConfig(context).custom_extension_repo;
127
+ string &endpoint = !custom_endpoint.empty() ? custom_endpoint : default_endpoint;
128
+ string url_template = endpoint + versioned_path;
124
129
 
125
130
  if (is_http_url) {
126
131
  url_template = extension;
@@ -433,6 +433,22 @@ Value EnableProfilingSetting::GetSetting(ClientContext &context) {
433
433
  }
434
434
  }
435
435
 
436
+ //===--------------------------------------------------------------------===//
437
+ // Custom Extension Repository
438
+ //===--------------------------------------------------------------------===//
439
+
440
+ void CustomExtensionRepository::ResetLocal(ClientContext &context) {
441
+ ClientConfig::GetConfig(context).custom_extension_repo = ClientConfig().custom_extension_repo;
442
+ }
443
+
444
+ void CustomExtensionRepository::SetLocal(ClientContext &context, const Value &input) {
445
+ ClientConfig::GetConfig(context).custom_extension_repo = StringUtil::Lower(input.ToString());
446
+ }
447
+
448
+ Value CustomExtensionRepository::GetSetting(ClientContext &context) {
449
+ return Value(ClientConfig::GetConfig(context).custom_extension_repo);
450
+ }
451
+
436
452
  //===--------------------------------------------------------------------===//
437
453
  // Enable Progress Bar
438
454
  //===--------------------------------------------------------------------===//
@@ -22,7 +22,7 @@ unique_ptr<CreateStatement> Transformer::TransformCreateDatabase(duckdb_libpgque
22
22
  info->catalog = qualified_name.catalog;
23
23
  info->name = qualified_name.name;
24
24
 
25
- result->info = move(info);
25
+ result->info = std::move(info);
26
26
  return result;
27
27
  }
28
28
 
@@ -119,7 +119,7 @@ void Binder::BindDoUpdateSetExpressions(const string &table_alias, LogicalInsert
119
119
  throw BinderException("Expression in the DO UPDATE SET clause can not be a subquery");
120
120
  }
121
121
 
122
- insert->expressions.push_back(move(bound_expr));
122
+ insert->expressions.push_back(std::move(bound_expr));
123
123
  }
124
124
 
125
125
  // Figure out which columns are indexed on
@@ -166,7 +166,7 @@ unique_ptr<LogicalOperator> Binder::BindUpdateSet(LogicalOperator *op, unique_pt
166
166
 
167
167
  op->expressions.push_back(make_unique<BoundColumnRefExpression>(
168
168
  bound_expr->return_type, ColumnBinding(proj_index, projection_expressions.size())));
169
- projection_expressions.push_back(move(bound_expr));
169
+ projection_expressions.push_back(std::move(bound_expr));
170
170
  }
171
171
  }
172
172
  if (op->type != LogicalOperatorType::LOGICAL_UPDATE && projection_expressions.empty()) {
@@ -174,8 +174,8 @@ unique_ptr<LogicalOperator> Binder::BindUpdateSet(LogicalOperator *op, unique_pt
174
174
  }
175
175
  // now create the projection
176
176
  auto proj = make_unique<LogicalProjection>(proj_index, std::move(projection_expressions));
177
- proj->AddChild(move(root));
178
- return unique_ptr_cast<LogicalProjection, LogicalOperator>(move(proj));
177
+ proj->AddChild(std::move(root));
178
+ return unique_ptr_cast<LogicalProjection, LogicalOperator>(std::move(proj));
179
179
  }
180
180
 
181
181
  BoundStatement Binder::Bind(UpdateStatement &stmt) {
@@ -356,7 +356,11 @@ using string_view = basic_string_view<char>;
356
356
  using wstring_view = basic_string_view<wchar_t>;
357
357
 
358
358
  // A UTF-8 code unit type.
359
+ #if FMT_HAS_FEATURE(__cpp_char8_t)
360
+ typedef char8_t fmt_char8_t;
361
+ #else
359
362
  typedef unsigned char fmt_char8_t;
363
+ #endif
360
364
 
361
365
  /** Specifies if ``T`` is a character type. Can be specialized by users. */
362
366
  template <typename T> struct is_char : std::false_type {};
@@ -17415,6 +17415,7 @@ YYLTYPE yylloc;
17415
17415
  yystate = 0;
17416
17416
  yyerrstatus = 0;
17417
17417
  yynerrs = 0;
17418
+ (void)yynerrs;
17418
17419
  yychar = YYEMPTY; /* Cause a token to be read. */
17419
17420
 
17420
17421
  /* Initialize stack pointers.