duckdb 0.4.1-dev26.0 → 0.4.1-dev36.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-dev26.0",
4
+ "version": "0.4.1-dev36.0",
5
5
  "description": "DuckDB node.js API",
6
6
  "gypfile": true,
7
7
  "dependencies": {
package/src/duckdb.cpp CHANGED
@@ -39599,7 +39599,7 @@ unique_ptr<VectorData[]> DataChunk::Orrify() {
39599
39599
  }
39600
39600
 
39601
39601
  void DataChunk::Hash(Vector &result) {
39602
- D_ASSERT(result.GetType().id() == LogicalTypeId::HASH);
39602
+ D_ASSERT(result.GetType().id() == LogicalType::HASH);
39603
39603
  VectorOperations::Hash(data[0], result, size());
39604
39604
  for (idx_t i = 1; i < ColumnCount(); i++) {
39605
39605
  VectorOperations::CombineHash(result, data[i], size());
@@ -44706,8 +44706,6 @@ Value Value::Numeric(const LogicalType &type, int64_t value) {
44706
44706
  return Value((float)value);
44707
44707
  case LogicalTypeId::DOUBLE:
44708
44708
  return Value((double)value);
44709
- case LogicalTypeId::HASH:
44710
- return Value::HASH(value);
44711
44709
  case LogicalTypeId::POINTER:
44712
44710
  return Value::POINTER(value);
44713
44711
  case LogicalTypeId::DATE:
@@ -45098,8 +45096,6 @@ string Value::ToString() const {
45098
45096
  return Blob::ToString(string_t(str_value));
45099
45097
  case LogicalTypeId::POINTER:
45100
45098
  return to_string(value_.pointer);
45101
- case LogicalTypeId::HASH:
45102
- return to_string(value_.hash);
45103
45099
  case LogicalTypeId::STRUCT: {
45104
45100
  string ret = "{";
45105
45101
  auto &child_types = StructType::GetChildTypes(type_);
@@ -46218,8 +46214,6 @@ Value Vector::GetValue(const Vector &v_p, idx_t index_p) {
46218
46214
  throw InternalException("ENUM can only have unsigned integers as physical types");
46219
46215
  }
46220
46216
  }
46221
- case LogicalTypeId::HASH:
46222
- return Value::HASH(((hash_t *)data)[index]);
46223
46217
  case LogicalTypeId::POINTER:
46224
46218
  return Value::POINTER(((uintptr_t *)data)[index]);
46225
46219
  case LogicalTypeId::FLOAT:
@@ -47611,9 +47605,6 @@ PhysicalType LogicalType::GetInternalType() {
47611
47605
  return PhysicalType::STRUCT;
47612
47606
  case LogicalTypeId::LIST:
47613
47607
  return PhysicalType::LIST;
47614
- case LogicalTypeId::HASH:
47615
- static_assert(sizeof(hash_t) == sizeof(uint64_t), "Hash must be uint64_t");
47616
- return PhysicalType::UINT64;
47617
47608
  case LogicalTypeId::POINTER:
47618
47609
  // LCOV_EXCL_START
47619
47610
  if (sizeof(uintptr_t) == sizeof(uint32_t)) {
@@ -47922,8 +47913,6 @@ string LogicalTypeIdToString(LogicalTypeId id) {
47922
47913
  return "LIST";
47923
47914
  case LogicalTypeId::MAP:
47924
47915
  return "MAP";
47925
- case LogicalTypeId::HASH:
47926
- return "HASH";
47927
47916
  case LogicalTypeId::POINTER:
47928
47917
  return "POINTER";
47929
47918
  case LogicalTypeId::TABLE:
@@ -52564,7 +52553,7 @@ static inline void ListLoopHash(Vector &input, Vector &hashes, const SelectionVe
52564
52553
 
52565
52554
  template <bool HAS_RSEL>
52566
52555
  static inline void HashTypeSwitch(Vector &input, Vector &result, const SelectionVector *rsel, idx_t count) {
52567
- D_ASSERT(result.GetType().id() == LogicalTypeId::HASH);
52556
+ D_ASSERT(result.GetType().id() == LogicalType::HASH);
52568
52557
  switch (input.GetType().InternalType()) {
52569
52558
  case PhysicalType::BOOL:
52570
52559
  case PhysicalType::INT8:
@@ -52696,7 +52685,7 @@ void TemplatedLoopCombineHash(Vector &input, Vector &hashes, const SelectionVect
52696
52685
 
52697
52686
  template <bool HAS_RSEL>
52698
52687
  static inline void CombineHashTypeSwitch(Vector &hashes, Vector &input, const SelectionVector *rsel, idx_t count) {
52699
- D_ASSERT(hashes.GetType().id() == LogicalTypeId::HASH);
52688
+ D_ASSERT(hashes.GetType().id() == LogicalType::HASH);
52700
52689
  switch (input.GetType().InternalType()) {
52701
52690
  case PhysicalType::BOOL:
52702
52691
  case PhysicalType::INT8:
@@ -57647,7 +57636,7 @@ void JoinHashTable::Build(DataChunk &keys, DataChunk &payload) {
57647
57636
  }
57648
57637
 
57649
57638
  void JoinHashTable::InsertHashes(Vector &hashes, idx_t count, data_ptr_t key_locations[]) {
57650
- D_ASSERT(hashes.GetType().id() == LogicalTypeId::HASH);
57639
+ D_ASSERT(hashes.GetType().id() == LogicalType::HASH);
57651
57640
 
57652
57641
  // use bitmask to get position in array
57653
57642
  ApplyBitmask(hashes, count);
@@ -60326,7 +60315,7 @@ static void ScanSortedPartition(WindowOperatorState &state, ChunkCollection &inp
60326
60315
  }
60327
60316
 
60328
60317
  static void HashChunk(counts_t &counts, DataChunk &hash_chunk, DataChunk &sort_chunk, const idx_t partition_cols) {
60329
- const vector<LogicalType> hash_types(1, LogicalTypeId::HASH);
60318
+ const vector<LogicalType> hash_types(1, LogicalType::HASH);
60330
60319
  hash_chunk.Initialize(hash_types);
60331
60320
  hash_chunk.SetCardinality(sort_chunk);
60332
60321
  auto &hash_vector = hash_chunk.data[0];
@@ -62322,6 +62311,12 @@ class DuckDB;
62322
62311
 
62323
62312
  enum class ExtensionLoadResult : uint8_t { LOADED_EXTENSION = 0, EXTENSION_UNKNOWN = 1, NOT_LOADED = 2 };
62324
62313
 
62314
+ struct DefaultExtension {
62315
+ const char *name;
62316
+ const char *description;
62317
+ bool statically_loaded;
62318
+ };
62319
+
62325
62320
  class ExtensionHelper {
62326
62321
  public:
62327
62322
  static void LoadAllExtensions(DuckDB &db);
@@ -62331,6 +62326,11 @@ public:
62331
62326
  static void InstallExtension(DatabaseInstance &db, const string &extension, bool force_install);
62332
62327
  static void LoadExternalExtension(DatabaseInstance &db, const string &extension);
62333
62328
 
62329
+ static string ExtensionDirectory(FileSystem &fs);
62330
+
62331
+ static idx_t DefaultExtensionCount();
62332
+ static DefaultExtension GetDefaultExtension(idx_t index);
62333
+
62334
62334
  private:
62335
62335
  static const vector<string> PathComponents();
62336
62336
 
@@ -107071,6 +107071,10 @@ struct DuckDBDependenciesFun {
107071
107071
  static void RegisterFunction(BuiltinFunctions &set);
107072
107072
  };
107073
107073
 
107074
+ struct DuckDBExtensionsFun {
107075
+ static void RegisterFunction(BuiltinFunctions &set);
107076
+ };
107077
+
107074
107078
  struct DuckDBFunctionsFun {
107075
107079
  static void RegisterFunction(BuiltinFunctions &set);
107076
107080
  };
@@ -108669,6 +108673,152 @@ void DuckDBDependenciesFun::RegisterFunction(BuiltinFunctions &set) {
108669
108673
 
108670
108674
 
108671
108675
 
108676
+ namespace duckdb {
108677
+
108678
+ struct ExtensionInformation {
108679
+ string name;
108680
+ bool loaded = false;
108681
+ bool installed = false;
108682
+ string file_path;
108683
+ string description;
108684
+ };
108685
+
108686
+ struct DuckDBExtensionsData : public GlobalTableFunctionState {
108687
+ DuckDBExtensionsData() : offset(0) {
108688
+ }
108689
+
108690
+ vector<ExtensionInformation> entries;
108691
+ idx_t offset;
108692
+ };
108693
+
108694
+ static unique_ptr<FunctionData> DuckDBExtensionsBind(ClientContext &context, TableFunctionBindInput &input,
108695
+ vector<LogicalType> &return_types, vector<string> &names) {
108696
+ names.emplace_back("extension_name");
108697
+ return_types.emplace_back(LogicalType::VARCHAR);
108698
+
108699
+ names.emplace_back("loaded");
108700
+ return_types.emplace_back(LogicalType::BOOLEAN);
108701
+
108702
+ names.emplace_back("installed");
108703
+ return_types.emplace_back(LogicalType::BOOLEAN);
108704
+
108705
+ names.emplace_back("install_path");
108706
+ return_types.emplace_back(LogicalType::VARCHAR);
108707
+
108708
+ names.emplace_back("description");
108709
+ return_types.emplace_back(LogicalType::VARCHAR);
108710
+
108711
+ return nullptr;
108712
+ }
108713
+
108714
+ unique_ptr<GlobalTableFunctionState> DuckDBExtensionsInit(ClientContext &context, TableFunctionInitInput &input) {
108715
+ auto result = make_unique<DuckDBExtensionsData>();
108716
+
108717
+ auto &fs = FileSystem::GetFileSystem(context);
108718
+ auto &db = DatabaseInstance::GetDatabase(context);
108719
+
108720
+ map<string, ExtensionInformation> installed_extensions;
108721
+ auto extension_count = ExtensionHelper::DefaultExtensionCount();
108722
+ for (idx_t i = 0; i < extension_count; i++) {
108723
+ auto extension = ExtensionHelper::GetDefaultExtension(i);
108724
+ ExtensionInformation info;
108725
+ info.name = extension.name;
108726
+ info.installed = extension.statically_loaded;
108727
+ info.loaded = false;
108728
+ info.file_path = extension.statically_loaded ? "(BUILT-IN)" : string();
108729
+ info.description = extension.description;
108730
+ installed_extensions[info.name] = move(info);
108731
+ }
108732
+
108733
+ // scan the install directory for installed extensions
108734
+ auto ext_directory = ExtensionHelper::ExtensionDirectory(fs);
108735
+ fs.ListFiles(ext_directory, [&](const string &path, bool is_directory) {
108736
+ if (!StringUtil::EndsWith(path, ".duckdb_extension")) {
108737
+ return;
108738
+ }
108739
+ ExtensionInformation info;
108740
+ info.name = fs.ExtractBaseName(path);
108741
+ info.loaded = false;
108742
+ info.file_path = fs.JoinPath(ext_directory, path);
108743
+ auto entry = installed_extensions.find(info.name);
108744
+ if (entry == installed_extensions.end()) {
108745
+ installed_extensions[info.name] = move(info);
108746
+ } else {
108747
+ if (!entry->second.loaded) {
108748
+ entry->second.file_path = info.file_path;
108749
+ }
108750
+ entry->second.installed = true;
108751
+ }
108752
+ });
108753
+
108754
+ // now check the list of currently loaded extensions
108755
+ auto &loaded_extensions = db.LoadedExtensions();
108756
+ for (auto &ext_name : loaded_extensions) {
108757
+ auto entry = installed_extensions.find(ext_name);
108758
+ if (entry == installed_extensions.end()) {
108759
+ ExtensionInformation info;
108760
+ info.name = ext_name;
108761
+ info.loaded = true;
108762
+ installed_extensions[ext_name] = move(info);
108763
+ } else {
108764
+ entry->second.loaded = true;
108765
+ }
108766
+ }
108767
+
108768
+ result->entries.reserve(installed_extensions.size());
108769
+ for (auto &kv : installed_extensions) {
108770
+ result->entries.push_back(move(kv.second));
108771
+ }
108772
+ return move(result);
108773
+ }
108774
+
108775
+ void DuckDBExtensionsFunction(ClientContext &context, TableFunctionInput &data_p, DataChunk &output) {
108776
+ auto &data = (DuckDBExtensionsData &)*data_p.global_state;
108777
+ if (data.offset >= data.entries.size()) {
108778
+ // finished returning values
108779
+ return;
108780
+ }
108781
+ // start returning values
108782
+ // either fill up the chunk or return all the remaining columns
108783
+ idx_t count = 0;
108784
+ while (data.offset < data.entries.size() && count < STANDARD_VECTOR_SIZE) {
108785
+ auto &entry = data.entries[data.offset];
108786
+
108787
+ // return values:
108788
+ // extension_name LogicalType::VARCHAR
108789
+ output.SetValue(0, count, Value(entry.name));
108790
+ // loaded LogicalType::BOOLEAN
108791
+ output.SetValue(1, count, Value::BOOLEAN(entry.loaded));
108792
+ // installed LogicalType::BOOLEAN
108793
+ output.SetValue(2, count, !entry.installed && entry.loaded ? Value() : Value::BOOLEAN(entry.installed));
108794
+ // install_path LogicalType::VARCHAR
108795
+ output.SetValue(3, count, Value(entry.file_path));
108796
+ // description LogicalType::VARCHAR
108797
+ output.SetValue(4, count, Value(entry.description));
108798
+
108799
+ data.offset++;
108800
+ count++;
108801
+ }
108802
+ output.SetCardinality(count);
108803
+ }
108804
+
108805
+ void DuckDBExtensionsFun::RegisterFunction(BuiltinFunctions &set) {
108806
+ TableFunctionSet functions("duckdb_extensions");
108807
+ functions.AddFunction(TableFunction({}, DuckDBExtensionsFunction, DuckDBExtensionsBind, DuckDBExtensionsInit));
108808
+ set.AddFunction(functions);
108809
+ }
108810
+
108811
+ } // namespace duckdb
108812
+
108813
+
108814
+
108815
+
108816
+
108817
+
108818
+
108819
+
108820
+
108821
+
108672
108822
 
108673
108823
 
108674
108824
 
@@ -111312,6 +111462,7 @@ void BuiltinFunctions::RegisterSQLiteFunctions() {
111312
111462
  DuckDBIndexesFun::RegisterFunction(*this);
111313
111463
  DuckDBSchemasFun::RegisterFunction(*this);
111314
111464
  DuckDBDependenciesFun::RegisterFunction(*this);
111465
+ DuckDBExtensionsFun::RegisterFunction(*this);
111315
111466
  DuckDBSequencesFun::RegisterFunction(*this);
111316
111467
  DuckDBSettingsFun::RegisterFunction(*this);
111317
111468
  DuckDBTablesFun::RegisterFunction(*this);
@@ -117879,6 +118030,10 @@ idx_t DatabaseInstance::NumberOfThreads() {
117879
118030
  return scheduler->NumberOfThreads();
117880
118031
  }
117881
118032
 
118033
+ const unordered_set<std::string> &DatabaseInstance::LoadedExtensions() {
118034
+ return loaded_extensions;
118035
+ }
118036
+
117882
118037
  idx_t DuckDB::NumberOfThreads() {
117883
118038
  return instance->NumberOfThreads();
117884
118039
  }
@@ -117907,31 +118062,52 @@ string ClientConfig::ExtractTimezoneFromConfig(ClientConfig &config) {
117907
118062
 
117908
118063
 
117909
118064
  #if defined(BUILD_ICU_EXTENSION) && !defined(DISABLE_BUILTIN_EXTENSIONS)
118065
+ #define ICU_STATICALLY_LOADED true
117910
118066
  #include "icu-extension.hpp"
118067
+ #else
118068
+ #define ICU_STATICALLY_LOADED false
117911
118069
  #endif
117912
118070
 
117913
118071
  #if defined(BUILD_PARQUET_EXTENSION) && !defined(DISABLE_BUILTIN_EXTENSIONS)
118072
+ #define PARQUET_STATICALLY_LOADED true
117914
118073
  #include "parquet-extension.hpp"
118074
+ #else
118075
+ #define PARQUET_STATICALLY_LOADED false
117915
118076
  #endif
117916
118077
 
117917
118078
  #if defined(BUILD_TPCH_EXTENSION) && !defined(DISABLE_BUILTIN_EXTENSIONS)
118079
+ #define TPCH_STATICALLY_LOADED true
117918
118080
  #include "tpch-extension.hpp"
118081
+ #else
118082
+ #define TPCH_STATICALLY_LOADED false
117919
118083
  #endif
117920
118084
 
117921
118085
  #if defined(BUILD_TPCDS_EXTENSION) && !defined(DISABLE_BUILTIN_EXTENSIONS)
118086
+ #define TPCDS_STATICALLY_LOADED true
117922
118087
  #include "tpcds-extension.hpp"
118088
+ #else
118089
+ #define TPCDS_STATICALLY_LOADED false
117923
118090
  #endif
117924
118091
 
117925
118092
  #if defined(BUILD_SUBSTRAIT_EXTENSION) && !defined(DISABLE_BUILTIN_EXTENSIONS)
118093
+ #define SUBSTRAIT_STATICALLY_LOADED true
117926
118094
  #include "substrait-extension.hpp"
118095
+ #else
118096
+ #define SUBSTRAIT_STATICALLY_LOADED false
117927
118097
  #endif
117928
118098
 
117929
118099
  #if defined(BUILD_FTS_EXTENSION) && !defined(DISABLE_BUILTIN_EXTENSIONS)
118100
+ #define FTS_STATICALLY_LOADED true
117930
118101
  #include "fts-extension.hpp"
118102
+ #else
118103
+ #define FTS_STATICALLY_LOADED false
117931
118104
  #endif
117932
118105
 
117933
118106
  #if defined(BUILD_HTTPFS_EXTENSION) && !defined(DISABLE_BUILTIN_EXTENSIONS)
118107
+ #define HTTPFS_STATICALLY_LOADED true
117934
118108
  #include "httpfs-extension.hpp"
118109
+ #else
118110
+ #define HTTPFS_STATICALLY_LOADED false
117935
118111
  #endif
117936
118112
 
117937
118113
  #if defined(BUILD_VISUALIZER_EXTENSION) && !defined(DISABLE_BUILTIN_EXTENSIONS)
@@ -117939,7 +118115,10 @@ string ClientConfig::ExtractTimezoneFromConfig(ClientConfig &config) {
117939
118115
  #endif
117940
118116
 
117941
118117
  #if defined(BUILD_JSON_EXTENSION) && !defined(DISABLE_BUILTIN_EXTENSIONS)
118118
+ #define JSON_STATICALLY_LOADED true
117942
118119
  #include "json-extension.hpp"
118120
+ #else
118121
+ #define JSON_STATICALLY_LOADED false
117943
118122
  #endif
117944
118123
 
117945
118124
  #if defined(BUILD_EXCEL_EXTENSION) && !defined(DISABLE_BUILTIN_EXTENSIONS)
@@ -117952,6 +118131,37 @@ string ClientConfig::ExtractTimezoneFromConfig(ClientConfig &config) {
117952
118131
 
117953
118132
  namespace duckdb {
117954
118133
 
118134
+ //===--------------------------------------------------------------------===//
118135
+ // Default Extensions
118136
+ //===--------------------------------------------------------------------===//
118137
+ static DefaultExtension internal_extensions[] = {
118138
+ {"icu", "Adds support for time zones and collations using the ICU library", ICU_STATICALLY_LOADED},
118139
+ {"parquet", "Adds support for reading and writing parquet files", PARQUET_STATICALLY_LOADED},
118140
+ {"tpch", "Adds TPC-H data generation and query support", TPCH_STATICALLY_LOADED},
118141
+ {"tpcds", "Adds TPC-DS data generation and query support", TPCDS_STATICALLY_LOADED},
118142
+ {"substrait", "Adds support for the Substrait integration", SUBSTRAIT_STATICALLY_LOADED},
118143
+ {"fts", "Adds support for Full-Text Search Indexes", FTS_STATICALLY_LOADED},
118144
+ {"httpfs", "Adds support for reading and writing files over a HTTP(S) connection", HTTPFS_STATICALLY_LOADED},
118145
+ {"json", "Adds support for JSON operations", JSON_STATICALLY_LOADED},
118146
+ {"sqlite_scanner", "Adds support for reading SQLite database files", false},
118147
+ {"postgres_scanner", "Adds support for reading from a Postgres database", false},
118148
+ {nullptr, nullptr, false}};
118149
+
118150
+ idx_t ExtensionHelper::DefaultExtensionCount() {
118151
+ idx_t index;
118152
+ for (index = 0; internal_extensions[index].name != nullptr; index++) {
118153
+ }
118154
+ return index;
118155
+ }
118156
+
118157
+ DefaultExtension ExtensionHelper::GetDefaultExtension(idx_t index) {
118158
+ D_ASSERT(index < DefaultExtensionCount());
118159
+ return internal_extensions[index];
118160
+ }
118161
+
118162
+ //===--------------------------------------------------------------------===//
118163
+ // Load Statically Compiled Extension
118164
+ //===--------------------------------------------------------------------===//
117955
118165
  void ExtensionHelper::LoadAllExtensions(DuckDB &db) {
117956
118166
  unordered_set<string> extensions {"parquet", "icu", "tpch", "tpcds", "fts", "httpfs",
117957
118167
  "substrait", "visualizer", "json", "excel", "sqlsmith"};
@@ -117960,9 +118170,6 @@ void ExtensionHelper::LoadAllExtensions(DuckDB &db) {
117960
118170
  }
117961
118171
  }
117962
118172
 
117963
- //===--------------------------------------------------------------------===//
117964
- // Load Statically Compiled Extension
117965
- //===--------------------------------------------------------------------===//
117966
118173
  ExtensionLoadResult ExtensionHelper::LoadExtension(DuckDB &db, const std::string &extension) {
117967
118174
  return LoadExtensionInternal(db, extension, false);
117968
118175
  }
@@ -117986,28 +118193,28 @@ ExtensionLoadResult ExtensionHelper::LoadExtensionInternal(DuckDB &db, const std
117986
118193
  }
117987
118194
  #endif
117988
118195
  if (extension == "parquet") {
117989
- #if defined(BUILD_PARQUET_EXTENSION) && !defined(DISABLE_BUILTIN_EXTENSIONS)
118196
+ #if PARQUET_STATICALLY_LOADED
117990
118197
  db.LoadExtension<ParquetExtension>();
117991
118198
  #else
117992
118199
  // parquet extension required but not build: skip this test
117993
118200
  return ExtensionLoadResult::NOT_LOADED;
117994
118201
  #endif
117995
118202
  } else if (extension == "icu") {
117996
- #if defined(BUILD_ICU_EXTENSION) && !defined(DISABLE_BUILTIN_EXTENSIONS)
118203
+ #if ICU_STATICALLY_LOADED
117997
118204
  db.LoadExtension<ICUExtension>();
117998
118205
  #else
117999
118206
  // icu extension required but not build: skip this test
118000
118207
  return ExtensionLoadResult::NOT_LOADED;
118001
118208
  #endif
118002
118209
  } else if (extension == "tpch") {
118003
- #if defined(BUILD_TPCH_EXTENSION) && !defined(DISABLE_BUILTIN_EXTENSIONS)
118210
+ #if TPCH_STATICALLY_LOADED
118004
118211
  db.LoadExtension<TPCHExtension>();
118005
118212
  #else
118006
118213
  // icu extension required but not build: skip this test
118007
118214
  return ExtensionLoadResult::NOT_LOADED;
118008
118215
  #endif
118009
118216
  } else if (extension == "substrait") {
118010
- #if defined(BUILD_SUBSTRAIT_EXTENSION) && !defined(DISABLE_BUILTIN_EXTENSIONS)
118217
+ #if SUBSTRAIT_STATICALLY_LOADED
118011
118218
 
118012
118219
  db.LoadExtension<SubstraitExtension>();
118013
118220
  #else
@@ -118015,21 +118222,21 @@ ExtensionLoadResult ExtensionHelper::LoadExtensionInternal(DuckDB &db, const std
118015
118222
  return ExtensionLoadResult::NOT_LOADED;
118016
118223
  #endif
118017
118224
  } else if (extension == "tpcds") {
118018
- #if defined(BUILD_TPCDS_EXTENSION) && !defined(DISABLE_BUILTIN_EXTENSIONS)
118225
+ #if TPCDS_STATICALLY_LOADED
118019
118226
  db.LoadExtension<TPCDSExtension>();
118020
118227
  #else
118021
118228
  // icu extension required but not build: skip this test
118022
118229
  return ExtensionLoadResult::NOT_LOADED;
118023
118230
  #endif
118024
118231
  } else if (extension == "fts") {
118025
- #if defined(BUILD_FTS_EXTENSION) && !defined(DISABLE_BUILTIN_EXTENSIONS)
118232
+ #if FTS_STATICALLY_LOADED
118026
118233
  db.LoadExtension<FTSExtension>();
118027
118234
  #else
118028
118235
  // fts extension required but not build: skip this test
118029
118236
  return ExtensionLoadResult::NOT_LOADED;
118030
118237
  #endif
118031
118238
  } else if (extension == "httpfs") {
118032
- #if defined(BUILD_HTTPFS_EXTENSION) && !defined(DISABLE_BUILTIN_EXTENSIONS)
118239
+ #if HTTPFS_STATICALLY_LOADED
118033
118240
  db.LoadExtension<HTTPFsExtension>();
118034
118241
  #else
118035
118242
  return ExtensionLoadResult::NOT_LOADED;
@@ -118042,7 +118249,7 @@ ExtensionLoadResult ExtensionHelper::LoadExtensionInternal(DuckDB &db, const std
118042
118249
  return ExtensionLoadResult::NOT_LOADED;
118043
118250
  #endif
118044
118251
  } else if (extension == "json") {
118045
- #if defined(BUILD_JSON_EXTENSION) && !defined(DISABLE_BUILTIN_EXTENSIONS)
118252
+ #if JSON_STATICALLY_LOADED
118046
118253
  db.LoadExtension<JSONExtension>();
118047
118254
  #else
118048
118255
  // json extension required but not build: skip this test
@@ -126285,13 +126492,7 @@ const vector<string> ExtensionHelper::PathComponents() {
126285
126492
  return vector<string> {".duckdb", "extensions", DuckDB::SourceID(), DuckDB::Platform()};
126286
126493
  }
126287
126494
 
126288
- void ExtensionHelper::InstallExtension(DatabaseInstance &db, const string &extension, bool force_install) {
126289
- auto &config = DBConfig::GetConfig(db);
126290
- if (!config.enable_external_access) {
126291
- throw PermissionException("Installing extensions is disabled through configuration");
126292
- }
126293
- auto &fs = FileSystem::GetFileSystem(db);
126294
-
126495
+ string ExtensionHelper::ExtensionDirectory(FileSystem &fs) {
126295
126496
  string local_path = fs.GetHomeDirectory();
126296
126497
  if (!fs.DirectoryExists(local_path)) {
126297
126498
  throw InternalException("Can't find the home directory at " + local_path);
@@ -126303,6 +126504,17 @@ void ExtensionHelper::InstallExtension(DatabaseInstance &db, const string &exten
126303
126504
  fs.CreateDirectory(local_path);
126304
126505
  }
126305
126506
  }
126507
+ return local_path;
126508
+ }
126509
+
126510
+ void ExtensionHelper::InstallExtension(DatabaseInstance &db, const string &extension, bool force_install) {
126511
+ auto &config = DBConfig::GetConfig(db);
126512
+ if (!config.enable_external_access) {
126513
+ throw PermissionException("Installing extensions is disabled through configuration");
126514
+ }
126515
+ auto &fs = FileSystem::GetFileSystem(db);
126516
+
126517
+ string local_path = ExtensionDirectory(fs);
126306
126518
 
126307
126519
  auto extension_name = fs.ExtractBaseName(extension);
126308
126520
 
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 "8e602ba1d"
15
- #define DUCKDB_VERSION "v0.4.1-dev26"
14
+ #define DUCKDB_SOURCE_ID "530a5f55c"
15
+ #define DUCKDB_VERSION "v0.4.1-dev36"
16
16
  //===----------------------------------------------------------------------===//
17
17
  // DuckDB
18
18
  //
@@ -983,7 +983,7 @@ enum class LogicalTypeId : uint8_t {
983
983
 
984
984
  HUGEINT = 50,
985
985
  POINTER = 51,
986
- HASH = 52,
986
+ // HASH = 52, // deprecated, uses UBIGINT instead
987
987
  VALIDITY = 53,
988
988
  UUID = 54,
989
989
 
@@ -1095,7 +1095,7 @@ public:
1095
1095
  static constexpr const LogicalTypeId INTERVAL = LogicalTypeId::INTERVAL;
1096
1096
  static constexpr const LogicalTypeId HUGEINT = LogicalTypeId::HUGEINT;
1097
1097
  static constexpr const LogicalTypeId UUID = LogicalTypeId::UUID;
1098
- static constexpr const LogicalTypeId HASH = LogicalTypeId::HASH;
1098
+ static constexpr const LogicalTypeId HASH = LogicalTypeId::UBIGINT;
1099
1099
  static constexpr const LogicalTypeId POINTER = LogicalTypeId::POINTER;
1100
1100
  static constexpr const LogicalTypeId TABLE = LogicalTypeId::TABLE;
1101
1101
  static constexpr const LogicalTypeId INVALID = LogicalTypeId::INVALID;
@@ -18742,6 +18742,8 @@ public:
18742
18742
 
18743
18743
  DUCKDB_API static DatabaseInstance &GetDatabase(ClientContext &context);
18744
18744
 
18745
+ DUCKDB_API const unordered_set<std::string> &LoadedExtensions();
18746
+
18745
18747
  private:
18746
18748
  void Initialize(const char *path, DBConfig *config);
18747
18749