duckdb 0.5.1-dev136.0 → 0.5.1-dev138.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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "duckdb",
3
3
  "main": "./lib/duckdb.js",
4
- "version": "0.5.1-dev136.0",
4
+ "version": "0.5.1-dev138.0",
5
5
  "description": "DuckDB node.js API",
6
6
  "gypfile": true,
7
7
  "dependencies": {
package/src/duckdb.cpp CHANGED
@@ -19202,6 +19202,8 @@ private:
19202
19202
  //! Set the file pointer of a file handle to a specified location. Reads and writes will happen from this location
19203
19203
  void SetFilePointer(FileHandle &handle, idx_t location);
19204
19204
  idx_t GetFilePointer(FileHandle &handle);
19205
+
19206
+ vector<string> FetchFileWithoutGlob(const string &path, FileOpener *opener, bool absolute_path);
19205
19207
  };
19206
19208
 
19207
19209
  } // namespace duckdb
@@ -20083,6 +20085,26 @@ static void GlobFiles(FileSystem &fs, const string &path, const string &glob, bo
20083
20085
  });
20084
20086
  }
20085
20087
 
20088
+ vector<string> LocalFileSystem::FetchFileWithoutGlob(const string &path, FileOpener *opener, bool absolute_path) {
20089
+ vector<string> result;
20090
+ if (FileExists(path) || IsPipe(path)) {
20091
+ result.push_back(path);
20092
+ } else if (!absolute_path) {
20093
+ Value value;
20094
+ if (opener->TryGetCurrentSetting("file_search_path", value)) {
20095
+ auto search_paths_str = value.ToString();
20096
+ std::vector<std::string> search_paths = StringUtil::Split(search_paths_str, ',');
20097
+ for (const auto &search_path : search_paths) {
20098
+ auto joined_path = JoinPath(search_path, path);
20099
+ if (FileExists(joined_path) || IsPipe(joined_path)) {
20100
+ result.push_back(joined_path);
20101
+ }
20102
+ }
20103
+ }
20104
+ }
20105
+ return result;
20106
+ }
20107
+
20086
20108
  vector<string> LocalFileSystem::Glob(const string &path, FileOpener *opener) {
20087
20109
  if (path.empty()) {
20088
20110
  return vector<string>();
@@ -20129,23 +20151,7 @@ vector<string> LocalFileSystem::Glob(const string &path, FileOpener *opener) {
20129
20151
  // Check if the path has a glob at all
20130
20152
  if (!HasGlob(path)) {
20131
20153
  // no glob: return only the file (if it exists or is a pipe)
20132
- vector<string> result;
20133
- if (FileExists(path) || IsPipe(path)) {
20134
- result.push_back(path);
20135
- } else if (!absolute_path) {
20136
- Value value;
20137
- if (opener->TryGetCurrentSetting("file_search_path", value)) {
20138
- auto search_paths_str = value.ToString();
20139
- std::vector<std::string> search_paths = StringUtil::Split(search_paths_str, ',');
20140
- for (const auto &search_path : search_paths) {
20141
- auto joined_path = JoinPath(search_path, path);
20142
- if (FileExists(joined_path) || IsPipe(joined_path)) {
20143
- result.push_back(joined_path);
20144
- }
20145
- }
20146
- }
20147
- }
20148
- return result;
20154
+ return FetchFileWithoutGlob(path, opener, absolute_path);
20149
20155
  }
20150
20156
  vector<string> previous_directories;
20151
20157
  if (absolute_path) {
@@ -20179,7 +20185,12 @@ vector<string> LocalFileSystem::Glob(const string &path, FileOpener *opener) {
20179
20185
  }
20180
20186
  }
20181
20187
  }
20182
- if (is_last_chunk || result.empty()) {
20188
+ if (result.empty()) {
20189
+ // no result found that matches the glob
20190
+ // last ditch effort: search the path as a string literal
20191
+ return FetchFileWithoutGlob(path, opener, absolute_path);
20192
+ }
20193
+ if (is_last_chunk) {
20183
20194
  return result;
20184
20195
  }
20185
20196
  previous_directories = move(result);
package/src/duckdb.hpp CHANGED
@@ -11,8 +11,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
11
11
  #pragma once
12
12
  #define DUCKDB_AMALGAMATION 1
13
13
  #define DUCKDB_AMALGAMATION_EXTENDED 1
14
- #define DUCKDB_SOURCE_ID "6823f459f"
15
- #define DUCKDB_VERSION "v0.5.1-dev136"
14
+ #define DUCKDB_SOURCE_ID "3ccb7e6d9"
15
+ #define DUCKDB_VERSION "v0.5.1-dev138"
16
16
  //===----------------------------------------------------------------------===//
17
17
  // DuckDB
18
18
  //