duckdb 0.6.2-dev708.0 → 0.6.2-dev716.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 CHANGED
@@ -240,7 +240,7 @@
240
240
  "src/duckdb/extension/json/yyjson/yyjson.cpp"
241
241
  ],
242
242
  "include_dirs": [
243
- "<!@(node -p \"require('node-addon-api').include\")",
243
+ "<!(node -p \"require('node-addon-api').include_dir\")",
244
244
  "src/duckdb/src/include",
245
245
  "src/duckdb/third_party/fmt/include",
246
246
  "src/duckdb/third_party/fsst",
package/binding.gyp.in CHANGED
@@ -12,7 +12,7 @@
12
12
  "${SOURCE_FILES}"
13
13
  ],
14
14
  "include_dirs": [
15
- "<!@(node -p \"require('node-addon-api').include\")",
15
+ "<!(node -p \"require('node-addon-api').include_dir\")",
16
16
  "${INCLUDE_FILES}"
17
17
  ],
18
18
  "defines": [
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-dev708.0",
5
+ "version": "0.6.2-dev716.0",
6
6
  "description": "DuckDB node.js API",
7
7
  "gypfile": true,
8
8
  "dependencies": {
@@ -1,8 +1,8 @@
1
1
  #ifndef DUCKDB_VERSION
2
- #define DUCKDB_VERSION "0.6.2-dev708"
2
+ #define DUCKDB_VERSION "0.6.2-dev716"
3
3
  #endif
4
4
  #ifndef DUCKDB_SOURCE_ID
5
- #define DUCKDB_SOURCE_ID "3261ee59be"
5
+ #define DUCKDB_SOURCE_ID "a3ea165426"
6
6
  #endif
7
7
  #include "duckdb/function/table/system_functions.hpp"
8
8
  #include "duckdb/main/database.hpp"
@@ -57,6 +57,9 @@ public:
57
57
  static void ReplacementOpenPost(ClientContext &context, const string &extension, DatabaseInstance &instance,
58
58
  ReplacementOpenData *open_data);
59
59
 
60
+ // Returns extension name, or empty string if not a replacement open path
61
+ static string ExtractExtensionPrefixFromPath(const string &path);
62
+
60
63
  private:
61
64
  static const vector<string> PathComponents();
62
65
  static ExtensionInitResult InitialLoad(DBConfig &context, FileOpener *opener, const string &extension);
@@ -27,8 +27,7 @@ DBConfig::DBConfig() {
27
27
  error_manager = make_unique<ErrorManager>();
28
28
  }
29
29
 
30
- DBConfig::DBConfig(std::unordered_map<string, string> &config_dict, bool read_only) {
31
- compression_functions = make_unique<CompressionFunctionSet>();
30
+ DBConfig::DBConfig(std::unordered_map<string, string> &config_dict, bool read_only) : DBConfig::DBConfig() {
32
31
  if (read_only) {
33
32
  options.access_mode = AccessMode::READ_ONLY;
34
33
  }
@@ -1,5 +1,5 @@
1
1
  #include "duckdb/main/db_instance_cache.hpp"
2
-
2
+ #include "duckdb/main/extension_helper.hpp"
3
3
  namespace duckdb {
4
4
 
5
5
  string GetDBAbsolutePath(const string &database) {
@@ -10,6 +10,10 @@ string GetDBAbsolutePath(const string &database) {
10
10
  // this is a memory db, just return it.
11
11
  return database;
12
12
  }
13
+ if (!ExtensionHelper::ExtractExtensionPrefixFromPath(database).empty()) {
14
+ // this database path is handled by a replacement open and is not a file path
15
+ return database;
16
+ }
13
17
  if (FileSystem::IsPathAbsolute(database)) {
14
18
  return database;
15
19
  }
@@ -176,4 +176,20 @@ void ExtensionHelper::ReplacementOpenPost(ClientContext &context, const string &
176
176
  }
177
177
  }
178
178
 
179
+ string ExtensionHelper::ExtractExtensionPrefixFromPath(const string &path) {
180
+ auto first_colon = path.find(':');
181
+ if (first_colon == string::npos || first_colon < 2) { // needs to be at least two characters because windows c: ...
182
+ return "";
183
+ }
184
+ auto extension = path.substr(0, first_colon);
185
+ D_ASSERT(extension.size() > 1);
186
+ // needs to be alphanumeric
187
+ for (auto &ch : extension) {
188
+ if (!isalnum(ch) && ch != '_') {
189
+ return "";
190
+ }
191
+ }
192
+ return extension;
193
+ }
194
+
179
195
  } // namespace duckdb
@@ -16,18 +16,10 @@ struct ExtensionPrefixOpenData : public ReplacementOpenData {
16
16
 
17
17
  static unique_ptr<ReplacementOpenData> ExtensionPrefixPreOpen(DBConfig &config, ReplacementOpenStaticData *) {
18
18
  auto path = config.options.database_path;
19
- auto first_colon = path.find(':');
20
- if (first_colon == string::npos || first_colon < 2) { // needs to be at least two characters because windows c: ...
19
+ string extension = ExtensionHelper::ExtractExtensionPrefixFromPath(path);
20
+ if (extension.empty()) {
21
21
  return nullptr;
22
22
  }
23
- auto extension = path.substr(0, first_colon);
24
- D_ASSERT(extension.size() > 1);
25
- // needs to be alphanumeric
26
- for (auto &ch : extension) {
27
- if (!isalnum(ch) && ch != '_') {
28
- return nullptr;
29
- }
30
- }
31
23
  auto extension_data = ExtensionHelper::ReplacementOpenPre(extension, config);
32
24
  if (extension_data) {
33
25
  return make_unique<ExtensionPrefixOpenData>(extension, path, move(extension_data));