duckdb 0.10.3-dev8.0 → 1.0.1-dev15.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.
Files changed (55) hide show
  1. package/.github/workflows/Electron.yml +293 -0
  2. package/.github/workflows/HighPriorityIssues.yml +1 -1
  3. package/.github/workflows/NodeJS.yml +3 -3
  4. package/package.json +1 -1
  5. package/scripts/electron-versions.json +64 -0
  6. package/scripts/node_build.sh +12 -0
  7. package/scripts/node_build_win.sh +12 -0
  8. package/src/duckdb/extension/parquet/parquet_extension.cpp +7 -1
  9. package/src/duckdb/src/catalog/dependency_manager.cpp +4 -0
  10. package/src/duckdb/src/common/enum_util.cpp +29 -0
  11. package/src/duckdb/src/common/error_data.cpp +5 -2
  12. package/src/duckdb/src/common/local_file_system.cpp +5 -0
  13. package/src/duckdb/src/common/multi_file_reader.cpp +3 -0
  14. package/src/duckdb/src/common/printer.cpp +1 -1
  15. package/src/duckdb/src/common/string_util.cpp +1 -1
  16. package/src/duckdb/src/core_functions/aggregate/holistic/approximate_quantile.cpp +14 -5
  17. package/src/duckdb/src/core_functions/aggregate/holistic/quantile.cpp +11 -3
  18. package/src/duckdb/src/execution/operator/helper/physical_load.cpp +2 -2
  19. package/src/duckdb/src/execution/operator/persistent/physical_copy_database.cpp +3 -1
  20. package/src/duckdb/src/execution/operator/persistent/physical_copy_to_file.cpp +13 -10
  21. package/src/duckdb/src/execution/physical_plan/plan_copy_to_file.cpp +2 -2
  22. package/src/duckdb/src/function/table/system/duckdb_extensions.cpp +2 -3
  23. package/src/duckdb/src/function/table/version/pragma_version.cpp +5 -5
  24. package/src/duckdb/src/include/duckdb/common/enum_util.hpp +8 -0
  25. package/src/duckdb/src/include/duckdb/common/enums/copy_overwrite_mode.hpp +18 -0
  26. package/src/duckdb/src/include/duckdb/common/multi_file_reader.hpp +1 -0
  27. package/src/duckdb/src/include/duckdb/common/shared_ptr.hpp +3 -3
  28. package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_copy_to_file.hpp +2 -1
  29. package/src/duckdb/src/include/duckdb/main/attached_database.hpp +6 -0
  30. package/src/duckdb/src/include/duckdb/main/config.hpp +4 -0
  31. package/src/duckdb/src/include/duckdb/main/extension_helper.hpp +6 -6
  32. package/src/duckdb/src/include/duckdb/main/settings.hpp +20 -0
  33. package/src/duckdb/src/include/duckdb/planner/operator/logical_comparison_join.hpp +7 -7
  34. package/src/duckdb/src/include/duckdb/planner/operator/logical_copy_to_file.hpp +2 -1
  35. package/src/duckdb/src/include/duckdb/storage/storage_extension.hpp +7 -0
  36. package/src/duckdb/src/include/duckdb.h +126 -4
  37. package/src/duckdb/src/main/attached_database.cpp +7 -6
  38. package/src/duckdb/src/main/capi/stream-c.cpp +17 -8
  39. package/src/duckdb/src/main/capi/table_function-c.cpp +11 -7
  40. package/src/duckdb/src/main/config.cpp +2 -0
  41. package/src/duckdb/src/main/extension/extension_helper.cpp +3 -25
  42. package/src/duckdb/src/main/extension/extension_install.cpp +10 -6
  43. package/src/duckdb/src/main/settings/settings.cpp +32 -0
  44. package/src/duckdb/src/optimizer/pushdown/pushdown_cross_product.cpp +3 -3
  45. package/src/duckdb/src/optimizer/rule/move_constants.cpp +4 -0
  46. package/src/duckdb/src/planner/binder/query_node/plan_subquery.cpp +2 -2
  47. package/src/duckdb/src/planner/binder/statement/bind_copy.cpp +17 -4
  48. package/src/duckdb/src/planner/binder/statement/bind_create.cpp +26 -15
  49. package/src/duckdb/src/planner/binder/tableref/plan_joinref.cpp +29 -11
  50. package/src/duckdb/src/planner/operator/logical_copy_to_file.cpp +3 -3
  51. package/src/duckdb/src/storage/storage_manager.cpp +17 -8
  52. package/test/replacement_scan.test.ts +2 -0
  53. /package/src/duckdb/src/include/duckdb/common/{enable_shared_from_this.ipp → enable_shared_from_this_ipp.hpp} +0 -0
  54. /package/src/duckdb/src/include/duckdb/common/{shared_ptr.ipp → shared_ptr_ipp.hpp} +0 -0
  55. /package/src/duckdb/src/include/duckdb/common/{weak_ptr.ipp → weak_ptr_ipp.hpp} +0 -0
@@ -35,6 +35,13 @@
35
35
  #endif
36
36
  #endif
37
37
 
38
+ //! In the future, we are planning to move extension functions to a separate header. For now you can set the define
39
+ //! below to remove the functions that are planned to be moved out of this header.
40
+ // #define DUCKDB_NO_EXTENSION_FUNCTIONS
41
+
42
+ //! Set the define below to remove all functions that are deprecated or planned to be deprecated
43
+ // #define DUCKDB_API_NO_DEPRECATED
44
+
38
45
  //! API versions
39
46
  //! If no explicit API version is defined, the latest API version is used.
40
47
  //! Note that using older API versions (i.e. not using DUCKDB_API_LATEST) is deprecated.
@@ -433,6 +440,7 @@ typedef struct _duckdb_value {
433
440
  // Table function types
434
441
  //===--------------------------------------------------------------------===//
435
442
 
443
+ #ifndef DUCKDB_NO_EXTENSION_FUNCTIONS
436
444
  //! A table function. Must be destroyed with `duckdb_destroy_table_function`.
437
445
  typedef void *duckdb_table_function;
438
446
 
@@ -463,6 +471,7 @@ typedef void *duckdb_replacement_scan_info;
463
471
 
464
472
  //! A replacement scan function that can be added to a database.
465
473
  typedef void (*duckdb_replacement_callback_t)(duckdb_replacement_scan_info info, const char *table_name, void *data);
474
+ #endif
466
475
 
467
476
  //===--------------------------------------------------------------------===//
468
477
  // Arrow-related types
@@ -709,13 +718,17 @@ Returns the number of columns present in a the result object.
709
718
  */
710
719
  DUCKDB_API idx_t duckdb_column_count(duckdb_result *result);
711
720
 
721
+ #ifndef DUCKDB_API_NO_DEPRECATED
712
722
  /*!
723
+ **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
724
+
713
725
  Returns the number of rows present in the result object.
714
726
 
715
727
  * result: The result object.
716
728
  * returns: The number of rows present in the result object.
717
729
  */
718
730
  DUCKDB_API idx_t duckdb_row_count(duckdb_result *result);
731
+ #endif
719
732
 
720
733
  /*!
721
734
  Returns the number of rows changed by the query stored in the result. This is relevant only for INSERT/UPDATE/DELETE
@@ -726,6 +739,7 @@ queries. For other queries the rows_changed will be 0.
726
739
  */
727
740
  DUCKDB_API idx_t duckdb_rows_changed(duckdb_result *result);
728
741
 
742
+ #ifndef DUCKDB_API_NO_DEPRECATED
729
743
  /*!
730
744
  **DEPRECATED**: Prefer using `duckdb_result_get_chunk` instead.
731
745
 
@@ -769,6 +783,7 @@ if (nullmask[row]) {
769
783
  * returns: The nullmask of the specified column.
770
784
  */
771
785
  DUCKDB_API bool *duckdb_nullmask_data(duckdb_result *result, idx_t col);
786
+ #endif
772
787
 
773
788
  /*!
774
789
  Returns the error message contained within the result. The error is only set if `duckdb_query` returns `DuckDBError`.
@@ -783,8 +798,10 @@ DUCKDB_API const char *duckdb_result_error(duckdb_result *result);
783
798
  //===--------------------------------------------------------------------===//
784
799
  // Result Functions
785
800
  //===--------------------------------------------------------------------===//
786
-
801
+ #ifndef DUCKDB_API_NO_DEPRECATED
787
802
  /*!
803
+ **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
804
+
788
805
  Fetches a data chunk from the duckdb_result. This function should be called repeatedly until the result is exhausted.
789
806
 
790
807
  The result must be destroyed with `duckdb_destroy_data_chunk`.
@@ -804,6 +821,8 @@ Use `duckdb_result_chunk_count` to figure out how many chunks there are in the r
804
821
  DUCKDB_API duckdb_data_chunk duckdb_result_get_chunk(duckdb_result result, idx_t chunk_index);
805
822
 
806
823
  /*!
824
+ **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
825
+
807
826
  Checks if the type of the internal result is StreamQueryResult.
808
827
 
809
828
  * result: The result object to check.
@@ -812,12 +831,15 @@ Checks if the type of the internal result is StreamQueryResult.
812
831
  DUCKDB_API bool duckdb_result_is_streaming(duckdb_result result);
813
832
 
814
833
  /*!
834
+ **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
835
+
815
836
  Returns the number of data chunks present in the result.
816
837
 
817
838
  * result: The result object
818
839
  * returns: Number of data chunks present in the result.
819
840
  */
820
841
  DUCKDB_API idx_t duckdb_result_chunk_count(duckdb_result result);
842
+ #endif
821
843
 
822
844
  /*!
823
845
  Returns the return_type of the given result, or DUCKDB_RETURN_TYPE_INVALID on error
@@ -827,6 +849,7 @@ Returns the return_type of the given result, or DUCKDB_RETURN_TYPE_INVALID on er
827
849
  */
828
850
  DUCKDB_API duckdb_result_type duckdb_result_return_type(duckdb_result result);
829
851
 
852
+ #ifndef DUCKDB_API_NO_DEPRECATED
830
853
  //===--------------------------------------------------------------------===//
831
854
  // Safe fetch functions
832
855
  //===--------------------------------------------------------------------===//
@@ -837,91 +860,127 @@ DUCKDB_API duckdb_result_type duckdb_result_return_type(duckdb_result result);
837
860
  // For fast access of values prefer using `duckdb_result_get_chunk`
838
861
 
839
862
  /*!
863
+ **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
864
+
840
865
  * returns: The boolean value at the specified location, or false if the value cannot be converted.
841
866
  */
842
867
  DUCKDB_API bool duckdb_value_boolean(duckdb_result *result, idx_t col, idx_t row);
843
868
 
844
869
  /*!
870
+ **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
871
+
845
872
  * returns: The int8_t value at the specified location, or 0 if the value cannot be converted.
846
873
  */
847
874
  DUCKDB_API int8_t duckdb_value_int8(duckdb_result *result, idx_t col, idx_t row);
848
875
 
849
876
  /*!
877
+ **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
878
+
850
879
  * returns: The int16_t value at the specified location, or 0 if the value cannot be converted.
851
880
  */
852
881
  DUCKDB_API int16_t duckdb_value_int16(duckdb_result *result, idx_t col, idx_t row);
853
882
 
854
883
  /*!
884
+ **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
885
+
855
886
  * returns: The int32_t value at the specified location, or 0 if the value cannot be converted.
856
887
  */
857
888
  DUCKDB_API int32_t duckdb_value_int32(duckdb_result *result, idx_t col, idx_t row);
858
889
 
859
890
  /*!
891
+ **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
892
+
860
893
  * returns: The int64_t value at the specified location, or 0 if the value cannot be converted.
861
894
  */
862
895
  DUCKDB_API int64_t duckdb_value_int64(duckdb_result *result, idx_t col, idx_t row);
863
896
 
864
897
  /*!
898
+ **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
899
+
865
900
  * returns: The duckdb_hugeint value at the specified location, or 0 if the value cannot be converted.
866
901
  */
867
902
  DUCKDB_API duckdb_hugeint duckdb_value_hugeint(duckdb_result *result, idx_t col, idx_t row);
868
903
 
869
904
  /*!
905
+ **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
906
+
870
907
  * returns: The duckdb_uhugeint value at the specified location, or 0 if the value cannot be converted.
871
908
  */
872
909
  DUCKDB_API duckdb_uhugeint duckdb_value_uhugeint(duckdb_result *result, idx_t col, idx_t row);
873
910
 
874
911
  /*!
912
+ **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
913
+
875
914
  * returns: The duckdb_decimal value at the specified location, or 0 if the value cannot be converted.
876
915
  */
877
916
  DUCKDB_API duckdb_decimal duckdb_value_decimal(duckdb_result *result, idx_t col, idx_t row);
878
917
 
879
918
  /*!
919
+ **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
920
+
880
921
  * returns: The uint8_t value at the specified location, or 0 if the value cannot be converted.
881
922
  */
882
923
  DUCKDB_API uint8_t duckdb_value_uint8(duckdb_result *result, idx_t col, idx_t row);
883
924
 
884
925
  /*!
926
+ **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
927
+
885
928
  * returns: The uint16_t value at the specified location, or 0 if the value cannot be converted.
886
929
  */
887
930
  DUCKDB_API uint16_t duckdb_value_uint16(duckdb_result *result, idx_t col, idx_t row);
888
931
 
889
932
  /*!
933
+ **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
934
+
890
935
  * returns: The uint32_t value at the specified location, or 0 if the value cannot be converted.
891
936
  */
892
937
  DUCKDB_API uint32_t duckdb_value_uint32(duckdb_result *result, idx_t col, idx_t row);
893
938
 
894
939
  /*!
940
+ **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
941
+
895
942
  * returns: The uint64_t value at the specified location, or 0 if the value cannot be converted.
896
943
  */
897
944
  DUCKDB_API uint64_t duckdb_value_uint64(duckdb_result *result, idx_t col, idx_t row);
898
945
 
899
946
  /*!
947
+ **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
948
+
900
949
  * returns: The float value at the specified location, or 0 if the value cannot be converted.
901
950
  */
902
951
  DUCKDB_API float duckdb_value_float(duckdb_result *result, idx_t col, idx_t row);
903
952
 
904
953
  /*!
954
+ **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
955
+
905
956
  * returns: The double value at the specified location, or 0 if the value cannot be converted.
906
957
  */
907
958
  DUCKDB_API double duckdb_value_double(duckdb_result *result, idx_t col, idx_t row);
908
959
 
909
960
  /*!
961
+ **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
962
+
910
963
  * returns: The duckdb_date value at the specified location, or 0 if the value cannot be converted.
911
964
  */
912
965
  DUCKDB_API duckdb_date duckdb_value_date(duckdb_result *result, idx_t col, idx_t row);
913
966
 
914
967
  /*!
968
+ **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
969
+
915
970
  * returns: The duckdb_time value at the specified location, or 0 if the value cannot be converted.
916
971
  */
917
972
  DUCKDB_API duckdb_time duckdb_value_time(duckdb_result *result, idx_t col, idx_t row);
918
973
 
919
974
  /*!
975
+ **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
976
+
920
977
  * returns: The duckdb_timestamp value at the specified location, or 0 if the value cannot be converted.
921
978
  */
922
979
  DUCKDB_API duckdb_timestamp duckdb_value_timestamp(duckdb_result *result, idx_t col, idx_t row);
923
980
 
924
981
  /*!
982
+ **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
983
+
925
984
  * returns: The duckdb_interval value at the specified location, or 0 if the value cannot be converted.
926
985
  */
927
986
  DUCKDB_API duckdb_interval duckdb_value_interval(duckdb_result *result, idx_t col, idx_t row);
@@ -934,6 +993,8 @@ converted. The result must be freed with `duckdb_free`.
934
993
  DUCKDB_API char *duckdb_value_varchar(duckdb_result *result, idx_t col, idx_t row);
935
994
 
936
995
  /*!
996
+ **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
997
+
937
998
  * returns: The string value at the specified location. Attempts to cast the result value to string.
938
999
  * No support for nested types, and for other complex types.
939
1000
  * The resulting field "string.data" must be freed with `duckdb_free.`
@@ -961,15 +1022,20 @@ The result must NOT be freed.
961
1022
  DUCKDB_API duckdb_string duckdb_value_string_internal(duckdb_result *result, idx_t col, idx_t row);
962
1023
 
963
1024
  /*!
1025
+ **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
1026
+
964
1027
  * returns: The duckdb_blob value at the specified location. Returns a blob with blob.data set to nullptr if the
965
1028
  value cannot be converted. The resulting field "blob.data" must be freed with `duckdb_free.`
966
1029
  */
967
1030
  DUCKDB_API duckdb_blob duckdb_value_blob(duckdb_result *result, idx_t col, idx_t row);
968
1031
 
969
1032
  /*!
1033
+ **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
1034
+
970
1035
  * returns: Returns true if the value at the specified index is NULL, and false otherwise.
971
1036
  */
972
1037
  DUCKDB_API bool duckdb_value_is_null(duckdb_result *result, idx_t col, idx_t row);
1038
+ #endif
973
1039
 
974
1040
  //===--------------------------------------------------------------------===//
975
1041
  // Helpers
@@ -1405,7 +1471,10 @@ Note that the result must be freed with `duckdb_destroy_result`.
1405
1471
  DUCKDB_API duckdb_state duckdb_execute_prepared(duckdb_prepared_statement prepared_statement,
1406
1472
  duckdb_result *out_result);
1407
1473
 
1474
+ #ifndef DUCKDB_API_NO_DEPRECATED
1408
1475
  /*!
1476
+ **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
1477
+
1409
1478
  Executes the prepared statement with the given bound parameters, and returns an optionally-streaming query result.
1410
1479
  To determine if the resulting query was in fact streamed, use `duckdb_result_is_streaming`
1411
1480
 
@@ -1420,6 +1489,7 @@ Note that the result must be freed with `duckdb_destroy_result`.
1420
1489
  */
1421
1490
  DUCKDB_API duckdb_state duckdb_execute_prepared_streaming(duckdb_prepared_statement prepared_statement,
1422
1491
  duckdb_result *out_result);
1492
+ #endif
1423
1493
 
1424
1494
  //===--------------------------------------------------------------------===//
1425
1495
  // Extract Statements
@@ -1492,8 +1562,10 @@ Note that after calling `duckdb_pending_prepared`, the pending result should alw
1492
1562
  */
1493
1563
  DUCKDB_API duckdb_state duckdb_pending_prepared(duckdb_prepared_statement prepared_statement,
1494
1564
  duckdb_pending_result *out_result);
1495
-
1565
+ #ifndef DUCKDB_API_NO_DEPRECATED
1496
1566
  /*!
1567
+ **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
1568
+
1497
1569
  Executes the prepared statement with the given bound parameters, and returns a pending result.
1498
1570
  This pending result will create a streaming duckdb_result when executed.
1499
1571
  The pending result represents an intermediate structure for a query that is not yet fully executed.
@@ -1507,6 +1579,7 @@ Note that after calling `duckdb_pending_prepared_streaming`, the pending result
1507
1579
  */
1508
1580
  DUCKDB_API duckdb_state duckdb_pending_prepared_streaming(duckdb_prepared_statement prepared_statement,
1509
1581
  duckdb_pending_result *out_result);
1582
+ #endif
1510
1583
 
1511
1584
  /*!
1512
1585
  Closes the pending result and de-allocates all memory allocated for the result.
@@ -2170,6 +2243,7 @@ Equivalent to `duckdb_validity_set_row_validity` with valid set to true.
2170
2243
  */
2171
2244
  DUCKDB_API void duckdb_validity_set_row_valid(uint64_t *validity, idx_t row);
2172
2245
 
2246
+ #ifndef DUCKDB_NO_EXTENSION_FUNCTIONS
2173
2247
  //===--------------------------------------------------------------------===//
2174
2248
  // Table Functions
2175
2249
  //===--------------------------------------------------------------------===//
@@ -2516,6 +2590,7 @@ Report that an error has occurred while executing the replacement scan.
2516
2590
  * error: The error message
2517
2591
  */
2518
2592
  DUCKDB_API void duckdb_replacement_scan_set_error(duckdb_replacement_scan_info info, const char *error);
2593
+ #endif
2519
2594
 
2520
2595
  //===--------------------------------------------------------------------===//
2521
2596
  // Appender
@@ -2743,11 +2818,14 @@ If the append is successful, DuckDBSuccess is returned.
2743
2818
  */
2744
2819
  DUCKDB_API duckdb_state duckdb_append_data_chunk(duckdb_appender appender, duckdb_data_chunk chunk);
2745
2820
 
2821
+ #ifndef DUCKDB_API_NO_DEPRECATED
2746
2822
  //===--------------------------------------------------------------------===//
2747
2823
  // Arrow Interface
2748
2824
  //===--------------------------------------------------------------------===//
2749
2825
 
2750
2826
  /*!
2827
+ **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
2828
+
2751
2829
  Executes a SQL query within a connection and stores the full (materialized) result in an arrow structure.
2752
2830
  If the query fails to execute, DuckDBError is returned and the error message can be retrieved by calling
2753
2831
  `duckdb_query_arrow_error`.
@@ -2763,6 +2841,8 @@ query fails, otherwise the error stored within the result will not be freed corr
2763
2841
  DUCKDB_API duckdb_state duckdb_query_arrow(duckdb_connection connection, const char *query, duckdb_arrow *out_result);
2764
2842
 
2765
2843
  /*!
2844
+ **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
2845
+
2766
2846
  Fetch the internal arrow schema from the arrow result. Remember to call release on the respective
2767
2847
  ArrowSchema object.
2768
2848
 
@@ -2773,6 +2853,8 @@ ArrowSchema object.
2773
2853
  DUCKDB_API duckdb_state duckdb_query_arrow_schema(duckdb_arrow result, duckdb_arrow_schema *out_schema);
2774
2854
 
2775
2855
  /*!
2856
+ **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
2857
+
2776
2858
  Fetch the internal arrow schema from the prepared statement. Remember to call release on the respective
2777
2859
  ArrowSchema object.
2778
2860
 
@@ -2783,6 +2865,8 @@ ArrowSchema object.
2783
2865
  DUCKDB_API duckdb_state duckdb_prepared_arrow_schema(duckdb_prepared_statement prepared,
2784
2866
  duckdb_arrow_schema *out_schema);
2785
2867
  /*!
2868
+ **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
2869
+
2786
2870
  Convert a data chunk into an arrow struct array. Remember to call release on the respective
2787
2871
  ArrowArray object.
2788
2872
 
@@ -2793,6 +2877,8 @@ ArrowArray object.
2793
2877
  DUCKDB_API void duckdb_result_arrow_array(duckdb_result result, duckdb_data_chunk chunk, duckdb_arrow_array *out_array);
2794
2878
 
2795
2879
  /*!
2880
+ **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
2881
+
2796
2882
  Fetch an internal arrow struct array from the arrow result. Remember to call release on the respective
2797
2883
  ArrowArray object.
2798
2884
 
@@ -2806,6 +2892,8 @@ So consume the out_array before calling this function again.
2806
2892
  DUCKDB_API duckdb_state duckdb_query_arrow_array(duckdb_arrow result, duckdb_arrow_array *out_array);
2807
2893
 
2808
2894
  /*!
2895
+ **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
2896
+
2809
2897
  Returns the number of columns present in the arrow result object.
2810
2898
 
2811
2899
  * result: The result object.
@@ -2814,6 +2902,8 @@ Returns the number of columns present in the arrow result object.
2814
2902
  DUCKDB_API idx_t duckdb_arrow_column_count(duckdb_arrow result);
2815
2903
 
2816
2904
  /*!
2905
+ **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
2906
+
2817
2907
  Returns the number of rows present in the arrow result object.
2818
2908
 
2819
2909
  * result: The result object.
@@ -2822,6 +2912,8 @@ Returns the number of rows present in the arrow result object.
2822
2912
  DUCKDB_API idx_t duckdb_arrow_row_count(duckdb_arrow result);
2823
2913
 
2824
2914
  /*!
2915
+ **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
2916
+
2825
2917
  Returns the number of rows changed by the query stored in the arrow result. This is relevant only for
2826
2918
  INSERT/UPDATE/DELETE queries. For other queries the rows_changed will be 0.
2827
2919
 
@@ -2831,7 +2923,9 @@ INSERT/UPDATE/DELETE queries. For other queries the rows_changed will be 0.
2831
2923
  DUCKDB_API idx_t duckdb_arrow_rows_changed(duckdb_arrow result);
2832
2924
 
2833
2925
  /*!
2834
- Returns the error message contained within the result. The error is only set if `duckdb_query_arrow` returns
2926
+ **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
2927
+
2928
+ Returns the error message contained within the result. The error is only set if `duckdb_query_arrow` returns
2835
2929
  `DuckDBError`.
2836
2930
 
2837
2931
  The error message should not be freed. It will be de-allocated when `duckdb_destroy_arrow` is called.
@@ -2842,6 +2936,8 @@ The error message should not be freed. It will be de-allocated when `duckdb_dest
2842
2936
  DUCKDB_API const char *duckdb_query_arrow_error(duckdb_arrow result);
2843
2937
 
2844
2938
  /*!
2939
+ **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
2940
+
2845
2941
  Closes the result and de-allocates all memory allocated for the arrow result.
2846
2942
 
2847
2943
  * result: The result to destroy.
@@ -2849,6 +2945,8 @@ Closes the result and de-allocates all memory allocated for the arrow result.
2849
2945
  DUCKDB_API void duckdb_destroy_arrow(duckdb_arrow *result);
2850
2946
 
2851
2947
  /*!
2948
+ **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
2949
+
2852
2950
  Releases the arrow array stream and de-allocates its memory.
2853
2951
 
2854
2952
  * stream: The arrow array stream to destroy.
@@ -2856,6 +2954,8 @@ Releases the arrow array stream and de-allocates its memory.
2856
2954
  DUCKDB_API void duckdb_destroy_arrow_stream(duckdb_arrow_stream *stream_p);
2857
2955
 
2858
2956
  /*!
2957
+ **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
2958
+
2859
2959
  Executes the prepared statement with the given bound parameters, and returns an arrow query result.
2860
2960
  Note that after running `duckdb_execute_prepared_arrow`, `duckdb_destroy_arrow` must be called on the result object.
2861
2961
 
@@ -2867,6 +2967,8 @@ DUCKDB_API duckdb_state duckdb_execute_prepared_arrow(duckdb_prepared_statement
2867
2967
  duckdb_arrow *out_result);
2868
2968
 
2869
2969
  /*!
2970
+ **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
2971
+
2870
2972
  Scans the Arrow stream and creates a view with the given name.
2871
2973
 
2872
2974
  * connection: The connection on which to execute the scan.
@@ -2878,6 +2980,8 @@ DUCKDB_API duckdb_state duckdb_arrow_scan(duckdb_connection connection, const ch
2878
2980
  duckdb_arrow_stream arrow);
2879
2981
 
2880
2982
  /*!
2983
+ **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
2984
+
2881
2985
  Scans the Arrow array and creates a view with the given name.
2882
2986
  Note that after running `duckdb_arrow_array_scan`, `duckdb_destroy_arrow_stream` must be called on the out stream.
2883
2987
 
@@ -2891,7 +2995,9 @@ Note that after running `duckdb_arrow_array_scan`, `duckdb_destroy_arrow_stream`
2891
2995
  DUCKDB_API duckdb_state duckdb_arrow_array_scan(duckdb_connection connection, const char *table_name,
2892
2996
  duckdb_arrow_schema arrow_schema, duckdb_arrow_array arrow_array,
2893
2997
  duckdb_arrow_stream *out_stream);
2998
+ #endif
2894
2999
 
3000
+ #ifndef DUCKDB_NO_EXTENSION_FUNCTIONS
2895
3001
  //===--------------------------------------------------------------------===//
2896
3002
  // Threading Information
2897
3003
  //===--------------------------------------------------------------------===//
@@ -2972,12 +3078,15 @@ Returns true if the execution of the current query is finished.
2972
3078
  * con: The connection on which to check
2973
3079
  */
2974
3080
  DUCKDB_API bool duckdb_execution_is_finished(duckdb_connection con);
3081
+ #endif
2975
3082
 
2976
3083
  //===--------------------------------------------------------------------===//
2977
3084
  // Streaming Result Interface
2978
3085
  //===--------------------------------------------------------------------===//
2979
-
3086
+ #ifndef DUCKDB_API_NO_DEPRECATED
2980
3087
  /*!
3088
+ **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
3089
+
2981
3090
  Fetches a data chunk from the (streaming) duckdb_result. This function should be called repeatedly until the result is
2982
3091
  exhausted.
2983
3092
 
@@ -2994,6 +3103,19 @@ It is not known beforehand how many chunks will be returned by this result.
2994
3103
  * returns: The resulting data chunk. Returns `NULL` if the result has an error.
2995
3104
  */
2996
3105
  DUCKDB_API duckdb_data_chunk duckdb_stream_fetch_chunk(duckdb_result result);
3106
+ #endif
3107
+
3108
+ /*!
3109
+ Fetches a data chunk from a duckdb_result. This function should be called repeatedly until the result is exhausted.
3110
+
3111
+ The result must be destroyed with `duckdb_destroy_data_chunk`.
3112
+
3113
+ It is not known beforehand how many chunks will be returned by this result.
3114
+
3115
+ * result: The result object to fetch the data chunk from.
3116
+ * returns: The resulting data chunk. Returns `NULL` if the result has an error.
3117
+ */
3118
+ DUCKDB_API duckdb_data_chunk duckdb_fetch_chunk(duckdb_result result);
2997
3119
 
2998
3120
  #ifdef __cplusplus
2999
3121
  }
@@ -41,14 +41,15 @@ AttachedDatabase::AttachedDatabase(DatabaseInstance &db, Catalog &catalog_p, str
41
41
  internal = true;
42
42
  }
43
43
 
44
- AttachedDatabase::AttachedDatabase(DatabaseInstance &db, Catalog &catalog_p, StorageExtension &storage_extension,
44
+ AttachedDatabase::AttachedDatabase(DatabaseInstance &db, Catalog &catalog_p, StorageExtension &storage_extension_p,
45
45
  ClientContext &context, string name_p, const AttachInfo &info,
46
46
  AccessMode access_mode)
47
- : CatalogEntry(CatalogType::DATABASE_ENTRY, catalog_p, std::move(name_p)), db(db), parent_catalog(&catalog_p) {
47
+ : CatalogEntry(CatalogType::DATABASE_ENTRY, catalog_p, std::move(name_p)), db(db), parent_catalog(&catalog_p),
48
+ storage_extension(&storage_extension_p) {
48
49
  type = access_mode == AccessMode::READ_ONLY ? AttachedDatabaseType::READ_ONLY_DATABASE
49
50
  : AttachedDatabaseType::READ_WRITE_DATABASE;
50
- catalog =
51
- storage_extension.attach(storage_extension.storage_info.get(), context, *this, name, *info.Copy(), access_mode);
51
+ catalog = storage_extension->attach(storage_extension->storage_info.get(), context, *this, name, *info.Copy(),
52
+ access_mode);
52
53
  if (!catalog) {
53
54
  throw InternalException("AttachedDatabase - attach function did not return a catalog");
54
55
  }
@@ -57,7 +58,7 @@ AttachedDatabase::AttachedDatabase(DatabaseInstance &db, Catalog &catalog_p, Sto
57
58
  storage = make_uniq<SingleFileStorageManager>(*this, info.path, access_mode == AccessMode::READ_ONLY);
58
59
  }
59
60
  transaction_manager =
60
- storage_extension.create_transaction_manager(storage_extension.storage_info.get(), *this, *catalog);
61
+ storage_extension->create_transaction_manager(storage_extension->storage_info.get(), *this, *catalog);
61
62
  if (!transaction_manager) {
62
63
  throw InternalException(
63
64
  "AttachedDatabase - create_transaction_manager function did not return a transaction manager");
@@ -82,7 +83,7 @@ bool AttachedDatabase::IsReadOnly() const {
82
83
  }
83
84
 
84
85
  bool AttachedDatabase::NameIsReserved(const string &name) {
85
- return name == DEFAULT_SCHEMA || name == TEMP_CATALOG;
86
+ return name == DEFAULT_SCHEMA || name == TEMP_CATALOG || name == SYSTEM_CATALOG;
86
87
  }
87
88
 
88
89
  string AttachedDatabase::ExtractDatabaseName(const string &dbpath, FileSystem &fs) {
@@ -7,19 +7,28 @@ duckdb_data_chunk duckdb_stream_fetch_chunk(duckdb_result result) {
7
7
  return nullptr;
8
8
  }
9
9
  auto &result_data = *((duckdb::DuckDBResultData *)result.internal_data);
10
- if (result_data.result_set_type == duckdb::CAPIResultSetType::CAPI_RESULT_TYPE_DEPRECATED) {
11
- return nullptr;
12
- }
13
10
  if (result_data.result->type != duckdb::QueryResultType::STREAM_RESULT) {
14
11
  // We can only fetch from a StreamQueryResult
15
12
  return nullptr;
16
13
  }
17
- result_data.result_set_type = duckdb::CAPIResultSetType::CAPI_RESULT_TYPE_STREAMING;
18
- auto &streaming = (duckdb::StreamQueryResult &)*result_data.result;
19
- if (!streaming.IsOpen()) {
14
+ return duckdb_fetch_chunk(result);
15
+ }
16
+
17
+ duckdb_data_chunk duckdb_fetch_chunk(duckdb_result result) {
18
+ if (!result.internal_data) {
20
19
  return nullptr;
21
20
  }
21
+ auto &result_data = *((duckdb::DuckDBResultData *)result.internal_data);
22
+ if (result_data.result_set_type == duckdb::CAPIResultSetType::CAPI_RESULT_TYPE_DEPRECATED) {
23
+ return nullptr;
24
+ }
25
+ result_data.result_set_type = duckdb::CAPIResultSetType::CAPI_RESULT_TYPE_STREAMING;
26
+ auto &result_instance = (duckdb::QueryResult &)*result_data.result;
22
27
  // FetchRaw ? Do we care about flattening them?
23
- auto chunk = streaming.Fetch();
24
- return reinterpret_cast<duckdb_data_chunk>(chunk.release());
28
+ try {
29
+ auto chunk = result_instance.Fetch();
30
+ return reinterpret_cast<duckdb_data_chunk>(chunk.release());
31
+ } catch (std::exception &e) {
32
+ return nullptr;
33
+ }
25
34
  }
@@ -284,13 +284,17 @@ duckdb_state duckdb_register_table_function(duckdb_connection connection, duckdb
284
284
  if (tf->name.empty() || !info->bind || !info->init || !info->function) {
285
285
  return DuckDBError;
286
286
  }
287
- con->context->RunFunctionInTransaction([&]() {
288
- auto &catalog = duckdb::Catalog::GetSystemCatalog(*con->context);
289
- duckdb::CreateTableFunctionInfo tf_info(*tf);
290
-
291
- // create the function in the catalog
292
- catalog.CreateTableFunction(*con->context, tf_info);
293
- });
287
+ try {
288
+ con->context->RunFunctionInTransaction([&]() {
289
+ auto &catalog = duckdb::Catalog::GetSystemCatalog(*con->context);
290
+ duckdb::CreateTableFunctionInfo tf_info(*tf);
291
+
292
+ // create the function in the catalog
293
+ catalog.CreateTableFunction(*con->context, tf_info);
294
+ });
295
+ } catch (...) { // LCOV_EXCL_START
296
+ return DuckDBError;
297
+ } // LCOV_EXCL_STOP
294
298
  return DuckDBSuccess;
295
299
  }
296
300
 
@@ -94,6 +94,8 @@ static const ConfigurationOption internal_options[] = {
94
94
  DUCKDB_GLOBAL(ForceBitpackingModeSetting),
95
95
  DUCKDB_LOCAL(HomeDirectorySetting),
96
96
  DUCKDB_LOCAL(LogQueryPathSetting),
97
+ DUCKDB_GLOBAL(EnableMacrosDependencies),
98
+ DUCKDB_GLOBAL(EnableViewDependencies),
97
99
  DUCKDB_GLOBAL(LockConfigurationSetting),
98
100
  DUCKDB_GLOBAL(ImmediateTransactionModeSetting),
99
101
  DUCKDB_LOCAL(IntegerDivisionSetting),
@@ -62,10 +62,6 @@
62
62
  #include "icu_extension.hpp"
63
63
  #endif
64
64
 
65
- #if DUCKDB_EXTENSION_EXCEL_LINKED
66
- #include "excel_extension.hpp"
67
- #endif
68
-
69
65
  #if DUCKDB_EXTENSION_PARQUET_LINKED
70
66
  #include "parquet_extension.hpp"
71
67
  #endif
@@ -126,6 +122,8 @@ static const DefaultExtension internal_extensions[] = {
126
122
  {"arrow", "A zero-copy data integration between Apache Arrow and DuckDB", false},
127
123
  {"azure", "Adds a filesystem abstraction for Azure blob storage to DuckDB", false},
128
124
  {"iceberg", "Adds support for Apache Iceberg", false},
125
+ {"vss", "Adds indexing support to accelerate Vector Similarity Search", false},
126
+ {"delta", "Adds support for Delta Lake", false},
129
127
  {nullptr, nullptr, false}};
130
128
 
131
129
  idx_t ExtensionHelper::DefaultExtensionCount() {
@@ -213,7 +211,7 @@ bool ExtensionHelper::TryAutoLoadExtension(ClientContext &context, const string
213
211
  if (dbconfig.options.autoinstall_known_extensions) {
214
212
  auto &config = DBConfig::GetConfig(context);
215
213
  auto autoinstall_repo = ExtensionRepository::GetRepositoryByUrl(config.options.autoinstall_extension_repo);
216
- ExtensionHelper::InstallExtension(context, extension_name, false, autoinstall_repo);
214
+ ExtensionHelper::InstallExtension(context, extension_name, false, autoinstall_repo, false);
217
215
  }
218
216
  ExtensionHelper::LoadExternalExtension(context, extension_name);
219
217
  return true;
@@ -323,26 +321,6 @@ vector<ExtensionUpdateResult> ExtensionHelper::UpdateExtensions(DatabaseInstance
323
321
  });
324
322
  #endif
325
323
 
326
- for (const auto &extension : db.LoadedExtensions()) {
327
- if (seen_extensions.find(extension) != seen_extensions.end()) {
328
- const auto &loaded_extension_data = db.LoadedExtensionsData();
329
- const auto &loaded_install_info = loaded_extension_data.find(extension);
330
-
331
- ExtensionUpdateResult statically_loaded_ext_result;
332
-
333
- if (loaded_install_info == loaded_extension_data.end()) {
334
- statically_loaded_ext_result.tag = ExtensionUpdateResultTag::UNKNOWN;
335
- } else if (loaded_install_info->second.mode == ExtensionInstallMode::STATICALLY_LINKED) {
336
- statically_loaded_ext_result.tag = ExtensionUpdateResultTag::STATICALLY_LOADED;
337
- statically_loaded_ext_result.installed_version = loaded_install_info->second.version;
338
- } else {
339
- statically_loaded_ext_result.tag = ExtensionUpdateResultTag::UNKNOWN;
340
- }
341
-
342
- result.push_back(std::move(statically_loaded_ext_result));
343
- }
344
- }
345
-
346
324
  return result;
347
325
  }
348
326