duckdb 0.6.2-dev1934.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-dev1934.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": {
@@ -1,8 +1,8 @@
1
1
  #ifndef DUCKDB_VERSION
2
- #define DUCKDB_VERSION "0.6.2-dev1934"
2
+ #define DUCKDB_VERSION "0.6.2-dev1968"
3
3
  #endif
4
4
  #ifndef DUCKDB_SOURCE_ID
5
- #define DUCKDB_SOURCE_ID "802f3ad570"
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"
@@ -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";
@@ -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
  //===--------------------------------------------------------------------===//