duckdb 0.3.3-dev105.0 → 0.3.3-dev108.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.3.3-dev105.0",
4
+ "version": "0.3.3-dev108.0",
5
5
  "description": "DuckDB node.js API",
6
6
  "gypfile": true,
7
7
  "dependencies": {
package/src/duckdb.cpp CHANGED
@@ -15826,6 +15826,10 @@ public:
15826
15826
  return "LocalFileSystem";
15827
15827
  }
15828
15828
 
15829
+ //! Returns the last Win32 error, in string format. Returns an empty string if there is no error, or on non-Windows
15830
+ //! systems.
15831
+ static std::string GetLastErrorAsString();
15832
+
15829
15833
  private:
15830
15834
  //! Set the file pointer of a file handle to a specified location. Reads and writes will happen from this location
15831
15835
  void SetFilePointer(FileHandle &handle, idx_t location);
@@ -16273,12 +16277,16 @@ void LocalFileSystem::MoveFile(const string &source, const string &target) {
16273
16277
  }
16274
16278
  }
16275
16279
 
16280
+ std::string LocalFileSystem::GetLastErrorAsString() {
16281
+ return string();
16282
+ }
16283
+
16276
16284
  #else
16277
16285
 
16278
16286
  constexpr char PIPE_PREFIX[] = "\\\\.\\pipe\\";
16279
16287
 
16280
16288
  // Returns the last Win32 error, in string format. Returns an empty string if there is no error.
16281
- std::string GetLastErrorAsString() {
16289
+ std::string LocalFileSystem::GetLastErrorAsString() {
16282
16290
  // Get the error message, if any.
16283
16291
  DWORD errorMessageID = GetLastError();
16284
16292
  if (errorMessageID == 0)
@@ -16354,7 +16362,7 @@ unique_ptr<FileHandle> LocalFileSystem::OpenFile(const string &path, uint8_t fla
16354
16362
  HANDLE hFile = CreateFileW(unicode_path.c_str(), desired_access, share_mode, NULL, creation_disposition,
16355
16363
  flags_and_attributes, NULL);
16356
16364
  if (hFile == INVALID_HANDLE_VALUE) {
16357
- auto error = GetLastErrorAsString();
16365
+ auto error = LocalFileSystem::GetLastErrorAsString();
16358
16366
  throw IOException("Cannot open file \"%s\": %s", path.c_str(), error);
16359
16367
  }
16360
16368
  auto handle = make_unique<WindowsFileHandle>(*this, path.c_str(), hFile);
@@ -16383,7 +16391,7 @@ static DWORD FSInternalRead(FileHandle &handle, HANDLE hFile, void *buffer, int6
16383
16391
  ov.hEvent = 0;
16384
16392
  auto rc = ReadFile(hFile, buffer, (DWORD)nr_bytes, &bytes_read, &ov);
16385
16393
  if (!rc) {
16386
- auto error = GetLastErrorAsString();
16394
+ auto error = LocalFileSystem::GetLastErrorAsString();
16387
16395
  throw IOException("Could not read file \"%s\" (error in ReadFile): %s", handle.path, error);
16388
16396
  }
16389
16397
  return bytes_read;
@@ -16417,7 +16425,7 @@ static DWORD FSInternalWrite(FileHandle &handle, HANDLE hFile, void *buffer, int
16417
16425
  ov.hEvent = 0;
16418
16426
  auto rc = WriteFile(hFile, buffer, (DWORD)nr_bytes, &bytes_written, &ov);
16419
16427
  if (!rc) {
16420
- auto error = GetLastErrorAsString();
16428
+ auto error = LocalFileSystem::GetLastErrorAsString();
16421
16429
  throw IOException("Could not write file \"%s\" (error in WriteFile): %s", handle.path, error);
16422
16430
  }
16423
16431
  return bytes_written;
@@ -16481,7 +16489,7 @@ void LocalFileSystem::Truncate(FileHandle &handle, int64_t new_size) {
16481
16489
  SetFilePointer(handle, new_size);
16482
16490
  // now set the end of file position
16483
16491
  if (!SetEndOfFile(hFile)) {
16484
- auto error = GetLastErrorAsString();
16492
+ auto error = LocalFileSystem::GetLastErrorAsString();
16485
16493
  throw IOException("Failure in SetEndOfFile call on file \"%s\": %s", handle.path, error);
16486
16494
  }
16487
16495
  }
@@ -109432,6 +109440,7 @@ void ExtensionHelper::InstallExtension(DatabaseInstance &db, const string &exten
109432
109440
 
109433
109441
 
109434
109442
 
109443
+
109435
109444
  #ifndef _WIN32
109436
109445
  #include <dlfcn.h>
109437
109446
  #else
@@ -109452,6 +109461,17 @@ void *dlsym(void *handle, const char *name) {
109452
109461
  D_ASSERT(handle);
109453
109462
  return (void *)GetProcAddress((HINSTANCE)handle, name);
109454
109463
  }
109464
+
109465
+ std::string GetDLError(void) {
109466
+ return LocalFileSystem::GetLastErrorAsString();
109467
+ }
109468
+
109469
+ #else
109470
+
109471
+ std::string GetDLError(void) {
109472
+ return dlerror();
109473
+ }
109474
+
109455
109475
  #endif
109456
109476
 
109457
109477
  } // namespace duckdb
@@ -109469,7 +109489,7 @@ template <class T>
109469
109489
  static T LoadFunctionFromDLL(void *dll, const string &function_name, const string &filename) {
109470
109490
  auto function = dlsym(dll, function_name.c_str());
109471
109491
  if (!function) {
109472
- throw IOException("File \"%s\" did not contain function \"%s\"", filename, function_name);
109492
+ throw IOException("File \"%s\" did not contain function \"%s\": %s", filename, function_name, GetDLError());
109473
109493
  }
109474
109494
  return (T)function;
109475
109495
  }
@@ -109497,7 +109517,7 @@ void ExtensionHelper::LoadExternalExtension(DatabaseInstance &db, const string &
109497
109517
  }
109498
109518
  auto lib_hdl = dlopen(filename.c_str(), RTLD_LAZY | RTLD_LOCAL);
109499
109519
  if (!lib_hdl) {
109500
- throw IOException("File \"%s\" could not be loaded", filename);
109520
+ throw IOException("File \"%s\" could not be loaded: %s", filename, GetDLError());
109501
109521
  }
109502
109522
 
109503
109523
  auto basename = fs.ExtractBaseName(filename);
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 "e25230541"
15
- #define DUCKDB_VERSION "v0.3.3-dev105"
14
+ #define DUCKDB_SOURCE_ID "6eb39f78f"
15
+ #define DUCKDB_VERSION "v0.3.3-dev108"
16
16
  //===----------------------------------------------------------------------===//
17
17
  // DuckDB
18
18
  //