duckdb 0.4.1-dev68.0 → 0.4.1-dev71.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.4.1-dev68.0",
4
+ "version": "0.4.1-dev71.0",
5
5
  "description": "DuckDB node.js API",
6
6
  "gypfile": true,
7
7
  "dependencies": {
package/src/duckdb.cpp CHANGED
@@ -126562,19 +126562,26 @@ void ExtensionHelper::InstallExtension(DatabaseInstance &db, const string &exten
126562
126562
  return;
126563
126563
  }
126564
126564
 
126565
+ string temp_path = local_extension_path + ".tmp";
126566
+ if (fs.FileExists(temp_path)) {
126567
+ fs.RemoveFile(temp_path);
126568
+ }
126565
126569
  auto is_http_url = StringUtil::Contains(extension, "http://");
126566
126570
  if (fs.FileExists(extension)) {
126571
+
126567
126572
  std::ifstream in(extension, std::ios::binary);
126568
126573
  if (in.bad()) {
126569
126574
  throw IOException("Failed to read extension from \"%s\"", extension);
126570
126575
  }
126571
- std::ofstream out(local_extension_path, std::ios::binary);
126576
+ std::ofstream out(temp_path, std::ios::binary);
126572
126577
  out << in.rdbuf();
126573
126578
  if (out.bad()) {
126574
- throw IOException("Failed to write extension to \"%s\"", local_extension_path);
126579
+ throw IOException("Failed to write extension to \"%s\"", temp_path);
126575
126580
  }
126576
126581
  in.close();
126577
126582
  out.close();
126583
+
126584
+ fs.MoveFile(temp_path, local_extension_path);
126578
126585
  return;
126579
126586
  } else if (StringUtil::Contains(extension, "/") && !is_http_url) {
126580
126587
  throw IOException("Failed to read extension from \"%s\": no such file", extension);
@@ -126616,11 +126623,13 @@ void ExtensionHelper::InstallExtension(DatabaseInstance &db, const string &exten
126616
126623
  throw IOException("Failed to download extension %s%s", url_base, url_local_part);
126617
126624
  }
126618
126625
  auto decompressed_body = GZipFileSystem::UncompressGZIPString(res->body);
126619
- std::ofstream out(local_extension_path, std::ios::binary);
126626
+ std::ofstream out(temp_path, std::ios::binary);
126620
126627
  out.write(decompressed_body.data(), decompressed_body.size());
126621
126628
  if (out.bad()) {
126622
- throw IOException("Failed to write extension to %s", local_extension_path);
126629
+ throw IOException("Failed to write extension to %s", temp_path);
126623
126630
  }
126631
+ out.close();
126632
+ fs.MoveFile(temp_path, local_extension_path);
126624
126633
  #endif
126625
126634
  }
126626
126635
 
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 "995622ad3"
15
- #define DUCKDB_VERSION "v0.4.1-dev68"
14
+ #define DUCKDB_SOURCE_ID "b3c5e47e0"
15
+ #define DUCKDB_VERSION "v0.4.1-dev71"
16
16
  //===----------------------------------------------------------------------===//
17
17
  // DuckDB
18
18
  //