duckdb 1.0.1-dev22.0 → 1.0.1-dev27.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 (1389) hide show
  1. package/.github/workflows/NodeJS.yml +1 -1
  2. package/binding.gyp +41 -0
  3. package/package.json +1 -1
  4. package/src/duckdb/extension/icu/icu-dateadd.cpp +4 -2
  5. package/src/duckdb/extension/icu/icu-datefunc.cpp +6 -2
  6. package/src/duckdb/extension/icu/icu-datesub.cpp +13 -2
  7. package/src/duckdb/extension/icu/icu-strptime.cpp +6 -6
  8. package/src/duckdb/extension/icu/icu-table-range.cpp +92 -73
  9. package/src/duckdb/extension/icu/icu-timebucket.cpp +12 -2
  10. package/src/duckdb/extension/icu/icu-timezone.cpp +3 -3
  11. package/src/duckdb/extension/icu/icu_extension.cpp +61 -9
  12. package/src/duckdb/extension/json/include/json_executors.hpp +20 -23
  13. package/src/duckdb/extension/json/include/json_functions.hpp +4 -0
  14. package/src/duckdb/extension/json/include/json_scan.hpp +6 -2
  15. package/src/duckdb/extension/json/include/json_structure.hpp +12 -9
  16. package/src/duckdb/extension/json/json_common.cpp +66 -10
  17. package/src/duckdb/extension/json/json_extension.cpp +13 -5
  18. package/src/duckdb/extension/json/json_functions/json_array_length.cpp +1 -1
  19. package/src/duckdb/extension/json/json_functions/json_create.cpp +21 -4
  20. package/src/duckdb/extension/json/json_functions/json_exists.cpp +32 -0
  21. package/src/duckdb/extension/json/json_functions/json_extract.cpp +2 -2
  22. package/src/duckdb/extension/json/json_functions/json_keys.cpp +1 -1
  23. package/src/duckdb/extension/json/json_functions/json_pretty.cpp +32 -0
  24. package/src/duckdb/extension/json/json_functions/json_serialize_sql.cpp +5 -1
  25. package/src/duckdb/extension/json/json_functions/json_structure.cpp +305 -94
  26. package/src/duckdb/extension/json/json_functions/json_transform.cpp +1 -1
  27. package/src/duckdb/extension/json/json_functions/json_type.cpp +3 -3
  28. package/src/duckdb/extension/json/json_functions/json_value.cpp +42 -0
  29. package/src/duckdb/extension/json/json_functions/read_json.cpp +16 -2
  30. package/src/duckdb/extension/json/json_functions/read_json_objects.cpp +3 -2
  31. package/src/duckdb/extension/json/json_functions.cpp +5 -1
  32. package/src/duckdb/extension/json/json_scan.cpp +13 -12
  33. package/src/duckdb/extension/json/serialize_json.cpp +5 -3
  34. package/src/duckdb/extension/parquet/column_reader.cpp +206 -43
  35. package/src/duckdb/extension/parquet/column_writer.cpp +133 -62
  36. package/src/duckdb/extension/parquet/geo_parquet.cpp +391 -0
  37. package/src/duckdb/extension/parquet/include/boolean_column_reader.hpp +16 -5
  38. package/src/duckdb/extension/parquet/include/column_reader.hpp +37 -12
  39. package/src/duckdb/extension/parquet/include/column_writer.hpp +10 -11
  40. package/src/duckdb/extension/parquet/include/expression_column_reader.hpp +52 -0
  41. package/src/duckdb/extension/parquet/include/geo_parquet.hpp +139 -0
  42. package/src/duckdb/extension/parquet/include/parquet_crypto.hpp +13 -8
  43. package/src/duckdb/extension/parquet/include/parquet_decimal_utils.hpp +3 -0
  44. package/src/duckdb/extension/parquet/include/parquet_file_metadata_cache.hpp +7 -3
  45. package/src/duckdb/extension/parquet/include/parquet_reader.hpp +55 -8
  46. package/src/duckdb/extension/parquet/include/parquet_rle_bp_decoder.hpp +3 -3
  47. package/src/duckdb/extension/parquet/include/parquet_rle_bp_encoder.hpp +1 -1
  48. package/src/duckdb/extension/parquet/include/parquet_timestamp.hpp +8 -0
  49. package/src/duckdb/extension/parquet/include/parquet_writer.hpp +21 -7
  50. package/src/duckdb/extension/parquet/include/resizable_buffer.hpp +33 -11
  51. package/src/duckdb/extension/parquet/include/string_column_reader.hpp +5 -2
  52. package/src/duckdb/extension/parquet/include/templated_column_reader.hpp +48 -14
  53. package/src/duckdb/extension/parquet/parquet_crypto.cpp +109 -61
  54. package/src/duckdb/extension/parquet/parquet_extension.cpp +305 -72
  55. package/src/duckdb/extension/parquet/parquet_metadata.cpp +4 -4
  56. package/src/duckdb/extension/parquet/parquet_reader.cpp +151 -40
  57. package/src/duckdb/extension/parquet/parquet_statistics.cpp +50 -16
  58. package/src/duckdb/extension/parquet/parquet_timestamp.cpp +42 -1
  59. package/src/duckdb/extension/parquet/parquet_writer.cpp +67 -75
  60. package/src/duckdb/extension/parquet/serialize_parquet.cpp +3 -1
  61. package/src/duckdb/extension/parquet/zstd_file_system.cpp +5 -1
  62. package/src/duckdb/src/catalog/catalog.cpp +14 -16
  63. package/src/duckdb/src/catalog/catalog_entry/duck_index_entry.cpp +14 -11
  64. package/src/duckdb/src/catalog/catalog_entry/duck_schema_entry.cpp +39 -19
  65. package/src/duckdb/src/catalog/catalog_entry/duck_table_entry.cpp +92 -78
  66. package/src/duckdb/src/catalog/catalog_entry/index_catalog_entry.cpp +10 -2
  67. package/src/duckdb/src/catalog/catalog_entry/macro_catalog_entry.cpp +10 -3
  68. package/src/duckdb/src/catalog/catalog_entry/schema_catalog_entry.cpp +3 -3
  69. package/src/duckdb/src/catalog/catalog_entry/table_catalog_entry.cpp +7 -7
  70. package/src/duckdb/src/catalog/catalog_entry.cpp +6 -3
  71. package/src/duckdb/src/catalog/catalog_set.cpp +14 -19
  72. package/src/duckdb/src/catalog/default/default_functions.cpp +179 -166
  73. package/src/duckdb/src/catalog/default/default_generator.cpp +24 -0
  74. package/src/duckdb/src/catalog/default/default_schemas.cpp +4 -3
  75. package/src/duckdb/src/catalog/default/default_table_functions.cpp +148 -0
  76. package/src/duckdb/src/catalog/default/default_views.cpp +7 -3
  77. package/src/duckdb/src/catalog/duck_catalog.cpp +7 -1
  78. package/src/duckdb/src/common/adbc/adbc.cpp +120 -58
  79. package/src/duckdb/src/common/allocator.cpp +71 -6
  80. package/src/duckdb/src/common/arrow/appender/bool_data.cpp +8 -7
  81. package/src/duckdb/src/common/arrow/appender/fixed_size_list_data.cpp +1 -1
  82. package/src/duckdb/src/common/arrow/appender/union_data.cpp +4 -5
  83. package/src/duckdb/src/common/arrow/arrow_appender.cpp +55 -21
  84. package/src/duckdb/src/common/arrow/arrow_converter.cpp +85 -10
  85. package/src/duckdb/src/common/arrow/arrow_merge_event.cpp +142 -0
  86. package/src/duckdb/src/common/arrow/arrow_query_result.cpp +56 -0
  87. package/src/duckdb/src/common/arrow/physical_arrow_batch_collector.cpp +37 -0
  88. package/src/duckdb/src/common/arrow/physical_arrow_collector.cpp +128 -0
  89. package/src/duckdb/src/common/arrow/schema_metadata.cpp +101 -0
  90. package/src/duckdb/src/common/cgroups.cpp +189 -0
  91. package/src/duckdb/src/common/compressed_file_system.cpp +6 -3
  92. package/src/duckdb/src/common/encryption_state.cpp +38 -0
  93. package/src/duckdb/src/common/enum_util.cpp +682 -14
  94. package/src/duckdb/src/common/enums/file_compression_type.cpp +24 -0
  95. package/src/duckdb/src/common/enums/metric_type.cpp +208 -0
  96. package/src/duckdb/src/common/enums/optimizer_type.cpp +8 -2
  97. package/src/duckdb/src/common/enums/physical_operator_type.cpp +2 -0
  98. package/src/duckdb/src/common/enums/relation_type.cpp +4 -0
  99. package/src/duckdb/src/common/enums/statement_type.cpp +15 -0
  100. package/src/duckdb/src/common/error_data.cpp +22 -20
  101. package/src/duckdb/src/common/exception/binder_exception.cpp +5 -0
  102. package/src/duckdb/src/common/exception.cpp +11 -1
  103. package/src/duckdb/src/common/extra_type_info.cpp +3 -0
  104. package/src/duckdb/src/common/file_buffer.cpp +1 -1
  105. package/src/duckdb/src/common/file_system.cpp +25 -3
  106. package/src/duckdb/src/common/filename_pattern.cpp +1 -0
  107. package/src/duckdb/src/common/fsst.cpp +15 -14
  108. package/src/duckdb/src/common/gzip_file_system.cpp +3 -1
  109. package/src/duckdb/src/common/hive_partitioning.cpp +103 -43
  110. package/src/duckdb/src/common/http_util.cpp +25 -0
  111. package/src/duckdb/src/common/local_file_system.cpp +48 -27
  112. package/src/duckdb/src/common/multi_file_list.cpp +113 -22
  113. package/src/duckdb/src/common/multi_file_reader.cpp +59 -58
  114. package/src/duckdb/src/common/operator/cast_operators.cpp +133 -34
  115. package/src/duckdb/src/common/operator/string_cast.cpp +42 -11
  116. package/src/duckdb/src/common/progress_bar/progress_bar.cpp +2 -2
  117. package/src/duckdb/src/common/progress_bar/terminal_progress_bar_display.cpp +1 -1
  118. package/src/duckdb/src/common/radix_partitioning.cpp +31 -21
  119. package/src/duckdb/src/common/random_engine.cpp +4 -0
  120. package/src/duckdb/src/common/re2_regex.cpp +47 -12
  121. package/src/duckdb/src/common/render_tree.cpp +243 -0
  122. package/src/duckdb/src/common/row_operations/row_aggregate.cpp +1 -1
  123. package/src/duckdb/src/common/row_operations/row_gather.cpp +2 -2
  124. package/src/duckdb/src/common/row_operations/row_matcher.cpp +58 -5
  125. package/src/duckdb/src/common/row_operations/row_radix_scatter.cpp +79 -43
  126. package/src/duckdb/src/common/serializer/binary_deserializer.cpp +1 -1
  127. package/src/duckdb/src/common/serializer/buffered_file_reader.cpp +6 -4
  128. package/src/duckdb/src/common/serializer/buffered_file_writer.cpp +18 -9
  129. package/src/duckdb/src/common/serializer/memory_stream.cpp +1 -0
  130. package/src/duckdb/src/common/sort/partition_state.cpp +33 -18
  131. package/src/duckdb/src/common/sort/radix_sort.cpp +22 -15
  132. package/src/duckdb/src/common/sort/sort_state.cpp +19 -16
  133. package/src/duckdb/src/common/sort/sorted_block.cpp +11 -10
  134. package/src/duckdb/src/common/string_util.cpp +167 -10
  135. package/src/duckdb/src/common/tree_renderer/graphviz_tree_renderer.cpp +108 -0
  136. package/src/duckdb/src/common/tree_renderer/html_tree_renderer.cpp +267 -0
  137. package/src/duckdb/src/common/tree_renderer/json_tree_renderer.cpp +116 -0
  138. package/src/duckdb/src/common/tree_renderer/text_tree_renderer.cpp +482 -0
  139. package/src/duckdb/src/common/tree_renderer/tree_renderer.cpp +12 -0
  140. package/src/duckdb/src/common/tree_renderer.cpp +16 -508
  141. package/src/duckdb/src/common/types/batched_data_collection.cpp +78 -9
  142. package/src/duckdb/src/common/types/bit.cpp +24 -22
  143. package/src/duckdb/src/common/types/blob.cpp +15 -11
  144. package/src/duckdb/src/common/types/column/column_data_allocator.cpp +18 -9
  145. package/src/duckdb/src/common/types/column/column_data_collection.cpp +4 -4
  146. package/src/duckdb/src/common/types/column/column_data_collection_segment.cpp +3 -4
  147. package/src/duckdb/src/common/types/column/column_data_consumer.cpp +2 -2
  148. package/src/duckdb/src/common/types/column/partitioned_column_data.cpp +70 -21
  149. package/src/duckdb/src/common/types/data_chunk.cpp +10 -1
  150. package/src/duckdb/src/common/types/date.cpp +8 -19
  151. package/src/duckdb/src/common/types/decimal.cpp +3 -2
  152. package/src/duckdb/src/common/types/hugeint.cpp +11 -3
  153. package/src/duckdb/src/common/types/hyperloglog.cpp +212 -227
  154. package/src/duckdb/src/common/types/interval.cpp +1 -1
  155. package/src/duckdb/src/common/types/list_segment.cpp +83 -49
  156. package/src/duckdb/src/common/types/row/partitioned_tuple_data.cpp +22 -83
  157. package/src/duckdb/src/common/types/row/row_data_collection.cpp +2 -2
  158. package/src/duckdb/src/common/types/row/row_data_collection_scanner.cpp +20 -4
  159. package/src/duckdb/src/common/types/row/tuple_data_allocator.cpp +28 -7
  160. package/src/duckdb/src/common/types/row/tuple_data_collection.cpp +29 -14
  161. package/src/duckdb/src/common/types/row/tuple_data_scatter_gather.cpp +152 -102
  162. package/src/duckdb/src/common/types/row/tuple_data_segment.cpp +4 -1
  163. package/src/duckdb/src/common/types/selection_vector.cpp +17 -1
  164. package/src/duckdb/src/common/types/time.cpp +62 -31
  165. package/src/duckdb/src/common/types/timestamp.cpp +70 -12
  166. package/src/duckdb/src/common/types/uuid.cpp +1 -1
  167. package/src/duckdb/src/common/types/validity_mask.cpp +40 -5
  168. package/src/duckdb/src/common/types/value.cpp +50 -8
  169. package/src/duckdb/src/common/types/varint.cpp +295 -0
  170. package/src/duckdb/src/common/types/vector.cpp +165 -54
  171. package/src/duckdb/src/common/types/vector_buffer.cpp +5 -4
  172. package/src/duckdb/src/common/types.cpp +106 -26
  173. package/src/duckdb/src/common/vector_operations/vector_copy.cpp +13 -25
  174. package/src/duckdb/src/common/vector_operations/vector_hash.cpp +6 -0
  175. package/src/duckdb/src/common/virtual_file_system.cpp +3 -3
  176. package/src/duckdb/src/core_functions/aggregate/distributive/approx_count.cpp +35 -82
  177. package/src/duckdb/src/core_functions/aggregate/distributive/arg_min_max.cpp +283 -46
  178. package/src/duckdb/src/core_functions/aggregate/distributive/bitagg.cpp +4 -4
  179. package/src/duckdb/src/core_functions/aggregate/distributive/entropy.cpp +3 -2
  180. package/src/duckdb/src/core_functions/aggregate/distributive/minmax.cpp +226 -338
  181. package/src/duckdb/src/core_functions/aggregate/distributive/sum.cpp +2 -0
  182. package/src/duckdb/src/core_functions/aggregate/holistic/approx_top_k.cpp +388 -0
  183. package/src/duckdb/src/core_functions/aggregate/holistic/approximate_quantile.cpp +63 -21
  184. package/src/duckdb/src/core_functions/aggregate/holistic/mad.cpp +330 -0
  185. package/src/duckdb/src/core_functions/aggregate/holistic/mode.cpp +136 -97
  186. package/src/duckdb/src/core_functions/aggregate/holistic/quantile.cpp +601 -1485
  187. package/src/duckdb/src/core_functions/aggregate/nested/binned_histogram.cpp +405 -0
  188. package/src/duckdb/src/core_functions/aggregate/nested/histogram.cpp +136 -165
  189. package/src/duckdb/src/core_functions/function_list.cpp +35 -8
  190. package/src/duckdb/src/core_functions/lambda_functions.cpp +5 -7
  191. package/src/duckdb/src/core_functions/scalar/array/array_functions.cpp +172 -198
  192. package/src/duckdb/src/core_functions/scalar/blob/create_sort_key.cpp +341 -54
  193. package/src/duckdb/src/core_functions/scalar/date/date_diff.cpp +2 -2
  194. package/src/duckdb/src/core_functions/scalar/date/date_part.cpp +89 -29
  195. package/src/duckdb/src/core_functions/scalar/date/date_trunc.cpp +1 -1
  196. package/src/duckdb/src/core_functions/scalar/date/make_date.cpp +2 -2
  197. package/src/duckdb/src/core_functions/scalar/date/strftime.cpp +133 -71
  198. package/src/duckdb/src/core_functions/scalar/date/to_interval.cpp +1 -1
  199. package/src/duckdb/src/core_functions/scalar/enum/enum_functions.cpp +1 -1
  200. package/src/duckdb/src/core_functions/scalar/generic/can_implicitly_cast.cpp +40 -0
  201. package/src/duckdb/src/core_functions/scalar/generic/error.cpp +1 -1
  202. package/src/duckdb/src/core_functions/scalar/generic/least.cpp +161 -58
  203. package/src/duckdb/src/core_functions/scalar/generic/typeof.cpp +13 -0
  204. package/src/duckdb/src/core_functions/scalar/list/array_slice.cpp +1 -1
  205. package/src/duckdb/src/core_functions/scalar/list/list_aggregates.cpp +59 -75
  206. package/src/duckdb/src/core_functions/scalar/list/list_distance.cpp +93 -40
  207. package/src/duckdb/src/core_functions/scalar/list/list_has_any_or_all.cpp +227 -0
  208. package/src/duckdb/src/core_functions/scalar/list/list_reduce.cpp +20 -19
  209. package/src/duckdb/src/core_functions/scalar/list/list_sort.cpp +0 -2
  210. package/src/duckdb/src/core_functions/scalar/list/list_value.cpp +106 -8
  211. package/src/duckdb/src/core_functions/scalar/map/map_contains.cpp +56 -0
  212. package/src/duckdb/src/core_functions/scalar/map/map_extract.cpp +73 -118
  213. package/src/duckdb/src/core_functions/scalar/math/numeric.cpp +98 -2
  214. package/src/duckdb/src/core_functions/scalar/operators/bitwise.cpp +1 -2
  215. package/src/duckdb/src/core_functions/scalar/random/setseed.cpp +1 -1
  216. package/src/duckdb/src/core_functions/scalar/string/bar.cpp +1 -1
  217. package/src/duckdb/src/core_functions/scalar/string/hex.cpp +5 -1
  218. package/src/duckdb/src/core_functions/scalar/string/md5.cpp +10 -37
  219. package/src/duckdb/src/core_functions/scalar/string/printf.cpp +18 -2
  220. package/src/duckdb/src/core_functions/scalar/string/repeat.cpp +45 -0
  221. package/src/duckdb/src/core_functions/scalar/string/reverse.cpp +4 -5
  222. package/src/duckdb/src/core_functions/scalar/string/sha1.cpp +35 -0
  223. package/src/duckdb/src/core_functions/scalar/string/sha256.cpp +5 -2
  224. package/src/duckdb/src/core_functions/scalar/string/url_encode.cpp +49 -0
  225. package/src/duckdb/src/core_functions/scalar/struct/struct_pack.cpp +1 -2
  226. package/src/duckdb/src/core_functions/scalar/union/union_extract.cpp +4 -2
  227. package/src/duckdb/src/execution/adaptive_filter.cpp +30 -11
  228. package/src/duckdb/src/execution/aggregate_hashtable.cpp +13 -18
  229. package/src/duckdb/src/execution/expression_executor/execute_conjunction.cpp +4 -9
  230. package/src/duckdb/src/execution/expression_executor.cpp +1 -1
  231. package/src/duckdb/src/execution/index/art/art.cpp +683 -670
  232. package/src/duckdb/src/execution/index/art/art_key.cpp +121 -38
  233. package/src/duckdb/src/execution/index/art/base_leaf.cpp +168 -0
  234. package/src/duckdb/src/execution/index/art/base_node.cpp +163 -0
  235. package/src/duckdb/src/execution/index/art/iterator.cpp +148 -77
  236. package/src/duckdb/src/execution/index/art/leaf.cpp +159 -263
  237. package/src/duckdb/src/execution/index/art/node.cpp +493 -247
  238. package/src/duckdb/src/execution/index/art/node256.cpp +31 -91
  239. package/src/duckdb/src/execution/index/art/node256_leaf.cpp +71 -0
  240. package/src/duckdb/src/execution/index/art/node48.cpp +75 -143
  241. package/src/duckdb/src/execution/index/art/prefix.cpp +424 -244
  242. package/src/duckdb/src/execution/index/bound_index.cpp +7 -1
  243. package/src/duckdb/src/execution/index/fixed_size_allocator.cpp +22 -18
  244. package/src/duckdb/src/execution/index/fixed_size_buffer.cpp +22 -73
  245. package/src/duckdb/src/execution/join_hashtable.cpp +637 -179
  246. package/src/duckdb/src/execution/operator/aggregate/aggregate_object.cpp +4 -4
  247. package/src/duckdb/src/execution/operator/aggregate/physical_hash_aggregate.cpp +15 -10
  248. package/src/duckdb/src/execution/operator/aggregate/physical_perfecthash_aggregate.cpp +13 -8
  249. package/src/duckdb/src/execution/operator/aggregate/physical_streaming_window.cpp +525 -132
  250. package/src/duckdb/src/execution/operator/aggregate/physical_ungrouped_aggregate.cpp +147 -138
  251. package/src/duckdb/src/execution/operator/aggregate/physical_window.cpp +531 -312
  252. package/src/duckdb/src/execution/operator/csv_scanner/buffer_manager/csv_buffer.cpp +1 -1
  253. package/src/duckdb/src/execution/operator/csv_scanner/buffer_manager/csv_buffer_manager.cpp +4 -3
  254. package/src/duckdb/src/execution/operator/csv_scanner/buffer_manager/csv_file_handle.cpp +9 -2
  255. package/src/duckdb/src/execution/operator/csv_scanner/scanner/base_scanner.cpp +13 -17
  256. package/src/duckdb/src/execution/operator/csv_scanner/scanner/column_count_scanner.cpp +60 -16
  257. package/src/duckdb/src/execution/operator/csv_scanner/scanner/csv_schema.cpp +105 -0
  258. package/src/duckdb/src/execution/operator/csv_scanner/scanner/scanner_boundary.cpp +24 -24
  259. package/src/duckdb/src/execution/operator/csv_scanner/scanner/skip_scanner.cpp +25 -2
  260. package/src/duckdb/src/execution/operator/csv_scanner/scanner/string_value_scanner.cpp +275 -112
  261. package/src/duckdb/src/execution/operator/csv_scanner/sniffer/csv_sniffer.cpp +106 -11
  262. package/src/duckdb/src/execution/operator/csv_scanner/sniffer/dialect_detection.cpp +253 -115
  263. package/src/duckdb/src/execution/operator/csv_scanner/sniffer/header_detection.cpp +93 -52
  264. package/src/duckdb/src/execution/operator/csv_scanner/sniffer/type_detection.cpp +116 -76
  265. package/src/duckdb/src/execution/operator/csv_scanner/sniffer/type_refinement.cpp +29 -14
  266. package/src/duckdb/src/execution/operator/csv_scanner/sniffer/type_replacement.cpp +1 -1
  267. package/src/duckdb/src/execution/operator/csv_scanner/state_machine/csv_state_machine_cache.cpp +70 -26
  268. package/src/duckdb/src/execution/operator/csv_scanner/table_function/csv_file_scanner.cpp +81 -60
  269. package/src/duckdb/src/execution/operator/csv_scanner/table_function/global_csv_state.cpp +88 -50
  270. package/src/duckdb/src/execution/operator/csv_scanner/util/csv_error.cpp +161 -51
  271. package/src/duckdb/src/execution/operator/csv_scanner/util/csv_reader_options.cpp +59 -17
  272. package/src/duckdb/src/execution/operator/filter/physical_filter.cpp +5 -5
  273. package/src/duckdb/src/execution/operator/helper/physical_batch_collector.cpp +0 -21
  274. package/src/duckdb/src/execution/operator/helper/physical_buffered_batch_collector.cpp +109 -0
  275. package/src/duckdb/src/execution/operator/helper/physical_buffered_collector.cpp +5 -13
  276. package/src/duckdb/src/execution/operator/helper/physical_explain_analyze.cpp +1 -1
  277. package/src/duckdb/src/execution/operator/helper/physical_load.cpp +12 -4
  278. package/src/duckdb/src/execution/operator/helper/physical_materialized_collector.cpp +0 -16
  279. package/src/duckdb/src/execution/operator/helper/physical_reservoir_sample.cpp +4 -2
  280. package/src/duckdb/src/execution/operator/helper/physical_reset.cpp +5 -0
  281. package/src/duckdb/src/execution/operator/helper/physical_result_collector.cpp +3 -1
  282. package/src/duckdb/src/execution/operator/helper/physical_set_variable.cpp +39 -0
  283. package/src/duckdb/src/execution/operator/helper/physical_streaming_sample.cpp +4 -2
  284. package/src/duckdb/src/execution/operator/helper/physical_transaction.cpp +16 -5
  285. package/src/duckdb/src/execution/operator/join/outer_join_marker.cpp +1 -1
  286. package/src/duckdb/src/execution/operator/join/perfect_hash_join_executor.cpp +1 -1
  287. package/src/duckdb/src/execution/operator/join/physical_asof_join.cpp +1 -1
  288. package/src/duckdb/src/execution/operator/join/physical_blockwise_nl_join.cpp +5 -4
  289. package/src/duckdb/src/execution/operator/join/physical_comparison_join.cpp +59 -21
  290. package/src/duckdb/src/execution/operator/join/physical_delim_join.cpp +7 -4
  291. package/src/duckdb/src/execution/operator/join/physical_hash_join.cpp +333 -176
  292. package/src/duckdb/src/execution/operator/join/physical_iejoin.cpp +57 -34
  293. package/src/duckdb/src/execution/operator/join/physical_join.cpp +16 -8
  294. package/src/duckdb/src/execution/operator/join/physical_left_delim_join.cpp +10 -4
  295. package/src/duckdb/src/execution/operator/join/physical_nested_loop_join.cpp +2 -5
  296. package/src/duckdb/src/execution/operator/join/physical_piecewise_merge_join.cpp +3 -3
  297. package/src/duckdb/src/execution/operator/join/physical_range_join.cpp +5 -5
  298. package/src/duckdb/src/execution/operator/join/physical_right_delim_join.cpp +7 -2
  299. package/src/duckdb/src/execution/operator/order/physical_order.cpp +17 -12
  300. package/src/duckdb/src/execution/operator/order/physical_top_n.cpp +12 -9
  301. package/src/duckdb/src/execution/operator/persistent/physical_batch_copy_to_file.cpp +35 -17
  302. package/src/duckdb/src/execution/operator/persistent/physical_batch_insert.cpp +17 -11
  303. package/src/duckdb/src/execution/operator/persistent/physical_copy_database.cpp +5 -1
  304. package/src/duckdb/src/execution/operator/persistent/physical_copy_to_file.cpp +156 -47
  305. package/src/duckdb/src/execution/operator/persistent/physical_insert.cpp +10 -2
  306. package/src/duckdb/src/execution/operator/persistent/physical_update.cpp +1 -3
  307. package/src/duckdb/src/execution/operator/projection/physical_pivot.cpp +2 -2
  308. package/src/duckdb/src/execution/operator/projection/physical_projection.cpp +13 -6
  309. package/src/duckdb/src/execution/operator/projection/physical_tableinout_function.cpp +22 -3
  310. package/src/duckdb/src/execution/operator/projection/physical_unnest.cpp +19 -3
  311. package/src/duckdb/src/execution/operator/scan/physical_column_data_scan.cpp +37 -22
  312. package/src/duckdb/src/execution/operator/scan/physical_table_scan.cpp +77 -21
  313. package/src/duckdb/src/execution/operator/schema/physical_attach.cpp +27 -55
  314. package/src/duckdb/src/execution/operator/schema/physical_create_art_index.cpp +41 -44
  315. package/src/duckdb/src/execution/operator/set/physical_cte.cpp +4 -6
  316. package/src/duckdb/src/execution/operator/set/physical_recursive_cte.cpp +4 -6
  317. package/src/duckdb/src/execution/operator/set/physical_union.cpp +18 -4
  318. package/src/duckdb/src/execution/perfect_aggregate_hashtable.cpp +3 -2
  319. package/src/duckdb/src/execution/physical_operator.cpp +45 -4
  320. package/src/duckdb/src/execution/physical_plan/plan_comparison_join.cpp +18 -7
  321. package/src/duckdb/src/execution/physical_plan/plan_copy_to_file.cpp +8 -3
  322. package/src/duckdb/src/execution/physical_plan/plan_delim_join.cpp +13 -6
  323. package/src/duckdb/src/execution/physical_plan/plan_explain.cpp +3 -3
  324. package/src/duckdb/src/execution/physical_plan/plan_get.cpp +111 -19
  325. package/src/duckdb/src/execution/physical_plan/plan_limit.cpp +19 -2
  326. package/src/duckdb/src/execution/physical_plan/plan_set.cpp +9 -0
  327. package/src/duckdb/src/execution/physical_plan/plan_window.cpp +3 -1
  328. package/src/duckdb/src/execution/physical_plan_generator.cpp +3 -3
  329. package/src/duckdb/src/execution/radix_partitioned_hashtable.cpp +49 -49
  330. package/src/duckdb/src/execution/reservoir_sample.cpp +2 -2
  331. package/src/duckdb/src/execution/window_executor.cpp +556 -318
  332. package/src/duckdb/src/execution/window_segment_tree.cpp +1058 -485
  333. package/src/duckdb/src/function/aggregate/distributive/count.cpp +5 -5
  334. package/src/duckdb/src/function/aggregate/distributive/first.cpp +92 -95
  335. package/src/duckdb/src/function/aggregate/sorted_aggregate_function.cpp +10 -9
  336. package/src/duckdb/src/function/aggregate_function.cpp +8 -0
  337. package/src/duckdb/src/function/cast/cast_function_set.cpp +10 -1
  338. package/src/duckdb/src/function/cast/decimal_cast.cpp +10 -1
  339. package/src/duckdb/src/function/cast/default_casts.cpp +2 -0
  340. package/src/duckdb/src/function/cast/numeric_casts.cpp +3 -0
  341. package/src/duckdb/src/function/cast/string_cast.cpp +8 -5
  342. package/src/duckdb/src/function/cast/time_casts.cpp +2 -2
  343. package/src/duckdb/src/function/cast/union_casts.cpp +1 -1
  344. package/src/duckdb/src/function/cast/varint_casts.cpp +283 -0
  345. package/src/duckdb/src/function/cast/vector_cast_helpers.cpp +3 -1
  346. package/src/duckdb/src/function/cast_rules.cpp +104 -15
  347. package/src/duckdb/src/function/compression_config.cpp +35 -33
  348. package/src/duckdb/src/function/copy_function.cpp +27 -0
  349. package/src/duckdb/src/function/function_binder.cpp +39 -11
  350. package/src/duckdb/src/function/macro_function.cpp +75 -32
  351. package/src/duckdb/src/function/pragma/pragma_queries.cpp +10 -0
  352. package/src/duckdb/src/function/scalar/compressed_materialization/compress_string.cpp +1 -0
  353. package/src/duckdb/src/function/scalar/generic/binning.cpp +507 -0
  354. package/src/duckdb/src/function/scalar/generic/getvariable.cpp +58 -0
  355. package/src/duckdb/src/function/scalar/generic_functions.cpp +1 -0
  356. package/src/duckdb/src/function/scalar/list/contains_or_position.cpp +33 -47
  357. package/src/duckdb/src/function/scalar/list/list_extract.cpp +70 -143
  358. package/src/duckdb/src/function/scalar/list/list_resize.cpp +93 -84
  359. package/src/duckdb/src/function/scalar/list/list_zip.cpp +3 -0
  360. package/src/duckdb/src/function/scalar/operators/arithmetic.cpp +24 -11
  361. package/src/duckdb/src/function/scalar/sequence/nextval.cpp +4 -4
  362. package/src/duckdb/src/function/scalar/strftime_format.cpp +196 -57
  363. package/src/duckdb/src/function/scalar/string/caseconvert.cpp +9 -7
  364. package/src/duckdb/src/function/scalar/string/concat.cpp +239 -123
  365. package/src/duckdb/src/function/scalar/string/concat_ws.cpp +149 -0
  366. package/src/duckdb/src/function/scalar/string/contains.cpp +18 -7
  367. package/src/duckdb/src/function/scalar/string/like.cpp +2 -2
  368. package/src/duckdb/src/function/scalar/string/substring.cpp +6 -11
  369. package/src/duckdb/src/function/scalar/string_functions.cpp +1 -0
  370. package/src/duckdb/src/function/scalar/struct/struct_extract.cpp +7 -3
  371. package/src/duckdb/src/function/scalar/system/aggregate_export.cpp +5 -5
  372. package/src/duckdb/src/function/scalar_function.cpp +5 -2
  373. package/src/duckdb/src/function/scalar_macro_function.cpp +2 -2
  374. package/src/duckdb/src/function/table/arrow/arrow_duck_schema.cpp +20 -39
  375. package/src/duckdb/src/function/table/arrow/arrow_type_info.cpp +135 -0
  376. package/src/duckdb/src/function/table/arrow.cpp +194 -52
  377. package/src/duckdb/src/function/table/arrow_conversion.cpp +212 -69
  378. package/src/duckdb/src/function/table/copy_csv.cpp +43 -14
  379. package/src/duckdb/src/function/table/query_function.cpp +80 -0
  380. package/src/duckdb/src/function/table/range.cpp +222 -142
  381. package/src/duckdb/src/function/table/read_csv.cpp +25 -13
  382. package/src/duckdb/src/function/table/sniff_csv.cpp +55 -35
  383. package/src/duckdb/src/function/table/system/duckdb_constraints.cpp +141 -129
  384. package/src/duckdb/src/function/table/system/duckdb_extensions.cpp +25 -14
  385. package/src/duckdb/src/function/table/system/duckdb_functions.cpp +20 -14
  386. package/src/duckdb/src/function/table/system/duckdb_indexes.cpp +15 -1
  387. package/src/duckdb/src/function/table/system/duckdb_variables.cpp +84 -0
  388. package/src/duckdb/src/function/table/system/test_all_types.cpp +1 -0
  389. package/src/duckdb/src/function/table/system/test_vector_types.cpp +33 -3
  390. package/src/duckdb/src/function/table/system_functions.cpp +1 -0
  391. package/src/duckdb/src/function/table/table_scan.cpp +45 -22
  392. package/src/duckdb/src/function/table/unnest.cpp +2 -2
  393. package/src/duckdb/src/function/table/version/pragma_version.cpp +4 -4
  394. package/src/duckdb/src/function/table_function.cpp +5 -4
  395. package/src/duckdb/src/function/table_macro_function.cpp +2 -2
  396. package/src/duckdb/src/include/duckdb/catalog/catalog.hpp +8 -4
  397. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/duck_index_entry.hpp +5 -2
  398. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/duck_schema_entry.hpp +3 -0
  399. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/index_catalog_entry.hpp +2 -2
  400. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/macro_catalog_entry.hpp +3 -4
  401. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_catalog_entry.hpp +5 -5
  402. package/src/duckdb/src/include/duckdb/catalog/default/builtin_types/types.hpp +2 -1
  403. package/src/duckdb/src/include/duckdb/catalog/default/default_functions.hpp +4 -5
  404. package/src/duckdb/src/include/duckdb/catalog/default/default_generator.hpp +4 -5
  405. package/src/duckdb/src/include/duckdb/catalog/default/default_schemas.hpp +2 -1
  406. package/src/duckdb/src/include/duckdb/catalog/default/default_table_functions.hpp +47 -0
  407. package/src/duckdb/src/include/duckdb/catalog/duck_catalog.hpp +2 -0
  408. package/src/duckdb/src/include/duckdb/catalog/similar_catalog_entry.hpp +2 -2
  409. package/src/duckdb/src/include/duckdb/common/allocator.hpp +9 -1
  410. package/src/duckdb/src/include/duckdb/common/array_ptr.hpp +120 -0
  411. package/src/duckdb/src/include/duckdb/common/arrow/appender/append_data.hpp +37 -11
  412. package/src/duckdb/src/include/duckdb/common/arrow/appender/enum_data.hpp +9 -8
  413. package/src/duckdb/src/include/duckdb/common/arrow/appender/list.hpp +1 -0
  414. package/src/duckdb/src/include/duckdb/common/arrow/appender/list_data.hpp +6 -4
  415. package/src/duckdb/src/include/duckdb/common/arrow/appender/list_view_data.hpp +92 -0
  416. package/src/duckdb/src/include/duckdb/common/arrow/appender/map_data.hpp +2 -2
  417. package/src/duckdb/src/include/duckdb/common/arrow/appender/scalar_data.hpp +26 -4
  418. package/src/duckdb/src/include/duckdb/common/arrow/appender/varchar_data.hpp +90 -11
  419. package/src/duckdb/src/include/duckdb/common/arrow/arrow_appender.hpp +6 -6
  420. package/src/duckdb/src/include/duckdb/common/arrow/arrow_buffer.hpp +8 -1
  421. package/src/duckdb/src/include/duckdb/common/arrow/arrow_merge_event.hpp +62 -0
  422. package/src/duckdb/src/include/duckdb/common/arrow/arrow_query_result.hpp +52 -0
  423. package/src/duckdb/src/include/duckdb/common/arrow/arrow_types_extension.hpp +42 -0
  424. package/src/duckdb/src/include/duckdb/common/arrow/physical_arrow_batch_collector.hpp +30 -0
  425. package/src/duckdb/src/include/duckdb/common/arrow/physical_arrow_collector.hpp +65 -0
  426. package/src/duckdb/src/include/duckdb/common/arrow/schema_metadata.hpp +43 -0
  427. package/src/duckdb/src/include/duckdb/common/bswap.hpp +18 -16
  428. package/src/duckdb/src/include/duckdb/common/cgroups.hpp +30 -0
  429. package/src/duckdb/src/include/duckdb/common/compressed_file_system.hpp +3 -0
  430. package/src/duckdb/src/include/duckdb/common/dl.hpp +8 -1
  431. package/src/duckdb/src/include/duckdb/common/encryption_state.hpp +48 -0
  432. package/src/duckdb/src/include/duckdb/common/enum_util.hpp +88 -0
  433. package/src/duckdb/src/include/duckdb/common/enums/checkpoint_type.hpp +2 -2
  434. package/src/duckdb/src/include/duckdb/common/enums/copy_overwrite_mode.hpp +6 -1
  435. package/src/duckdb/src/include/duckdb/common/enums/destroy_buffer_upon.hpp +21 -0
  436. package/src/duckdb/src/include/duckdb/common/enums/explain_format.hpp +17 -0
  437. package/src/duckdb/src/include/duckdb/common/enums/file_compression_type.hpp +4 -0
  438. package/src/duckdb/src/include/duckdb/common/enums/join_type.hpp +2 -2
  439. package/src/duckdb/src/include/duckdb/common/enums/metric_type.hpp +88 -0
  440. package/src/duckdb/src/include/duckdb/common/enums/optimizer_type.hpp +6 -1
  441. package/src/duckdb/src/include/duckdb/common/enums/pending_execution_result.hpp +2 -1
  442. package/src/duckdb/src/include/duckdb/common/enums/physical_operator_type.hpp +1 -0
  443. package/src/duckdb/src/include/duckdb/common/enums/profiler_format.hpp +1 -1
  444. package/src/duckdb/src/include/duckdb/common/enums/relation_type.hpp +3 -1
  445. package/src/duckdb/src/include/duckdb/common/enums/set_scope.hpp +2 -1
  446. package/src/duckdb/src/include/duckdb/common/enums/statement_type.hpp +23 -2
  447. package/src/duckdb/src/include/duckdb/common/enums/stream_execution_result.hpp +25 -0
  448. package/src/duckdb/src/include/duckdb/common/enums/tableref_type.hpp +2 -1
  449. package/src/duckdb/src/include/duckdb/common/enums/wal_type.hpp +1 -0
  450. package/src/duckdb/src/include/duckdb/common/error_data.hpp +5 -2
  451. package/src/duckdb/src/include/duckdb/common/exception/binder_exception.hpp +1 -0
  452. package/src/duckdb/src/include/duckdb/common/exception.hpp +20 -2
  453. package/src/duckdb/src/include/duckdb/common/extra_operator_info.hpp +12 -0
  454. package/src/duckdb/src/include/duckdb/common/file_buffer.hpp +2 -0
  455. package/src/duckdb/src/include/duckdb/common/file_open_flags.hpp +16 -0
  456. package/src/duckdb/src/include/duckdb/common/file_opener.hpp +18 -0
  457. package/src/duckdb/src/include/duckdb/common/file_system.hpp +3 -0
  458. package/src/duckdb/src/include/duckdb/common/filename_pattern.hpp +4 -0
  459. package/src/duckdb/src/include/duckdb/common/fixed_size_map.hpp +160 -96
  460. package/src/duckdb/src/include/duckdb/common/fsst.hpp +9 -2
  461. package/src/duckdb/src/include/duckdb/common/helper.hpp +22 -8
  462. package/src/duckdb/src/include/duckdb/common/hive_partitioning.hpp +16 -7
  463. package/src/duckdb/src/include/duckdb/common/http_util.hpp +19 -0
  464. package/src/duckdb/src/include/duckdb/common/insertion_order_preserving_map.hpp +19 -6
  465. package/src/duckdb/src/include/duckdb/common/limits.hpp +9 -2
  466. package/src/duckdb/src/include/duckdb/common/multi_file_list.hpp +38 -6
  467. package/src/duckdb/src/include/duckdb/common/multi_file_reader.hpp +9 -2
  468. package/src/duckdb/src/include/duckdb/common/multi_file_reader_options.hpp +5 -1
  469. package/src/duckdb/src/include/duckdb/common/numeric_utils.hpp +82 -50
  470. package/src/duckdb/src/include/duckdb/common/operator/abs.hpp +11 -0
  471. package/src/duckdb/src/include/duckdb/common/operator/cast_operators.hpp +7 -3
  472. package/src/duckdb/src/include/duckdb/common/operator/decimal_cast_operators.hpp +23 -1
  473. package/src/duckdb/src/include/duckdb/common/operator/double_cast_operator.hpp +2 -1
  474. package/src/duckdb/src/include/duckdb/common/operator/integer_cast_operator.hpp +1 -1
  475. package/src/duckdb/src/include/duckdb/common/operator/numeric_cast.hpp +4 -0
  476. package/src/duckdb/src/include/duckdb/common/operator/string_cast.hpp +2 -0
  477. package/src/duckdb/src/include/duckdb/common/optional_ptr.hpp +10 -5
  478. package/src/duckdb/src/include/duckdb/common/optionally_owned_ptr.hpp +1 -0
  479. package/src/duckdb/src/include/duckdb/common/owning_string_map.hpp +155 -0
  480. package/src/duckdb/src/include/duckdb/common/perfect_map_set.hpp +2 -3
  481. package/src/duckdb/src/include/duckdb/common/platform.hpp +58 -0
  482. package/src/duckdb/src/include/duckdb/common/radix.hpp +172 -27
  483. package/src/duckdb/src/include/duckdb/common/radix_partitioning.hpp +5 -1
  484. package/src/duckdb/src/include/duckdb/common/random_engine.hpp +1 -0
  485. package/src/duckdb/src/include/duckdb/common/re2_regex.hpp +1 -1
  486. package/src/duckdb/src/include/duckdb/common/render_tree.hpp +77 -0
  487. package/src/duckdb/src/include/duckdb/common/row_operations/row_matcher.hpp +12 -0
  488. package/src/duckdb/src/include/duckdb/common/serializer/binary_serializer.hpp +6 -2
  489. package/src/duckdb/src/include/duckdb/common/serializer/buffered_file_writer.hpp +5 -3
  490. package/src/duckdb/src/include/duckdb/common/serializer/deserializer.hpp +15 -7
  491. package/src/duckdb/src/include/duckdb/common/serializer/memory_stream.hpp +3 -1
  492. package/src/duckdb/src/include/duckdb/common/serializer/serialization_data.hpp +245 -0
  493. package/src/duckdb/src/include/duckdb/common/serializer/serializer.hpp +10 -0
  494. package/src/duckdb/src/include/duckdb/common/sort/duckdb_pdqsort.hpp +10 -11
  495. package/src/duckdb/src/include/duckdb/common/sort/partition_state.hpp +12 -6
  496. package/src/duckdb/src/include/duckdb/common/string_util.hpp +37 -7
  497. package/src/duckdb/src/include/duckdb/common/tree_renderer/graphviz_tree_renderer.hpp +44 -0
  498. package/src/duckdb/src/include/duckdb/common/tree_renderer/html_tree_renderer.hpp +44 -0
  499. package/src/duckdb/src/include/duckdb/common/tree_renderer/json_tree_renderer.hpp +44 -0
  500. package/src/duckdb/src/include/duckdb/common/tree_renderer/text_tree_renderer.hpp +119 -0
  501. package/src/duckdb/src/include/duckdb/common/tree_renderer.hpp +9 -123
  502. package/src/duckdb/src/include/duckdb/common/type_visitor.hpp +96 -0
  503. package/src/duckdb/src/include/duckdb/common/typedefs.hpp +11 -1
  504. package/src/duckdb/src/include/duckdb/common/types/arrow_string_view_type.hpp +84 -0
  505. package/src/duckdb/src/include/duckdb/common/types/batched_data_collection.hpp +36 -1
  506. package/src/duckdb/src/include/duckdb/common/types/bit.hpp +1 -1
  507. package/src/duckdb/src/include/duckdb/common/types/cast_helpers.hpp +2 -2
  508. package/src/duckdb/src/include/duckdb/common/types/column/column_data_allocator.hpp +4 -2
  509. package/src/duckdb/src/include/duckdb/common/types/column/partitioned_column_data.hpp +52 -0
  510. package/src/duckdb/src/include/duckdb/common/types/data_chunk.hpp +2 -0
  511. package/src/duckdb/src/include/duckdb/common/types/date.hpp +0 -3
  512. package/src/duckdb/src/include/duckdb/common/types/date_lookup_cache.hpp +65 -0
  513. package/src/duckdb/src/include/duckdb/common/types/datetime.hpp +5 -2
  514. package/src/duckdb/src/include/duckdb/common/types/hyperloglog.hpp +49 -40
  515. package/src/duckdb/src/include/duckdb/common/types/interval.hpp +5 -1
  516. package/src/duckdb/src/include/duckdb/common/types/list_segment.hpp +2 -1
  517. package/src/duckdb/src/include/duckdb/common/types/row/partitioned_tuple_data.hpp +41 -9
  518. package/src/duckdb/src/include/duckdb/common/types/row/row_data_collection.hpp +4 -3
  519. package/src/duckdb/src/include/duckdb/common/types/row/row_data_collection_scanner.hpp +3 -1
  520. package/src/duckdb/src/include/duckdb/common/types/row/tuple_data_allocator.hpp +4 -0
  521. package/src/duckdb/src/include/duckdb/common/types/row/tuple_data_collection.hpp +4 -0
  522. package/src/duckdb/src/include/duckdb/common/types/row/tuple_data_states.hpp +1 -1
  523. package/src/duckdb/src/include/duckdb/common/types/selection_vector.hpp +4 -0
  524. package/src/duckdb/src/include/duckdb/common/types/string_type.hpp +4 -1
  525. package/src/duckdb/src/include/duckdb/common/types/time.hpp +11 -6
  526. package/src/duckdb/src/include/duckdb/common/types/timestamp.hpp +13 -3
  527. package/src/duckdb/src/include/duckdb/common/types/validity_mask.hpp +103 -12
  528. package/src/duckdb/src/include/duckdb/common/types/value.hpp +12 -3
  529. package/src/duckdb/src/include/duckdb/common/types/varint.hpp +107 -0
  530. package/src/duckdb/src/include/duckdb/common/types/vector.hpp +5 -1
  531. package/src/duckdb/src/include/duckdb/common/types/vector_buffer.hpp +7 -2
  532. package/src/duckdb/src/include/duckdb/common/types.hpp +6 -39
  533. package/src/duckdb/src/include/duckdb/common/union_by_name.hpp +42 -10
  534. package/src/duckdb/src/include/duckdb/common/vector_operations/generic_executor.hpp +29 -0
  535. package/src/duckdb/src/include/duckdb/common/vector_operations/unary_executor.hpp +0 -7
  536. package/src/duckdb/src/include/duckdb/common/vector_operations/vector_operations.hpp +2 -0
  537. package/src/duckdb/src/include/duckdb/common/winapi.hpp +8 -0
  538. package/src/duckdb/src/include/duckdb/core_functions/aggregate/algebraic/covar.hpp +8 -4
  539. package/src/duckdb/src/include/duckdb/core_functions/aggregate/algebraic/stddev.hpp +8 -4
  540. package/src/duckdb/src/include/duckdb/core_functions/aggregate/distributive_functions.hpp +4 -2
  541. package/src/duckdb/src/include/duckdb/core_functions/aggregate/histogram_helpers.hpp +99 -0
  542. package/src/duckdb/src/include/duckdb/core_functions/aggregate/holistic_functions.hpp +16 -7
  543. package/src/duckdb/src/include/duckdb/core_functions/aggregate/minmax_n_helpers.hpp +396 -0
  544. package/src/duckdb/src/include/duckdb/core_functions/aggregate/nested_functions.hpp +10 -0
  545. package/src/duckdb/src/include/duckdb/core_functions/aggregate/quantile_helpers.hpp +65 -0
  546. package/src/duckdb/src/include/duckdb/core_functions/aggregate/quantile_sort_tree.hpp +349 -0
  547. package/src/duckdb/src/include/duckdb/core_functions/aggregate/quantile_state.hpp +300 -0
  548. package/src/duckdb/src/include/duckdb/core_functions/aggregate/regression/regr_slope.hpp +1 -1
  549. package/src/duckdb/src/include/duckdb/core_functions/aggregate/sort_key_helpers.hpp +55 -0
  550. package/src/duckdb/src/include/duckdb/core_functions/array_kernels.hpp +107 -0
  551. package/src/duckdb/src/include/duckdb/core_functions/create_sort_key.hpp +55 -0
  552. package/src/duckdb/src/include/duckdb/core_functions/lambda_functions.hpp +1 -2
  553. package/src/duckdb/src/include/duckdb/core_functions/scalar/array_functions.hpp +24 -0
  554. package/src/duckdb/src/include/duckdb/core_functions/scalar/date_functions.hpp +9 -0
  555. package/src/duckdb/src/include/duckdb/core_functions/scalar/generic_functions.hpp +27 -0
  556. package/src/duckdb/src/include/duckdb/core_functions/scalar/list_functions.hpp +80 -8
  557. package/src/duckdb/src/include/duckdb/core_functions/scalar/map_functions.hpp +9 -0
  558. package/src/duckdb/src/include/duckdb/core_functions/scalar/math_functions.hpp +54 -0
  559. package/src/duckdb/src/include/duckdb/core_functions/scalar/string_functions.hpp +30 -21
  560. package/src/duckdb/src/include/duckdb/execution/adaptive_filter.hpp +25 -14
  561. package/src/duckdb/src/include/duckdb/execution/aggregate_hashtable.hpp +2 -48
  562. package/src/duckdb/src/include/duckdb/execution/executor.hpp +25 -2
  563. package/src/duckdb/src/include/duckdb/execution/ht_entry.hpp +102 -0
  564. package/src/duckdb/src/include/duckdb/execution/index/art/art.hpp +94 -101
  565. package/src/duckdb/src/include/duckdb/execution/index/art/art_key.hpp +43 -25
  566. package/src/duckdb/src/include/duckdb/execution/index/art/base_leaf.hpp +109 -0
  567. package/src/duckdb/src/include/duckdb/execution/index/art/base_node.hpp +140 -0
  568. package/src/duckdb/src/include/duckdb/execution/index/art/iterator.hpp +43 -24
  569. package/src/duckdb/src/include/duckdb/execution/index/art/leaf.hpp +41 -52
  570. package/src/duckdb/src/include/duckdb/execution/index/art/node.hpp +133 -74
  571. package/src/duckdb/src/include/duckdb/execution/index/art/node256.hpp +46 -29
  572. package/src/duckdb/src/include/duckdb/execution/index/art/node256_leaf.hpp +53 -0
  573. package/src/duckdb/src/include/duckdb/execution/index/art/node48.hpp +52 -35
  574. package/src/duckdb/src/include/duckdb/execution/index/art/prefix.hpp +96 -57
  575. package/src/duckdb/src/include/duckdb/execution/index/bound_index.hpp +9 -4
  576. package/src/duckdb/src/include/duckdb/execution/index/fixed_size_allocator.hpp +48 -10
  577. package/src/duckdb/src/include/duckdb/execution/index/fixed_size_buffer.hpp +0 -2
  578. package/src/duckdb/src/include/duckdb/execution/index/index_pointer.hpp +4 -2
  579. package/src/duckdb/src/include/duckdb/execution/join_hashtable.hpp +114 -36
  580. package/src/duckdb/src/include/duckdb/execution/merge_sort_tree.hpp +158 -67
  581. package/src/duckdb/src/include/duckdb/execution/operator/aggregate/aggregate_object.hpp +1 -1
  582. package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_hash_aggregate.hpp +1 -1
  583. package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_perfecthash_aggregate.hpp +1 -1
  584. package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_streaming_window.hpp +19 -2
  585. package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_ungrouped_aggregate.hpp +1 -1
  586. package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_window.hpp +1 -1
  587. package/src/duckdb/src/include/duckdb/execution/operator/aggregate/ungrouped_aggregate_state.hpp +75 -0
  588. package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/base_scanner.hpp +81 -23
  589. package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/column_count_scanner.hpp +27 -8
  590. package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_buffer_manager.hpp +2 -1
  591. package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_error.hpp +31 -22
  592. package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_file_handle.hpp +4 -2
  593. package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_file_scanner.hpp +48 -5
  594. package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_option.hpp +7 -3
  595. package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_reader_options.hpp +22 -12
  596. package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_schema.hpp +35 -0
  597. package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_sniffer.hpp +81 -39
  598. package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_state.hpp +2 -1
  599. package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_state_machine.hpp +18 -1
  600. package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_state_machine_cache.hpp +9 -7
  601. package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/global_csv_state.hpp +5 -4
  602. package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/header_value.hpp +26 -0
  603. package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/scanner_boundary.hpp +6 -9
  604. package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/skip_scanner.hpp +3 -0
  605. package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/state_machine_options.hpp +5 -3
  606. package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/string_value_scanner.hpp +36 -19
  607. package/src/duckdb/src/include/duckdb/execution/operator/filter/physical_filter.hpp +1 -1
  608. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_batch_collector.hpp +21 -0
  609. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_buffered_batch_collector.hpp +53 -0
  610. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_buffered_collector.hpp +3 -0
  611. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_explain_analyze.hpp +6 -2
  612. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_materialized_collector.hpp +18 -0
  613. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_reservoir_sample.hpp +1 -1
  614. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_result_collector.hpp +6 -0
  615. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_set.hpp +2 -2
  616. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_set_variable.hpp +43 -0
  617. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_streaming_sample.hpp +1 -1
  618. package/src/duckdb/src/include/duckdb/execution/operator/join/join_filter_pushdown.hpp +59 -0
  619. package/src/duckdb/src/include/duckdb/execution/operator/join/physical_blockwise_nl_join.hpp +1 -1
  620. package/src/duckdb/src/include/duckdb/execution/operator/join/physical_comparison_join.hpp +8 -1
  621. package/src/duckdb/src/include/duckdb/execution/operator/join/physical_delim_join.hpp +5 -2
  622. package/src/duckdb/src/include/duckdb/execution/operator/join/physical_hash_join.hpp +4 -2
  623. package/src/duckdb/src/include/duckdb/execution/operator/join/physical_iejoin.hpp +2 -0
  624. package/src/duckdb/src/include/duckdb/execution/operator/join/physical_join.hpp +1 -1
  625. package/src/duckdb/src/include/duckdb/execution/operator/join/physical_left_delim_join.hpp +3 -1
  626. package/src/duckdb/src/include/duckdb/execution/operator/join/physical_range_join.hpp +4 -1
  627. package/src/duckdb/src/include/duckdb/execution/operator/join/physical_right_delim_join.hpp +3 -1
  628. package/src/duckdb/src/include/duckdb/execution/operator/order/physical_order.hpp +1 -1
  629. package/src/duckdb/src/include/duckdb/execution/operator/order/physical_top_n.hpp +1 -1
  630. package/src/duckdb/src/include/duckdb/execution/operator/persistent/batch_memory_manager.hpp +5 -37
  631. package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_batch_copy_to_file.hpp +5 -4
  632. package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_copy_to_file.hpp +8 -2
  633. package/src/duckdb/src/include/duckdb/execution/operator/projection/physical_projection.hpp +1 -1
  634. package/src/duckdb/src/include/duckdb/execution/operator/projection/physical_tableinout_function.hpp +2 -0
  635. package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_column_data_scan.hpp +9 -3
  636. package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_table_scan.hpp +8 -6
  637. package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_art_index.hpp +2 -2
  638. package/src/duckdb/src/include/duckdb/execution/operator/set/physical_cte.hpp +1 -1
  639. package/src/duckdb/src/include/duckdb/execution/operator/set/physical_recursive_cte.hpp +1 -1
  640. package/src/duckdb/src/include/duckdb/execution/physical_operator.hpp +21 -6
  641. package/src/duckdb/src/include/duckdb/execution/physical_operator_states.hpp +3 -2
  642. package/src/duckdb/src/include/duckdb/execution/physical_plan_generator.hpp +3 -0
  643. package/src/duckdb/src/include/duckdb/execution/window_executor.hpp +137 -110
  644. package/src/duckdb/src/include/duckdb/execution/window_segment_tree.hpp +57 -126
  645. package/src/duckdb/src/include/duckdb/function/aggregate_function.hpp +21 -4
  646. package/src/duckdb/src/include/duckdb/function/cast/default_casts.hpp +1 -1
  647. package/src/duckdb/src/include/duckdb/function/compression/compression.hpp +10 -10
  648. package/src/duckdb/src/include/duckdb/function/compression_function.hpp +37 -7
  649. package/src/duckdb/src/include/duckdb/function/copy_function.hpp +24 -11
  650. package/src/duckdb/src/include/duckdb/function/function_binder.hpp +4 -4
  651. package/src/duckdb/src/include/duckdb/function/function_serialization.hpp +41 -1
  652. package/src/duckdb/src/include/duckdb/function/macro_function.hpp +15 -5
  653. package/src/duckdb/src/include/duckdb/function/pragma/pragma_functions.hpp +1 -0
  654. package/src/duckdb/src/include/duckdb/function/replacement_scan.hpp +20 -4
  655. package/src/duckdb/src/include/duckdb/function/scalar/generic_functions.hpp +6 -0
  656. package/src/duckdb/src/include/duckdb/function/scalar/list/contains_or_position.hpp +77 -109
  657. package/src/duckdb/src/include/duckdb/function/scalar/nested_functions.hpp +1 -1
  658. package/src/duckdb/src/include/duckdb/function/scalar/regexp.hpp +6 -3
  659. package/src/duckdb/src/include/duckdb/function/scalar/strftime_format.hpp +25 -12
  660. package/src/duckdb/src/include/duckdb/function/scalar/string_functions.hpp +9 -8
  661. package/src/duckdb/src/include/duckdb/function/scalar_function.hpp +38 -4
  662. package/src/duckdb/src/include/duckdb/function/scalar_macro_function.hpp +1 -1
  663. package/src/duckdb/src/include/duckdb/function/table/arrow/arrow_duck_schema.hpp +11 -57
  664. package/src/duckdb/src/include/duckdb/function/table/arrow/arrow_type_info.hpp +142 -0
  665. package/src/duckdb/src/include/duckdb/function/table/arrow/enum/arrow_datetime_type.hpp +18 -0
  666. package/src/duckdb/src/include/duckdb/function/table/arrow/enum/arrow_type_info_type.hpp +7 -0
  667. package/src/duckdb/src/include/duckdb/function/table/arrow/enum/arrow_variable_size_type.hpp +10 -0
  668. package/src/duckdb/src/include/duckdb/function/table/arrow.hpp +2 -0
  669. package/src/duckdb/src/include/duckdb/function/table/range.hpp +4 -0
  670. package/src/duckdb/src/include/duckdb/function/table/read_csv.hpp +4 -1
  671. package/src/duckdb/src/include/duckdb/function/table/system_functions.hpp +4 -0
  672. package/src/duckdb/src/include/duckdb/function/table/table_scan.hpp +5 -5
  673. package/src/duckdb/src/include/duckdb/function/table_function.hpp +14 -2
  674. package/src/duckdb/src/include/duckdb/function/table_macro_function.hpp +1 -1
  675. package/src/duckdb/src/include/duckdb/main/appender.hpp +14 -4
  676. package/src/duckdb/src/include/duckdb/main/attached_database.hpp +25 -7
  677. package/src/duckdb/src/include/duckdb/main/buffered_data/batched_buffered_data.hpp +79 -0
  678. package/src/duckdb/src/include/duckdb/main/buffered_data/buffered_data.hpp +10 -20
  679. package/src/duckdb/src/include/duckdb/main/buffered_data/simple_buffered_data.hpp +11 -12
  680. package/src/duckdb/src/include/duckdb/main/capi/capi_internal.hpp +7 -2
  681. package/src/duckdb/src/include/duckdb/main/capi/cast/generic.hpp +1 -1
  682. package/src/duckdb/src/include/duckdb/main/capi/cast/utils.hpp +2 -2
  683. package/src/duckdb/src/include/duckdb/main/capi/extension_api.hpp +809 -0
  684. package/src/duckdb/src/include/duckdb/main/chunk_scan_state/batched_data_collection.hpp +35 -0
  685. package/src/duckdb/src/include/duckdb/main/client_config.hpp +68 -2
  686. package/src/duckdb/src/include/duckdb/main/client_context.hpp +30 -22
  687. package/src/duckdb/src/include/duckdb/main/client_context_state.hpp +79 -1
  688. package/src/duckdb/src/include/duckdb/main/client_properties.hpp +9 -3
  689. package/src/duckdb/src/include/duckdb/main/config.hpp +55 -7
  690. package/src/duckdb/src/include/duckdb/main/connection.hpp +5 -1
  691. package/src/duckdb/src/include/duckdb/main/database.hpp +16 -5
  692. package/src/duckdb/src/include/duckdb/main/database_manager.hpp +9 -8
  693. package/src/duckdb/src/include/duckdb/main/db_instance_cache.hpp +21 -6
  694. package/src/duckdb/src/include/duckdb/main/extension.hpp +20 -0
  695. package/src/duckdb/src/include/duckdb/main/extension_entries.hpp +25 -0
  696. package/src/duckdb/src/include/duckdb/main/extension_helper.hpp +29 -23
  697. package/src/duckdb/src/include/duckdb/main/extension_install_info.hpp +6 -0
  698. package/src/duckdb/src/include/duckdb/main/extension_util.hpp +3 -0
  699. package/src/duckdb/src/include/duckdb/main/pending_query_result.hpp +4 -2
  700. package/src/duckdb/src/include/duckdb/main/prepared_statement.hpp +5 -6
  701. package/src/duckdb/src/include/duckdb/main/prepared_statement_data.hpp +2 -5
  702. package/src/duckdb/src/include/duckdb/main/profiling_info.hpp +87 -0
  703. package/src/duckdb/src/include/duckdb/main/profiling_node.hpp +60 -0
  704. package/src/duckdb/src/include/duckdb/main/query_profiler.hpp +72 -34
  705. package/src/duckdb/src/include/duckdb/main/query_result.hpp +1 -1
  706. package/src/duckdb/src/include/duckdb/main/relation/create_table_relation.hpp +2 -1
  707. package/src/duckdb/src/include/duckdb/main/relation/delim_get_relation.hpp +30 -0
  708. package/src/duckdb/src/include/duckdb/main/relation/explain_relation.hpp +3 -1
  709. package/src/duckdb/src/include/duckdb/main/relation/join_relation.hpp +3 -0
  710. package/src/duckdb/src/include/duckdb/main/relation/materialized_relation.hpp +1 -4
  711. package/src/duckdb/src/include/duckdb/main/relation/query_relation.hpp +4 -1
  712. package/src/duckdb/src/include/duckdb/main/relation/read_json_relation.hpp +6 -0
  713. package/src/duckdb/src/include/duckdb/main/relation/table_function_relation.hpp +1 -0
  714. package/src/duckdb/src/include/duckdb/main/relation/view_relation.hpp +2 -0
  715. package/src/duckdb/src/include/duckdb/main/relation.hpp +7 -4
  716. package/src/duckdb/src/include/duckdb/main/secret/default_secrets.hpp +36 -0
  717. package/src/duckdb/src/include/duckdb/main/secret/secret.hpp +108 -0
  718. package/src/duckdb/src/include/duckdb/main/secret/secret_manager.hpp +14 -4
  719. package/src/duckdb/src/include/duckdb/main/settings.hpp +227 -3
  720. package/src/duckdb/src/include/duckdb/main/stream_query_result.hpp +8 -0
  721. package/src/duckdb/src/include/duckdb/optimizer/build_probe_side_optimizer.hpp +51 -0
  722. package/src/duckdb/src/include/duckdb/optimizer/compressed_materialization.hpp +7 -0
  723. package/src/duckdb/src/include/duckdb/optimizer/cte_filter_pusher.hpp +46 -0
  724. package/src/duckdb/src/include/duckdb/optimizer/filter_combiner.hpp +1 -1
  725. package/src/duckdb/src/include/duckdb/optimizer/filter_pushdown.hpp +7 -0
  726. package/src/duckdb/src/include/duckdb/optimizer/join_filter_pushdown_optimizer.hpp +31 -0
  727. package/src/duckdb/src/include/duckdb/optimizer/join_order/cardinality_estimator.hpp +51 -10
  728. package/src/duckdb/src/include/duckdb/optimizer/join_order/cost_model.hpp +1 -0
  729. package/src/duckdb/src/include/duckdb/optimizer/join_order/join_order_optimizer.hpp +17 -5
  730. package/src/duckdb/src/include/duckdb/optimizer/join_order/query_graph.hpp +1 -1
  731. package/src/duckdb/src/include/duckdb/optimizer/join_order/query_graph_manager.hpp +15 -13
  732. package/src/duckdb/src/include/duckdb/optimizer/join_order/relation_manager.hpp +9 -4
  733. package/src/duckdb/src/include/duckdb/optimizer/limit_pushdown.hpp +25 -0
  734. package/src/duckdb/src/include/duckdb/optimizer/optimizer.hpp +1 -0
  735. package/src/duckdb/src/include/duckdb/optimizer/rule/join_dependent_filter.hpp +37 -0
  736. package/src/duckdb/src/include/duckdb/parallel/executor_task.hpp +6 -1
  737. package/src/duckdb/src/include/duckdb/parallel/interrupt.hpp +54 -2
  738. package/src/duckdb/src/include/duckdb/parallel/meta_pipeline.hpp +27 -8
  739. package/src/duckdb/src/include/duckdb/parallel/pipeline.hpp +1 -0
  740. package/src/duckdb/src/include/duckdb/parallel/pipeline_prepare_finish_event.hpp +25 -0
  741. package/src/duckdb/src/include/duckdb/parallel/task_executor.hpp +63 -0
  742. package/src/duckdb/src/include/duckdb/parallel/task_scheduler.hpp +10 -1
  743. package/src/duckdb/src/include/duckdb/parser/expression/function_expression.hpp +4 -1
  744. package/src/duckdb/src/include/duckdb/parser/expression/star_expression.hpp +5 -0
  745. package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_table_info.hpp +5 -0
  746. package/src/duckdb/src/include/duckdb/parser/parsed_data/attach_info.hpp +5 -0
  747. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_index_info.hpp +2 -0
  748. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_macro_info.hpp +11 -1
  749. package/src/duckdb/src/include/duckdb/parser/parsed_data/transaction_info.hpp +9 -0
  750. package/src/duckdb/src/include/duckdb/parser/parsed_expression_iterator.hpp +13 -6
  751. package/src/duckdb/src/include/duckdb/parser/parser_extension.hpp +1 -1
  752. package/src/duckdb/src/include/duckdb/parser/sql_statement.hpp +1 -3
  753. package/src/duckdb/src/include/duckdb/parser/statement/copy_statement.hpp +2 -0
  754. package/src/duckdb/src/include/duckdb/parser/statement/explain_statement.hpp +5 -1
  755. package/src/duckdb/src/include/duckdb/parser/statement/set_statement.hpp +2 -2
  756. package/src/duckdb/src/include/duckdb/parser/statement/transaction_statement.hpp +1 -1
  757. package/src/duckdb/src/include/duckdb/parser/tableref/basetableref.hpp +0 -2
  758. package/src/duckdb/src/include/duckdb/parser/tableref/column_data_ref.hpp +9 -7
  759. package/src/duckdb/src/include/duckdb/parser/tableref/delimgetref.hpp +37 -0
  760. package/src/duckdb/src/include/duckdb/parser/tableref/joinref.hpp +4 -0
  761. package/src/duckdb/src/include/duckdb/parser/tableref/pivotref.hpp +0 -2
  762. package/src/duckdb/src/include/duckdb/parser/tableref/subqueryref.hpp +0 -2
  763. package/src/duckdb/src/include/duckdb/parser/tableref/table_function_ref.hpp +0 -1
  764. package/src/duckdb/src/include/duckdb/parser/tableref.hpp +3 -1
  765. package/src/duckdb/src/include/duckdb/parser/transformer.hpp +17 -9
  766. package/src/duckdb/src/include/duckdb/planner/binder.hpp +24 -14
  767. package/src/duckdb/src/include/duckdb/planner/collation_binding.hpp +44 -0
  768. package/src/duckdb/src/include/duckdb/planner/expression/bound_aggregate_expression.hpp +1 -1
  769. package/src/duckdb/src/include/duckdb/planner/expression/bound_between_expression.hpp +1 -1
  770. package/src/duckdb/src/include/duckdb/planner/expression/bound_case_expression.hpp +1 -1
  771. package/src/duckdb/src/include/duckdb/planner/expression/bound_cast_expression.hpp +1 -1
  772. package/src/duckdb/src/include/duckdb/planner/expression/bound_columnref_expression.hpp +1 -1
  773. package/src/duckdb/src/include/duckdb/planner/expression/bound_comparison_expression.hpp +1 -1
  774. package/src/duckdb/src/include/duckdb/planner/expression/bound_conjunction_expression.hpp +1 -1
  775. package/src/duckdb/src/include/duckdb/planner/expression/bound_constant_expression.hpp +1 -1
  776. package/src/duckdb/src/include/duckdb/planner/expression/bound_default_expression.hpp +1 -1
  777. package/src/duckdb/src/include/duckdb/planner/expression/bound_expanded_expression.hpp +1 -1
  778. package/src/duckdb/src/include/duckdb/planner/expression/bound_function_expression.hpp +1 -1
  779. package/src/duckdb/src/include/duckdb/planner/expression/bound_lambda_expression.hpp +1 -1
  780. package/src/duckdb/src/include/duckdb/planner/expression/bound_lambdaref_expression.hpp +1 -1
  781. package/src/duckdb/src/include/duckdb/planner/expression/bound_operator_expression.hpp +1 -1
  782. package/src/duckdb/src/include/duckdb/planner/expression/bound_parameter_data.hpp +2 -0
  783. package/src/duckdb/src/include/duckdb/planner/expression/bound_parameter_expression.hpp +1 -1
  784. package/src/duckdb/src/include/duckdb/planner/expression/bound_reference_expression.hpp +1 -1
  785. package/src/duckdb/src/include/duckdb/planner/expression/bound_subquery_expression.hpp +2 -2
  786. package/src/duckdb/src/include/duckdb/planner/expression/bound_unnest_expression.hpp +1 -1
  787. package/src/duckdb/src/include/duckdb/planner/expression/bound_window_expression.hpp +1 -1
  788. package/src/duckdb/src/include/duckdb/planner/expression.hpp +2 -2
  789. package/src/duckdb/src/include/duckdb/planner/expression_binder/column_alias_binder.hpp +2 -0
  790. package/src/duckdb/src/include/duckdb/planner/expression_binder/group_binder.hpp +1 -0
  791. package/src/duckdb/src/include/duckdb/planner/expression_binder/order_binder.hpp +6 -5
  792. package/src/duckdb/src/include/duckdb/planner/expression_binder/where_binder.hpp +1 -0
  793. package/src/duckdb/src/include/duckdb/planner/expression_binder.hpp +19 -11
  794. package/src/duckdb/src/include/duckdb/planner/filter/conjunction_filter.hpp +4 -0
  795. package/src/duckdb/src/include/duckdb/planner/filter/constant_filter.hpp +2 -0
  796. package/src/duckdb/src/include/duckdb/planner/filter/null_filter.hpp +4 -0
  797. package/src/duckdb/src/include/duckdb/planner/filter/struct_filter.hpp +2 -0
  798. package/src/duckdb/src/include/duckdb/planner/logical_operator.hpp +7 -2
  799. package/src/duckdb/src/include/duckdb/planner/logical_operator_visitor.hpp +2 -1
  800. package/src/duckdb/src/include/duckdb/planner/operator/logical_aggregate.hpp +1 -1
  801. package/src/duckdb/src/include/duckdb/planner/operator/logical_any_join.hpp +1 -1
  802. package/src/duckdb/src/include/duckdb/planner/operator/logical_comparison_join.hpp +6 -1
  803. package/src/duckdb/src/include/duckdb/planner/operator/logical_copy_to_file.hpp +10 -2
  804. package/src/duckdb/src/include/duckdb/planner/operator/logical_cteref.hpp +1 -0
  805. package/src/duckdb/src/include/duckdb/planner/operator/logical_delim_get.hpp +1 -1
  806. package/src/duckdb/src/include/duckdb/planner/operator/logical_distinct.hpp +1 -1
  807. package/src/duckdb/src/include/duckdb/planner/operator/logical_execute.hpp +1 -1
  808. package/src/duckdb/src/include/duckdb/planner/operator/logical_explain.hpp +4 -2
  809. package/src/duckdb/src/include/duckdb/planner/operator/logical_get.hpp +15 -5
  810. package/src/duckdb/src/include/duckdb/planner/operator/logical_materialized_cte.hpp +1 -0
  811. package/src/duckdb/src/include/duckdb/planner/operator/logical_order.hpp +1 -1
  812. package/src/duckdb/src/include/duckdb/planner/subquery/flatten_dependent_join.hpp +2 -1
  813. package/src/duckdb/src/include/duckdb/planner/table_filter.hpp +24 -2
  814. package/src/duckdb/src/include/duckdb/planner/tableref/bound_delimgetref.hpp +26 -0
  815. package/src/duckdb/src/include/duckdb/planner/tableref/bound_joinref.hpp +6 -0
  816. package/src/duckdb/src/include/duckdb/planner/tableref/bound_subqueryref.hpp +1 -1
  817. package/src/duckdb/src/include/duckdb/planner/tableref/bound_table_function.hpp +2 -0
  818. package/src/duckdb/src/include/duckdb/planner/tableref/list.hpp +2 -0
  819. package/src/duckdb/src/include/duckdb/storage/arena_allocator.hpp +2 -1
  820. package/src/duckdb/src/include/duckdb/storage/block.hpp +4 -2
  821. package/src/duckdb/src/include/duckdb/storage/block_manager.hpp +48 -3
  822. package/src/duckdb/src/include/duckdb/storage/buffer/block_handle.hpp +21 -7
  823. package/src/duckdb/src/include/duckdb/storage/buffer/buffer_pool.hpp +65 -51
  824. package/src/duckdb/src/include/duckdb/storage/buffer_manager.hpp +14 -5
  825. package/src/duckdb/src/include/duckdb/storage/checkpoint/row_group_writer.hpp +0 -4
  826. package/src/duckdb/src/include/duckdb/storage/checkpoint/string_checkpoint_state.hpp +3 -2
  827. package/src/duckdb/src/include/duckdb/storage/checkpoint/table_data_writer.hpp +1 -0
  828. package/src/duckdb/src/include/duckdb/storage/checkpoint/write_overflow_strings_to_disk.hpp +3 -4
  829. package/src/duckdb/src/include/duckdb/storage/checkpoint_manager.hpp +2 -0
  830. package/src/duckdb/src/include/duckdb/storage/compression/alp/algorithm/alp.hpp +4 -4
  831. package/src/duckdb/src/include/duckdb/storage/compression/alp/alp_analyze.hpp +6 -4
  832. package/src/duckdb/src/include/duckdb/storage/compression/alp/alp_compress.hpp +19 -17
  833. package/src/duckdb/src/include/duckdb/storage/compression/alp/alp_constants.hpp +2 -2
  834. package/src/duckdb/src/include/duckdb/storage/compression/alp/alp_scan.hpp +3 -4
  835. package/src/duckdb/src/include/duckdb/storage/compression/alp/alp_utils.hpp +3 -2
  836. package/src/duckdb/src/include/duckdb/storage/compression/alprd/algorithm/alprd.hpp +3 -2
  837. package/src/duckdb/src/include/duckdb/storage/compression/alprd/alprd_analyze.hpp +13 -11
  838. package/src/duckdb/src/include/duckdb/storage/compression/alprd/alprd_compress.hpp +19 -19
  839. package/src/duckdb/src/include/duckdb/storage/compression/alprd/alprd_scan.hpp +3 -4
  840. package/src/duckdb/src/include/duckdb/storage/compression/chimp/chimp_scan.hpp +1 -1
  841. package/src/duckdb/src/include/duckdb/storage/compression/patas/patas_scan.hpp +1 -1
  842. package/src/duckdb/src/include/duckdb/storage/data_pointer.hpp +10 -2
  843. package/src/duckdb/src/include/duckdb/storage/data_table.hpp +3 -2
  844. package/src/duckdb/src/include/duckdb/storage/in_memory_block_manager.hpp +15 -0
  845. package/src/duckdb/src/include/duckdb/storage/index_storage_info.hpp +14 -10
  846. package/src/duckdb/src/include/duckdb/storage/metadata/metadata_manager.hpp +6 -8
  847. package/src/duckdb/src/include/duckdb/storage/partial_block_manager.hpp +7 -4
  848. package/src/duckdb/src/include/duckdb/storage/segment/uncompressed.hpp +4 -7
  849. package/src/duckdb/src/include/duckdb/storage/single_file_block_manager.hpp +29 -4
  850. package/src/duckdb/src/include/duckdb/storage/standard_buffer_manager.hpp +22 -7
  851. package/src/duckdb/src/include/duckdb/storage/statistics/base_statistics.hpp +15 -2
  852. package/src/duckdb/src/include/duckdb/storage/statistics/distinct_statistics.hpp +8 -2
  853. package/src/duckdb/src/include/duckdb/storage/statistics/numeric_stats.hpp +5 -16
  854. package/src/duckdb/src/include/duckdb/storage/statistics/numeric_stats_union.hpp +51 -13
  855. package/src/duckdb/src/include/duckdb/storage/statistics/string_stats.hpp +6 -3
  856. package/src/duckdb/src/include/duckdb/storage/storage_info.hpp +29 -19
  857. package/src/duckdb/src/include/duckdb/storage/storage_manager.hpp +23 -7
  858. package/src/duckdb/src/include/duckdb/storage/string_uncompressed.hpp +27 -18
  859. package/src/duckdb/src/include/duckdb/storage/table/append_state.hpp +6 -3
  860. package/src/duckdb/src/include/duckdb/storage/table/array_column_data.hpp +5 -2
  861. package/src/duckdb/src/include/duckdb/storage/table/chunk_info.hpp +3 -0
  862. package/src/duckdb/src/include/duckdb/storage/table/column_checkpoint_state.hpp +5 -1
  863. package/src/duckdb/src/include/duckdb/storage/table/column_data.hpp +77 -6
  864. package/src/duckdb/src/include/duckdb/storage/table/column_segment.hpp +23 -11
  865. package/src/duckdb/src/include/duckdb/storage/table/data_table_info.hpp +3 -0
  866. package/src/duckdb/src/include/duckdb/storage/table/list_column_data.hpp +5 -2
  867. package/src/duckdb/src/include/duckdb/storage/table/row_group.hpp +18 -4
  868. package/src/duckdb/src/include/duckdb/storage/table/row_group_collection.hpp +7 -1
  869. package/src/duckdb/src/include/duckdb/storage/table/row_version_manager.hpp +2 -1
  870. package/src/duckdb/src/include/duckdb/storage/table/scan_state.hpp +89 -14
  871. package/src/duckdb/src/include/duckdb/storage/table/standard_column_data.hpp +4 -2
  872. package/src/duckdb/src/include/duckdb/storage/table/struct_column_data.hpp +4 -2
  873. package/src/duckdb/src/include/duckdb/storage/table/table_index_list.hpp +2 -2
  874. package/src/duckdb/src/include/duckdb/storage/table/validity_column_data.hpp +1 -1
  875. package/src/duckdb/src/include/duckdb/storage/temporary_memory_manager.hpp +33 -15
  876. package/src/duckdb/src/include/duckdb/storage/write_ahead_log.hpp +9 -9
  877. package/src/duckdb/src/include/duckdb/transaction/cleanup_state.hpp +3 -1
  878. package/src/duckdb/src/include/duckdb/transaction/commit_state.hpp +4 -16
  879. package/src/duckdb/src/include/duckdb/transaction/duck_transaction.hpp +27 -4
  880. package/src/duckdb/src/include/duckdb/transaction/duck_transaction_manager.hpp +11 -0
  881. package/src/duckdb/src/include/duckdb/transaction/local_storage.hpp +6 -2
  882. package/src/duckdb/src/include/duckdb/transaction/meta_transaction.hpp +5 -5
  883. package/src/duckdb/src/include/duckdb/transaction/transaction_context.hpp +6 -2
  884. package/src/duckdb/src/include/duckdb/transaction/undo_buffer.hpp +5 -3
  885. package/src/duckdb/src/include/duckdb/transaction/wal_write_state.hpp +48 -0
  886. package/src/duckdb/src/include/duckdb.h +1779 -739
  887. package/src/duckdb/src/include/duckdb_extension.h +921 -0
  888. package/src/duckdb/src/main/appender.cpp +53 -7
  889. package/src/duckdb/src/main/attached_database.cpp +87 -17
  890. package/src/duckdb/src/main/buffered_data/batched_buffered_data.cpp +226 -0
  891. package/src/duckdb/src/main/buffered_data/buffered_data.cpp +35 -0
  892. package/src/duckdb/src/main/buffered_data/simple_buffered_data.cpp +48 -23
  893. package/src/duckdb/src/main/capi/aggregate_function-c.cpp +327 -0
  894. package/src/duckdb/src/main/capi/appender-c.cpp +18 -0
  895. package/src/duckdb/src/main/capi/cast/utils-c.cpp +2 -2
  896. package/src/duckdb/src/main/capi/cast_function-c.cpp +210 -0
  897. package/src/duckdb/src/main/capi/config-c.cpp +3 -3
  898. package/src/duckdb/src/main/capi/data_chunk-c.cpp +18 -7
  899. package/src/duckdb/src/main/capi/duckdb_value-c.cpp +223 -24
  900. package/src/duckdb/src/main/capi/helper-c.cpp +51 -11
  901. package/src/duckdb/src/main/capi/logical_types-c.cpp +105 -46
  902. package/src/duckdb/src/main/capi/pending-c.cpp +7 -6
  903. package/src/duckdb/src/main/capi/prepared-c.cpp +18 -7
  904. package/src/duckdb/src/main/capi/profiling_info-c.cpp +84 -0
  905. package/src/duckdb/src/main/capi/result-c.cpp +139 -37
  906. package/src/duckdb/src/main/capi/scalar_function-c.cpp +269 -0
  907. package/src/duckdb/src/main/capi/table_description-c.cpp +82 -0
  908. package/src/duckdb/src/main/capi/table_function-c.cpp +161 -95
  909. package/src/duckdb/src/main/capi/value-c.cpp +2 -2
  910. package/src/duckdb/src/main/chunk_scan_state/batched_data_collection.cpp +57 -0
  911. package/src/duckdb/src/main/client_config.cpp +17 -0
  912. package/src/duckdb/src/main/client_context.cpp +67 -52
  913. package/src/duckdb/src/main/client_data.cpp +3 -3
  914. package/src/duckdb/src/main/config.cpp +120 -62
  915. package/src/duckdb/src/main/connection.cpp +14 -2
  916. package/src/duckdb/src/main/database.cpp +96 -35
  917. package/src/duckdb/src/main/database_manager.cpp +25 -23
  918. package/src/duckdb/src/main/database_path_and_type.cpp +2 -2
  919. package/src/duckdb/src/main/db_instance_cache.cpp +54 -19
  920. package/src/duckdb/src/main/extension/extension_helper.cpp +47 -42
  921. package/src/duckdb/src/main/extension/extension_install.cpp +155 -87
  922. package/src/duckdb/src/main/extension/extension_load.cpp +180 -26
  923. package/src/duckdb/src/main/extension/extension_util.cpp +8 -0
  924. package/src/duckdb/src/main/extension.cpp +72 -5
  925. package/src/duckdb/src/main/pending_query_result.cpp +20 -12
  926. package/src/duckdb/src/main/prepared_statement.cpp +6 -6
  927. package/src/duckdb/src/main/prepared_statement_data.cpp +28 -17
  928. package/src/duckdb/src/main/profiling_info.cpp +196 -0
  929. package/src/duckdb/src/main/query_profiler.cpp +413 -224
  930. package/src/duckdb/src/main/query_result.cpp +1 -1
  931. package/src/duckdb/src/main/relation/create_table_relation.cpp +4 -2
  932. package/src/duckdb/src/main/relation/create_view_relation.cpp +0 -6
  933. package/src/duckdb/src/main/relation/delim_get_relation.cpp +44 -0
  934. package/src/duckdb/src/main/relation/explain_relation.cpp +4 -3
  935. package/src/duckdb/src/main/relation/join_relation.cpp +5 -0
  936. package/src/duckdb/src/main/relation/limit_relation.cpp +1 -1
  937. package/src/duckdb/src/main/relation/materialized_relation.cpp +3 -3
  938. package/src/duckdb/src/main/relation/query_relation.cpp +42 -15
  939. package/src/duckdb/src/main/relation/read_csv_relation.cpp +7 -14
  940. package/src/duckdb/src/main/relation/read_json_relation.cpp +20 -0
  941. package/src/duckdb/src/main/relation/setop_relation.cpp +1 -1
  942. package/src/duckdb/src/main/relation/table_function_relation.cpp +6 -0
  943. package/src/duckdb/src/main/relation/view_relation.cpp +10 -0
  944. package/src/duckdb/src/main/relation.cpp +12 -8
  945. package/src/duckdb/src/main/secret/default_secrets.cpp +108 -0
  946. package/src/duckdb/src/main/secret/secret.cpp +145 -2
  947. package/src/duckdb/src/main/secret/secret_manager.cpp +85 -35
  948. package/src/duckdb/src/main/secret/secret_storage.cpp +29 -17
  949. package/src/duckdb/src/main/settings/settings.cpp +503 -11
  950. package/src/duckdb/src/main/stream_query_result.cpp +75 -2
  951. package/src/duckdb/src/optimizer/build_probe_side_optimizer.cpp +248 -0
  952. package/src/duckdb/src/optimizer/column_lifetime_analyzer.cpp +28 -6
  953. package/src/duckdb/src/optimizer/compressed_materialization/compress_comparison_join.cpp +152 -0
  954. package/src/duckdb/src/optimizer/compressed_materialization.cpp +11 -1
  955. package/src/duckdb/src/optimizer/cse_optimizer.cpp +3 -0
  956. package/src/duckdb/src/optimizer/cte_filter_pusher.cpp +117 -0
  957. package/src/duckdb/src/optimizer/filter_combiner.cpp +30 -9
  958. package/src/duckdb/src/optimizer/filter_pullup.cpp +54 -2
  959. package/src/duckdb/src/optimizer/filter_pushdown.cpp +71 -3
  960. package/src/duckdb/src/optimizer/join_filter_pushdown_optimizer.cpp +154 -0
  961. package/src/duckdb/src/optimizer/join_order/cardinality_estimator.cpp +245 -114
  962. package/src/duckdb/src/optimizer/join_order/join_order_optimizer.cpp +42 -20
  963. package/src/duckdb/src/optimizer/join_order/join_relation_set.cpp +6 -2
  964. package/src/duckdb/src/optimizer/join_order/plan_enumerator.cpp +32 -10
  965. package/src/duckdb/src/optimizer/join_order/query_graph_manager.cpp +97 -131
  966. package/src/duckdb/src/optimizer/join_order/relation_manager.cpp +265 -51
  967. package/src/duckdb/src/optimizer/join_order/relation_statistics_helper.cpp +21 -17
  968. package/src/duckdb/src/optimizer/limit_pushdown.cpp +42 -0
  969. package/src/duckdb/src/optimizer/optimizer.cpp +51 -8
  970. package/src/duckdb/src/optimizer/pushdown/pushdown_aggregate.cpp +17 -17
  971. package/src/duckdb/src/optimizer/pushdown/pushdown_cross_product.cpp +22 -4
  972. package/src/duckdb/src/optimizer/pushdown/pushdown_get.cpp +1 -18
  973. package/src/duckdb/src/optimizer/pushdown/pushdown_inner_join.cpp +6 -0
  974. package/src/duckdb/src/optimizer/pushdown/pushdown_mark_join.cpp +4 -2
  975. package/src/duckdb/src/optimizer/pushdown/pushdown_window.cpp +91 -0
  976. package/src/duckdb/src/optimizer/remove_unused_columns.cpp +21 -25
  977. package/src/duckdb/src/optimizer/rule/comparison_simplification.cpp +1 -0
  978. package/src/duckdb/src/optimizer/rule/empty_needle_removal.cpp +3 -0
  979. package/src/duckdb/src/optimizer/rule/equal_or_null_simplification.cpp +2 -2
  980. package/src/duckdb/src/optimizer/rule/in_clause_simplification_rule.cpp +8 -2
  981. package/src/duckdb/src/optimizer/rule/join_dependent_filter.cpp +135 -0
  982. package/src/duckdb/src/optimizer/rule/like_optimizations.cpp +1 -1
  983. package/src/duckdb/src/optimizer/rule/regex_optimizations.cpp +1 -1
  984. package/src/duckdb/src/optimizer/statistics/operator/propagate_filter.cpp +6 -1
  985. package/src/duckdb/src/optimizer/statistics/operator/propagate_get.cpp +7 -6
  986. package/src/duckdb/src/optimizer/statistics/operator/propagate_join.cpp +1 -1
  987. package/src/duckdb/src/optimizer/topn_optimizer.cpp +46 -7
  988. package/src/duckdb/src/parallel/executor.cpp +129 -51
  989. package/src/duckdb/src/parallel/executor_task.cpp +16 -3
  990. package/src/duckdb/src/parallel/meta_pipeline.cpp +98 -29
  991. package/src/duckdb/src/parallel/pipeline.cpp +17 -3
  992. package/src/duckdb/src/parallel/pipeline_executor.cpp +14 -2
  993. package/src/duckdb/src/parallel/pipeline_prepare_finish_event.cpp +34 -0
  994. package/src/duckdb/src/parallel/task_executor.cpp +84 -0
  995. package/src/duckdb/src/parallel/task_scheduler.cpp +94 -16
  996. package/src/duckdb/src/parallel/thread_context.cpp +1 -1
  997. package/src/duckdb/src/parser/expression/function_expression.cpp +14 -0
  998. package/src/duckdb/src/parser/expression/star_expression.cpp +35 -2
  999. package/src/duckdb/src/parser/parsed_data/alter_table_info.cpp +5 -1
  1000. package/src/duckdb/src/parser/parsed_data/attach_info.cpp +17 -0
  1001. package/src/duckdb/src/parser/parsed_data/create_index_info.cpp +37 -28
  1002. package/src/duckdb/src/parser/parsed_data/create_macro_info.cpp +44 -2
  1003. package/src/duckdb/src/parser/parsed_data/transaction_info.cpp +21 -1
  1004. package/src/duckdb/src/parser/parsed_expression_iterator.cpp +29 -25
  1005. package/src/duckdb/src/parser/parser.cpp +41 -1
  1006. package/src/duckdb/src/parser/query_node/recursive_cte_node.cpp +1 -0
  1007. package/src/duckdb/src/parser/statement/explain_statement.cpp +28 -13
  1008. package/src/duckdb/src/parser/statement/relation_statement.cpp +5 -0
  1009. package/src/duckdb/src/parser/statement/set_statement.cpp +4 -2
  1010. package/src/duckdb/src/parser/statement/transaction_statement.cpp +3 -3
  1011. package/src/duckdb/src/parser/tableref/column_data_ref.cpp +1 -27
  1012. package/src/duckdb/src/parser/tableref/delimgetref.cpp +30 -0
  1013. package/src/duckdb/src/parser/tableref/joinref.cpp +4 -0
  1014. package/src/duckdb/src/parser/transform/constraint/transform_constraint.cpp +35 -29
  1015. package/src/duckdb/src/parser/transform/expression/transform_array_access.cpp +32 -32
  1016. package/src/duckdb/src/parser/transform/expression/transform_columnref.cpp +2 -1
  1017. package/src/duckdb/src/parser/transform/expression/transform_constant.cpp +17 -0
  1018. package/src/duckdb/src/parser/transform/expression/transform_function.cpp +5 -0
  1019. package/src/duckdb/src/parser/transform/expression/transform_multi_assign_reference.cpp +36 -34
  1020. package/src/duckdb/src/parser/transform/expression/transform_operator.cpp +30 -14
  1021. package/src/duckdb/src/parser/transform/expression/transform_subquery.cpp +1 -1
  1022. package/src/duckdb/src/parser/transform/helpers/transform_alias.cpp +2 -1
  1023. package/src/duckdb/src/parser/transform/helpers/transform_cte.cpp +27 -19
  1024. package/src/duckdb/src/parser/transform/helpers/transform_orderby.cpp +31 -28
  1025. package/src/duckdb/src/parser/transform/statement/transform_alter_table.cpp +25 -27
  1026. package/src/duckdb/src/parser/transform/statement/transform_copy.cpp +1 -1
  1027. package/src/duckdb/src/parser/transform/statement/transform_create_function.cpp +53 -42
  1028. package/src/duckdb/src/parser/transform/statement/transform_create_table.cpp +6 -6
  1029. package/src/duckdb/src/parser/transform/statement/transform_create_table_as.cpp +1 -1
  1030. package/src/duckdb/src/parser/transform/statement/transform_create_type.cpp +1 -1
  1031. package/src/duckdb/src/parser/transform/statement/transform_create_view.cpp +1 -1
  1032. package/src/duckdb/src/parser/transform/statement/transform_explain.cpp +38 -3
  1033. package/src/duckdb/src/parser/transform/statement/transform_insert.cpp +1 -2
  1034. package/src/duckdb/src/parser/transform/statement/transform_pivot_stmt.cpp +1 -1
  1035. package/src/duckdb/src/parser/transform/statement/transform_prepare.cpp +1 -1
  1036. package/src/duckdb/src/parser/transform/statement/transform_select.cpp +26 -21
  1037. package/src/duckdb/src/parser/transform/statement/transform_set.cpp +8 -8
  1038. package/src/duckdb/src/parser/transform/statement/transform_show.cpp +5 -2
  1039. package/src/duckdb/src/parser/transform/statement/transform_show_select.cpp +6 -4
  1040. package/src/duckdb/src/parser/transform/statement/transform_transaction.cpp +27 -6
  1041. package/src/duckdb/src/parser/transform/statement/transform_update.cpp +8 -9
  1042. package/src/duckdb/src/parser/transform/statement/transform_upsert.cpp +11 -12
  1043. package/src/duckdb/src/parser/transform/statement/transform_vacuum.cpp +3 -3
  1044. package/src/duckdb/src/parser/transform/tableref/transform_join.cpp +16 -10
  1045. package/src/duckdb/src/parser/transform/tableref/transform_pivot.cpp +1 -1
  1046. package/src/duckdb/src/parser/transform/tableref/transform_subquery.cpp +1 -1
  1047. package/src/duckdb/src/parser/transformer.cpp +11 -7
  1048. package/src/duckdb/src/planner/bind_context.cpp +3 -3
  1049. package/src/duckdb/src/planner/binder/expression/bind_aggregate_expression.cpp +22 -7
  1050. package/src/duckdb/src/planner/binder/expression/bind_between_expression.cpp +3 -3
  1051. package/src/duckdb/src/planner/binder/expression/bind_collate_expression.cpp +3 -2
  1052. package/src/duckdb/src/planner/binder/expression/bind_columnref_expression.cpp +11 -4
  1053. package/src/duckdb/src/planner/binder/expression/bind_comparison_expression.cpp +9 -54
  1054. package/src/duckdb/src/planner/binder/expression/bind_function_expression.cpp +3 -5
  1055. package/src/duckdb/src/planner/binder/expression/bind_macro_expression.cpp +24 -27
  1056. package/src/duckdb/src/planner/binder/expression/bind_operator_expression.cpp +7 -7
  1057. package/src/duckdb/src/planner/binder/expression/bind_parameter_expression.cpp +9 -2
  1058. package/src/duckdb/src/planner/binder/expression/bind_star_expression.cpp +26 -7
  1059. package/src/duckdb/src/planner/binder/expression/bind_unnest_expression.cpp +5 -0
  1060. package/src/duckdb/src/planner/binder/expression/bind_unpacked_star_expression.cpp +91 -0
  1061. package/src/duckdb/src/planner/binder/expression/bind_window_expression.cpp +2 -2
  1062. package/src/duckdb/src/planner/binder/query_node/bind_select_node.cpp +11 -8
  1063. package/src/duckdb/src/planner/binder/query_node/bind_setop_node.cpp +1 -1
  1064. package/src/duckdb/src/planner/binder/query_node/bind_table_macro_node.cpp +6 -10
  1065. package/src/duckdb/src/planner/binder/query_node/plan_cte_node.cpp +14 -10
  1066. package/src/duckdb/src/planner/binder/query_node/plan_setop.cpp +3 -3
  1067. package/src/duckdb/src/planner/binder/query_node/plan_subquery.cpp +46 -7
  1068. package/src/duckdb/src/planner/binder/statement/bind_call.cpp +13 -20
  1069. package/src/duckdb/src/planner/binder/statement/bind_copy.cpp +105 -13
  1070. package/src/duckdb/src/planner/binder/statement/bind_copy_database.cpp +7 -3
  1071. package/src/duckdb/src/planner/binder/statement/bind_create.cpp +75 -55
  1072. package/src/duckdb/src/planner/binder/statement/bind_create_table.cpp +1 -1
  1073. package/src/duckdb/src/planner/binder/statement/bind_delete.cpp +5 -4
  1074. package/src/duckdb/src/planner/binder/statement/bind_drop.cpp +2 -2
  1075. package/src/duckdb/src/planner/binder/statement/bind_execute.cpp +24 -8
  1076. package/src/duckdb/src/planner/binder/statement/bind_explain.cpp +2 -2
  1077. package/src/duckdb/src/planner/binder/statement/bind_export.cpp +5 -105
  1078. package/src/duckdb/src/planner/binder/statement/bind_extension.cpp +2 -2
  1079. package/src/duckdb/src/planner/binder/statement/bind_insert.cpp +109 -41
  1080. package/src/duckdb/src/planner/binder/statement/bind_set.cpp +23 -7
  1081. package/src/duckdb/src/planner/binder/statement/bind_simple.cpp +4 -1
  1082. package/src/duckdb/src/planner/binder/statement/bind_summarize.cpp +17 -3
  1083. package/src/duckdb/src/planner/binder/statement/bind_update.cpp +5 -4
  1084. package/src/duckdb/src/planner/binder/statement/bind_vacuum.cpp +8 -6
  1085. package/src/duckdb/src/planner/binder/tableref/bind_basetableref.cpp +55 -42
  1086. package/src/duckdb/src/planner/binder/tableref/bind_column_data_ref.cpp +3 -2
  1087. package/src/duckdb/src/planner/binder/tableref/bind_delimgetref.cpp +16 -0
  1088. package/src/duckdb/src/planner/binder/tableref/bind_joinref.cpp +31 -1
  1089. package/src/duckdb/src/planner/binder/tableref/bind_pivot.cpp +6 -0
  1090. package/src/duckdb/src/planner/binder/tableref/bind_showref.cpp +2 -0
  1091. package/src/duckdb/src/planner/binder/tableref/bind_table_function.cpp +106 -46
  1092. package/src/duckdb/src/planner/binder/tableref/plan_delimgetref.cpp +11 -0
  1093. package/src/duckdb/src/planner/binder/tableref/plan_joinref.cpp +15 -2
  1094. package/src/duckdb/src/planner/binder/tableref/plan_table_function.cpp +4 -0
  1095. package/src/duckdb/src/planner/binder.cpp +172 -15
  1096. package/src/duckdb/src/planner/collation_binding.cpp +99 -0
  1097. package/src/duckdb/src/planner/expression/bound_aggregate_expression.cpp +10 -4
  1098. package/src/duckdb/src/planner/expression/bound_between_expression.cpp +1 -1
  1099. package/src/duckdb/src/planner/expression/bound_case_expression.cpp +1 -1
  1100. package/src/duckdb/src/planner/expression/bound_cast_expression.cpp +14 -12
  1101. package/src/duckdb/src/planner/expression/bound_columnref_expression.cpp +1 -1
  1102. package/src/duckdb/src/planner/expression/bound_comparison_expression.cpp +1 -1
  1103. package/src/duckdb/src/planner/expression/bound_conjunction_expression.cpp +1 -1
  1104. package/src/duckdb/src/planner/expression/bound_constant_expression.cpp +1 -1
  1105. package/src/duckdb/src/planner/expression/bound_expanded_expression.cpp +1 -1
  1106. package/src/duckdb/src/planner/expression/bound_function_expression.cpp +8 -2
  1107. package/src/duckdb/src/planner/expression/bound_lambda_expression.cpp +1 -1
  1108. package/src/duckdb/src/planner/expression/bound_lambdaref_expression.cpp +1 -1
  1109. package/src/duckdb/src/planner/expression/bound_operator_expression.cpp +1 -1
  1110. package/src/duckdb/src/planner/expression/bound_parameter_expression.cpp +1 -1
  1111. package/src/duckdb/src/planner/expression/bound_reference_expression.cpp +1 -1
  1112. package/src/duckdb/src/planner/expression/bound_subquery_expression.cpp +1 -1
  1113. package/src/duckdb/src/planner/expression/bound_unnest_expression.cpp +1 -1
  1114. package/src/duckdb/src/planner/expression/bound_window_expression.cpp +6 -6
  1115. package/src/duckdb/src/planner/expression_binder/aggregate_binder.cpp +1 -1
  1116. package/src/duckdb/src/planner/expression_binder/alter_binder.cpp +2 -2
  1117. package/src/duckdb/src/planner/expression_binder/base_select_binder.cpp +1 -1
  1118. package/src/duckdb/src/planner/expression_binder/column_alias_binder.cpp +7 -0
  1119. package/src/duckdb/src/planner/expression_binder/constant_binder.cpp +3 -3
  1120. package/src/duckdb/src/planner/expression_binder/group_binder.cpp +26 -22
  1121. package/src/duckdb/src/planner/expression_binder/having_binder.cpp +7 -1
  1122. package/src/duckdb/src/planner/expression_binder/index_binder.cpp +2 -2
  1123. package/src/duckdb/src/planner/expression_binder/insert_binder.cpp +2 -2
  1124. package/src/duckdb/src/planner/expression_binder/lateral_binder.cpp +2 -2
  1125. package/src/duckdb/src/planner/expression_binder/order_binder.cpp +61 -43
  1126. package/src/duckdb/src/planner/expression_binder/qualify_binder.cpp +2 -2
  1127. package/src/duckdb/src/planner/expression_binder/relation_binder.cpp +4 -4
  1128. package/src/duckdb/src/planner/expression_binder/returning_binder.cpp +3 -2
  1129. package/src/duckdb/src/planner/expression_binder/table_function_binder.cpp +10 -3
  1130. package/src/duckdb/src/planner/expression_binder/update_binder.cpp +1 -1
  1131. package/src/duckdb/src/planner/expression_binder/where_binder.cpp +9 -2
  1132. package/src/duckdb/src/planner/expression_binder.cpp +121 -21
  1133. package/src/duckdb/src/planner/expression_iterator.cpp +26 -1
  1134. package/src/duckdb/src/planner/filter/conjunction_filter.cpp +33 -0
  1135. package/src/duckdb/src/planner/filter/constant_filter.cpp +15 -0
  1136. package/src/duckdb/src/planner/filter/null_filter.cpp +22 -0
  1137. package/src/duckdb/src/planner/filter/struct_filter.cpp +16 -0
  1138. package/src/duckdb/src/planner/logical_operator.cpp +24 -7
  1139. package/src/duckdb/src/planner/operator/logical_aggregate.cpp +13 -7
  1140. package/src/duckdb/src/planner/operator/logical_any_join.cpp +5 -2
  1141. package/src/duckdb/src/planner/operator/logical_comparison_join.cpp +13 -5
  1142. package/src/duckdb/src/planner/operator/logical_copy_to_file.cpp +64 -8
  1143. package/src/duckdb/src/planner/operator/logical_cteref.cpp +7 -0
  1144. package/src/duckdb/src/planner/operator/logical_distinct.cpp +6 -5
  1145. package/src/duckdb/src/planner/operator/logical_get.cpp +60 -18
  1146. package/src/duckdb/src/planner/operator/logical_materialized_cte.cpp +7 -0
  1147. package/src/duckdb/src/planner/operator/logical_order.cpp +7 -4
  1148. package/src/duckdb/src/planner/operator/logical_top_n.cpp +2 -2
  1149. package/src/duckdb/src/planner/operator/logical_vacuum.cpp +1 -1
  1150. package/src/duckdb/src/planner/planner.cpp +2 -3
  1151. package/src/duckdb/src/planner/subquery/flatten_dependent_join.cpp +27 -10
  1152. package/src/duckdb/src/planner/table_filter.cpp +51 -0
  1153. package/src/duckdb/src/storage/arena_allocator.cpp +28 -10
  1154. package/src/duckdb/src/storage/block.cpp +3 -2
  1155. package/src/duckdb/src/storage/buffer/block_handle.cpp +29 -14
  1156. package/src/duckdb/src/storage/buffer/block_manager.cpp +6 -5
  1157. package/src/duckdb/src/storage/buffer/buffer_handle.cpp +1 -1
  1158. package/src/duckdb/src/storage/buffer/buffer_pool.cpp +264 -125
  1159. package/src/duckdb/src/storage/buffer_manager.cpp +5 -1
  1160. package/src/duckdb/src/storage/checkpoint/row_group_writer.cpp +0 -6
  1161. package/src/duckdb/src/storage/checkpoint/table_data_writer.cpp +26 -3
  1162. package/src/duckdb/src/storage/checkpoint/write_overflow_strings_to_disk.cpp +21 -9
  1163. package/src/duckdb/src/storage/checkpoint_manager.cpp +49 -24
  1164. package/src/duckdb/src/storage/compression/alp/alp.cpp +6 -11
  1165. package/src/duckdb/src/storage/compression/alprd.cpp +5 -9
  1166. package/src/duckdb/src/storage/compression/bitpacking.cpp +35 -31
  1167. package/src/duckdb/src/storage/compression/chimp/chimp.cpp +6 -8
  1168. package/src/duckdb/src/storage/compression/dictionary_compression.cpp +71 -58
  1169. package/src/duckdb/src/storage/compression/fixed_size_uncompressed.cpp +15 -13
  1170. package/src/duckdb/src/storage/compression/fsst.cpp +66 -53
  1171. package/src/duckdb/src/storage/compression/numeric_constant.cpp +4 -5
  1172. package/src/duckdb/src/storage/compression/patas.cpp +6 -17
  1173. package/src/duckdb/src/storage/compression/rle.cpp +20 -18
  1174. package/src/duckdb/src/storage/compression/string_uncompressed.cpp +71 -52
  1175. package/src/duckdb/src/storage/compression/uncompressed.cpp +2 -2
  1176. package/src/duckdb/src/storage/compression/validity_uncompressed.cpp +8 -7
  1177. package/src/duckdb/src/storage/data_pointer.cpp +22 -0
  1178. package/src/duckdb/src/storage/data_table.cpp +41 -12
  1179. package/src/duckdb/src/storage/local_storage.cpp +22 -8
  1180. package/src/duckdb/src/storage/metadata/metadata_manager.cpp +33 -17
  1181. package/src/duckdb/src/storage/metadata/metadata_reader.cpp +4 -4
  1182. package/src/duckdb/src/storage/metadata/metadata_writer.cpp +3 -3
  1183. package/src/duckdb/src/storage/partial_block_manager.cpp +19 -8
  1184. package/src/duckdb/src/storage/serialization/serialize_create_info.cpp +11 -8
  1185. package/src/duckdb/src/storage/serialization/serialize_expression.cpp +1 -1
  1186. package/src/duckdb/src/storage/serialization/serialize_extension_install_info.cpp +2 -0
  1187. package/src/duckdb/src/storage/serialization/serialize_logical_operator.cpp +3 -3
  1188. package/src/duckdb/src/storage/serialization/serialize_nodes.cpp +19 -5
  1189. package/src/duckdb/src/storage/serialization/serialize_parse_info.cpp +21 -1
  1190. package/src/duckdb/src/storage/serialization/serialize_parsed_expression.cpp +4 -2
  1191. package/src/duckdb/src/storage/serialization/serialize_query_node.cpp +2 -2
  1192. package/src/duckdb/src/storage/serialization/serialize_storage.cpp +2 -0
  1193. package/src/duckdb/src/storage/serialization/serialize_tableref.cpp +8 -4
  1194. package/src/duckdb/src/storage/serialization/serialize_types.cpp +4 -4
  1195. package/src/duckdb/src/storage/single_file_block_manager.cpp +170 -34
  1196. package/src/duckdb/src/storage/standard_buffer_manager.cpp +221 -64
  1197. package/src/duckdb/src/storage/statistics/column_statistics.cpp +4 -3
  1198. package/src/duckdb/src/storage/statistics/distinct_statistics.cpp +36 -26
  1199. package/src/duckdb/src/storage/statistics/numeric_stats.cpp +4 -15
  1200. package/src/duckdb/src/storage/statistics/string_stats.cpp +14 -8
  1201. package/src/duckdb/src/storage/statistics/struct_stats.cpp +2 -1
  1202. package/src/duckdb/src/storage/storage_info.cpp +34 -9
  1203. package/src/duckdb/src/storage/storage_manager.cpp +147 -74
  1204. package/src/duckdb/src/storage/table/array_column_data.cpp +37 -17
  1205. package/src/duckdb/src/storage/table/chunk_info.cpp +38 -0
  1206. package/src/duckdb/src/storage/table/column_checkpoint_state.cpp +10 -6
  1207. package/src/duckdb/src/storage/table/column_data.cpp +252 -31
  1208. package/src/duckdb/src/storage/table/column_data_checkpointer.cpp +2 -12
  1209. package/src/duckdb/src/storage/table/column_segment.cpp +63 -34
  1210. package/src/duckdb/src/storage/table/list_column_data.cpp +34 -15
  1211. package/src/duckdb/src/storage/table/row_group.cpp +228 -120
  1212. package/src/duckdb/src/storage/table/row_group_collection.cpp +122 -120
  1213. package/src/duckdb/src/storage/table/row_version_manager.cpp +27 -1
  1214. package/src/duckdb/src/storage/table/scan_state.cpp +101 -18
  1215. package/src/duckdb/src/storage/table/standard_column_data.cpp +20 -34
  1216. package/src/duckdb/src/storage/table/struct_column_data.cpp +39 -42
  1217. package/src/duckdb/src/storage/table/table_statistics.cpp +2 -1
  1218. package/src/duckdb/src/storage/table/update_segment.cpp +9 -8
  1219. package/src/duckdb/src/storage/table/validity_column_data.cpp +2 -2
  1220. package/src/duckdb/src/storage/table_index_list.cpp +8 -7
  1221. package/src/duckdb/src/storage/temporary_file_manager.cpp +11 -9
  1222. package/src/duckdb/src/storage/temporary_memory_manager.cpp +227 -39
  1223. package/src/duckdb/src/storage/wal_replay.cpp +68 -28
  1224. package/src/duckdb/src/storage/write_ahead_log.cpp +56 -47
  1225. package/src/duckdb/src/transaction/cleanup_state.cpp +9 -1
  1226. package/src/duckdb/src/transaction/commit_state.cpp +7 -170
  1227. package/src/duckdb/src/transaction/duck_transaction.cpp +87 -19
  1228. package/src/duckdb/src/transaction/duck_transaction_manager.cpp +65 -10
  1229. package/src/duckdb/src/transaction/meta_transaction.cpp +18 -3
  1230. package/src/duckdb/src/transaction/transaction_context.cpp +21 -17
  1231. package/src/duckdb/src/transaction/undo_buffer.cpp +20 -14
  1232. package/src/duckdb/src/transaction/wal_write_state.cpp +292 -0
  1233. package/src/duckdb/src/verification/prepared_statement_verifier.cpp +0 -1
  1234. package/src/duckdb/third_party/brotli/common/brotli_constants.h +204 -0
  1235. package/src/duckdb/third_party/brotli/common/brotli_platform.h +543 -0
  1236. package/src/duckdb/third_party/brotli/common/constants.cpp +17 -0
  1237. package/src/duckdb/third_party/brotli/common/context.cpp +156 -0
  1238. package/src/duckdb/third_party/brotli/common/context.h +110 -0
  1239. package/src/duckdb/third_party/brotli/common/dictionary.cpp +5912 -0
  1240. package/src/duckdb/third_party/brotli/common/dictionary.h +60 -0
  1241. package/src/duckdb/third_party/brotli/common/platform.cpp +24 -0
  1242. package/src/duckdb/third_party/brotli/common/shared_dictionary.cpp +517 -0
  1243. package/src/duckdb/third_party/brotli/common/shared_dictionary_internal.h +71 -0
  1244. package/src/duckdb/third_party/brotli/common/transform.cpp +287 -0
  1245. package/src/duckdb/third_party/brotli/common/transform.h +77 -0
  1246. package/src/duckdb/third_party/brotli/common/version.h +51 -0
  1247. package/src/duckdb/third_party/brotli/dec/bit_reader.cpp +74 -0
  1248. package/src/duckdb/third_party/brotli/dec/bit_reader.h +419 -0
  1249. package/src/duckdb/third_party/brotli/dec/decode.cpp +2758 -0
  1250. package/src/duckdb/third_party/brotli/dec/huffman.cpp +338 -0
  1251. package/src/duckdb/third_party/brotli/dec/huffman.h +118 -0
  1252. package/src/duckdb/third_party/brotli/dec/prefix.h +733 -0
  1253. package/src/duckdb/third_party/brotli/dec/state.cpp +178 -0
  1254. package/src/duckdb/third_party/brotli/dec/state.h +386 -0
  1255. package/src/duckdb/third_party/brotli/enc/backward_references.cpp +3775 -0
  1256. package/src/duckdb/third_party/brotli/enc/backward_references.h +36 -0
  1257. package/src/duckdb/third_party/brotli/enc/backward_references_hq.cpp +935 -0
  1258. package/src/duckdb/third_party/brotli/enc/backward_references_hq.h +92 -0
  1259. package/src/duckdb/third_party/brotli/enc/bit_cost.cpp +410 -0
  1260. package/src/duckdb/third_party/brotli/enc/bit_cost.h +60 -0
  1261. package/src/duckdb/third_party/brotli/enc/block_splitter.cpp +1653 -0
  1262. package/src/duckdb/third_party/brotli/enc/block_splitter.h +48 -0
  1263. package/src/duckdb/third_party/brotli/enc/brotli_bit_stream.cpp +1431 -0
  1264. package/src/duckdb/third_party/brotli/enc/brotli_bit_stream.h +85 -0
  1265. package/src/duckdb/third_party/brotli/enc/brotli_hash.h +4352 -0
  1266. package/src/duckdb/third_party/brotli/enc/brotli_params.h +47 -0
  1267. package/src/duckdb/third_party/brotli/enc/cluster.cpp +1025 -0
  1268. package/src/duckdb/third_party/brotli/enc/cluster.h +1017 -0
  1269. package/src/duckdb/third_party/brotli/enc/command.cpp +24 -0
  1270. package/src/duckdb/third_party/brotli/enc/command.h +187 -0
  1271. package/src/duckdb/third_party/brotli/enc/compound_dictionary.cpp +209 -0
  1272. package/src/duckdb/third_party/brotli/enc/compound_dictionary.h +75 -0
  1273. package/src/duckdb/third_party/brotli/enc/compress_fragment.cpp +796 -0
  1274. package/src/duckdb/third_party/brotli/enc/compress_fragment.h +82 -0
  1275. package/src/duckdb/third_party/brotli/enc/compress_fragment_two_pass.cpp +653 -0
  1276. package/src/duckdb/third_party/brotli/enc/compress_fragment_two_pass.h +68 -0
  1277. package/src/duckdb/third_party/brotli/enc/dictionary_hash.cpp +1844 -0
  1278. package/src/duckdb/third_party/brotli/enc/dictionary_hash.h +21 -0
  1279. package/src/duckdb/third_party/brotli/enc/encode.cpp +1990 -0
  1280. package/src/duckdb/third_party/brotli/enc/encoder_dict.cpp +636 -0
  1281. package/src/duckdb/third_party/brotli/enc/encoder_dict.h +153 -0
  1282. package/src/duckdb/third_party/brotli/enc/entropy_encode.cpp +500 -0
  1283. package/src/duckdb/third_party/brotli/enc/entropy_encode.h +119 -0
  1284. package/src/duckdb/third_party/brotli/enc/entropy_encode_static.h +538 -0
  1285. package/src/duckdb/third_party/brotli/enc/fast_log.cpp +101 -0
  1286. package/src/duckdb/third_party/brotli/enc/fast_log.h +63 -0
  1287. package/src/duckdb/third_party/brotli/enc/find_match_length.h +68 -0
  1288. package/src/duckdb/third_party/brotli/enc/histogram.cpp +96 -0
  1289. package/src/duckdb/third_party/brotli/enc/histogram.h +210 -0
  1290. package/src/duckdb/third_party/brotli/enc/literal_cost.cpp +176 -0
  1291. package/src/duckdb/third_party/brotli/enc/literal_cost.h +28 -0
  1292. package/src/duckdb/third_party/brotli/enc/memory.cpp +190 -0
  1293. package/src/duckdb/third_party/brotli/enc/memory.h +127 -0
  1294. package/src/duckdb/third_party/brotli/enc/metablock.cpp +1225 -0
  1295. package/src/duckdb/third_party/brotli/enc/metablock.h +102 -0
  1296. package/src/duckdb/third_party/brotli/enc/prefix.h +50 -0
  1297. package/src/duckdb/third_party/brotli/enc/quality.h +202 -0
  1298. package/src/duckdb/third_party/brotli/enc/ringbuffer.h +164 -0
  1299. package/src/duckdb/third_party/brotli/enc/state.h +106 -0
  1300. package/src/duckdb/third_party/brotli/enc/static_dict.cpp +538 -0
  1301. package/src/duckdb/third_party/brotli/enc/static_dict.h +37 -0
  1302. package/src/duckdb/third_party/brotli/enc/static_dict_lut.h +5862 -0
  1303. package/src/duckdb/third_party/brotli/enc/utf8_util.cpp +81 -0
  1304. package/src/duckdb/third_party/brotli/enc/utf8_util.h +29 -0
  1305. package/src/duckdb/third_party/brotli/enc/write_bits.h +84 -0
  1306. package/src/duckdb/third_party/brotli/include/brotli/decode.h +405 -0
  1307. package/src/duckdb/third_party/brotli/include/brotli/encode.h +489 -0
  1308. package/src/duckdb/third_party/brotli/include/brotli/port.h +238 -0
  1309. package/src/duckdb/third_party/brotli/include/brotli/shared_dictionary.h +96 -0
  1310. package/src/duckdb/third_party/brotli/include/brotli/types.h +83 -0
  1311. package/src/duckdb/third_party/fast_float/fast_float/fast_float.h +20 -4
  1312. package/src/duckdb/third_party/fmt/include/fmt/format.h +54 -10
  1313. package/src/duckdb/third_party/fsst/fsst.h +2 -2
  1314. package/src/duckdb/third_party/fsst/libfsst.hpp +2 -2
  1315. package/src/duckdb/third_party/httplib/httplib.hpp +6763 -5580
  1316. package/src/duckdb/third_party/hyperloglog/hyperloglog.cpp +13 -30
  1317. package/src/duckdb/third_party/hyperloglog/hyperloglog.hpp +8 -2
  1318. package/src/duckdb/third_party/libpg_query/include/nodes/nodes.hpp +1 -0
  1319. package/src/duckdb/third_party/libpg_query/include/nodes/parsenodes.hpp +22 -9
  1320. package/src/duckdb/third_party/libpg_query/include/parser/gram.hpp +1041 -554
  1321. package/src/duckdb/third_party/libpg_query/include/parser/kwlist.hpp +1 -0
  1322. package/src/duckdb/third_party/libpg_query/postgres_parser.cpp +2 -1
  1323. package/src/duckdb/third_party/libpg_query/src_backend_parser_gram.cpp +21605 -21752
  1324. package/src/duckdb/third_party/libpg_query/src_backend_parser_scan.cpp +538 -299
  1325. package/src/duckdb/third_party/mbedtls/include/mbedtls/mbedtls_config.h +1 -0
  1326. package/src/duckdb/third_party/mbedtls/include/mbedtls_wrapper.hpp +36 -12
  1327. package/src/duckdb/third_party/mbedtls/library/md.cpp +6 -6
  1328. package/src/duckdb/third_party/mbedtls/library/sha1.cpp +2 -0
  1329. package/src/duckdb/third_party/mbedtls/library/sha256.cpp +3 -0
  1330. package/src/duckdb/third_party/mbedtls/mbedtls_wrapper.cpp +99 -47
  1331. package/src/duckdb/third_party/pcg/pcg_extras.hpp +1 -1
  1332. package/src/duckdb/third_party/re2/re2/prog.cc +2 -2
  1333. package/src/duckdb/third_party/snappy/snappy-internal.h +398 -0
  1334. package/src/duckdb/third_party/snappy/snappy-sinksource.cc +111 -9
  1335. package/src/duckdb/third_party/snappy/snappy-sinksource.h +158 -0
  1336. package/src/duckdb/third_party/snappy/snappy-stubs-internal.h +523 -3
  1337. package/src/duckdb/third_party/snappy/snappy-stubs-public.h +34 -1
  1338. package/src/duckdb/third_party/snappy/snappy.cc +2626 -0
  1339. package/src/duckdb/third_party/snappy/snappy.h +223 -0
  1340. package/src/duckdb/third_party/snappy/snappy_version.hpp +11 -0
  1341. package/src/duckdb/third_party/utf8proc/include/utf8proc.hpp +69 -101
  1342. package/src/duckdb/third_party/utf8proc/include/utf8proc_wrapper.hpp +53 -0
  1343. package/src/duckdb/third_party/utf8proc/utf8proc.cpp +627 -678
  1344. package/src/duckdb/third_party/utf8proc/utf8proc_data.cpp +15008 -12868
  1345. package/src/duckdb/third_party/utf8proc/utf8proc_wrapper.cpp +185 -29
  1346. package/src/duckdb/ub_extension_json_json_functions.cpp +6 -0
  1347. package/src/duckdb/ub_src_catalog_default.cpp +4 -0
  1348. package/src/duckdb/ub_src_common.cpp +7 -1
  1349. package/src/duckdb/ub_src_common_arrow.cpp +10 -0
  1350. package/src/duckdb/ub_src_common_enums.cpp +2 -0
  1351. package/src/duckdb/ub_src_common_tree_renderer.cpp +10 -0
  1352. package/src/duckdb/ub_src_common_types.cpp +2 -0
  1353. package/src/duckdb/ub_src_core_functions_aggregate_holistic.cpp +4 -0
  1354. package/src/duckdb/ub_src_core_functions_aggregate_nested.cpp +2 -0
  1355. package/src/duckdb/ub_src_core_functions_scalar_generic.cpp +2 -0
  1356. package/src/duckdb/ub_src_core_functions_scalar_list.cpp +2 -4
  1357. package/src/duckdb/ub_src_core_functions_scalar_map.cpp +2 -0
  1358. package/src/duckdb/ub_src_core_functions_scalar_string.cpp +4 -0
  1359. package/src/duckdb/ub_src_execution_index_art.cpp +5 -3
  1360. package/src/duckdb/ub_src_execution_operator_csv_scanner_scanner.cpp +2 -0
  1361. package/src/duckdb/ub_src_execution_operator_helper.cpp +4 -0
  1362. package/src/duckdb/ub_src_function.cpp +4 -0
  1363. package/src/duckdb/ub_src_function_cast.cpp +2 -0
  1364. package/src/duckdb/ub_src_function_scalar_generic.cpp +4 -0
  1365. package/src/duckdb/ub_src_function_scalar_list.cpp +0 -2
  1366. package/src/duckdb/ub_src_function_scalar_string.cpp +2 -0
  1367. package/src/duckdb/ub_src_function_table.cpp +2 -0
  1368. package/src/duckdb/ub_src_function_table_arrow.cpp +2 -0
  1369. package/src/duckdb/ub_src_function_table_system.cpp +2 -0
  1370. package/src/duckdb/ub_src_main.cpp +4 -0
  1371. package/src/duckdb/ub_src_main_buffered_data.cpp +4 -0
  1372. package/src/duckdb/ub_src_main_capi.cpp +10 -0
  1373. package/src/duckdb/ub_src_main_chunk_scan_state.cpp +2 -0
  1374. package/src/duckdb/ub_src_main_relation.cpp +2 -0
  1375. package/src/duckdb/ub_src_main_secret.cpp +2 -0
  1376. package/src/duckdb/ub_src_optimizer.cpp +8 -0
  1377. package/src/duckdb/ub_src_optimizer_compressed_materialization.cpp +2 -0
  1378. package/src/duckdb/ub_src_optimizer_pushdown.cpp +2 -0
  1379. package/src/duckdb/ub_src_optimizer_rule.cpp +2 -0
  1380. package/src/duckdb/ub_src_parallel.cpp +4 -0
  1381. package/src/duckdb/ub_src_parser_tableref.cpp +2 -0
  1382. package/src/duckdb/ub_src_planner.cpp +2 -0
  1383. package/src/duckdb/ub_src_planner_binder_expression.cpp +2 -0
  1384. package/src/duckdb/ub_src_planner_binder_tableref.cpp +4 -0
  1385. package/src/duckdb/ub_src_storage_statistics.cpp +0 -2
  1386. package/src/duckdb/ub_src_transaction.cpp +2 -0
  1387. package/test/columns.test.ts +1 -1
  1388. package/test/prepare.test.ts +1 -1
  1389. package/test/test_all_types.test.ts +1 -1
@@ -6,17 +6,25 @@
6
6
  //
7
7
  //
8
8
  //===----------------------------------------------------------------------===//
9
+ //
10
+ // !!!!!!!
11
+ // WARNING: this file is autogenerated by scripts/generate_c_api.py, manual changes will be overwritten
12
+ // !!!!!!!
9
13
 
10
14
  #pragma once
11
15
 
12
16
  //! duplicate of duckdb/main/winapi.hpp
13
17
  #ifndef DUCKDB_API
14
18
  #ifdef _WIN32
19
+ #ifdef DUCKDB_STATIC_BUILD
20
+ #define DUCKDB_API
21
+ #else
15
22
  #if defined(DUCKDB_BUILD_LIBRARY) && !defined(DUCKDB_BUILD_LOADABLE_EXTENSION)
16
23
  #define DUCKDB_API __declspec(dllexport)
17
24
  #else
18
25
  #define DUCKDB_API __declspec(dllimport)
19
26
  #endif
27
+ #endif
20
28
  #else
21
29
  #define DUCKDB_API
22
30
  #endif
@@ -25,41 +33,20 @@
25
33
  //! duplicate of duckdb/main/winapi.hpp
26
34
  #ifndef DUCKDB_EXTENSION_API
27
35
  #ifdef _WIN32
36
+ #ifdef DUCKDB_STATIC_BUILD
37
+ #define DUCKDB_EXTENSION_API
38
+ #else
28
39
  #ifdef DUCKDB_BUILD_LOADABLE_EXTENSION
29
40
  #define DUCKDB_EXTENSION_API __declspec(dllexport)
30
41
  #else
31
42
  #define DUCKDB_EXTENSION_API
32
43
  #endif
44
+ #endif
33
45
  #else
34
46
  #define DUCKDB_EXTENSION_API __attribute__((visibility("default")))
35
47
  #endif
36
48
  #endif
37
49
 
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
-
45
- //! API versions
46
- //! If no explicit API version is defined, the latest API version is used.
47
- //! Note that using older API versions (i.e. not using DUCKDB_API_LATEST) is deprecated.
48
- //! These will not be supported long-term, and will be removed in future versions.
49
- #ifndef DUCKDB_API_0_3_1
50
- #define DUCKDB_API_0_3_1 1
51
- #endif
52
- #ifndef DUCKDB_API_0_3_2
53
- #define DUCKDB_API_0_3_2 2
54
- #endif
55
- #ifndef DUCKDB_API_LATEST
56
- #define DUCKDB_API_LATEST DUCKDB_API_0_3_2
57
- #endif
58
-
59
- #ifndef DUCKDB_API_VERSION
60
- #define DUCKDB_API_VERSION DUCKDB_API_LATEST
61
- #endif
62
-
63
50
  #include <stdbool.h>
64
51
  #include <stdint.h>
65
52
  #include <stddef.h>
@@ -142,25 +129,29 @@ typedef enum DUCKDB_TYPE {
142
129
  DUCKDB_TYPE_TIME_TZ = 30,
143
130
  // duckdb_timestamp
144
131
  DUCKDB_TYPE_TIMESTAMP_TZ = 31,
132
+ // ANY type
133
+ DUCKDB_TYPE_ANY = 34,
134
+ // duckdb_varint
135
+ DUCKDB_TYPE_VARINT = 35,
145
136
  } duckdb_type;
146
137
  //! An enum over the returned state of different functions.
147
- typedef enum { DuckDBSuccess = 0, DuckDBError = 1 } duckdb_state;
138
+ typedef enum duckdb_state { DuckDBSuccess = 0, DuckDBError = 1 } duckdb_state;
148
139
  //! An enum over the pending state of a pending query result.
149
- typedef enum {
140
+ typedef enum duckdb_pending_state {
150
141
  DUCKDB_PENDING_RESULT_READY = 0,
151
142
  DUCKDB_PENDING_RESULT_NOT_READY = 1,
152
143
  DUCKDB_PENDING_ERROR = 2,
153
144
  DUCKDB_PENDING_NO_TASKS_AVAILABLE = 3
154
145
  } duckdb_pending_state;
155
146
  //! An enum over DuckDB's different result types.
156
- typedef enum {
147
+ typedef enum duckdb_result_type {
157
148
  DUCKDB_RESULT_TYPE_INVALID = 0,
158
149
  DUCKDB_RESULT_TYPE_CHANGED_ROWS = 1,
159
150
  DUCKDB_RESULT_TYPE_NOTHING = 2,
160
151
  DUCKDB_RESULT_TYPE_QUERY_RESULT = 3,
161
152
  } duckdb_result_type;
162
153
  //! An enum over DuckDB's different statement types.
163
- typedef enum {
154
+ typedef enum duckdb_statement_type {
164
155
  DUCKDB_STATEMENT_TYPE_INVALID = 0,
165
156
  DUCKDB_STATEMENT_TYPE_SELECT = 1,
166
157
  DUCKDB_STATEMENT_TYPE_INSERT = 2,
@@ -190,6 +181,54 @@ typedef enum {
190
181
  DUCKDB_STATEMENT_TYPE_DETACH = 26,
191
182
  DUCKDB_STATEMENT_TYPE_MULTI = 27,
192
183
  } duckdb_statement_type;
184
+ //! An enum over DuckDB's different result types.
185
+ typedef enum duckdb_error_type {
186
+ DUCKDB_ERROR_INVALID = 0,
187
+ DUCKDB_ERROR_OUT_OF_RANGE = 1,
188
+ DUCKDB_ERROR_CONVERSION = 2,
189
+ DUCKDB_ERROR_UNKNOWN_TYPE = 3,
190
+ DUCKDB_ERROR_DECIMAL = 4,
191
+ DUCKDB_ERROR_MISMATCH_TYPE = 5,
192
+ DUCKDB_ERROR_DIVIDE_BY_ZERO = 6,
193
+ DUCKDB_ERROR_OBJECT_SIZE = 7,
194
+ DUCKDB_ERROR_INVALID_TYPE = 8,
195
+ DUCKDB_ERROR_SERIALIZATION = 9,
196
+ DUCKDB_ERROR_TRANSACTION = 10,
197
+ DUCKDB_ERROR_NOT_IMPLEMENTED = 11,
198
+ DUCKDB_ERROR_EXPRESSION = 12,
199
+ DUCKDB_ERROR_CATALOG = 13,
200
+ DUCKDB_ERROR_PARSER = 14,
201
+ DUCKDB_ERROR_PLANNER = 15,
202
+ DUCKDB_ERROR_SCHEDULER = 16,
203
+ DUCKDB_ERROR_EXECUTOR = 17,
204
+ DUCKDB_ERROR_CONSTRAINT = 18,
205
+ DUCKDB_ERROR_INDEX = 19,
206
+ DUCKDB_ERROR_STAT = 20,
207
+ DUCKDB_ERROR_CONNECTION = 21,
208
+ DUCKDB_ERROR_SYNTAX = 22,
209
+ DUCKDB_ERROR_SETTINGS = 23,
210
+ DUCKDB_ERROR_BINDER = 24,
211
+ DUCKDB_ERROR_NETWORK = 25,
212
+ DUCKDB_ERROR_OPTIMIZER = 26,
213
+ DUCKDB_ERROR_NULL_POINTER = 27,
214
+ DUCKDB_ERROR_IO = 28,
215
+ DUCKDB_ERROR_INTERRUPT = 29,
216
+ DUCKDB_ERROR_FATAL = 30,
217
+ DUCKDB_ERROR_INTERNAL = 31,
218
+ DUCKDB_ERROR_INVALID_INPUT = 32,
219
+ DUCKDB_ERROR_OUT_OF_MEMORY = 33,
220
+ DUCKDB_ERROR_PERMISSION = 34,
221
+ DUCKDB_ERROR_PARAMETER_NOT_RESOLVED = 35,
222
+ DUCKDB_ERROR_PARAMETER_NOT_ALLOWED = 36,
223
+ DUCKDB_ERROR_DEPENDENCY = 37,
224
+ DUCKDB_ERROR_HTTP = 38,
225
+ DUCKDB_ERROR_MISSING_EXTENSION = 39,
226
+ DUCKDB_ERROR_AUTOLOAD = 40,
227
+ DUCKDB_ERROR_SEQUENCE = 41,
228
+ DUCKDB_INVALID_CONFIGURATION = 42
229
+ } duckdb_error_type;
230
+ //! An enum over DuckDB's different cast modes.
231
+ typedef enum duckdb_cast_mode { DUCKDB_CAST_NORMAL = 0, DUCKDB_CAST_TRY = 1 } duckdb_cast_mode;
193
232
 
194
233
  //===--------------------------------------------------------------------===//
195
234
  // General type definitions
@@ -313,28 +352,21 @@ typedef struct {
313
352
  //! duckdb_column_type, and duckdb_column_name, which take the result and the column index
314
353
  //! as their parameters
315
354
  typedef struct {
316
- #if DUCKDB_API_VERSION < DUCKDB_API_0_3_2
317
- void *data;
318
- bool *nullmask;
319
- duckdb_type type;
320
- char *name;
321
- #else
322
355
  // deprecated, use duckdb_column_data
323
- void *__deprecated_data;
356
+ void *deprecated_data;
324
357
  // deprecated, use duckdb_nullmask_data
325
- bool *__deprecated_nullmask;
358
+ bool *deprecated_nullmask;
326
359
  // deprecated, use duckdb_column_type
327
- duckdb_type __deprecated_type;
360
+ duckdb_type deprecated_type;
328
361
  // deprecated, use duckdb_column_name
329
- char *__deprecated_name;
330
- #endif
362
+ char *deprecated_name;
331
363
  void *internal_data;
332
364
  } duckdb_column;
333
365
 
334
366
  //! A vector to a specified column in a data chunk. Lives as long as the
335
367
  //! data chunk lives, i.e., must not be destroyed.
336
368
  typedef struct _duckdb_vector {
337
- void *__vctr;
369
+ void *internal_ptr;
338
370
  } * duckdb_vector;
339
371
 
340
372
  //===--------------------------------------------------------------------===//
@@ -358,100 +390,177 @@ typedef struct {
358
390
  //! A query result consists of a pointer to its internal data.
359
391
  //! Must be freed with 'duckdb_destroy_result'.
360
392
  typedef struct {
361
- #if DUCKDB_API_VERSION < DUCKDB_API_0_3_2
362
- idx_t column_count;
363
- idx_t row_count;
364
- idx_t rows_changed;
365
- duckdb_column *columns;
366
- char *error_message;
367
- #else
368
393
  // deprecated, use duckdb_column_count
369
- idx_t __deprecated_column_count;
394
+ idx_t deprecated_column_count;
370
395
  // deprecated, use duckdb_row_count
371
- idx_t __deprecated_row_count;
396
+ idx_t deprecated_row_count;
372
397
  // deprecated, use duckdb_rows_changed
373
- idx_t __deprecated_rows_changed;
398
+ idx_t deprecated_rows_changed;
374
399
  // deprecated, use duckdb_column_*-family of functions
375
- duckdb_column *__deprecated_columns;
400
+ duckdb_column *deprecated_columns;
376
401
  // deprecated, use duckdb_result_error
377
- char *__deprecated_error_message;
378
- #endif
402
+ char *deprecated_error_message;
379
403
  void *internal_data;
380
404
  } duckdb_result;
381
405
 
382
406
  //! A database object. Should be closed with `duckdb_close`.
383
407
  typedef struct _duckdb_database {
384
- void *__db;
408
+ void *internal_ptr;
385
409
  } * duckdb_database;
386
410
 
387
411
  //! A connection to a duckdb database. Must be closed with `duckdb_disconnect`.
388
412
  typedef struct _duckdb_connection {
389
- void *__conn;
413
+ void *internal_ptr;
390
414
  } * duckdb_connection;
391
415
 
392
416
  //! A prepared statement is a parameterized query that allows you to bind parameters to it.
393
417
  //! Must be destroyed with `duckdb_destroy_prepare`.
394
418
  typedef struct _duckdb_prepared_statement {
395
- void *__prep;
419
+ void *internal_ptr;
396
420
  } * duckdb_prepared_statement;
397
421
 
398
422
  //! Extracted statements. Must be destroyed with `duckdb_destroy_extracted`.
399
423
  typedef struct _duckdb_extracted_statements {
400
- void *__extrac;
424
+ void *internal_ptr;
401
425
  } * duckdb_extracted_statements;
402
426
 
403
427
  //! The pending result represents an intermediate structure for a query that is not yet fully executed.
404
428
  //! Must be destroyed with `duckdb_destroy_pending`.
405
429
  typedef struct _duckdb_pending_result {
406
- void *__pend;
430
+ void *internal_ptr;
407
431
  } * duckdb_pending_result;
408
432
 
409
433
  //! The appender enables fast data loading into DuckDB.
410
434
  //! Must be destroyed with `duckdb_appender_destroy`.
411
435
  typedef struct _duckdb_appender {
412
- void *__appn;
436
+ void *internal_ptr;
413
437
  } * duckdb_appender;
414
438
 
439
+ //! The table description allows querying info about the table.
440
+ //! Must be destroyed with `duckdb_table_description_destroy`.
441
+ typedef struct _duckdb_table_description {
442
+ void *internal_ptr;
443
+ } * duckdb_table_description;
444
+
415
445
  //! Can be used to provide start-up options for the DuckDB instance.
416
446
  //! Must be destroyed with `duckdb_destroy_config`.
417
447
  typedef struct _duckdb_config {
418
- void *__cnfg;
448
+ void *internal_ptr;
419
449
  } * duckdb_config;
420
450
 
421
451
  //! Holds an internal logical type.
422
452
  //! Must be destroyed with `duckdb_destroy_logical_type`.
423
453
  typedef struct _duckdb_logical_type {
424
- void *__lglt;
454
+ void *internal_ptr;
425
455
  } * duckdb_logical_type;
426
456
 
457
+ //! Holds extra information used when registering a custom logical type.
458
+ //! Reserved for future use.
459
+ typedef struct _duckdb_create_type_info {
460
+ void *internal_ptr;
461
+ } * duckdb_create_type_info;
462
+
427
463
  //! Contains a data chunk from a duckdb_result.
428
464
  //! Must be destroyed with `duckdb_destroy_data_chunk`.
429
465
  typedef struct _duckdb_data_chunk {
430
- void *__dtck;
466
+ void *internal_ptr;
431
467
  } * duckdb_data_chunk;
432
468
 
433
469
  //! Holds a DuckDB value, which wraps a type.
434
470
  //! Must be destroyed with `duckdb_destroy_value`.
435
471
  typedef struct _duckdb_value {
436
- void *__val;
472
+ void *internal_ptr;
437
473
  } * duckdb_value;
438
474
 
475
+ //! Holds a recursive tree that matches the query plan.
476
+ typedef struct _duckdb_profiling_info {
477
+ void *internal_ptr;
478
+ } * duckdb_profiling_info;
479
+
480
+ //===--------------------------------------------------------------------===//
481
+ // C API Extension info
482
+ //===--------------------------------------------------------------------===//
483
+ //! Holds state during the C API extension intialization process
484
+ typedef struct _duckdb_extension_info {
485
+ void *internal_ptr;
486
+ } * duckdb_extension_info;
487
+
488
+ //===--------------------------------------------------------------------===//
489
+ // Function types
490
+ //===--------------------------------------------------------------------===//
491
+ //! Additional function info. When setting this info, it is necessary to pass a destroy-callback function.
492
+ typedef struct _duckdb_function_info {
493
+ void *internal_ptr;
494
+ } * duckdb_function_info;
495
+
496
+ //===--------------------------------------------------------------------===//
497
+ // Scalar function types
498
+ //===--------------------------------------------------------------------===//
499
+ //! A scalar function. Must be destroyed with `duckdb_destroy_scalar_function`.
500
+ typedef struct _duckdb_scalar_function {
501
+ void *internal_ptr;
502
+ } * duckdb_scalar_function;
503
+
504
+ //! A scalar function set. Must be destroyed with `duckdb_destroy_scalar_function_set`.
505
+ typedef struct _duckdb_scalar_function_set {
506
+ void *internal_ptr;
507
+ } * duckdb_scalar_function_set;
508
+
509
+ //! The main function of the scalar function.
510
+ typedef void (*duckdb_scalar_function_t)(duckdb_function_info info, duckdb_data_chunk input, duckdb_vector output);
511
+
512
+ //===--------------------------------------------------------------------===//
513
+ // Aggregate function types
514
+ //===--------------------------------------------------------------------===//
515
+ //! An aggregate function. Must be destroyed with `duckdb_destroy_aggregate_function`.
516
+ typedef struct _duckdb_aggregate_function {
517
+ void *internal_ptr;
518
+ } * duckdb_aggregate_function;
519
+
520
+ //! A aggregate function set. Must be destroyed with `duckdb_destroy_aggregate_function_set`.
521
+ typedef struct _duckdb_aggregate_function_set {
522
+ void *internal_ptr;
523
+ } * duckdb_aggregate_function_set;
524
+
525
+ //! Aggregate state
526
+ typedef struct _duckdb_aggregate_state {
527
+ void *internal_ptr;
528
+ } * duckdb_aggregate_state;
529
+
530
+ //! Returns the aggregate state size
531
+ typedef idx_t (*duckdb_aggregate_state_size)(duckdb_function_info info);
532
+ //! Initialize the aggregate state
533
+ typedef void (*duckdb_aggregate_init_t)(duckdb_function_info info, duckdb_aggregate_state state);
534
+ //! Destroy aggregate state (optional)
535
+ typedef void (*duckdb_aggregate_destroy_t)(duckdb_aggregate_state *states, idx_t count);
536
+ //! Update a set of aggregate states with new values
537
+ typedef void (*duckdb_aggregate_update_t)(duckdb_function_info info, duckdb_data_chunk input,
538
+ duckdb_aggregate_state *states);
539
+ //! Combine aggregate states
540
+ typedef void (*duckdb_aggregate_combine_t)(duckdb_function_info info, duckdb_aggregate_state *source,
541
+ duckdb_aggregate_state *target, idx_t count);
542
+ //! Finalize aggregate states into a result vector
543
+ typedef void (*duckdb_aggregate_finalize_t)(duckdb_function_info info, duckdb_aggregate_state *source,
544
+ duckdb_vector result, idx_t count, idx_t offset);
545
+
439
546
  //===--------------------------------------------------------------------===//
440
547
  // Table function types
441
548
  //===--------------------------------------------------------------------===//
442
549
 
443
- #ifndef DUCKDB_NO_EXTENSION_FUNCTIONS
444
550
  //! A table function. Must be destroyed with `duckdb_destroy_table_function`.
445
- typedef void *duckdb_table_function;
551
+ typedef struct _duckdb_table_function {
552
+ void *internal_ptr;
553
+ } * duckdb_table_function;
446
554
 
447
555
  //! The bind info of the function. When setting this info, it is necessary to pass a destroy-callback function.
448
- typedef void *duckdb_bind_info;
556
+ typedef struct _duckdb_bind_info {
557
+ void *internal_ptr;
558
+ } * duckdb_bind_info;
449
559
 
450
560
  //! Additional function init info. When setting this info, it is necessary to pass a destroy-callback function.
451
- typedef void *duckdb_init_info;
452
-
453
- //! Additional function info. When setting this info, it is necessary to pass a destroy-callback function.
454
- typedef void *duckdb_function_info;
561
+ typedef struct _duckdb_init_info {
562
+ void *internal_ptr;
563
+ } * duckdb_init_info;
455
564
 
456
565
  //! The bind function of the table function.
457
566
  typedef void (*duckdb_table_function_bind_t)(duckdb_bind_info info);
@@ -462,16 +571,29 @@ typedef void (*duckdb_table_function_init_t)(duckdb_init_info info);
462
571
  //! The main function of the table function.
463
572
  typedef void (*duckdb_table_function_t)(duckdb_function_info info, duckdb_data_chunk output);
464
573
 
574
+ //===--------------------------------------------------------------------===//
575
+ // Cast types
576
+ //===--------------------------------------------------------------------===//
577
+
578
+ //! A cast function. Must be destroyed with `duckdb_destroy_cast_function`.
579
+ typedef struct _duckdb_cast_function {
580
+ void *internal_ptr;
581
+ } * duckdb_cast_function;
582
+
583
+ typedef bool (*duckdb_cast_function_t)(duckdb_function_info info, idx_t count, duckdb_vector input,
584
+ duckdb_vector output);
585
+
465
586
  //===--------------------------------------------------------------------===//
466
587
  // Replacement scan types
467
588
  //===--------------------------------------------------------------------===//
468
589
 
469
590
  //! Additional replacement scan info. When setting this info, it is necessary to pass a destroy-callback function.
470
- typedef void *duckdb_replacement_scan_info;
591
+ typedef struct _duckdb_replacement_scan_info {
592
+ void *internal_ptr;
593
+ } * duckdb_replacement_scan_info;
471
594
 
472
595
  //! A replacement scan function that can be added to a database.
473
596
  typedef void (*duckdb_replacement_callback_t)(duckdb_replacement_scan_info info, const char *table_name, void *data);
474
- #endif
475
597
 
476
598
  //===--------------------------------------------------------------------===//
477
599
  // Arrow-related types
@@ -479,30 +601,43 @@ typedef void (*duckdb_replacement_callback_t)(duckdb_replacement_scan_info info,
479
601
 
480
602
  //! Holds an arrow query result. Must be destroyed with `duckdb_destroy_arrow`.
481
603
  typedef struct _duckdb_arrow {
482
- void *__arrw;
604
+ void *internal_ptr;
483
605
  } * duckdb_arrow;
484
606
 
485
607
  //! Holds an arrow array stream. Must be destroyed with `duckdb_destroy_arrow_stream`.
486
608
  typedef struct _duckdb_arrow_stream {
487
- void *__arrwstr;
609
+ void *internal_ptr;
488
610
  } * duckdb_arrow_stream;
489
611
 
490
612
  //! Holds an arrow schema. Remember to release the respective ArrowSchema object.
491
613
  typedef struct _duckdb_arrow_schema {
492
- void *__arrs;
614
+ void *internal_ptr;
493
615
  } * duckdb_arrow_schema;
494
616
 
495
617
  //! Holds an arrow array. Remember to release the respective ArrowArray object.
496
618
  typedef struct _duckdb_arrow_array {
497
- void *__arra;
619
+ void *internal_ptr;
498
620
  } * duckdb_arrow_array;
499
621
 
622
+ //===--------------------------------------------------------------------===//
623
+ // DuckDB extension access
624
+ //===--------------------------------------------------------------------===//
625
+ //! Passed to C API extension as parameter to the entrypoint
626
+ struct duckdb_extension_access {
627
+ //! Indicate that an error has occured
628
+ void (*set_error)(duckdb_extension_info info, const char *error);
629
+ //! Fetch the database from duckdb to register extensions to
630
+ duckdb_database *(*get_database)(duckdb_extension_info info);
631
+ //! Fetch the API
632
+ void *(*get_api)(duckdb_extension_info info, const char *version);
633
+ };
634
+
500
635
  //===--------------------------------------------------------------------===//
501
636
  // Functions
502
637
  //===--------------------------------------------------------------------===//
503
638
 
504
639
  //===--------------------------------------------------------------------===//
505
- // Open/Connect
640
+ // Open Connect
506
641
  //===--------------------------------------------------------------------===//
507
642
 
508
643
  /*!
@@ -510,9 +645,9 @@ Creates a new database or opens an existing database file stored at the given pa
510
645
  If no path is given a new in-memory database is created instead.
511
646
  The instantiated database should be closed with 'duckdb_close'.
512
647
 
513
- * path: Path to the database file on disk, or `nullptr` or `:memory:` to open an in-memory database.
514
- * out_database: The result database object.
515
- * returns: `DuckDBSuccess` on success or `DuckDBError` on failure.
648
+ * @param path Path to the database file on disk, or `nullptr` or `:memory:` to open an in-memory database.
649
+ * @param out_database The result database object.
650
+ * @return `DuckDBSuccess` on success or `DuckDBError` on failure.
516
651
  */
517
652
  DUCKDB_API duckdb_state duckdb_open(const char *path, duckdb_database *out_database);
518
653
 
@@ -520,12 +655,12 @@ DUCKDB_API duckdb_state duckdb_open(const char *path, duckdb_database *out_datab
520
655
  Extended version of duckdb_open. Creates a new database or opens an existing database file stored at the given path.
521
656
  The instantiated database should be closed with 'duckdb_close'.
522
657
 
523
- * path: Path to the database file on disk, or `nullptr` or `:memory:` to open an in-memory database.
524
- * out_database: The result database object.
525
- * config: (Optional) configuration used to start up the database system.
526
- * out_error: If set and the function returns DuckDBError, this will contain the reason why the start-up failed.
658
+ * @param path Path to the database file on disk, or `nullptr` or `:memory:` to open an in-memory database.
659
+ * @param out_database The result database object.
660
+ * @param config (Optional) configuration used to start up the database system.
661
+ * @param out_error If set and the function returns DuckDBError, this will contain the reason why the start-up failed.
527
662
  Note that the error must be freed using `duckdb_free`.
528
- * returns: `DuckDBSuccess` on success or `DuckDBError` on failure.
663
+ * @return `DuckDBSuccess` on success or `DuckDBError` on failure.
529
664
  */
530
665
  DUCKDB_API duckdb_state duckdb_open_ext(const char *path, duckdb_database *out_database, duckdb_config config,
531
666
  char **out_error);
@@ -536,7 +671,7 @@ This should be called after you are done with any database allocated through `du
536
671
  Note that failing to call `duckdb_close` (in case of e.g. a program crash) will not cause data corruption.
537
672
  Still, it is recommended to always correctly close a database object after you are done with it.
538
673
 
539
- * database: The database object to shut down.
674
+ * @param database The database object to shut down.
540
675
  */
541
676
  DUCKDB_API void duckdb_close(duckdb_database *database);
542
677
 
@@ -545,31 +680,31 @@ Opens a connection to a database. Connections are required to query the database
545
680
  associated with the connection.
546
681
  The instantiated connection should be closed using 'duckdb_disconnect'.
547
682
 
548
- * database: The database file to connect to.
549
- * out_connection: The result connection object.
550
- * returns: `DuckDBSuccess` on success or `DuckDBError` on failure.
683
+ * @param database The database file to connect to.
684
+ * @param out_connection The result connection object.
685
+ * @return `DuckDBSuccess` on success or `DuckDBError` on failure.
551
686
  */
552
687
  DUCKDB_API duckdb_state duckdb_connect(duckdb_database database, duckdb_connection *out_connection);
553
688
 
554
689
  /*!
555
690
  Interrupt running query
556
691
 
557
- * connection: The connection to interrupt
692
+ * @param connection The connection to interrupt
558
693
  */
559
694
  DUCKDB_API void duckdb_interrupt(duckdb_connection connection);
560
695
 
561
696
  /*!
562
697
  Get progress of the running query
563
698
 
564
- * connection: The working connection
565
- * returns: -1 if no progress or a percentage of the progress
699
+ * @param connection The working connection
700
+ * @return -1 if no progress or a percentage of the progress
566
701
  */
567
702
  DUCKDB_API duckdb_query_progress_type duckdb_query_progress(duckdb_connection connection);
568
703
 
569
704
  /*!
570
705
  Closes the specified connection and de-allocates all memory allocated for that connection.
571
706
 
572
- * connection: The connection to close.
707
+ * @param connection The connection to close.
573
708
  */
574
709
  DUCKDB_API void duckdb_disconnect(duckdb_connection *connection);
575
710
 
@@ -591,8 +726,11 @@ The duckdb_config must be destroyed using 'duckdb_destroy_config'
591
726
 
592
727
  This will always succeed unless there is a malloc failure.
593
728
 
594
- * out_config: The result configuration object.
595
- * returns: `DuckDBSuccess` on success or `DuckDBError` on failure.
729
+ Note that `duckdb_destroy_config` should always be called on the resulting config, even if the function returns
730
+ `DuckDBError`.
731
+
732
+ * @param out_config The result configuration object.
733
+ * @return `DuckDBSuccess` on success or `DuckDBError` on failure.
596
734
  */
597
735
  DUCKDB_API duckdb_state duckdb_create_config(duckdb_config *out_config);
598
736
 
@@ -601,7 +739,7 @@ This returns the total amount of configuration options available for usage with
601
739
 
602
740
  This should not be called in a loop as it internally loops over all the options.
603
741
 
604
- * returns: The amount of config options available.
742
+ * @return The amount of config options available.
605
743
  */
606
744
  DUCKDB_API size_t duckdb_config_count();
607
745
 
@@ -611,10 +749,10 @@ display configuration options. This will succeed unless `index` is out of range
611
749
 
612
750
  The result name or description MUST NOT be freed.
613
751
 
614
- * index: The index of the configuration option (between 0 and `duckdb_config_count`)
615
- * out_name: A name of the configuration flag.
616
- * out_description: A description of the configuration flag.
617
- * returns: `DuckDBSuccess` on success or `DuckDBError` on failure.
752
+ * @param index The index of the configuration option (between 0 and `duckdb_config_count`)
753
+ * @param out_name A name of the configuration flag.
754
+ * @param out_description A description of the configuration flag.
755
+ * @return `DuckDBSuccess` on success or `DuckDBError` on failure.
618
756
  */
619
757
  DUCKDB_API duckdb_state duckdb_get_config_flag(size_t index, const char **out_name, const char **out_description);
620
758
 
@@ -626,17 +764,17 @@ In the source code, configuration options are defined in `config.cpp`.
626
764
 
627
765
  This can fail if either the name is invalid, or if the value provided for the option is invalid.
628
766
 
629
- * duckdb_config: The configuration object to set the option on.
630
- * name: The name of the configuration flag to set.
631
- * option: The value to set the configuration flag to.
632
- * returns: `DuckDBSuccess` on success or `DuckDBError` on failure.
767
+ * @param config The configuration object to set the option on.
768
+ * @param name The name of the configuration flag to set.
769
+ * @param option The value to set the configuration flag to.
770
+ * @return `DuckDBSuccess` on success or `DuckDBError` on failure.
633
771
  */
634
772
  DUCKDB_API duckdb_state duckdb_set_config(duckdb_config config, const char *name, const char *option);
635
773
 
636
774
  /*!
637
775
  Destroys the specified configuration object and de-allocates all memory allocated for the object.
638
776
 
639
- * config: The configuration object to destroy.
777
+ * @param config The configuration object to destroy.
640
778
  */
641
779
  DUCKDB_API void duckdb_destroy_config(duckdb_config *config);
642
780
 
@@ -652,17 +790,17 @@ If the query fails to execute, DuckDBError is returned and the error message can
652
790
  Note that after running `duckdb_query`, `duckdb_destroy_result` must be called on the result object even if the
653
791
  query fails, otherwise the error stored within the result will not be freed correctly.
654
792
 
655
- * connection: The connection to perform the query in.
656
- * query: The SQL query to run.
657
- * out_result: The query result.
658
- * returns: `DuckDBSuccess` on success or `DuckDBError` on failure.
793
+ * @param connection The connection to perform the query in.
794
+ * @param query The SQL query to run.
795
+ * @param out_result The query result.
796
+ * @return `DuckDBSuccess` on success or `DuckDBError` on failure.
659
797
  */
660
798
  DUCKDB_API duckdb_state duckdb_query(duckdb_connection connection, const char *query, duckdb_result *out_result);
661
799
 
662
800
  /*!
663
801
  Closes the result and de-allocates all memory allocated for that connection.
664
802
 
665
- * result: The result to destroy.
803
+ * @param result The result to destroy.
666
804
  */
667
805
  DUCKDB_API void duckdb_destroy_result(duckdb_result *result);
668
806
 
@@ -672,9 +810,9 @@ automatically be destroyed when the result is destroyed.
672
810
 
673
811
  Returns `NULL` if the column is out of range.
674
812
 
675
- * result: The result object to fetch the column name from.
676
- * col: The column index.
677
- * returns: The column name of the specified column.
813
+ * @param result The result object to fetch the column name from.
814
+ * @param col The column index.
815
+ * @return The column name of the specified column.
678
816
  */
679
817
  DUCKDB_API const char *duckdb_column_name(duckdb_result *result, idx_t col);
680
818
 
@@ -683,18 +821,18 @@ Returns the column type of the specified column.
683
821
 
684
822
  Returns `DUCKDB_TYPE_INVALID` if the column is out of range.
685
823
 
686
- * result: The result object to fetch the column type from.
687
- * col: The column index.
688
- * returns: The column type of the specified column.
824
+ * @param result The result object to fetch the column type from.
825
+ * @param col The column index.
826
+ * @return The column type of the specified column.
689
827
  */
690
828
  DUCKDB_API duckdb_type duckdb_column_type(duckdb_result *result, idx_t col);
691
829
 
692
830
  /*!
693
831
  Returns the statement type of the statement that was executed
694
832
 
695
- * result: The result object to fetch the statement type from.
696
- * returns: duckdb_statement_type value or DUCKDB_STATEMENT_TYPE_INVALID
697
- */
833
+ * @param result The result object to fetch the statement type from.
834
+ * @return duckdb_statement_type value or DUCKDB_STATEMENT_TYPE_INVALID
835
+ */
698
836
  DUCKDB_API duckdb_statement_type duckdb_result_statement_type(duckdb_result result);
699
837
 
700
838
  /*!
@@ -704,17 +842,17 @@ The return type of this call should be destroyed with `duckdb_destroy_logical_ty
704
842
 
705
843
  Returns `NULL` if the column is out of range.
706
844
 
707
- * result: The result object to fetch the column type from.
708
- * col: The column index.
709
- * returns: The logical column type of the specified column.
845
+ * @param result The result object to fetch the column type from.
846
+ * @param col The column index.
847
+ * @return The logical column type of the specified column.
710
848
  */
711
849
  DUCKDB_API duckdb_logical_type duckdb_column_logical_type(duckdb_result *result, idx_t col);
712
850
 
713
851
  /*!
714
852
  Returns the number of columns present in a the result object.
715
853
 
716
- * result: The result object.
717
- * returns: The number of columns present in the result object.
854
+ * @param result The result object.
855
+ * @return The number of columns present in the result object.
718
856
  */
719
857
  DUCKDB_API idx_t duckdb_column_count(duckdb_result *result);
720
858
 
@@ -724,8 +862,8 @@ DUCKDB_API idx_t duckdb_column_count(duckdb_result *result);
724
862
 
725
863
  Returns the number of rows present in the result object.
726
864
 
727
- * result: The result object.
728
- * returns: The number of rows present in the result object.
865
+ * @param result The result object.
866
+ * @return The number of rows present in the result object.
729
867
  */
730
868
  DUCKDB_API idx_t duckdb_row_count(duckdb_result *result);
731
869
  #endif
@@ -734,8 +872,8 @@ DUCKDB_API idx_t duckdb_row_count(duckdb_result *result);
734
872
  Returns the number of rows changed by the query stored in the result. This is relevant only for INSERT/UPDATE/DELETE
735
873
  queries. For other queries the rows_changed will be 0.
736
874
 
737
- * result: The result object.
738
- * returns: The number of rows changed.
875
+ * @param result The result object.
876
+ * @return The number of rows changed.
739
877
  */
740
878
  DUCKDB_API idx_t duckdb_rows_changed(duckdb_result *result);
741
879
 
@@ -755,12 +893,14 @@ int32_t *data = (int32_t *) duckdb_column_data(&result, 0);
755
893
  printf("Data for row %d: %d\n", row, data[row]);
756
894
  ```
757
895
 
758
- * result: The result object to fetch the column data from.
759
- * col: The column index.
760
- * returns: The column data of the specified column.
896
+ * @param result The result object to fetch the column data from.
897
+ * @param col The column index.
898
+ * @return The column data of the specified column.
761
899
  */
762
900
  DUCKDB_API void *duckdb_column_data(duckdb_result *result, idx_t col);
901
+ #endif
763
902
 
903
+ #ifndef DUCKDB_API_NO_DEPRECATED
764
904
  /*!
765
905
  **DEPRECATED**: Prefer using `duckdb_result_get_chunk` instead.
766
906
 
@@ -778,9 +918,9 @@ if (nullmask[row]) {
778
918
  }
779
919
  ```
780
920
 
781
- * result: The result object to fetch the nullmask from.
782
- * col: The column index.
783
- * returns: The nullmask of the specified column.
921
+ * @param result The result object to fetch the nullmask from.
922
+ * @param col The column index.
923
+ * @return The nullmask of the specified column.
784
924
  */
785
925
  DUCKDB_API bool *duckdb_nullmask_data(duckdb_result *result, idx_t col);
786
926
  #endif
@@ -790,14 +930,24 @@ Returns the error message contained within the result. The error is only set if
790
930
 
791
931
  The result of this function must not be freed. It will be cleaned up when `duckdb_destroy_result` is called.
792
932
 
793
- * result: The result object to fetch the error from.
794
- * returns: The error of the result.
933
+ * @param result The result object to fetch the error from.
934
+ * @return The error of the result.
795
935
  */
796
936
  DUCKDB_API const char *duckdb_result_error(duckdb_result *result);
797
937
 
938
+ /*!
939
+ Returns the result error type contained within the result. The error is only set if `duckdb_query` returns
940
+ `DuckDBError`.
941
+
942
+ * @param result The result object to fetch the error from.
943
+ * @return The error type of the result.
944
+ */
945
+ DUCKDB_API duckdb_error_type duckdb_result_error_type(duckdb_result *result);
946
+
798
947
  //===--------------------------------------------------------------------===//
799
948
  // Result Functions
800
949
  //===--------------------------------------------------------------------===//
950
+
801
951
  #ifndef DUCKDB_API_NO_DEPRECATED
802
952
  /*!
803
953
  **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
@@ -814,9 +964,9 @@ mixed with the legacy result functions).
814
964
 
815
965
  Use `duckdb_result_chunk_count` to figure out how many chunks there are in the result.
816
966
 
817
- * result: The result object to fetch the data chunk from.
818
- * chunk_index: The chunk index to fetch from.
819
- * returns: The resulting data chunk. Returns `NULL` if the chunk index is out of bounds.
967
+ * @param result The result object to fetch the data chunk from.
968
+ * @param chunk_index The chunk index to fetch from.
969
+ * @return The resulting data chunk. Returns `NULL` if the chunk index is out of bounds.
820
970
  */
821
971
  DUCKDB_API duckdb_data_chunk duckdb_result_get_chunk(duckdb_result result, idx_t chunk_index);
822
972
 
@@ -825,8 +975,8 @@ DUCKDB_API duckdb_data_chunk duckdb_result_get_chunk(duckdb_result result, idx_t
825
975
 
826
976
  Checks if the type of the internal result is StreamQueryResult.
827
977
 
828
- * result: The result object to check.
829
- * returns: Whether or not the result object is of the type StreamQueryResult
978
+ * @param result The result object to check.
979
+ * @return Whether or not the result object is of the type StreamQueryResult
830
980
  */
831
981
  DUCKDB_API bool duckdb_result_is_streaming(duckdb_result result);
832
982
 
@@ -835,159 +985,160 @@ DUCKDB_API bool duckdb_result_is_streaming(duckdb_result result);
835
985
 
836
986
  Returns the number of data chunks present in the result.
837
987
 
838
- * result: The result object
839
- * returns: Number of data chunks present in the result.
988
+ * @param result The result object
989
+ * @return Number of data chunks present in the result.
840
990
  */
841
991
  DUCKDB_API idx_t duckdb_result_chunk_count(duckdb_result result);
842
- #endif
843
992
 
844
993
  /*!
845
994
  Returns the return_type of the given result, or DUCKDB_RETURN_TYPE_INVALID on error
846
995
 
847
- * result: The result object
848
- * returns: The return_type
849
- */
996
+ * @param result The result object
997
+ * @return The return_type
998
+ */
850
999
  DUCKDB_API duckdb_result_type duckdb_result_return_type(duckdb_result result);
851
1000
 
852
- #ifndef DUCKDB_API_NO_DEPRECATED
1001
+ #endif
853
1002
  //===--------------------------------------------------------------------===//
854
- // Safe fetch functions
1003
+ // Safe Fetch Functions
855
1004
  //===--------------------------------------------------------------------===//
856
1005
 
857
1006
  // These functions will perform conversions if necessary.
858
1007
  // On failure (e.g. if conversion cannot be performed or if the value is NULL) a default value is returned.
859
1008
  // Note that these functions are slow since they perform bounds checking and conversion
860
1009
  // For fast access of values prefer using `duckdb_result_get_chunk`
861
-
1010
+ #ifndef DUCKDB_API_NO_DEPRECATED
862
1011
  /*!
863
1012
  **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
864
1013
 
865
- * returns: The boolean value at the specified location, or false if the value cannot be converted.
866
- */
1014
+ * @return The boolean value at the specified location, or false if the value cannot be converted.
1015
+ */
867
1016
  DUCKDB_API bool duckdb_value_boolean(duckdb_result *result, idx_t col, idx_t row);
868
1017
 
869
1018
  /*!
870
1019
  **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
871
1020
 
872
- * returns: The int8_t value at the specified location, or 0 if the value cannot be converted.
873
- */
1021
+ * @return The int8_t value at the specified location, or 0 if the value cannot be converted.
1022
+ */
874
1023
  DUCKDB_API int8_t duckdb_value_int8(duckdb_result *result, idx_t col, idx_t row);
875
1024
 
876
1025
  /*!
877
1026
  **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
878
1027
 
879
- * returns: The int16_t value at the specified location, or 0 if the value cannot be converted.
880
- */
1028
+ * @return The int16_t value at the specified location, or 0 if the value cannot be converted.
1029
+ */
881
1030
  DUCKDB_API int16_t duckdb_value_int16(duckdb_result *result, idx_t col, idx_t row);
882
1031
 
883
1032
  /*!
884
1033
  **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
885
1034
 
886
- * returns: The int32_t value at the specified location, or 0 if the value cannot be converted.
887
- */
1035
+ * @return The int32_t value at the specified location, or 0 if the value cannot be converted.
1036
+ */
888
1037
  DUCKDB_API int32_t duckdb_value_int32(duckdb_result *result, idx_t col, idx_t row);
889
1038
 
890
1039
  /*!
891
1040
  **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
892
1041
 
893
- * returns: The int64_t value at the specified location, or 0 if the value cannot be converted.
894
- */
1042
+ * @return The int64_t value at the specified location, or 0 if the value cannot be converted.
1043
+ */
895
1044
  DUCKDB_API int64_t duckdb_value_int64(duckdb_result *result, idx_t col, idx_t row);
896
1045
 
897
1046
  /*!
898
1047
  **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
899
1048
 
900
- * returns: The duckdb_hugeint value at the specified location, or 0 if the value cannot be converted.
901
- */
1049
+ * @return The duckdb_hugeint value at the specified location, or 0 if the value cannot be converted.
1050
+ */
902
1051
  DUCKDB_API duckdb_hugeint duckdb_value_hugeint(duckdb_result *result, idx_t col, idx_t row);
903
1052
 
904
1053
  /*!
905
1054
  **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
906
1055
 
907
- * returns: The duckdb_uhugeint value at the specified location, or 0 if the value cannot be converted.
908
- */
1056
+ * @return The duckdb_uhugeint value at the specified location, or 0 if the value cannot be converted.
1057
+ */
909
1058
  DUCKDB_API duckdb_uhugeint duckdb_value_uhugeint(duckdb_result *result, idx_t col, idx_t row);
910
1059
 
911
1060
  /*!
912
1061
  **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
913
1062
 
914
- * returns: The duckdb_decimal value at the specified location, or 0 if the value cannot be converted.
915
- */
1063
+ * @return The duckdb_decimal value at the specified location, or 0 if the value cannot be converted.
1064
+ */
916
1065
  DUCKDB_API duckdb_decimal duckdb_value_decimal(duckdb_result *result, idx_t col, idx_t row);
917
1066
 
918
1067
  /*!
919
1068
  **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
920
1069
 
921
- * returns: The uint8_t value at the specified location, or 0 if the value cannot be converted.
922
- */
1070
+ * @return The uint8_t value at the specified location, or 0 if the value cannot be converted.
1071
+ */
923
1072
  DUCKDB_API uint8_t duckdb_value_uint8(duckdb_result *result, idx_t col, idx_t row);
924
1073
 
925
1074
  /*!
926
1075
  **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
927
1076
 
928
- * returns: The uint16_t value at the specified location, or 0 if the value cannot be converted.
929
- */
1077
+ * @return The uint16_t value at the specified location, or 0 if the value cannot be converted.
1078
+ */
930
1079
  DUCKDB_API uint16_t duckdb_value_uint16(duckdb_result *result, idx_t col, idx_t row);
931
1080
 
932
1081
  /*!
933
1082
  **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
934
1083
 
935
- * returns: The uint32_t value at the specified location, or 0 if the value cannot be converted.
936
- */
1084
+ * @return The uint32_t value at the specified location, or 0 if the value cannot be converted.
1085
+ */
937
1086
  DUCKDB_API uint32_t duckdb_value_uint32(duckdb_result *result, idx_t col, idx_t row);
938
1087
 
939
1088
  /*!
940
1089
  **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
941
1090
 
942
- * returns: The uint64_t value at the specified location, or 0 if the value cannot be converted.
943
- */
1091
+ * @return The uint64_t value at the specified location, or 0 if the value cannot be converted.
1092
+ */
944
1093
  DUCKDB_API uint64_t duckdb_value_uint64(duckdb_result *result, idx_t col, idx_t row);
945
1094
 
946
1095
  /*!
947
1096
  **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
948
1097
 
949
- * returns: The float value at the specified location, or 0 if the value cannot be converted.
950
- */
1098
+ * @return The float value at the specified location, or 0 if the value cannot be converted.
1099
+ */
951
1100
  DUCKDB_API float duckdb_value_float(duckdb_result *result, idx_t col, idx_t row);
952
1101
 
953
1102
  /*!
954
1103
  **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
955
1104
 
956
- * returns: The double value at the specified location, or 0 if the value cannot be converted.
957
- */
1105
+ * @return The double value at the specified location, or 0 if the value cannot be converted.
1106
+ */
958
1107
  DUCKDB_API double duckdb_value_double(duckdb_result *result, idx_t col, idx_t row);
959
1108
 
960
1109
  /*!
961
1110
  **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
962
1111
 
963
- * returns: The duckdb_date value at the specified location, or 0 if the value cannot be converted.
964
- */
1112
+ * @return The duckdb_date value at the specified location, or 0 if the value cannot be converted.
1113
+ */
965
1114
  DUCKDB_API duckdb_date duckdb_value_date(duckdb_result *result, idx_t col, idx_t row);
966
1115
 
967
1116
  /*!
968
1117
  **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
969
1118
 
970
- * returns: The duckdb_time value at the specified location, or 0 if the value cannot be converted.
971
- */
1119
+ * @return The duckdb_time value at the specified location, or 0 if the value cannot be converted.
1120
+ */
972
1121
  DUCKDB_API duckdb_time duckdb_value_time(duckdb_result *result, idx_t col, idx_t row);
973
1122
 
974
1123
  /*!
975
1124
  **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
976
1125
 
977
- * returns: The duckdb_timestamp value at the specified location, or 0 if the value cannot be converted.
978
- */
1126
+ * @return The duckdb_timestamp value at the specified location, or 0 if the value cannot be converted.
1127
+ */
979
1128
  DUCKDB_API duckdb_timestamp duckdb_value_timestamp(duckdb_result *result, idx_t col, idx_t row);
980
1129
 
981
1130
  /*!
982
1131
  **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
983
1132
 
984
- * returns: The duckdb_interval value at the specified location, or 0 if the value cannot be converted.
985
- */
1133
+ * @return The duckdb_interval value at the specified location, or 0 if the value cannot be converted.
1134
+ */
986
1135
  DUCKDB_API duckdb_interval duckdb_value_interval(duckdb_result *result, idx_t col, idx_t row);
987
1136
 
988
1137
  /*!
989
- * DEPRECATED: use duckdb_value_string instead. This function does not work correctly if the string contains null bytes.
990
- * returns: The text value at the specified location as a null-terminated string, or nullptr if the value cannot be
1138
+ **DEPRECATED**: Use duckdb_value_string instead. This function does not work correctly if the string contains null
1139
+ bytes.
1140
+
1141
+ * @return The text value at the specified location as a null-terminated string, or nullptr if the value cannot be
991
1142
  converted. The result must be freed with `duckdb_free`.
992
1143
  */
993
1144
  DUCKDB_API char *duckdb_value_varchar(duckdb_result *result, idx_t col, idx_t row);
@@ -995,16 +1146,18 @@ DUCKDB_API char *duckdb_value_varchar(duckdb_result *result, idx_t col, idx_t ro
995
1146
  /*!
996
1147
  **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
997
1148
 
998
- * returns: The string value at the specified location. Attempts to cast the result value to string.
999
- * No support for nested types, and for other complex types.
1000
- * The resulting field "string.data" must be freed with `duckdb_free.`
1001
- */
1149
+ No support for nested types, and for other complex types.
1150
+ The resulting field "string.data" must be freed with `duckdb_free.`
1151
+
1152
+ * @return The string value at the specified location. Attempts to cast the result value to string.
1153
+ */
1002
1154
  DUCKDB_API duckdb_string duckdb_value_string(duckdb_result *result, idx_t col, idx_t row);
1003
1155
 
1004
1156
  /*!
1005
- * DEPRECATED: use duckdb_value_string_internal instead. This function does not work correctly if the string contains
1157
+ **DEPRECATED**: Use duckdb_value_string_internal instead. This function does not work correctly if the string contains
1006
1158
  null bytes.
1007
- * returns: The char* value at the specified location. ONLY works on VARCHAR columns and does not auto-cast.
1159
+
1160
+ * @return The char* value at the specified location. ONLY works on VARCHAR columns and does not auto-cast.
1008
1161
  If the column is NOT a VARCHAR column this function will return NULL.
1009
1162
 
1010
1163
  The result must NOT be freed.
@@ -1012,9 +1165,9 @@ The result must NOT be freed.
1012
1165
  DUCKDB_API char *duckdb_value_varchar_internal(duckdb_result *result, idx_t col, idx_t row);
1013
1166
 
1014
1167
  /*!
1015
- * DEPRECATED: use duckdb_value_string_internal instead. This function does not work correctly if the string contains
1168
+ **DEPRECATED**: Use duckdb_value_string_internal instead. This function does not work correctly if the string contains
1016
1169
  null bytes.
1017
- * returns: The char* value at the specified location. ONLY works on VARCHAR columns and does not auto-cast.
1170
+ * @return The char* value at the specified location. ONLY works on VARCHAR columns and does not auto-cast.
1018
1171
  If the column is NOT a VARCHAR column this function will return NULL.
1019
1172
 
1020
1173
  The result must NOT be freed.
@@ -1024,7 +1177,7 @@ DUCKDB_API duckdb_string duckdb_value_string_internal(duckdb_result *result, idx
1024
1177
  /*!
1025
1178
  **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
1026
1179
 
1027
- * returns: The duckdb_blob value at the specified location. Returns a blob with blob.data set to nullptr if the
1180
+ * @return The duckdb_blob value at the specified location. Returns a blob with blob.data set to nullptr if the
1028
1181
  value cannot be converted. The resulting field "blob.data" must be freed with `duckdb_free.`
1029
1182
  */
1030
1183
  DUCKDB_API duckdb_blob duckdb_value_blob(duckdb_result *result, idx_t col, idx_t row);
@@ -1032,11 +1185,11 @@ DUCKDB_API duckdb_blob duckdb_value_blob(duckdb_result *result, idx_t col, idx_t
1032
1185
  /*!
1033
1186
  **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
1034
1187
 
1035
- * returns: Returns true if the value at the specified index is NULL, and false otherwise.
1036
- */
1188
+ * @return Returns true if the value at the specified index is NULL, and false otherwise.
1189
+ */
1037
1190
  DUCKDB_API bool duckdb_value_is_null(duckdb_result *result, idx_t col, idx_t row);
1038
- #endif
1039
1191
 
1192
+ #endif
1040
1193
  //===--------------------------------------------------------------------===//
1041
1194
  // Helpers
1042
1195
  //===--------------------------------------------------------------------===//
@@ -1045,8 +1198,8 @@ DUCKDB_API bool duckdb_value_is_null(duckdb_result *result, idx_t col, idx_t row
1045
1198
  Allocate `size` bytes of memory using the duckdb internal malloc function. Any memory allocated in this manner
1046
1199
  should be freed using `duckdb_free`.
1047
1200
 
1048
- * size: The number of bytes to allocate.
1049
- * returns: A pointer to the allocated memory region.
1201
+ * @param size The number of bytes to allocate.
1202
+ * @return A pointer to the allocated memory region.
1050
1203
  */
1051
1204
  DUCKDB_API void *duckdb_malloc(size_t size);
1052
1205
 
@@ -1054,7 +1207,7 @@ DUCKDB_API void *duckdb_malloc(size_t size);
1054
1207
  Free a value returned from `duckdb_malloc`, `duckdb_value_varchar`, `duckdb_value_blob`, or
1055
1208
  `duckdb_value_string`.
1056
1209
 
1057
- * ptr: The memory region to de-allocate.
1210
+ * @param ptr The memory region to de-allocate.
1058
1211
  */
1059
1212
  DUCKDB_API void duckdb_free(void *ptr);
1060
1213
 
@@ -1062,7 +1215,7 @@ DUCKDB_API void duckdb_free(void *ptr);
1062
1215
  The internal vector size used by DuckDB.
1063
1216
  This is the amount of tuples that will fit into a data chunk created by `duckdb_create_data_chunk`.
1064
1217
 
1065
- * returns: The vector size.
1218
+ * @return The vector size.
1066
1219
  */
1067
1220
  DUCKDB_API idx_t duckdb_vector_size();
1068
1221
 
@@ -1073,48 +1226,64 @@ This means that the data of the string does not have a separate allocation.
1073
1226
  */
1074
1227
  DUCKDB_API bool duckdb_string_is_inlined(duckdb_string_t string);
1075
1228
 
1229
+ /*!
1230
+ Get the string length of a string_t
1231
+
1232
+ * @param string The string to get the length of.
1233
+ * @return The length.
1234
+ */
1235
+ DUCKDB_API uint32_t duckdb_string_t_length(duckdb_string_t string);
1236
+
1237
+ /*!
1238
+ Get a pointer to the string data of a string_t
1239
+
1240
+ * @param string The string to get the pointer to.
1241
+ * @return The pointer.
1242
+ */
1243
+ DUCKDB_API const char *duckdb_string_t_data(duckdb_string_t *string);
1244
+
1076
1245
  //===--------------------------------------------------------------------===//
1077
- // Date/Time/Timestamp Helpers
1246
+ // Date Time Timestamp Helpers
1078
1247
  //===--------------------------------------------------------------------===//
1079
1248
 
1080
1249
  /*!
1081
1250
  Decompose a `duckdb_date` object into year, month and date (stored as `duckdb_date_struct`).
1082
1251
 
1083
- * date: The date object, as obtained from a `DUCKDB_TYPE_DATE` column.
1084
- * returns: The `duckdb_date_struct` with the decomposed elements.
1252
+ * @param date The date object, as obtained from a `DUCKDB_TYPE_DATE` column.
1253
+ * @return The `duckdb_date_struct` with the decomposed elements.
1085
1254
  */
1086
1255
  DUCKDB_API duckdb_date_struct duckdb_from_date(duckdb_date date);
1087
1256
 
1088
1257
  /*!
1089
1258
  Re-compose a `duckdb_date` from year, month and date (`duckdb_date_struct`).
1090
1259
 
1091
- * date: The year, month and date stored in a `duckdb_date_struct`.
1092
- * returns: The `duckdb_date` element.
1260
+ * @param date The year, month and date stored in a `duckdb_date_struct`.
1261
+ * @return The `duckdb_date` element.
1093
1262
  */
1094
1263
  DUCKDB_API duckdb_date duckdb_to_date(duckdb_date_struct date);
1095
1264
 
1096
1265
  /*!
1097
1266
  Test a `duckdb_date` to see if it is a finite value.
1098
1267
 
1099
- * date: The date object, as obtained from a `DUCKDB_TYPE_DATE` column.
1100
- * returns: True if the date is finite, false if it is ±infinity.
1268
+ * @param date The date object, as obtained from a `DUCKDB_TYPE_DATE` column.
1269
+ * @return True if the date is finite, false if it is ±infinity.
1101
1270
  */
1102
1271
  DUCKDB_API bool duckdb_is_finite_date(duckdb_date date);
1103
1272
 
1104
1273
  /*!
1105
1274
  Decompose a `duckdb_time` object into hour, minute, second and microsecond (stored as `duckdb_time_struct`).
1106
1275
 
1107
- * time: The time object, as obtained from a `DUCKDB_TYPE_TIME` column.
1108
- * returns: The `duckdb_time_struct` with the decomposed elements.
1276
+ * @param time The time object, as obtained from a `DUCKDB_TYPE_TIME` column.
1277
+ * @return The `duckdb_time_struct` with the decomposed elements.
1109
1278
  */
1110
1279
  DUCKDB_API duckdb_time_struct duckdb_from_time(duckdb_time time);
1111
1280
 
1112
1281
  /*!
1113
1282
  Create a `duckdb_time_tz` object from micros and a timezone offset.
1114
1283
 
1115
- * micros: The microsecond component of the time.
1116
- * offset: The timezone offset component of the time.
1117
- * returns: The `duckdb_time_tz` element.
1284
+ * @param micros The microsecond component of the time.
1285
+ * @param offset The timezone offset component of the time.
1286
+ * @return The `duckdb_time_tz` element.
1118
1287
  */
1119
1288
  DUCKDB_API duckdb_time_tz duckdb_create_time_tz(int64_t micros, int32_t offset);
1120
1289
 
@@ -1123,41 +1292,39 @@ Decompose a TIME_TZ objects into micros and a timezone offset.
1123
1292
 
1124
1293
  Use `duckdb_from_time` to further decompose the micros into hour, minute, second and microsecond.
1125
1294
 
1126
- * micros: The time object, as obtained from a `DUCKDB_TYPE_TIME_TZ` column.
1127
- * out_micros: The microsecond component of the time.
1128
- * out_offset: The timezone offset component of the time.
1295
+ * @param micros The time object, as obtained from a `DUCKDB_TYPE_TIME_TZ` column.
1129
1296
  */
1130
1297
  DUCKDB_API duckdb_time_tz_struct duckdb_from_time_tz(duckdb_time_tz micros);
1131
1298
 
1132
1299
  /*!
1133
1300
  Re-compose a `duckdb_time` from hour, minute, second and microsecond (`duckdb_time_struct`).
1134
1301
 
1135
- * time: The hour, minute, second and microsecond in a `duckdb_time_struct`.
1136
- * returns: The `duckdb_time` element.
1302
+ * @param time The hour, minute, second and microsecond in a `duckdb_time_struct`.
1303
+ * @return The `duckdb_time` element.
1137
1304
  */
1138
1305
  DUCKDB_API duckdb_time duckdb_to_time(duckdb_time_struct time);
1139
1306
 
1140
1307
  /*!
1141
1308
  Decompose a `duckdb_timestamp` object into a `duckdb_timestamp_struct`.
1142
1309
 
1143
- * ts: The ts object, as obtained from a `DUCKDB_TYPE_TIMESTAMP` column.
1144
- * returns: The `duckdb_timestamp_struct` with the decomposed elements.
1310
+ * @param ts The ts object, as obtained from a `DUCKDB_TYPE_TIMESTAMP` column.
1311
+ * @return The `duckdb_timestamp_struct` with the decomposed elements.
1145
1312
  */
1146
1313
  DUCKDB_API duckdb_timestamp_struct duckdb_from_timestamp(duckdb_timestamp ts);
1147
1314
 
1148
1315
  /*!
1149
1316
  Re-compose a `duckdb_timestamp` from a duckdb_timestamp_struct.
1150
1317
 
1151
- * ts: The de-composed elements in a `duckdb_timestamp_struct`.
1152
- * returns: The `duckdb_timestamp` element.
1318
+ * @param ts The de-composed elements in a `duckdb_timestamp_struct`.
1319
+ * @return The `duckdb_timestamp` element.
1153
1320
  */
1154
1321
  DUCKDB_API duckdb_timestamp duckdb_to_timestamp(duckdb_timestamp_struct ts);
1155
1322
 
1156
1323
  /*!
1157
1324
  Test a `duckdb_timestamp` to see if it is a finite value.
1158
1325
 
1159
- * ts: The timestamp object, as obtained from a `DUCKDB_TYPE_TIMESTAMP` column.
1160
- * returns: True if the timestamp is finite, false if it is ±infinity.
1326
+ * @param ts The timestamp object, as obtained from a `DUCKDB_TYPE_TIMESTAMP` column.
1327
+ * @return True if the timestamp is finite, false if it is ±infinity.
1161
1328
  */
1162
1329
  DUCKDB_API bool duckdb_is_finite_timestamp(duckdb_timestamp ts);
1163
1330
 
@@ -1168,8 +1335,8 @@ DUCKDB_API bool duckdb_is_finite_timestamp(duckdb_timestamp ts);
1168
1335
  /*!
1169
1336
  Converts a duckdb_hugeint object (as obtained from a `DUCKDB_TYPE_HUGEINT` column) into a double.
1170
1337
 
1171
- * val: The hugeint value.
1172
- * returns: The converted `double` element.
1338
+ * @param val The hugeint value.
1339
+ * @return The converted `double` element.
1173
1340
  */
1174
1341
  DUCKDB_API double duckdb_hugeint_to_double(duckdb_hugeint val);
1175
1342
 
@@ -1178,8 +1345,8 @@ Converts a double value to a duckdb_hugeint object.
1178
1345
 
1179
1346
  If the conversion fails because the double value is too big the result will be 0.
1180
1347
 
1181
- * val: The double value.
1182
- * returns: The converted `duckdb_hugeint` element.
1348
+ * @param val The double value.
1349
+ * @return The converted `duckdb_hugeint` element.
1183
1350
  */
1184
1351
  DUCKDB_API duckdb_hugeint duckdb_double_to_hugeint(double val);
1185
1352
 
@@ -1190,8 +1357,8 @@ DUCKDB_API duckdb_hugeint duckdb_double_to_hugeint(double val);
1190
1357
  /*!
1191
1358
  Converts a duckdb_uhugeint object (as obtained from a `DUCKDB_TYPE_UHUGEINT` column) into a double.
1192
1359
 
1193
- * val: The uhugeint value.
1194
- * returns: The converted `double` element.
1360
+ * @param val The uhugeint value.
1361
+ * @return The converted `double` element.
1195
1362
  */
1196
1363
  DUCKDB_API double duckdb_uhugeint_to_double(duckdb_uhugeint val);
1197
1364
 
@@ -1200,8 +1367,8 @@ Converts a double value to a duckdb_uhugeint object.
1200
1367
 
1201
1368
  If the conversion fails because the double value is too big the result will be 0.
1202
1369
 
1203
- * val: The double value.
1204
- * returns: The converted `duckdb_uhugeint` element.
1370
+ * @param val The double value.
1371
+ * @return The converted `duckdb_uhugeint` element.
1205
1372
  */
1206
1373
  DUCKDB_API duckdb_uhugeint duckdb_double_to_uhugeint(double val);
1207
1374
 
@@ -1214,16 +1381,16 @@ Converts a double value to a duckdb_decimal object.
1214
1381
 
1215
1382
  If the conversion fails because the double value is too big, or the width/scale are invalid the result will be 0.
1216
1383
 
1217
- * val: The double value.
1218
- * returns: The converted `duckdb_decimal` element.
1384
+ * @param val The double value.
1385
+ * @return The converted `duckdb_decimal` element.
1219
1386
  */
1220
1387
  DUCKDB_API duckdb_decimal duckdb_double_to_decimal(double val, uint8_t width, uint8_t scale);
1221
1388
 
1222
1389
  /*!
1223
1390
  Converts a duckdb_decimal object (as obtained from a `DUCKDB_TYPE_DECIMAL` column) into a double.
1224
1391
 
1225
- * val: The decimal value.
1226
- * returns: The converted `double` element.
1392
+ * @param val The decimal value.
1393
+ * @return The converted `double` element.
1227
1394
  */
1228
1395
  DUCKDB_API double duckdb_decimal_to_double(duckdb_decimal val);
1229
1396
 
@@ -1240,7 +1407,6 @@ DUCKDB_API double duckdb_decimal_to_double(duckdb_decimal val);
1240
1407
  // SELECT * FROM tbl WHERE id=?
1241
1408
  // Or a query with multiple parameters:
1242
1409
  // SELECT * FROM tbl WHERE id=$1 OR name=$2
1243
-
1244
1410
  /*!
1245
1411
  Create a prepared statement object from a query.
1246
1412
 
@@ -1249,10 +1415,10 @@ Note that after calling `duckdb_prepare`, the prepared statement should always b
1249
1415
 
1250
1416
  If the prepare fails, `duckdb_prepare_error` can be called to obtain the reason why the prepare failed.
1251
1417
 
1252
- * connection: The connection object
1253
- * query: The SQL query to prepare
1254
- * out_prepared_statement: The resulting prepared statement object
1255
- * returns: `DuckDBSuccess` on success or `DuckDBError` on failure.
1418
+ * @param connection The connection object
1419
+ * @param query The SQL query to prepare
1420
+ * @param out_prepared_statement The resulting prepared statement object
1421
+ * @return `DuckDBSuccess` on success or `DuckDBError` on failure.
1256
1422
  */
1257
1423
  DUCKDB_API duckdb_state duckdb_prepare(duckdb_connection connection, const char *query,
1258
1424
  duckdb_prepared_statement *out_prepared_statement);
@@ -1260,7 +1426,7 @@ DUCKDB_API duckdb_state duckdb_prepare(duckdb_connection connection, const char
1260
1426
  /*!
1261
1427
  Closes the prepared statement and de-allocates all memory allocated for the statement.
1262
1428
 
1263
- * prepared_statement: The prepared statement to destroy.
1429
+ * @param prepared_statement The prepared statement to destroy.
1264
1430
  */
1265
1431
  DUCKDB_API void duckdb_destroy_prepare(duckdb_prepared_statement *prepared_statement);
1266
1432
 
@@ -1270,8 +1436,8 @@ If the prepared statement has no error message, this returns `nullptr` instead.
1270
1436
 
1271
1437
  The error message should not be freed. It will be de-allocated when `duckdb_destroy_prepare` is called.
1272
1438
 
1273
- * prepared_statement: The prepared statement to obtain the error from.
1274
- * returns: The error message, or `nullptr` if there is none.
1439
+ * @param prepared_statement The prepared statement to obtain the error from.
1440
+ * @return The error message, or `nullptr` if there is none.
1275
1441
  */
1276
1442
  DUCKDB_API const char *duckdb_prepare_error(duckdb_prepared_statement prepared_statement);
1277
1443
 
@@ -1280,7 +1446,7 @@ Returns the number of parameters that can be provided to the given prepared stat
1280
1446
 
1281
1447
  Returns 0 if the query was not successfully prepared.
1282
1448
 
1283
- * prepared_statement: The prepared statement to obtain the number of parameters for.
1449
+ * @param prepared_statement The prepared statement to obtain the number of parameters for.
1284
1450
  */
1285
1451
  DUCKDB_API idx_t duckdb_nparams(duckdb_prepared_statement prepared_statement);
1286
1452
 
@@ -1290,7 +1456,7 @@ The returned string should be freed using `duckdb_free`.
1290
1456
 
1291
1457
  Returns NULL if the index is out of range for the provided prepared statement.
1292
1458
 
1293
- * prepared_statement: The prepared statement for which to get the parameter name from.
1459
+ * @param prepared_statement The prepared statement for which to get the parameter name from.
1294
1460
  */
1295
1461
  DUCKDB_API const char *duckdb_parameter_name(duckdb_prepared_statement prepared_statement, idx_t index);
1296
1462
 
@@ -1299,9 +1465,9 @@ Returns the parameter type for the parameter at the given index.
1299
1465
 
1300
1466
  Returns `DUCKDB_TYPE_INVALID` if the parameter index is out of range or the statement was not successfully prepared.
1301
1467
 
1302
- * prepared_statement: The prepared statement.
1303
- * param_idx: The parameter index.
1304
- * returns: The parameter type
1468
+ * @param prepared_statement The prepared statement.
1469
+ * @param param_idx The parameter index.
1470
+ * @return The parameter type
1305
1471
  */
1306
1472
  DUCKDB_API duckdb_type duckdb_param_type(duckdb_prepared_statement prepared_statement, idx_t param_idx);
1307
1473
 
@@ -1313,13 +1479,13 @@ DUCKDB_API duckdb_state duckdb_clear_bindings(duckdb_prepared_statement prepared
1313
1479
  /*!
1314
1480
  Returns the statement type of the statement to be executed
1315
1481
 
1316
- * statement: The prepared statement.
1317
- * returns: duckdb_statement_type value or DUCKDB_STATEMENT_TYPE_INVALID
1318
- */
1482
+ * @param statement The prepared statement.
1483
+ * @return duckdb_statement_type value or DUCKDB_STATEMENT_TYPE_INVALID
1484
+ */
1319
1485
  DUCKDB_API duckdb_statement_type duckdb_prepared_statement_type(duckdb_prepared_statement statement);
1320
1486
 
1321
1487
  //===--------------------------------------------------------------------===//
1322
- // Bind Values to Prepared Statements
1488
+ // Bind Values To Prepared Statements
1323
1489
  //===--------------------------------------------------------------------===//
1324
1490
 
1325
1491
  /*!
@@ -1364,11 +1530,13 @@ Binds a duckdb_hugeint value to the prepared statement at the specified index.
1364
1530
  */
1365
1531
  DUCKDB_API duckdb_state duckdb_bind_hugeint(duckdb_prepared_statement prepared_statement, idx_t param_idx,
1366
1532
  duckdb_hugeint val);
1533
+
1367
1534
  /*!
1368
1535
  Binds an duckdb_uhugeint value to the prepared statement at the specified index.
1369
1536
  */
1370
1537
  DUCKDB_API duckdb_state duckdb_bind_uhugeint(duckdb_prepared_statement prepared_statement, idx_t param_idx,
1371
1538
  duckdb_uhugeint val);
1539
+
1372
1540
  /*!
1373
1541
  Binds a duckdb_decimal value to the prepared statement at the specified index.
1374
1542
  */
@@ -1423,6 +1591,12 @@ Binds a duckdb_timestamp value to the prepared statement at the specified index.
1423
1591
  DUCKDB_API duckdb_state duckdb_bind_timestamp(duckdb_prepared_statement prepared_statement, idx_t param_idx,
1424
1592
  duckdb_timestamp val);
1425
1593
 
1594
+ /*!
1595
+ Binds a duckdb_timestamp value to the prepared statement at the specified index.
1596
+ */
1597
+ DUCKDB_API duckdb_state duckdb_bind_timestamp_tz(duckdb_prepared_statement prepared_statement, idx_t param_idx,
1598
+ duckdb_timestamp val);
1599
+
1426
1600
  /*!
1427
1601
  Binds a duckdb_interval value to the prepared statement at the specified index.
1428
1602
  */
@@ -1464,9 +1638,9 @@ between calls to this function.
1464
1638
 
1465
1639
  Note that the result must be freed with `duckdb_destroy_result`.
1466
1640
 
1467
- * prepared_statement: The prepared statement to execute.
1468
- * out_result: The query result.
1469
- * returns: `DuckDBSuccess` on success or `DuckDBError` on failure.
1641
+ * @param prepared_statement The prepared statement to execute.
1642
+ * @param out_result The query result.
1643
+ * @return `DuckDBSuccess` on success or `DuckDBError` on failure.
1470
1644
  */
1471
1645
  DUCKDB_API duckdb_state duckdb_execute_prepared(duckdb_prepared_statement prepared_statement,
1472
1646
  duckdb_result *out_result);
@@ -1483,9 +1657,9 @@ between calls to this function.
1483
1657
 
1484
1658
  Note that the result must be freed with `duckdb_destroy_result`.
1485
1659
 
1486
- * prepared_statement: The prepared statement to execute.
1487
- * out_result: The query result.
1488
- * returns: `DuckDBSuccess` on success or `DuckDBError` on failure.
1660
+ * @param prepared_statement The prepared statement to execute.
1661
+ * @param out_result The query result.
1662
+ * @return `DuckDBSuccess` on success or `DuckDBError` on failure.
1489
1663
  */
1490
1664
  DUCKDB_API duckdb_state duckdb_execute_prepared_streaming(duckdb_prepared_statement prepared_statement,
1491
1665
  duckdb_result *out_result);
@@ -1496,7 +1670,6 @@ DUCKDB_API duckdb_state duckdb_execute_prepared_streaming(duckdb_prepared_statem
1496
1670
  //===--------------------------------------------------------------------===//
1497
1671
 
1498
1672
  // A query string can be extracted into multiple SQL statements. Each statement can be prepared and executed separately.
1499
-
1500
1673
  /*!
1501
1674
  Extract all statements from a query.
1502
1675
  Note that after calling `duckdb_extract_statements`, the extracted statements should always be destroyed using
@@ -1504,10 +1677,10 @@ Note that after calling `duckdb_extract_statements`, the extracted statements sh
1504
1677
 
1505
1678
  If the extract fails, `duckdb_extract_statements_error` can be called to obtain the reason why the extract failed.
1506
1679
 
1507
- * connection: The connection object
1508
- * query: The SQL query to extract
1509
- * out_extracted_statements: The resulting extracted statements object
1510
- * returns: The number of extracted statements or 0 on failure.
1680
+ * @param connection The connection object
1681
+ * @param query The SQL query to extract
1682
+ * @param out_extracted_statements The resulting extracted statements object
1683
+ * @return The number of extracted statements or 0 on failure.
1511
1684
  */
1512
1685
  DUCKDB_API idx_t duckdb_extract_statements(duckdb_connection connection, const char *query,
1513
1686
  duckdb_extracted_statements *out_extracted_statements);
@@ -1519,28 +1692,29 @@ Note that after calling `duckdb_prepare_extracted_statement`, the prepared state
1519
1692
 
1520
1693
  If the prepare fails, `duckdb_prepare_error` can be called to obtain the reason why the prepare failed.
1521
1694
 
1522
- * connection: The connection object
1523
- * extracted_statements: The extracted statements object
1524
- * index: The index of the extracted statement to prepare
1525
- * out_prepared_statement: The resulting prepared statement object
1526
- * returns: `DuckDBSuccess` on success or `DuckDBError` on failure.
1695
+ * @param connection The connection object
1696
+ * @param extracted_statements The extracted statements object
1697
+ * @param index The index of the extracted statement to prepare
1698
+ * @param out_prepared_statement The resulting prepared statement object
1699
+ * @return `DuckDBSuccess` on success or `DuckDBError` on failure.
1527
1700
  */
1528
1701
  DUCKDB_API duckdb_state duckdb_prepare_extracted_statement(duckdb_connection connection,
1529
1702
  duckdb_extracted_statements extracted_statements,
1530
1703
  idx_t index,
1531
1704
  duckdb_prepared_statement *out_prepared_statement);
1705
+
1532
1706
  /*!
1533
1707
  Returns the error message contained within the extracted statements.
1534
1708
  The result of this function must not be freed. It will be cleaned up when `duckdb_destroy_extracted` is called.
1535
1709
 
1536
- * result: The extracted statements to fetch the error from.
1537
- * returns: The error of the extracted statements.
1710
+ * @param extracted_statements The extracted statements to fetch the error from.
1711
+ * @return The error of the extracted statements.
1538
1712
  */
1539
1713
  DUCKDB_API const char *duckdb_extract_statements_error(duckdb_extracted_statements extracted_statements);
1540
1714
 
1541
1715
  /*!
1542
1716
  De-allocates all memory allocated for the extracted statements.
1543
- * extracted_statements: The extracted statements to destroy.
1717
+ * @param extracted_statements The extracted statements to destroy.
1544
1718
  */
1545
1719
  DUCKDB_API void duckdb_destroy_extracted(duckdb_extracted_statements *extracted_statements);
1546
1720
 
@@ -1556,12 +1730,13 @@ The pending result can be used to incrementally execute a query, returning contr
1556
1730
  Note that after calling `duckdb_pending_prepared`, the pending result should always be destroyed using
1557
1731
  `duckdb_destroy_pending`, even if this function returns DuckDBError.
1558
1732
 
1559
- * prepared_statement: The prepared statement to execute.
1560
- * out_result: The pending query result.
1561
- * returns: `DuckDBSuccess` on success or `DuckDBError` on failure.
1733
+ * @param prepared_statement The prepared statement to execute.
1734
+ * @param out_result The pending query result.
1735
+ * @return `DuckDBSuccess` on success or `DuckDBError` on failure.
1562
1736
  */
1563
1737
  DUCKDB_API duckdb_state duckdb_pending_prepared(duckdb_prepared_statement prepared_statement,
1564
1738
  duckdb_pending_result *out_result);
1739
+
1565
1740
  #ifndef DUCKDB_API_NO_DEPRECATED
1566
1741
  /*!
1567
1742
  **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
@@ -1573,9 +1748,9 @@ The pending result represents an intermediate structure for a query that is not
1573
1748
  Note that after calling `duckdb_pending_prepared_streaming`, the pending result should always be destroyed using
1574
1749
  `duckdb_destroy_pending`, even if this function returns DuckDBError.
1575
1750
 
1576
- * prepared_statement: The prepared statement to execute.
1577
- * out_result: The pending query result.
1578
- * returns: `DuckDBSuccess` on success or `DuckDBError` on failure.
1751
+ * @param prepared_statement The prepared statement to execute.
1752
+ * @param out_result The pending query result.
1753
+ * @return `DuckDBSuccess` on success or `DuckDBError` on failure.
1579
1754
  */
1580
1755
  DUCKDB_API duckdb_state duckdb_pending_prepared_streaming(duckdb_prepared_statement prepared_statement,
1581
1756
  duckdb_pending_result *out_result);
@@ -1584,7 +1759,7 @@ DUCKDB_API duckdb_state duckdb_pending_prepared_streaming(duckdb_prepared_statem
1584
1759
  /*!
1585
1760
  Closes the pending result and de-allocates all memory allocated for the result.
1586
1761
 
1587
- * pending_result: The pending result to destroy.
1762
+ * @param pending_result The pending result to destroy.
1588
1763
  */
1589
1764
  DUCKDB_API void duckdb_destroy_pending(duckdb_pending_result *pending_result);
1590
1765
 
@@ -1593,8 +1768,8 @@ Returns the error message contained within the pending result.
1593
1768
 
1594
1769
  The result of this function must not be freed. It will be cleaned up when `duckdb_destroy_pending` is called.
1595
1770
 
1596
- * result: The pending result to fetch the error from.
1597
- * returns: The error of the pending result.
1771
+ * @param pending_result The pending result to fetch the error from.
1772
+ * @return The error of the pending result.
1598
1773
  */
1599
1774
  DUCKDB_API const char *duckdb_pending_error(duckdb_pending_result pending_result);
1600
1775
 
@@ -1607,8 +1782,8 @@ If this returns DUCKDB_PENDING_ERROR, an error occurred during execution.
1607
1782
 
1608
1783
  The error message can be obtained by calling duckdb_pending_error on the pending_result.
1609
1784
 
1610
- * pending_result: The pending result to execute a task within.
1611
- * returns: The state of the pending result after the execution.
1785
+ * @param pending_result The pending result to execute a task within.
1786
+ * @return The state of the pending result after the execution.
1612
1787
  */
1613
1788
  DUCKDB_API duckdb_pending_state duckdb_pending_execute_task(duckdb_pending_result pending_result);
1614
1789
 
@@ -1619,8 +1794,8 @@ If this returns DUCKDB_PENDING_ERROR, an error occurred during execution.
1619
1794
 
1620
1795
  The error message can be obtained by calling duckdb_pending_error on the pending_result.
1621
1796
 
1622
- * pending_result: The pending result.
1623
- * returns: The state of the pending result.
1797
+ * @param pending_result The pending result.
1798
+ * @return The state of the pending result.
1624
1799
  */
1625
1800
  DUCKDB_API duckdb_pending_state duckdb_pending_execute_check_state(duckdb_pending_result pending_result);
1626
1801
 
@@ -1632,9 +1807,9 @@ Otherwise, all remaining tasks must be executed first.
1632
1807
 
1633
1808
  Note that the result must be freed with `duckdb_destroy_result`.
1634
1809
 
1635
- * pending_result: The pending result to execute.
1636
- * out_result: The result object.
1637
- * returns: `DuckDBSuccess` on success or `DuckDBError` on failure.
1810
+ * @param pending_result The pending result to execute.
1811
+ * @param out_result The result object.
1812
+ * @return `DuckDBSuccess` on success or `DuckDBError` on failure.
1638
1813
  */
1639
1814
  DUCKDB_API duckdb_state duckdb_execute_pending(duckdb_pending_result pending_result, duckdb_result *out_result);
1640
1815
 
@@ -1642,8 +1817,8 @@ DUCKDB_API duckdb_state duckdb_execute_pending(duckdb_pending_result pending_res
1642
1817
  Returns whether a duckdb_pending_state is finished executing. For example if `pending_state` is
1643
1818
  DUCKDB_PENDING_RESULT_READY, this function will return true.
1644
1819
 
1645
- * pending_state: The pending state on which to decide whether to finish execution.
1646
- * returns: Boolean indicating pending execution should be considered finished.
1820
+ * @param pending_state The pending state on which to decide whether to finish execution.
1821
+ * @return Boolean indicating pending execution should be considered finished.
1647
1822
  */
1648
1823
  DUCKDB_API bool duckdb_pending_execution_is_finished(duckdb_pending_state pending_state);
1649
1824
 
@@ -1654,447 +1829,794 @@ DUCKDB_API bool duckdb_pending_execution_is_finished(duckdb_pending_state pendin
1654
1829
  /*!
1655
1830
  Destroys the value and de-allocates all memory allocated for that type.
1656
1831
 
1657
- * value: The value to destroy.
1832
+ * @param value The value to destroy.
1658
1833
  */
1659
1834
  DUCKDB_API void duckdb_destroy_value(duckdb_value *value);
1660
1835
 
1661
1836
  /*!
1662
1837
  Creates a value from a null-terminated string
1663
1838
 
1664
- * value: The null-terminated string
1665
- * returns: The value. This must be destroyed with `duckdb_destroy_value`.
1839
+ * @param text The null-terminated string
1840
+ * @return The value. This must be destroyed with `duckdb_destroy_value`.
1666
1841
  */
1667
1842
  DUCKDB_API duckdb_value duckdb_create_varchar(const char *text);
1668
1843
 
1669
1844
  /*!
1670
1845
  Creates a value from a string
1671
1846
 
1672
- * value: The text
1673
- * length: The length of the text
1674
- * returns: The value. This must be destroyed with `duckdb_destroy_value`.
1847
+ * @param text The text
1848
+ * @param length The length of the text
1849
+ * @return The value. This must be destroyed with `duckdb_destroy_value`.
1675
1850
  */
1676
1851
  DUCKDB_API duckdb_value duckdb_create_varchar_length(const char *text, idx_t length);
1677
1852
 
1678
1853
  /*!
1679
- Creates a value from an int64
1854
+ Creates a value from a boolean
1680
1855
 
1681
- * value: The bigint value
1682
- * returns: The value. This must be destroyed with `duckdb_destroy_value`.
1856
+ * @param input The boolean value
1857
+ * @return The value. This must be destroyed with `duckdb_destroy_value`.
1683
1858
  */
1684
- DUCKDB_API duckdb_value duckdb_create_int64(int64_t val);
1859
+ DUCKDB_API duckdb_value duckdb_create_bool(bool input);
1685
1860
 
1686
1861
  /*!
1687
- Creates a struct value from a type and an array of values
1862
+ Creates a value from a int8_t (a tinyint)
1688
1863
 
1689
- * type: The type of the struct
1690
- * values: The values for the struct fields
1691
- * returns: The value. This must be destroyed with `duckdb_destroy_value`.
1864
+ * @param input The tinyint value
1865
+ * @return The value. This must be destroyed with `duckdb_destroy_value`.
1692
1866
  */
1693
- DUCKDB_API duckdb_value duckdb_create_struct_value(duckdb_logical_type type, duckdb_value *values);
1867
+ DUCKDB_API duckdb_value duckdb_create_int8(int8_t input);
1694
1868
 
1695
1869
  /*!
1696
- Creates a list value from a type and an array of values of length `value_count`
1870
+ Creates a value from a uint8_t (a utinyint)
1697
1871
 
1698
- * type: The type of the list
1699
- * values: The values for the list
1700
- * value_count: The number of values in the list
1701
- * returns: The value. This must be destroyed with `duckdb_destroy_value`.
1872
+ * @param input The utinyint value
1873
+ * @return The value. This must be destroyed with `duckdb_destroy_value`.
1702
1874
  */
1703
- DUCKDB_API duckdb_value duckdb_create_list_value(duckdb_logical_type type, duckdb_value *values, idx_t value_count);
1875
+ DUCKDB_API duckdb_value duckdb_create_uint8(uint8_t input);
1704
1876
 
1705
1877
  /*!
1706
- Creates a array value from a type and an array of values of length `value_count`
1878
+ Creates a value from a int16_t (a smallint)
1707
1879
 
1708
- * type: The type of the array
1709
- * values: The values for the array
1710
- * value_count: The number of values in the array
1711
- * returns: The value. This must be destroyed with `duckdb_destroy_value`.
1880
+ * @param input The smallint value
1881
+ * @return The value. This must be destroyed with `duckdb_destroy_value`.
1712
1882
  */
1713
- DUCKDB_API duckdb_value duckdb_create_array_value(duckdb_logical_type type, duckdb_value *values, idx_t value_count);
1883
+ DUCKDB_API duckdb_value duckdb_create_int16(int16_t input);
1714
1884
 
1715
1885
  /*!
1716
- Obtains a string representation of the given value.
1717
- The result must be destroyed with `duckdb_free`.
1886
+ Creates a value from a uint16_t (a usmallint)
1718
1887
 
1719
- * value: The value
1720
- * returns: The string value. This must be destroyed with `duckdb_free`.
1888
+ * @param input The usmallint value
1889
+ * @return The value. This must be destroyed with `duckdb_destroy_value`.
1721
1890
  */
1722
- DUCKDB_API char *duckdb_get_varchar(duckdb_value value);
1891
+ DUCKDB_API duckdb_value duckdb_create_uint16(uint16_t input);
1723
1892
 
1724
1893
  /*!
1725
- Obtains an int64 of the given value.
1894
+ Creates a value from a int32_t (an integer)
1726
1895
 
1727
- * value: The value
1728
- * returns: The int64 value, or 0 if no conversion is possible
1896
+ * @param input The integer value
1897
+ * @return The value. This must be destroyed with `duckdb_destroy_value`.
1729
1898
  */
1730
- DUCKDB_API int64_t duckdb_get_int64(duckdb_value value);
1731
-
1732
- //===--------------------------------------------------------------------===//
1733
- // Logical Type Interface
1734
- //===--------------------------------------------------------------------===//
1899
+ DUCKDB_API duckdb_value duckdb_create_int32(int32_t input);
1735
1900
 
1736
1901
  /*!
1737
- Creates a `duckdb_logical_type` from a standard primitive type.
1738
- The resulting type should be destroyed with `duckdb_destroy_logical_type`.
1902
+ Creates a value from a uint32_t (a uinteger)
1739
1903
 
1740
- This should not be used with `DUCKDB_TYPE_DECIMAL`.
1741
-
1742
- * type: The primitive type to create.
1743
- * returns: The logical type.
1904
+ * @param input The uinteger value
1905
+ * @return The value. This must be destroyed with `duckdb_destroy_value`.
1744
1906
  */
1745
- DUCKDB_API duckdb_logical_type duckdb_create_logical_type(duckdb_type type);
1907
+ DUCKDB_API duckdb_value duckdb_create_uint32(uint32_t input);
1746
1908
 
1747
1909
  /*!
1748
- Returns the alias of a duckdb_logical_type, if one is set, else `NULL`.
1749
- The result must be destroyed with `duckdb_free`.
1910
+ Creates a value from a uint64_t (a ubigint)
1750
1911
 
1751
- * type: The logical type to return the alias of
1752
- * returns: The alias or `NULL`
1753
- */
1754
- DUCKDB_API char *duckdb_logical_type_get_alias(duckdb_logical_type type);
1912
+ * @param input The ubigint value
1913
+ * @return The value. This must be destroyed with `duckdb_destroy_value`.
1914
+ */
1915
+ DUCKDB_API duckdb_value duckdb_create_uint64(uint64_t input);
1755
1916
 
1756
1917
  /*!
1757
- Creates a list type from its child type.
1758
- The resulting type should be destroyed with `duckdb_destroy_logical_type`.
1918
+ Creates a value from an int64
1759
1919
 
1760
- * type: The child type of list type to create.
1761
- * returns: The logical type.
1920
+ * @return The value. This must be destroyed with `duckdb_destroy_value`.
1762
1921
  */
1763
- DUCKDB_API duckdb_logical_type duckdb_create_list_type(duckdb_logical_type type);
1922
+ DUCKDB_API duckdb_value duckdb_create_int64(int64_t val);
1764
1923
 
1765
1924
  /*!
1766
- Creates a array type from its child type.
1767
- The resulting type should be destroyed with `duckdb_destroy_logical_type`.
1925
+ Creates a value from a hugeint
1768
1926
 
1769
- * type: The child type of array type to create.
1770
- * array_size: The number of elements in the array.
1771
- * returns: The logical type.
1927
+ * @param input The hugeint value
1928
+ * @return The value. This must be destroyed with `duckdb_destroy_value`.
1772
1929
  */
1773
- DUCKDB_API duckdb_logical_type duckdb_create_array_type(duckdb_logical_type type, idx_t array_size);
1930
+ DUCKDB_API duckdb_value duckdb_create_hugeint(duckdb_hugeint input);
1774
1931
 
1775
1932
  /*!
1776
- Creates a map type from its key type and value type.
1777
- The resulting type should be destroyed with `duckdb_destroy_logical_type`.
1933
+ Creates a value from a uhugeint
1778
1934
 
1779
- * type: The key type and value type of map type to create.
1780
- * returns: The logical type.
1935
+ * @param input The uhugeint value
1936
+ * @return The value. This must be destroyed with `duckdb_destroy_value`.
1781
1937
  */
1782
- DUCKDB_API duckdb_logical_type duckdb_create_map_type(duckdb_logical_type key_type, duckdb_logical_type value_type);
1938
+ DUCKDB_API duckdb_value duckdb_create_uhugeint(duckdb_uhugeint input);
1783
1939
 
1784
1940
  /*!
1785
- Creates a UNION type from the passed types array.
1786
- The resulting type should be destroyed with `duckdb_destroy_logical_type`.
1941
+ Creates a value from a float
1787
1942
 
1788
- * types: The array of types that the union should consist of.
1789
- * type_amount: The size of the types array.
1790
- * returns: The logical type.
1943
+ * @param input The float value
1944
+ * @return The value. This must be destroyed with `duckdb_destroy_value`.
1791
1945
  */
1792
- DUCKDB_API duckdb_logical_type duckdb_create_union_type(duckdb_logical_type *member_types, const char **member_names,
1793
- idx_t member_count);
1946
+ DUCKDB_API duckdb_value duckdb_create_float(float input);
1794
1947
 
1795
1948
  /*!
1796
- Creates a STRUCT type from the passed member name and type arrays.
1797
- The resulting type should be destroyed with `duckdb_destroy_logical_type`.
1949
+ Creates a value from a double
1798
1950
 
1799
- * member_types: The array of types that the struct should consist of.
1800
- * member_names: The array of names that the struct should consist of.
1801
- * member_count: The number of members that were specified for both arrays.
1802
- * returns: The logical type.
1951
+ * @param input The double value
1952
+ * @return The value. This must be destroyed with `duckdb_destroy_value`.
1803
1953
  */
1804
- DUCKDB_API duckdb_logical_type duckdb_create_struct_type(duckdb_logical_type *member_types, const char **member_names,
1805
- idx_t member_count);
1954
+ DUCKDB_API duckdb_value duckdb_create_double(double input);
1806
1955
 
1807
1956
  /*!
1808
- Creates an ENUM type from the passed member name array.
1809
- The resulting type should be destroyed with `duckdb_destroy_logical_type`.
1957
+ Creates a value from a date
1810
1958
 
1811
- * enum_name: The name of the enum.
1812
- * member_names: The array of names that the enum should consist of.
1813
- * member_count: The number of elements that were specified in the array.
1814
- * returns: The logical type.
1959
+ * @param input The date value
1960
+ * @return The value. This must be destroyed with `duckdb_destroy_value`.
1815
1961
  */
1816
- DUCKDB_API duckdb_logical_type duckdb_create_enum_type(const char **member_names, idx_t member_count);
1962
+ DUCKDB_API duckdb_value duckdb_create_date(duckdb_date input);
1817
1963
 
1818
1964
  /*!
1819
- Creates a `duckdb_logical_type` of type decimal with the specified width and scale.
1820
- The resulting type should be destroyed with `duckdb_destroy_logical_type`.
1965
+ Creates a value from a time
1821
1966
 
1822
- * width: The width of the decimal type
1823
- * scale: The scale of the decimal type
1824
- * returns: The logical type.
1967
+ * @param input The time value
1968
+ * @return The value. This must be destroyed with `duckdb_destroy_value`.
1825
1969
  */
1826
- DUCKDB_API duckdb_logical_type duckdb_create_decimal_type(uint8_t width, uint8_t scale);
1970
+ DUCKDB_API duckdb_value duckdb_create_time(duckdb_time input);
1827
1971
 
1828
1972
  /*!
1829
- Retrieves the enum type class of a `duckdb_logical_type`.
1973
+ Creates a value from a time_tz.
1974
+ Not to be confused with `duckdb_create_time_tz`, which creates a duckdb_time_tz_t.
1830
1975
 
1831
- * type: The logical type object
1832
- * returns: The type id
1976
+ * @param value The time_tz value
1977
+ * @return The value. This must be destroyed with `duckdb_destroy_value`.
1833
1978
  */
1834
- DUCKDB_API duckdb_type duckdb_get_type_id(duckdb_logical_type type);
1979
+ DUCKDB_API duckdb_value duckdb_create_time_tz_value(duckdb_time_tz value);
1835
1980
 
1836
1981
  /*!
1837
- Retrieves the width of a decimal type.
1982
+ Creates a value from a timestamp
1838
1983
 
1839
- * type: The logical type object
1840
- * returns: The width of the decimal type
1984
+ * @param input The timestamp value
1985
+ * @return The value. This must be destroyed with `duckdb_destroy_value`.
1841
1986
  */
1842
- DUCKDB_API uint8_t duckdb_decimal_width(duckdb_logical_type type);
1987
+ DUCKDB_API duckdb_value duckdb_create_timestamp(duckdb_timestamp input);
1843
1988
 
1844
1989
  /*!
1845
- Retrieves the scale of a decimal type.
1990
+ Creates a value from an interval
1846
1991
 
1847
- * type: The logical type object
1848
- * returns: The scale of the decimal type
1992
+ * @param input The interval value
1993
+ * @return The value. This must be destroyed with `duckdb_destroy_value`.
1849
1994
  */
1850
- DUCKDB_API uint8_t duckdb_decimal_scale(duckdb_logical_type type);
1995
+ DUCKDB_API duckdb_value duckdb_create_interval(duckdb_interval input);
1851
1996
 
1852
1997
  /*!
1853
- Retrieves the internal storage type of a decimal type.
1998
+ Creates a value from a blob
1854
1999
 
1855
- * type: The logical type object
1856
- * returns: The internal type of the decimal type
2000
+ * @param data The blob data
2001
+ * @param length The length of the blob data
2002
+ * @return The value. This must be destroyed with `duckdb_destroy_value`.
1857
2003
  */
1858
- DUCKDB_API duckdb_type duckdb_decimal_internal_type(duckdb_logical_type type);
2004
+ DUCKDB_API duckdb_value duckdb_create_blob(const uint8_t *data, idx_t length);
1859
2005
 
1860
2006
  /*!
1861
- Retrieves the internal storage type of an enum type.
2007
+ Returns the boolean value of the given value.
1862
2008
 
1863
- * type: The logical type object
1864
- * returns: The internal type of the enum type
2009
+ * @param val A duckdb_value containing a boolean
2010
+ * @return A boolean, or false if the value cannot be converted
1865
2011
  */
1866
- DUCKDB_API duckdb_type duckdb_enum_internal_type(duckdb_logical_type type);
2012
+ DUCKDB_API bool duckdb_get_bool(duckdb_value val);
1867
2013
 
1868
2014
  /*!
1869
- Retrieves the dictionary size of the enum type.
2015
+ Returns the int8_t value of the given value.
1870
2016
 
1871
- * type: The logical type object
1872
- * returns: The dictionary size of the enum type
2017
+ * @param val A duckdb_value containing a tinyint
2018
+ * @return A int8_t, or MinValue<int8> if the value cannot be converted
1873
2019
  */
1874
- DUCKDB_API uint32_t duckdb_enum_dictionary_size(duckdb_logical_type type);
2020
+ DUCKDB_API int8_t duckdb_get_int8(duckdb_value val);
1875
2021
 
1876
2022
  /*!
1877
- Retrieves the dictionary value at the specified position from the enum.
2023
+ Returns the uint8_t value of the given value.
1878
2024
 
1879
- The result must be freed with `duckdb_free`.
1880
-
1881
- * type: The logical type object
1882
- * index: The index in the dictionary
1883
- * returns: The string value of the enum type. Must be freed with `duckdb_free`.
2025
+ * @param val A duckdb_value containing a utinyint
2026
+ * @return A uint8_t, or MinValue<uint8> if the value cannot be converted
1884
2027
  */
1885
- DUCKDB_API char *duckdb_enum_dictionary_value(duckdb_logical_type type, idx_t index);
2028
+ DUCKDB_API uint8_t duckdb_get_uint8(duckdb_value val);
1886
2029
 
1887
2030
  /*!
1888
- Retrieves the child type of the given list type.
1889
-
1890
- The result must be freed with `duckdb_destroy_logical_type`.
2031
+ Returns the int16_t value of the given value.
1891
2032
 
1892
- * type: The logical type object
1893
- * returns: The child type of the list type. Must be destroyed with `duckdb_destroy_logical_type`.
2033
+ * @param val A duckdb_value containing a smallint
2034
+ * @return A int16_t, or MinValue<int16> if the value cannot be converted
1894
2035
  */
1895
- DUCKDB_API duckdb_logical_type duckdb_list_type_child_type(duckdb_logical_type type);
2036
+ DUCKDB_API int16_t duckdb_get_int16(duckdb_value val);
1896
2037
 
1897
2038
  /*!
1898
- Retrieves the child type of the given array type.
1899
-
1900
- The result must be freed with `duckdb_destroy_logical_type`.
2039
+ Returns the uint16_t value of the given value.
1901
2040
 
1902
- * type: The logical type object
1903
- * returns: The child type of the array type. Must be destroyed with `duckdb_destroy_logical_type`.
2041
+ * @param val A duckdb_value containing a usmallint
2042
+ * @return A uint16_t, or MinValue<uint16> if the value cannot be converted
1904
2043
  */
1905
- DUCKDB_API duckdb_logical_type duckdb_array_type_child_type(duckdb_logical_type type);
2044
+ DUCKDB_API uint16_t duckdb_get_uint16(duckdb_value val);
1906
2045
 
1907
2046
  /*!
1908
- Retrieves the array size of the given array type.
2047
+ Returns the int32_t value of the given value.
1909
2048
 
1910
- * type: The logical type object
1911
- * returns: The fixed number of elements the values of this array type can store.
2049
+ * @param val A duckdb_value containing a integer
2050
+ * @return A int32_t, or MinValue<int32> if the value cannot be converted
1912
2051
  */
1913
- DUCKDB_API idx_t duckdb_array_type_array_size(duckdb_logical_type type);
2052
+ DUCKDB_API int32_t duckdb_get_int32(duckdb_value val);
1914
2053
 
1915
2054
  /*!
1916
- Retrieves the key type of the given map type.
2055
+ Returns the uint32_t value of the given value.
1917
2056
 
1918
- The result must be freed with `duckdb_destroy_logical_type`.
1919
-
1920
- * type: The logical type object
1921
- * returns: The key type of the map type. Must be destroyed with `duckdb_destroy_logical_type`.
2057
+ * @param val A duckdb_value containing a uinteger
2058
+ * @return A uint32_t, or MinValue<uint32> if the value cannot be converted
1922
2059
  */
1923
- DUCKDB_API duckdb_logical_type duckdb_map_type_key_type(duckdb_logical_type type);
2060
+ DUCKDB_API uint32_t duckdb_get_uint32(duckdb_value val);
1924
2061
 
1925
2062
  /*!
1926
- Retrieves the value type of the given map type.
2063
+ Returns the int64_t value of the given value.
1927
2064
 
1928
- The result must be freed with `duckdb_destroy_logical_type`.
1929
-
1930
- * type: The logical type object
1931
- * returns: The value type of the map type. Must be destroyed with `duckdb_destroy_logical_type`.
2065
+ * @param val A duckdb_value containing a bigint
2066
+ * @return A int64_t, or MinValue<int64> if the value cannot be converted
1932
2067
  */
1933
- DUCKDB_API duckdb_logical_type duckdb_map_type_value_type(duckdb_logical_type type);
2068
+ DUCKDB_API int64_t duckdb_get_int64(duckdb_value val);
1934
2069
 
1935
2070
  /*!
1936
- Returns the number of children of a struct type.
2071
+ Returns the uint64_t value of the given value.
1937
2072
 
1938
- * type: The logical type object
1939
- * returns: The number of children of a struct type.
2073
+ * @param val A duckdb_value containing a ubigint
2074
+ * @return A uint64_t, or MinValue<uint64> if the value cannot be converted
1940
2075
  */
1941
- DUCKDB_API idx_t duckdb_struct_type_child_count(duckdb_logical_type type);
2076
+ DUCKDB_API uint64_t duckdb_get_uint64(duckdb_value val);
1942
2077
 
1943
2078
  /*!
1944
- Retrieves the name of the struct child.
1945
-
1946
- The result must be freed with `duckdb_free`.
2079
+ Returns the hugeint value of the given value.
1947
2080
 
1948
- * type: The logical type object
1949
- * index: The child index
1950
- * returns: The name of the struct type. Must be freed with `duckdb_free`.
2081
+ * @param val A duckdb_value containing a hugeint
2082
+ * @return A duckdb_hugeint, or MinValue<hugeint> if the value cannot be converted
1951
2083
  */
1952
- DUCKDB_API char *duckdb_struct_type_child_name(duckdb_logical_type type, idx_t index);
2084
+ DUCKDB_API duckdb_hugeint duckdb_get_hugeint(duckdb_value val);
1953
2085
 
1954
2086
  /*!
1955
- Retrieves the child type of the given struct type at the specified index.
1956
-
1957
- The result must be freed with `duckdb_destroy_logical_type`.
2087
+ Returns the uhugeint value of the given value.
1958
2088
 
1959
- * type: The logical type object
1960
- * index: The child index
1961
- * returns: The child type of the struct type. Must be destroyed with `duckdb_destroy_logical_type`.
2089
+ * @param val A duckdb_value containing a uhugeint
2090
+ * @return A duckdb_uhugeint, or MinValue<uhugeint> if the value cannot be converted
1962
2091
  */
1963
- DUCKDB_API duckdb_logical_type duckdb_struct_type_child_type(duckdb_logical_type type, idx_t index);
2092
+ DUCKDB_API duckdb_uhugeint duckdb_get_uhugeint(duckdb_value val);
1964
2093
 
1965
2094
  /*!
1966
- Returns the number of members that the union type has.
2095
+ Returns the float value of the given value.
1967
2096
 
1968
- * type: The logical type (union) object
1969
- * returns: The number of members of a union type.
2097
+ * @param val A duckdb_value containing a float
2098
+ * @return A float, or NAN if the value cannot be converted
1970
2099
  */
1971
- DUCKDB_API idx_t duckdb_union_type_member_count(duckdb_logical_type type);
2100
+ DUCKDB_API float duckdb_get_float(duckdb_value val);
1972
2101
 
1973
2102
  /*!
1974
- Retrieves the name of the union member.
2103
+ Returns the double value of the given value.
1975
2104
 
1976
- The result must be freed with `duckdb_free`.
2105
+ * @param val A duckdb_value containing a double
2106
+ * @return A double, or NAN if the value cannot be converted
2107
+ */
2108
+ DUCKDB_API double duckdb_get_double(duckdb_value val);
2109
+
2110
+ /*!
2111
+ Returns the date value of the given value.
1977
2112
 
1978
- * type: The logical type object
1979
- * index: The child index
1980
- * returns: The name of the union member. Must be freed with `duckdb_free`.
2113
+ * @param val A duckdb_value containing a date
2114
+ * @return A duckdb_date, or MinValue<date> if the value cannot be converted
1981
2115
  */
1982
- DUCKDB_API char *duckdb_union_type_member_name(duckdb_logical_type type, idx_t index);
2116
+ DUCKDB_API duckdb_date duckdb_get_date(duckdb_value val);
1983
2117
 
1984
2118
  /*!
1985
- Retrieves the child type of the given union member at the specified index.
2119
+ Returns the time value of the given value.
1986
2120
 
1987
- The result must be freed with `duckdb_destroy_logical_type`.
2121
+ * @param val A duckdb_value containing a time
2122
+ * @return A duckdb_time, or MinValue<time> if the value cannot be converted
2123
+ */
2124
+ DUCKDB_API duckdb_time duckdb_get_time(duckdb_value val);
1988
2125
 
1989
- * type: The logical type object
1990
- * index: The child index
1991
- * returns: The child type of the union member. Must be destroyed with `duckdb_destroy_logical_type`.
2126
+ /*!
2127
+ Returns the time_tz value of the given value.
2128
+
2129
+ * @param val A duckdb_value containing a time_tz
2130
+ * @return A duckdb_time_tz, or MinValue<time_tz> if the value cannot be converted
1992
2131
  */
1993
- DUCKDB_API duckdb_logical_type duckdb_union_type_member_type(duckdb_logical_type type, idx_t index);
2132
+ DUCKDB_API duckdb_time_tz duckdb_get_time_tz(duckdb_value val);
1994
2133
 
1995
2134
  /*!
1996
- Destroys the logical type and de-allocates all memory allocated for that type.
2135
+ Returns the timestamp value of the given value.
1997
2136
 
1998
- * type: The logical type to destroy.
2137
+ * @param val A duckdb_value containing a timestamp
2138
+ * @return A duckdb_timestamp, or MinValue<timestamp> if the value cannot be converted
1999
2139
  */
2000
- DUCKDB_API void duckdb_destroy_logical_type(duckdb_logical_type *type);
2140
+ DUCKDB_API duckdb_timestamp duckdb_get_timestamp(duckdb_value val);
2001
2141
 
2002
- //===--------------------------------------------------------------------===//
2003
- // Data Chunk Interface
2004
- //===--------------------------------------------------------------------===//
2142
+ /*!
2143
+ Returns the interval value of the given value.
2144
+
2145
+ * @param val A duckdb_value containing a interval
2146
+ * @return A duckdb_interval, or MinValue<interval> if the value cannot be converted
2147
+ */
2148
+ DUCKDB_API duckdb_interval duckdb_get_interval(duckdb_value val);
2005
2149
 
2006
2150
  /*!
2007
- Creates an empty DataChunk with the specified set of types.
2151
+ Returns the type of the given value. The type is valid as long as the value is not destroyed.
2152
+ The type itself must not be destroyed.
2153
+
2154
+ * @param val A duckdb_value
2155
+ * @return A duckdb_logical_type.
2156
+ */
2157
+ DUCKDB_API duckdb_logical_type duckdb_get_value_type(duckdb_value val);
2008
2158
 
2009
- Note that the result must be destroyed with `duckdb_destroy_data_chunk`.
2159
+ /*!
2160
+ Returns the blob value of the given value.
2010
2161
 
2011
- * types: An array of types of the data chunk.
2012
- * column_count: The number of columns.
2013
- * returns: The data chunk.
2162
+ * @param val A duckdb_value containing a blob
2163
+ * @return A duckdb_blob
2014
2164
  */
2015
- DUCKDB_API duckdb_data_chunk duckdb_create_data_chunk(duckdb_logical_type *types, idx_t column_count);
2165
+ DUCKDB_API duckdb_blob duckdb_get_blob(duckdb_value val);
2016
2166
 
2017
2167
  /*!
2018
- Destroys the data chunk and de-allocates all memory allocated for that chunk.
2168
+ Obtains a string representation of the given value.
2169
+ The result must be destroyed with `duckdb_free`.
2019
2170
 
2020
- * chunk: The data chunk to destroy.
2171
+ * @param value The value
2172
+ * @return The string value. This must be destroyed with `duckdb_free`.
2021
2173
  */
2022
- DUCKDB_API void duckdb_destroy_data_chunk(duckdb_data_chunk *chunk);
2174
+ DUCKDB_API char *duckdb_get_varchar(duckdb_value value);
2023
2175
 
2024
2176
  /*!
2025
- Resets a data chunk, clearing the validity masks and setting the cardinality of the data chunk to 0.
2177
+ Creates a struct value from a type and an array of values. Must be destroyed with `duckdb_destroy_value`.
2026
2178
 
2027
- * chunk: The data chunk to reset.
2179
+ * @param type The type of the struct
2180
+ * @param values The values for the struct fields
2181
+ * @return The struct value, or nullptr, if any child type is `DUCKDB_TYPE_ANY` or `DUCKDB_TYPE_INVALID`.
2028
2182
  */
2029
- DUCKDB_API void duckdb_data_chunk_reset(duckdb_data_chunk chunk);
2183
+ DUCKDB_API duckdb_value duckdb_create_struct_value(duckdb_logical_type type, duckdb_value *values);
2030
2184
 
2031
2185
  /*!
2032
- Retrieves the number of columns in a data chunk.
2186
+ Creates a list value from a child (element) type and an array of values of length `value_count`.
2187
+ Must be destroyed with `duckdb_destroy_value`.
2033
2188
 
2034
- * chunk: The data chunk to get the data from
2035
- * returns: The number of columns in the data chunk
2189
+ * @param type The type of the list
2190
+ * @param values The values for the list
2191
+ * @param value_count The number of values in the list
2192
+ * @return The list value, or nullptr, if the child type is `DUCKDB_TYPE_ANY` or `DUCKDB_TYPE_INVALID`.
2036
2193
  */
2037
- DUCKDB_API idx_t duckdb_data_chunk_get_column_count(duckdb_data_chunk chunk);
2194
+ DUCKDB_API duckdb_value duckdb_create_list_value(duckdb_logical_type type, duckdb_value *values, idx_t value_count);
2038
2195
 
2039
2196
  /*!
2040
- Retrieves the vector at the specified column index in the data chunk.
2197
+ Creates an array value from a child (element) type and an array of values of length `value_count`.
2198
+ Must be destroyed with `duckdb_destroy_value`.
2041
2199
 
2042
- The pointer to the vector is valid for as long as the chunk is alive.
2043
- It does NOT need to be destroyed.
2200
+ * @param type The type of the array
2201
+ * @param values The values for the array
2202
+ * @param value_count The number of values in the array
2203
+ * @return The array value, or nullptr, if the child type is `DUCKDB_TYPE_ANY` or `DUCKDB_TYPE_INVALID`.
2204
+ */
2205
+ DUCKDB_API duckdb_value duckdb_create_array_value(duckdb_logical_type type, duckdb_value *values, idx_t value_count);
2206
+
2207
+ /*!
2208
+ Returns the number of elements in a MAP value.
2044
2209
 
2045
- * chunk: The data chunk to get the data from
2046
- * returns: The vector
2210
+ * @param value The MAP value.
2211
+ * @return The number of elements in the map.
2047
2212
  */
2048
- DUCKDB_API duckdb_vector duckdb_data_chunk_get_vector(duckdb_data_chunk chunk, idx_t col_idx);
2213
+ DUCKDB_API idx_t duckdb_get_map_size(duckdb_value value);
2049
2214
 
2050
2215
  /*!
2051
- Retrieves the current number of tuples in a data chunk.
2216
+ Returns the MAP key at index as a duckdb_value.
2052
2217
 
2053
- * chunk: The data chunk to get the data from
2054
- * returns: The number of tuples in the data chunk
2218
+ * @param value The MAP value.
2219
+ * @param index The index of the key.
2220
+ * @return The key as a duckdb_value.
2055
2221
  */
2056
- DUCKDB_API idx_t duckdb_data_chunk_get_size(duckdb_data_chunk chunk);
2222
+ DUCKDB_API duckdb_value duckdb_get_map_key(duckdb_value value, idx_t index);
2057
2223
 
2058
2224
  /*!
2059
- Sets the current number of tuples in a data chunk.
2225
+ Returns the MAP value at index as a duckdb_value.
2060
2226
 
2061
- * chunk: The data chunk to set the size in
2062
- * size: The number of tuples in the data chunk
2227
+ * @param value The MAP value.
2228
+ * @param index The index of the value.
2229
+ * @return The value as a duckdb_value.
2063
2230
  */
2064
- DUCKDB_API void duckdb_data_chunk_set_size(duckdb_data_chunk chunk, idx_t size);
2231
+ DUCKDB_API duckdb_value duckdb_get_map_value(duckdb_value value, idx_t index);
2065
2232
 
2066
2233
  //===--------------------------------------------------------------------===//
2067
- // Vector Interface
2234
+ // Logical Type Interface
2068
2235
  //===--------------------------------------------------------------------===//
2069
2236
 
2070
2237
  /*!
2071
- Retrieves the column type of the specified vector.
2238
+ Creates a `duckdb_logical_type` from a primitive type.
2239
+ The resulting logical type must be destroyed with `duckdb_destroy_logical_type`.
2072
2240
 
2073
- The result must be destroyed with `duckdb_destroy_logical_type`.
2241
+ Returns an invalid logical type, if type is: `DUCKDB_TYPE_INVALID`, `DUCKDB_TYPE_DECIMAL`, `DUCKDB_TYPE_ENUM`,
2242
+ `DUCKDB_TYPE_LIST`, `DUCKDB_TYPE_STRUCT`, `DUCKDB_TYPE_MAP`, `DUCKDB_TYPE_ARRAY`, or `DUCKDB_TYPE_UNION`.
2074
2243
 
2075
- * vector: The vector get the data from
2076
- * returns: The type of the vector
2244
+ * @param type The primitive type to create.
2245
+ * @return The logical type.
2077
2246
  */
2078
- DUCKDB_API duckdb_logical_type duckdb_vector_get_column_type(duckdb_vector vector);
2247
+ DUCKDB_API duckdb_logical_type duckdb_create_logical_type(duckdb_type type);
2079
2248
 
2080
2249
  /*!
2081
- Retrieves the data pointer of the vector.
2082
-
2083
- The data pointer can be used to read or write values from the vector.
2084
- How to read or write values depends on the type of the vector.
2250
+ Returns the alias of a duckdb_logical_type, if set, else `nullptr`.
2251
+ The result must be destroyed with `duckdb_free`.
2085
2252
 
2086
- * vector: The vector to get the data from
2087
- * returns: The data pointer
2253
+ * @param type The logical type
2254
+ * @return The alias or `nullptr`
2088
2255
  */
2089
- DUCKDB_API void *duckdb_vector_get_data(duckdb_vector vector);
2256
+ DUCKDB_API char *duckdb_logical_type_get_alias(duckdb_logical_type type);
2090
2257
 
2091
2258
  /*!
2092
- Retrieves the validity mask pointer of the specified vector.
2259
+ Sets the alias of a duckdb_logical_type.
2093
2260
 
2094
- If all values are valid, this function MIGHT return NULL!
2261
+ * @param type The logical type
2262
+ * @param alias The alias to set
2263
+ */
2264
+ DUCKDB_API void duckdb_logical_type_set_alias(duckdb_logical_type type, const char *alias);
2095
2265
 
2096
- The validity mask is a bitset that signifies null-ness within the data chunk.
2097
- It is a series of uint64_t values, where each uint64_t value contains validity for 64 tuples.
2266
+ /*!
2267
+ Creates a LIST type from its child type.
2268
+ The return type must be destroyed with `duckdb_destroy_logical_type`.
2269
+
2270
+ * @param type The child type of the list
2271
+ * @return The logical type.
2272
+ */
2273
+ DUCKDB_API duckdb_logical_type duckdb_create_list_type(duckdb_logical_type type);
2274
+
2275
+ /*!
2276
+ Creates an ARRAY type from its child type.
2277
+ The return type must be destroyed with `duckdb_destroy_logical_type`.
2278
+
2279
+ * @param type The child type of the array.
2280
+ * @param array_size The number of elements in the array.
2281
+ * @return The logical type.
2282
+ */
2283
+ DUCKDB_API duckdb_logical_type duckdb_create_array_type(duckdb_logical_type type, idx_t array_size);
2284
+
2285
+ /*!
2286
+ Creates a MAP type from its key type and value type.
2287
+ The return type must be destroyed with `duckdb_destroy_logical_type`.
2288
+
2289
+ * @param key_type The map's key type.
2290
+ * @param value_type The map's value type.
2291
+ * @return The logical type.
2292
+ */
2293
+ DUCKDB_API duckdb_logical_type duckdb_create_map_type(duckdb_logical_type key_type, duckdb_logical_type value_type);
2294
+
2295
+ /*!
2296
+ Creates a UNION type from the passed arrays.
2297
+ The return type must be destroyed with `duckdb_destroy_logical_type`.
2298
+
2299
+ * @param member_types The array of union member types.
2300
+ * @param member_names The union member names.
2301
+ * @param member_count The number of union members.
2302
+ * @return The logical type.
2303
+ */
2304
+ DUCKDB_API duckdb_logical_type duckdb_create_union_type(duckdb_logical_type *member_types, const char **member_names,
2305
+ idx_t member_count);
2306
+
2307
+ /*!
2308
+ Creates a STRUCT type based on the member types and names.
2309
+ The resulting type must be destroyed with `duckdb_destroy_logical_type`.
2310
+
2311
+ * @param member_types The array of types of the struct members.
2312
+ * @param member_names The array of names of the struct members.
2313
+ * @param member_count The number of members of the struct.
2314
+ * @return The logical type.
2315
+ */
2316
+ DUCKDB_API duckdb_logical_type duckdb_create_struct_type(duckdb_logical_type *member_types, const char **member_names,
2317
+ idx_t member_count);
2318
+
2319
+ /*!
2320
+ Creates an ENUM type from the passed member name array.
2321
+ The resulting type should be destroyed with `duckdb_destroy_logical_type`.
2322
+
2323
+ * @param member_names The array of names that the enum should consist of.
2324
+ * @param member_count The number of elements that were specified in the array.
2325
+ * @return The logical type.
2326
+ */
2327
+ DUCKDB_API duckdb_logical_type duckdb_create_enum_type(const char **member_names, idx_t member_count);
2328
+
2329
+ /*!
2330
+ Creates a DECIMAL type with the specified width and scale.
2331
+ The resulting type should be destroyed with `duckdb_destroy_logical_type`.
2332
+
2333
+ * @param width The width of the decimal type
2334
+ * @param scale The scale of the decimal type
2335
+ * @return The logical type.
2336
+ */
2337
+ DUCKDB_API duckdb_logical_type duckdb_create_decimal_type(uint8_t width, uint8_t scale);
2338
+
2339
+ /*!
2340
+ Retrieves the enum `duckdb_type` of a `duckdb_logical_type`.
2341
+
2342
+ * @param type The logical type.
2343
+ * @return The `duckdb_type` id.
2344
+ */
2345
+ DUCKDB_API duckdb_type duckdb_get_type_id(duckdb_logical_type type);
2346
+
2347
+ /*!
2348
+ Retrieves the width of a decimal type.
2349
+
2350
+ * @param type The logical type object
2351
+ * @return The width of the decimal type
2352
+ */
2353
+ DUCKDB_API uint8_t duckdb_decimal_width(duckdb_logical_type type);
2354
+
2355
+ /*!
2356
+ Retrieves the scale of a decimal type.
2357
+
2358
+ * @param type The logical type object
2359
+ * @return The scale of the decimal type
2360
+ */
2361
+ DUCKDB_API uint8_t duckdb_decimal_scale(duckdb_logical_type type);
2362
+
2363
+ /*!
2364
+ Retrieves the internal storage type of a decimal type.
2365
+
2366
+ * @param type The logical type object
2367
+ * @return The internal type of the decimal type
2368
+ */
2369
+ DUCKDB_API duckdb_type duckdb_decimal_internal_type(duckdb_logical_type type);
2370
+
2371
+ /*!
2372
+ Retrieves the internal storage type of an enum type.
2373
+
2374
+ * @param type The logical type object
2375
+ * @return The internal type of the enum type
2376
+ */
2377
+ DUCKDB_API duckdb_type duckdb_enum_internal_type(duckdb_logical_type type);
2378
+
2379
+ /*!
2380
+ Retrieves the dictionary size of the enum type.
2381
+
2382
+ * @param type The logical type object
2383
+ * @return The dictionary size of the enum type
2384
+ */
2385
+ DUCKDB_API uint32_t duckdb_enum_dictionary_size(duckdb_logical_type type);
2386
+
2387
+ /*!
2388
+ Retrieves the dictionary value at the specified position from the enum.
2389
+
2390
+ The result must be freed with `duckdb_free`.
2391
+
2392
+ * @param type The logical type object
2393
+ * @param index The index in the dictionary
2394
+ * @return The string value of the enum type. Must be freed with `duckdb_free`.
2395
+ */
2396
+ DUCKDB_API char *duckdb_enum_dictionary_value(duckdb_logical_type type, idx_t index);
2397
+
2398
+ /*!
2399
+ Retrieves the child type of the given LIST type. Also accepts MAP types.
2400
+ The result must be freed with `duckdb_destroy_logical_type`.
2401
+
2402
+ * @param type The logical type, either LIST or MAP.
2403
+ * @return The child type of the LIST or MAP type.
2404
+ */
2405
+ DUCKDB_API duckdb_logical_type duckdb_list_type_child_type(duckdb_logical_type type);
2406
+
2407
+ /*!
2408
+ Retrieves the child type of the given ARRAY type.
2409
+
2410
+ The result must be freed with `duckdb_destroy_logical_type`.
2411
+
2412
+ * @param type The logical type. Must be ARRAY.
2413
+ * @return The child type of the ARRAY type.
2414
+ */
2415
+ DUCKDB_API duckdb_logical_type duckdb_array_type_child_type(duckdb_logical_type type);
2416
+
2417
+ /*!
2418
+ Retrieves the array size of the given array type.
2419
+
2420
+ * @param type The logical type object
2421
+ * @return The fixed number of elements the values of this array type can store.
2422
+ */
2423
+ DUCKDB_API idx_t duckdb_array_type_array_size(duckdb_logical_type type);
2424
+
2425
+ /*!
2426
+ Retrieves the key type of the given map type.
2427
+
2428
+ The result must be freed with `duckdb_destroy_logical_type`.
2429
+
2430
+ * @param type The logical type object
2431
+ * @return The key type of the map type. Must be destroyed with `duckdb_destroy_logical_type`.
2432
+ */
2433
+ DUCKDB_API duckdb_logical_type duckdb_map_type_key_type(duckdb_logical_type type);
2434
+
2435
+ /*!
2436
+ Retrieves the value type of the given map type.
2437
+
2438
+ The result must be freed with `duckdb_destroy_logical_type`.
2439
+
2440
+ * @param type The logical type object
2441
+ * @return The value type of the map type. Must be destroyed with `duckdb_destroy_logical_type`.
2442
+ */
2443
+ DUCKDB_API duckdb_logical_type duckdb_map_type_value_type(duckdb_logical_type type);
2444
+
2445
+ /*!
2446
+ Returns the number of children of a struct type.
2447
+
2448
+ * @param type The logical type object
2449
+ * @return The number of children of a struct type.
2450
+ */
2451
+ DUCKDB_API idx_t duckdb_struct_type_child_count(duckdb_logical_type type);
2452
+
2453
+ /*!
2454
+ Retrieves the name of the struct child.
2455
+
2456
+ The result must be freed with `duckdb_free`.
2457
+
2458
+ * @param type The logical type object
2459
+ * @param index The child index
2460
+ * @return The name of the struct type. Must be freed with `duckdb_free`.
2461
+ */
2462
+ DUCKDB_API char *duckdb_struct_type_child_name(duckdb_logical_type type, idx_t index);
2463
+
2464
+ /*!
2465
+ Retrieves the child type of the given struct type at the specified index.
2466
+
2467
+ The result must be freed with `duckdb_destroy_logical_type`.
2468
+
2469
+ * @param type The logical type object
2470
+ * @param index The child index
2471
+ * @return The child type of the struct type. Must be destroyed with `duckdb_destroy_logical_type`.
2472
+ */
2473
+ DUCKDB_API duckdb_logical_type duckdb_struct_type_child_type(duckdb_logical_type type, idx_t index);
2474
+
2475
+ /*!
2476
+ Returns the number of members that the union type has.
2477
+
2478
+ * @param type The logical type (union) object
2479
+ * @return The number of members of a union type.
2480
+ */
2481
+ DUCKDB_API idx_t duckdb_union_type_member_count(duckdb_logical_type type);
2482
+
2483
+ /*!
2484
+ Retrieves the name of the union member.
2485
+
2486
+ The result must be freed with `duckdb_free`.
2487
+
2488
+ * @param type The logical type object
2489
+ * @param index The child index
2490
+ * @return The name of the union member. Must be freed with `duckdb_free`.
2491
+ */
2492
+ DUCKDB_API char *duckdb_union_type_member_name(duckdb_logical_type type, idx_t index);
2493
+
2494
+ /*!
2495
+ Retrieves the child type of the given union member at the specified index.
2496
+
2497
+ The result must be freed with `duckdb_destroy_logical_type`.
2498
+
2499
+ * @param type The logical type object
2500
+ * @param index The child index
2501
+ * @return The child type of the union member. Must be destroyed with `duckdb_destroy_logical_type`.
2502
+ */
2503
+ DUCKDB_API duckdb_logical_type duckdb_union_type_member_type(duckdb_logical_type type, idx_t index);
2504
+
2505
+ /*!
2506
+ Destroys the logical type and de-allocates all memory allocated for that type.
2507
+
2508
+ * @param type The logical type to destroy.
2509
+ */
2510
+ DUCKDB_API void duckdb_destroy_logical_type(duckdb_logical_type *type);
2511
+
2512
+ /*!
2513
+ Registers a custom type within the given connection.
2514
+ The type must have an alias
2515
+
2516
+ * @param con The connection to use
2517
+ * @param type The custom type to register
2518
+ * @return Whether or not the registration was successful.
2519
+ */
2520
+ DUCKDB_API duckdb_state duckdb_register_logical_type(duckdb_connection con, duckdb_logical_type type,
2521
+ duckdb_create_type_info info);
2522
+
2523
+ //===--------------------------------------------------------------------===//
2524
+ // Data Chunk Interface
2525
+ //===--------------------------------------------------------------------===//
2526
+
2527
+ /*!
2528
+ Creates an empty data chunk with the specified column types.
2529
+ The result must be destroyed with `duckdb_destroy_data_chunk`.
2530
+
2531
+ * @param types An array of column types. Column types can not contain ANY and INVALID types.
2532
+ * @param column_count The number of columns.
2533
+ * @return The data chunk.
2534
+ */
2535
+ DUCKDB_API duckdb_data_chunk duckdb_create_data_chunk(duckdb_logical_type *types, idx_t column_count);
2536
+
2537
+ /*!
2538
+ Destroys the data chunk and de-allocates all memory allocated for that chunk.
2539
+
2540
+ * @param chunk The data chunk to destroy.
2541
+ */
2542
+ DUCKDB_API void duckdb_destroy_data_chunk(duckdb_data_chunk *chunk);
2543
+
2544
+ /*!
2545
+ Resets a data chunk, clearing the validity masks and setting the cardinality of the data chunk to 0.
2546
+ After calling this method, you must call `duckdb_vector_get_validity` and `duckdb_vector_get_data` to obtain current
2547
+ data and validity pointers
2548
+
2549
+ * @param chunk The data chunk to reset.
2550
+ */
2551
+ DUCKDB_API void duckdb_data_chunk_reset(duckdb_data_chunk chunk);
2552
+
2553
+ /*!
2554
+ Retrieves the number of columns in a data chunk.
2555
+
2556
+ * @param chunk The data chunk to get the data from
2557
+ * @return The number of columns in the data chunk
2558
+ */
2559
+ DUCKDB_API idx_t duckdb_data_chunk_get_column_count(duckdb_data_chunk chunk);
2560
+
2561
+ /*!
2562
+ Retrieves the vector at the specified column index in the data chunk.
2563
+
2564
+ The pointer to the vector is valid for as long as the chunk is alive.
2565
+ It does NOT need to be destroyed.
2566
+
2567
+ * @param chunk The data chunk to get the data from
2568
+ * @return The vector
2569
+ */
2570
+ DUCKDB_API duckdb_vector duckdb_data_chunk_get_vector(duckdb_data_chunk chunk, idx_t col_idx);
2571
+
2572
+ /*!
2573
+ Retrieves the current number of tuples in a data chunk.
2574
+
2575
+ * @param chunk The data chunk to get the data from
2576
+ * @return The number of tuples in the data chunk
2577
+ */
2578
+ DUCKDB_API idx_t duckdb_data_chunk_get_size(duckdb_data_chunk chunk);
2579
+
2580
+ /*!
2581
+ Sets the current number of tuples in a data chunk.
2582
+
2583
+ * @param chunk The data chunk to set the size in
2584
+ * @param size The number of tuples in the data chunk
2585
+ */
2586
+ DUCKDB_API void duckdb_data_chunk_set_size(duckdb_data_chunk chunk, idx_t size);
2587
+
2588
+ //===--------------------------------------------------------------------===//
2589
+ // Vector Interface
2590
+ //===--------------------------------------------------------------------===//
2591
+
2592
+ /*!
2593
+ Retrieves the column type of the specified vector.
2594
+
2595
+ The result must be destroyed with `duckdb_destroy_logical_type`.
2596
+
2597
+ * @param vector The vector get the data from
2598
+ * @return The type of the vector
2599
+ */
2600
+ DUCKDB_API duckdb_logical_type duckdb_vector_get_column_type(duckdb_vector vector);
2601
+
2602
+ /*!
2603
+ Retrieves the data pointer of the vector.
2604
+
2605
+ The data pointer can be used to read or write values from the vector.
2606
+ How to read or write values depends on the type of the vector.
2607
+
2608
+ * @param vector The vector to get the data from
2609
+ * @return The data pointer
2610
+ */
2611
+ DUCKDB_API void *duckdb_vector_get_data(duckdb_vector vector);
2612
+
2613
+ /*!
2614
+ Retrieves the validity mask pointer of the specified vector.
2615
+
2616
+ If all values are valid, this function MIGHT return NULL!
2617
+
2618
+ The validity mask is a bitset that signifies null-ness within the data chunk.
2619
+ It is a series of uint64_t values, where each uint64_t value contains validity for 64 tuples.
2098
2620
  The bit is set to 1 if the value is valid (i.e. not NULL) or 0 if the value is invalid (i.e. NULL).
2099
2621
 
2100
2622
  Validity of a specific value can be obtained like this:
@@ -2105,8 +2627,8 @@ bool is_valid = validity_mask[entry_idx] & (1 << idx_in_entry);
2105
2627
 
2106
2628
  Alternatively, the (slower) duckdb_validity_row_is_valid function can be used.
2107
2629
 
2108
- * vector: The vector to get the data from
2109
- * returns: The pointer to the validity mask, or NULL if no validity mask is present
2630
+ * @param vector The vector to get the data from
2631
+ * @return The pointer to the validity mask, or NULL if no validity mask is present
2110
2632
  */
2111
2633
  DUCKDB_API uint64_t *duckdb_vector_get_validity(duckdb_vector vector);
2112
2634
 
@@ -2116,26 +2638,26 @@ Ensures the validity mask is writable by allocating it.
2116
2638
  After this function is called, `duckdb_vector_get_validity` will ALWAYS return non-NULL.
2117
2639
  This allows null values to be written to the vector, regardless of whether a validity mask was present before.
2118
2640
 
2119
- * vector: The vector to alter
2641
+ * @param vector The vector to alter
2120
2642
  */
2121
2643
  DUCKDB_API void duckdb_vector_ensure_validity_writable(duckdb_vector vector);
2122
2644
 
2123
2645
  /*!
2124
2646
  Assigns a string element in the vector at the specified location.
2125
2647
 
2126
- * vector: The vector to alter
2127
- * index: The row position in the vector to assign the string to
2128
- * str: The null-terminated string
2648
+ * @param vector The vector to alter
2649
+ * @param index The row position in the vector to assign the string to
2650
+ * @param str The null-terminated string
2129
2651
  */
2130
2652
  DUCKDB_API void duckdb_vector_assign_string_element(duckdb_vector vector, idx_t index, const char *str);
2131
2653
 
2132
2654
  /*!
2133
2655
  Assigns a string element in the vector at the specified location. You may also use this function to assign BLOBs.
2134
2656
 
2135
- * vector: The vector to alter
2136
- * index: The row position in the vector to assign the string to
2137
- * str: The string
2138
- * str_len: The length of the string (in bytes)
2657
+ * @param vector The vector to alter
2658
+ * @param index The row position in the vector to assign the string to
2659
+ * @param str The string
2660
+ * @param str_len The length of the string (in bytes)
2139
2661
  */
2140
2662
  DUCKDB_API void duckdb_vector_assign_string_element_len(duckdb_vector vector, idx_t index, const char *str,
2141
2663
  idx_t str_len);
@@ -2145,34 +2667,37 @@ Retrieves the child vector of a list vector.
2145
2667
 
2146
2668
  The resulting vector is valid as long as the parent vector is valid.
2147
2669
 
2148
- * vector: The vector
2149
- * returns: The child vector
2670
+ * @param vector The vector
2671
+ * @return The child vector
2150
2672
  */
2151
2673
  DUCKDB_API duckdb_vector duckdb_list_vector_get_child(duckdb_vector vector);
2152
2674
 
2153
2675
  /*!
2154
2676
  Returns the size of the child vector of the list.
2155
2677
 
2156
- * vector: The vector
2157
- * returns: The size of the child list
2678
+ * @param vector The vector
2679
+ * @return The size of the child list
2158
2680
  */
2159
2681
  DUCKDB_API idx_t duckdb_list_vector_get_size(duckdb_vector vector);
2160
2682
 
2161
2683
  /*!
2162
2684
  Sets the total size of the underlying child-vector of a list vector.
2163
2685
 
2164
- * vector: The list vector.
2165
- * size: The size of the child list.
2166
- * returns: The duckdb state. Returns DuckDBError if the vector is nullptr.
2686
+ * @param vector The list vector.
2687
+ * @param size The size of the child list.
2688
+ * @return The duckdb state. Returns DuckDBError if the vector is nullptr.
2167
2689
  */
2168
2690
  DUCKDB_API duckdb_state duckdb_list_vector_set_size(duckdb_vector vector, idx_t size);
2169
2691
 
2170
2692
  /*!
2171
2693
  Sets the total capacity of the underlying child-vector of a list.
2172
2694
 
2173
- * vector: The list vector.
2174
- * required_capacity: the total capacity to reserve.
2175
- * return: The duckdb state. Returns DuckDBError if the vector is nullptr.
2695
+ After calling this method, you must call `duckdb_vector_get_validity` and `duckdb_vector_get_data` to obtain current
2696
+ data and validity pointers
2697
+
2698
+ * @param vector The list vector.
2699
+ * @param required_capacity the total capacity to reserve.
2700
+ * @return The duckdb state. Returns DuckDBError if the vector is nullptr.
2176
2701
  */
2177
2702
  DUCKDB_API duckdb_state duckdb_list_vector_reserve(duckdb_vector vector, idx_t required_capacity);
2178
2703
 
@@ -2181,9 +2706,9 @@ Retrieves the child vector of a struct vector.
2181
2706
 
2182
2707
  The resulting vector is valid as long as the parent vector is valid.
2183
2708
 
2184
- * vector: The vector
2185
- * index: The child index
2186
- * returns: The child vector
2709
+ * @param vector The vector
2710
+ * @param index The child index
2711
+ * @return The child vector
2187
2712
  */
2188
2713
  DUCKDB_API duckdb_vector duckdb_struct_vector_get_child(duckdb_vector vector, idx_t index);
2189
2714
 
@@ -2193,8 +2718,8 @@ Retrieves the child vector of a array vector.
2193
2718
  The resulting vector is valid as long as the parent vector is valid.
2194
2719
  The resulting vector has the size of the parent vector multiplied by the array size.
2195
2720
 
2196
- * vector: The vector
2197
- * returns: The child vector
2721
+ * @param vector The vector
2722
+ * @return The child vector
2198
2723
  */
2199
2724
  DUCKDB_API duckdb_vector duckdb_array_vector_get_child(duckdb_vector vector);
2200
2725
 
@@ -2205,9 +2730,9 @@ DUCKDB_API duckdb_vector duckdb_array_vector_get_child(duckdb_vector vector);
2205
2730
  /*!
2206
2731
  Returns whether or not a row is valid (i.e. not NULL) in the given validity mask.
2207
2732
 
2208
- * validity: The validity mask, as obtained through `duckdb_vector_get_validity`
2209
- * row: The row index
2210
- * returns: true if the row is valid, false otherwise
2733
+ * @param validity The validity mask, as obtained through `duckdb_vector_get_validity`
2734
+ * @param row The row index
2735
+ * @return true if the row is valid, false otherwise
2211
2736
  */
2212
2737
  DUCKDB_API bool duckdb_validity_row_is_valid(uint64_t *validity, idx_t row);
2213
2738
 
@@ -2217,9 +2742,9 @@ In a validity mask, sets a specific row to either valid or invalid.
2217
2742
  Note that `duckdb_vector_ensure_validity_writable` should be called before calling `duckdb_vector_get_validity`,
2218
2743
  to ensure that there is a validity mask to write to.
2219
2744
 
2220
- * validity: The validity mask, as obtained through `duckdb_vector_get_validity`.
2221
- * row: The row index
2222
- * valid: Whether or not to set the row to valid, or invalid
2745
+ * @param validity The validity mask, as obtained through `duckdb_vector_get_validity`.
2746
+ * @param row The row index
2747
+ * @param valid Whether or not to set the row to valid, or invalid
2223
2748
  */
2224
2749
  DUCKDB_API void duckdb_validity_set_row_validity(uint64_t *validity, idx_t row, bool valid);
2225
2750
 
@@ -2228,8 +2753,8 @@ In a validity mask, sets a specific row to invalid.
2228
2753
 
2229
2754
  Equivalent to `duckdb_validity_set_row_validity` with valid set to false.
2230
2755
 
2231
- * validity: The validity mask
2232
- * row: The row index
2756
+ * @param validity The validity mask
2757
+ * @param row The row index
2233
2758
  */
2234
2759
  DUCKDB_API void duckdb_validity_set_row_invalid(uint64_t *validity, idx_t row);
2235
2760
 
@@ -2238,12 +2763,326 @@ In a validity mask, sets a specific row to valid.
2238
2763
 
2239
2764
  Equivalent to `duckdb_validity_set_row_validity` with valid set to true.
2240
2765
 
2241
- * validity: The validity mask
2242
- * row: The row index
2766
+ * @param validity The validity mask
2767
+ * @param row The row index
2243
2768
  */
2244
2769
  DUCKDB_API void duckdb_validity_set_row_valid(uint64_t *validity, idx_t row);
2245
2770
 
2246
- #ifndef DUCKDB_NO_EXTENSION_FUNCTIONS
2771
+ //===--------------------------------------------------------------------===//
2772
+ // Scalar Functions
2773
+ //===--------------------------------------------------------------------===//
2774
+
2775
+ /*!
2776
+ Creates a new empty scalar function.
2777
+
2778
+ The return value should be destroyed with `duckdb_destroy_scalar_function`.
2779
+
2780
+ * @return The scalar function object.
2781
+ */
2782
+ DUCKDB_API duckdb_scalar_function duckdb_create_scalar_function();
2783
+
2784
+ /*!
2785
+ Destroys the given scalar function object.
2786
+
2787
+ * @param scalar_function The scalar function to destroy
2788
+ */
2789
+ DUCKDB_API void duckdb_destroy_scalar_function(duckdb_scalar_function *scalar_function);
2790
+
2791
+ /*!
2792
+ Sets the name of the given scalar function.
2793
+
2794
+ * @param scalar_function The scalar function
2795
+ * @param name The name of the scalar function
2796
+ */
2797
+ DUCKDB_API void duckdb_scalar_function_set_name(duckdb_scalar_function scalar_function, const char *name);
2798
+
2799
+ /*!
2800
+ Sets the parameters of the given scalar function to varargs. Does not require adding parameters with
2801
+ duckdb_scalar_function_add_parameter.
2802
+
2803
+ * @param scalar_function The scalar function.
2804
+ * @param type The type of the arguments.
2805
+ * @return The parameter type. Cannot contain INVALID.
2806
+ */
2807
+ DUCKDB_API void duckdb_scalar_function_set_varargs(duckdb_scalar_function scalar_function, duckdb_logical_type type);
2808
+
2809
+ /*!
2810
+ Sets the parameters of the given scalar function to varargs. Does not require adding parameters with
2811
+ duckdb_scalar_function_add_parameter.
2812
+
2813
+ * @param scalar_function The scalar function.
2814
+ */
2815
+ DUCKDB_API void duckdb_scalar_function_set_special_handling(duckdb_scalar_function scalar_function);
2816
+
2817
+ /*!
2818
+ Sets the Function Stability of the scalar function to VOLATILE, indicating the function should be re-run for every row.
2819
+ This limits optimization that can be performed for the function.
2820
+
2821
+ * @param scalar_function The scalar function.
2822
+ */
2823
+ DUCKDB_API void duckdb_scalar_function_set_volatile(duckdb_scalar_function scalar_function);
2824
+
2825
+ /*!
2826
+ Adds a parameter to the scalar function.
2827
+
2828
+ * @param scalar_function The scalar function.
2829
+ * @param type The parameter type. Cannot contain INVALID.
2830
+ */
2831
+ DUCKDB_API void duckdb_scalar_function_add_parameter(duckdb_scalar_function scalar_function, duckdb_logical_type type);
2832
+
2833
+ /*!
2834
+ Sets the return type of the scalar function.
2835
+
2836
+ * @param scalar_function The scalar function
2837
+ * @param type Cannot contain INVALID or ANY.
2838
+ */
2839
+ DUCKDB_API void duckdb_scalar_function_set_return_type(duckdb_scalar_function scalar_function,
2840
+ duckdb_logical_type type);
2841
+
2842
+ /*!
2843
+ Assigns extra information to the scalar function that can be fetched during binding, etc.
2844
+
2845
+ * @param scalar_function The scalar function
2846
+ * @param extra_info The extra information
2847
+ * @param destroy The callback that will be called to destroy the bind data (if any)
2848
+ */
2849
+ DUCKDB_API void duckdb_scalar_function_set_extra_info(duckdb_scalar_function scalar_function, void *extra_info,
2850
+ duckdb_delete_callback_t destroy);
2851
+
2852
+ /*!
2853
+ Sets the main function of the scalar function.
2854
+
2855
+ * @param scalar_function The scalar function
2856
+ * @param function The function
2857
+ */
2858
+ DUCKDB_API void duckdb_scalar_function_set_function(duckdb_scalar_function scalar_function,
2859
+ duckdb_scalar_function_t function);
2860
+
2861
+ /*!
2862
+ Register the scalar function object within the given connection.
2863
+
2864
+ The function requires at least a name, a function and a return type.
2865
+
2866
+ If the function is incomplete or a function with this name already exists DuckDBError is returned.
2867
+
2868
+ * @param con The connection to register it in.
2869
+ * @param scalar_function The function pointer
2870
+ * @return Whether or not the registration was successful.
2871
+ */
2872
+ DUCKDB_API duckdb_state duckdb_register_scalar_function(duckdb_connection con, duckdb_scalar_function scalar_function);
2873
+
2874
+ /*!
2875
+ Retrieves the extra info of the function as set in `duckdb_scalar_function_set_extra_info`.
2876
+
2877
+ * @param info The info object.
2878
+ * @return The extra info.
2879
+ */
2880
+ DUCKDB_API void *duckdb_scalar_function_get_extra_info(duckdb_function_info info);
2881
+
2882
+ /*!
2883
+ Report that an error has occurred while executing the scalar function.
2884
+
2885
+ * @param info The info object.
2886
+ * @param error The error message
2887
+ */
2888
+ DUCKDB_API void duckdb_scalar_function_set_error(duckdb_function_info info, const char *error);
2889
+
2890
+ /*!
2891
+ Creates a new empty scalar function set.
2892
+
2893
+ The return value should be destroyed with `duckdb_destroy_scalar_function_set`.
2894
+
2895
+ * @return The scalar function set object.
2896
+ */
2897
+ DUCKDB_API duckdb_scalar_function_set duckdb_create_scalar_function_set(const char *name);
2898
+
2899
+ /*!
2900
+ Destroys the given scalar function set object.
2901
+
2902
+ */
2903
+ DUCKDB_API void duckdb_destroy_scalar_function_set(duckdb_scalar_function_set *scalar_function_set);
2904
+
2905
+ /*!
2906
+ Adds the scalar function as a new overload to the scalar function set.
2907
+
2908
+ Returns DuckDBError if the function could not be added, for example if the overload already exists.
2909
+
2910
+ * @param set The scalar function set
2911
+ * @param function The function to add
2912
+ */
2913
+ DUCKDB_API duckdb_state duckdb_add_scalar_function_to_set(duckdb_scalar_function_set set,
2914
+ duckdb_scalar_function function);
2915
+
2916
+ /*!
2917
+ Register the scalar function set within the given connection.
2918
+
2919
+ The set requires at least a single valid overload.
2920
+
2921
+ If the set is incomplete or a function with this name already exists DuckDBError is returned.
2922
+
2923
+ * @param con The connection to register it in.
2924
+ * @param set The function set to register
2925
+ * @return Whether or not the registration was successful.
2926
+ */
2927
+ DUCKDB_API duckdb_state duckdb_register_scalar_function_set(duckdb_connection con, duckdb_scalar_function_set set);
2928
+
2929
+ //===--------------------------------------------------------------------===//
2930
+ // Aggregate Functions
2931
+ //===--------------------------------------------------------------------===//
2932
+
2933
+ /*!
2934
+ Creates a new empty aggregate function.
2935
+
2936
+ The return value should be destroyed with `duckdb_destroy_aggregate_function`.
2937
+
2938
+ * @return The aggregate function object.
2939
+ */
2940
+ DUCKDB_API duckdb_aggregate_function duckdb_create_aggregate_function();
2941
+
2942
+ /*!
2943
+ Destroys the given aggregate function object.
2944
+
2945
+ */
2946
+ DUCKDB_API void duckdb_destroy_aggregate_function(duckdb_aggregate_function *aggregate_function);
2947
+
2948
+ /*!
2949
+ Sets the name of the given aggregate function.
2950
+
2951
+ * @param aggregate_function The aggregate function
2952
+ * @param name The name of the aggregate function
2953
+ */
2954
+ DUCKDB_API void duckdb_aggregate_function_set_name(duckdb_aggregate_function aggregate_function, const char *name);
2955
+
2956
+ /*!
2957
+ Adds a parameter to the aggregate function.
2958
+
2959
+ * @param aggregate_function The aggregate function.
2960
+ * @param type The parameter type. Cannot contain INVALID.
2961
+ */
2962
+ DUCKDB_API void duckdb_aggregate_function_add_parameter(duckdb_aggregate_function aggregate_function,
2963
+ duckdb_logical_type type);
2964
+
2965
+ /*!
2966
+ Sets the return type of the aggregate function.
2967
+
2968
+ * @param aggregate_function The aggregate function.
2969
+ * @param type The return type. Cannot contain INVALID or ANY.
2970
+ */
2971
+ DUCKDB_API void duckdb_aggregate_function_set_return_type(duckdb_aggregate_function aggregate_function,
2972
+ duckdb_logical_type type);
2973
+
2974
+ /*!
2975
+ Sets the main functions of the aggregate function.
2976
+
2977
+ * @param aggregate_function The aggregate function
2978
+ * @param state_size state size
2979
+ * @param state_init state init function
2980
+ * @param update update states
2981
+ * @param combine combine states
2982
+ * @param finalize finalize states
2983
+ */
2984
+ DUCKDB_API void duckdb_aggregate_function_set_functions(duckdb_aggregate_function aggregate_function,
2985
+ duckdb_aggregate_state_size state_size,
2986
+ duckdb_aggregate_init_t state_init,
2987
+ duckdb_aggregate_update_t update,
2988
+ duckdb_aggregate_combine_t combine,
2989
+ duckdb_aggregate_finalize_t finalize);
2990
+
2991
+ /*!
2992
+ Sets the state destructor callback of the aggregate function (optional)
2993
+
2994
+ * @param aggregate_function The aggregate function
2995
+ * @param destroy state destroy callback
2996
+ */
2997
+ DUCKDB_API void duckdb_aggregate_function_set_destructor(duckdb_aggregate_function aggregate_function,
2998
+ duckdb_aggregate_destroy_t destroy);
2999
+
3000
+ /*!
3001
+ Register the aggregate function object within the given connection.
3002
+
3003
+ The function requires at least a name, functions and a return type.
3004
+
3005
+ If the function is incomplete or a function with this name already exists DuckDBError is returned.
3006
+
3007
+ * @param con The connection to register it in.
3008
+ * @return Whether or not the registration was successful.
3009
+ */
3010
+ DUCKDB_API duckdb_state duckdb_register_aggregate_function(duckdb_connection con,
3011
+ duckdb_aggregate_function aggregate_function);
3012
+
3013
+ /*!
3014
+ Sets the NULL handling of the aggregate function to SPECIAL_HANDLING.
3015
+
3016
+ * @param aggregate_function The aggregate function
3017
+ */
3018
+ DUCKDB_API void duckdb_aggregate_function_set_special_handling(duckdb_aggregate_function aggregate_function);
3019
+
3020
+ /*!
3021
+ Assigns extra information to the scalar function that can be fetched during binding, etc.
3022
+
3023
+ * @param aggregate_function The aggregate function
3024
+ * @param extra_info The extra information
3025
+ * @param destroy The callback that will be called to destroy the bind data (if any)
3026
+ */
3027
+ DUCKDB_API void duckdb_aggregate_function_set_extra_info(duckdb_aggregate_function aggregate_function, void *extra_info,
3028
+ duckdb_delete_callback_t destroy);
3029
+
3030
+ /*!
3031
+ Retrieves the extra info of the function as set in `duckdb_aggregate_function_set_extra_info`.
3032
+
3033
+ * @param info The info object
3034
+ * @return The extra info
3035
+ */
3036
+ DUCKDB_API void *duckdb_aggregate_function_get_extra_info(duckdb_function_info info);
3037
+
3038
+ /*!
3039
+ Report that an error has occurred while executing the aggregate function.
3040
+
3041
+ * @param info The info object
3042
+ * @param error The error message
3043
+ */
3044
+ DUCKDB_API void duckdb_aggregate_function_set_error(duckdb_function_info info, const char *error);
3045
+
3046
+ /*!
3047
+ Creates a new empty aggregate function set.
3048
+
3049
+ The return value should be destroyed with `duckdb_destroy_aggregate_function_set`.
3050
+
3051
+ * @return The aggregate function set object.
3052
+ */
3053
+ DUCKDB_API duckdb_aggregate_function_set duckdb_create_aggregate_function_set(const char *name);
3054
+
3055
+ /*!
3056
+ Destroys the given aggregate function set object.
3057
+
3058
+ */
3059
+ DUCKDB_API void duckdb_destroy_aggregate_function_set(duckdb_aggregate_function_set *aggregate_function_set);
3060
+
3061
+ /*!
3062
+ Adds the aggregate function as a new overload to the aggregate function set.
3063
+
3064
+ Returns DuckDBError if the function could not be added, for example if the overload already exists.
3065
+
3066
+ * @param set The aggregate function set
3067
+ * @param function The function to add
3068
+ */
3069
+ DUCKDB_API duckdb_state duckdb_add_aggregate_function_to_set(duckdb_aggregate_function_set set,
3070
+ duckdb_aggregate_function function);
3071
+
3072
+ /*!
3073
+ Register the aggregate function set within the given connection.
3074
+
3075
+ The set requires at least a single valid overload.
3076
+
3077
+ If the set is incomplete or a function with this name already exists DuckDBError is returned.
3078
+
3079
+ * @param con The connection to register it in.
3080
+ * @param set The function set to register
3081
+ * @return Whether or not the registration was successful.
3082
+ */
3083
+ DUCKDB_API duckdb_state duckdb_register_aggregate_function_set(duckdb_connection con,
3084
+ duckdb_aggregate_function_set set);
3085
+
2247
3086
  //===--------------------------------------------------------------------===//
2248
3087
  // Table Functions
2249
3088
  //===--------------------------------------------------------------------===//
@@ -2253,39 +3092,39 @@ Creates a new empty table function.
2253
3092
 
2254
3093
  The return value should be destroyed with `duckdb_destroy_table_function`.
2255
3094
 
2256
- * returns: The table function object.
3095
+ * @return The table function object.
2257
3096
  */
2258
3097
  DUCKDB_API duckdb_table_function duckdb_create_table_function();
2259
3098
 
2260
3099
  /*!
2261
3100
  Destroys the given table function object.
2262
3101
 
2263
- * table_function: The table function to destroy
3102
+ * @param table_function The table function to destroy
2264
3103
  */
2265
3104
  DUCKDB_API void duckdb_destroy_table_function(duckdb_table_function *table_function);
2266
3105
 
2267
3106
  /*!
2268
3107
  Sets the name of the given table function.
2269
3108
 
2270
- * table_function: The table function
2271
- * name: The name of the table function
3109
+ * @param table_function The table function
3110
+ * @param name The name of the table function
2272
3111
  */
2273
3112
  DUCKDB_API void duckdb_table_function_set_name(duckdb_table_function table_function, const char *name);
2274
3113
 
2275
3114
  /*!
2276
3115
  Adds a parameter to the table function.
2277
3116
 
2278
- * table_function: The table function
2279
- * type: The type of the parameter to add.
3117
+ * @param table_function The table function.
3118
+ * @param type The parameter type. Cannot contain INVALID.
2280
3119
  */
2281
3120
  DUCKDB_API void duckdb_table_function_add_parameter(duckdb_table_function table_function, duckdb_logical_type type);
2282
3121
 
2283
3122
  /*!
2284
3123
  Adds a named parameter to the table function.
2285
3124
 
2286
- * table_function: The table function
2287
- * name: The name of the parameter
2288
- * type: The type of the parameter to add.
3125
+ * @param table_function The table function.
3126
+ * @param name The parameter name.
3127
+ * @param type The parameter type. Cannot contain INVALID.
2289
3128
  */
2290
3129
  DUCKDB_API void duckdb_table_function_add_named_parameter(duckdb_table_function table_function, const char *name,
2291
3130
  duckdb_logical_type type);
@@ -2293,9 +3132,9 @@ DUCKDB_API void duckdb_table_function_add_named_parameter(duckdb_table_function
2293
3132
  /*!
2294
3133
  Assigns extra information to the table function that can be fetched during binding, etc.
2295
3134
 
2296
- * table_function: The table function
2297
- * extra_info: The extra information
2298
- * destroy: The callback that will be called to destroy the bind data (if any)
3135
+ * @param table_function The table function
3136
+ * @param extra_info The extra information
3137
+ * @param destroy The callback that will be called to destroy the bind data (if any)
2299
3138
  */
2300
3139
  DUCKDB_API void duckdb_table_function_set_extra_info(duckdb_table_function table_function, void *extra_info,
2301
3140
  duckdb_delete_callback_t destroy);
@@ -2303,24 +3142,24 @@ DUCKDB_API void duckdb_table_function_set_extra_info(duckdb_table_function table
2303
3142
  /*!
2304
3143
  Sets the bind function of the table function.
2305
3144
 
2306
- * table_function: The table function
2307
- * bind: The bind function
3145
+ * @param table_function The table function
3146
+ * @param bind The bind function
2308
3147
  */
2309
3148
  DUCKDB_API void duckdb_table_function_set_bind(duckdb_table_function table_function, duckdb_table_function_bind_t bind);
2310
3149
 
2311
3150
  /*!
2312
3151
  Sets the init function of the table function.
2313
3152
 
2314
- * table_function: The table function
2315
- * init: The init function
3153
+ * @param table_function The table function
3154
+ * @param init The init function
2316
3155
  */
2317
3156
  DUCKDB_API void duckdb_table_function_set_init(duckdb_table_function table_function, duckdb_table_function_init_t init);
2318
3157
 
2319
3158
  /*!
2320
3159
  Sets the thread-local init function of the table function.
2321
3160
 
2322
- * table_function: The table function
2323
- * init: The init function
3161
+ * @param table_function The table function
3162
+ * @param init The init function
2324
3163
  */
2325
3164
  DUCKDB_API void duckdb_table_function_set_local_init(duckdb_table_function table_function,
2326
3165
  duckdb_table_function_init_t init);
@@ -2328,8 +3167,8 @@ DUCKDB_API void duckdb_table_function_set_local_init(duckdb_table_function table
2328
3167
  /*!
2329
3168
  Sets the main function of the table function.
2330
3169
 
2331
- * table_function: The table function
2332
- * function: The function
3170
+ * @param table_function The table function
3171
+ * @param function The function
2333
3172
  */
2334
3173
  DUCKDB_API void duckdb_table_function_set_function(duckdb_table_function table_function,
2335
3174
  duckdb_table_function_t function);
@@ -2341,8 +3180,8 @@ If this is set to true, the system will provide a list of all required columns i
2341
3180
  the `duckdb_init_get_column_count` and `duckdb_init_get_column_index` functions.
2342
3181
  If this is set to false (the default), the system will expect all columns to be projected.
2343
3182
 
2344
- * table_function: The table function
2345
- * pushdown: True if the table function supports projection pushdown, false otherwise.
3183
+ * @param table_function The table function
3184
+ * @param pushdown True if the table function supports projection pushdown, false otherwise.
2346
3185
  */
2347
3186
  DUCKDB_API void duckdb_table_function_supports_projection_pushdown(duckdb_table_function table_function, bool pushdown);
2348
3187
 
@@ -2353,9 +3192,9 @@ The function requires at least a name, a bind function, an init function and a m
2353
3192
 
2354
3193
  If the function is incomplete or a function with this name already exists DuckDBError is returned.
2355
3194
 
2356
- * con: The connection to register it in.
2357
- * function: The function pointer
2358
- * returns: Whether or not the registration was successful.
3195
+ * @param con The connection to register it in.
3196
+ * @param function The function pointer
3197
+ * @return Whether or not the registration was successful.
2359
3198
  */
2360
3199
  DUCKDB_API duckdb_state duckdb_register_table_function(duckdb_connection con, duckdb_table_function function);
2361
3200
 
@@ -2366,25 +3205,25 @@ DUCKDB_API duckdb_state duckdb_register_table_function(duckdb_connection con, du
2366
3205
  /*!
2367
3206
  Retrieves the extra info of the function as set in `duckdb_table_function_set_extra_info`.
2368
3207
 
2369
- * info: The info object
2370
- * returns: The extra info
3208
+ * @param info The info object
3209
+ * @return The extra info
2371
3210
  */
2372
3211
  DUCKDB_API void *duckdb_bind_get_extra_info(duckdb_bind_info info);
2373
3212
 
2374
3213
  /*!
2375
3214
  Adds a result column to the output of the table function.
2376
3215
 
2377
- * info: The info object
2378
- * name: The name of the column
2379
- * type: The logical type of the column
3216
+ * @param info The table function's bind info.
3217
+ * @param name The column name.
3218
+ * @param type The logical column type.
2380
3219
  */
2381
3220
  DUCKDB_API void duckdb_bind_add_result_column(duckdb_bind_info info, const char *name, duckdb_logical_type type);
2382
3221
 
2383
3222
  /*!
2384
3223
  Retrieves the number of regular (non-named) parameters to the function.
2385
3224
 
2386
- * info: The info object
2387
- * returns: The number of parameters
3225
+ * @param info The info object
3226
+ * @return The number of parameters
2388
3227
  */
2389
3228
  DUCKDB_API idx_t duckdb_bind_get_parameter_count(duckdb_bind_info info);
2390
3229
 
@@ -2393,9 +3232,9 @@ Retrieves the parameter at the given index.
2393
3232
 
2394
3233
  The result must be destroyed with `duckdb_destroy_value`.
2395
3234
 
2396
- * info: The info object
2397
- * index: The index of the parameter to get
2398
- * returns: The value of the parameter. Must be destroyed with `duckdb_destroy_value`.
3235
+ * @param info The info object
3236
+ * @param index The index of the parameter to get
3237
+ * @return The value of the parameter. Must be destroyed with `duckdb_destroy_value`.
2399
3238
  */
2400
3239
  DUCKDB_API duckdb_value duckdb_bind_get_parameter(duckdb_bind_info info, idx_t index);
2401
3240
 
@@ -2404,34 +3243,34 @@ Retrieves a named parameter with the given name.
2404
3243
 
2405
3244
  The result must be destroyed with `duckdb_destroy_value`.
2406
3245
 
2407
- * info: The info object
2408
- * name: The name of the parameter
2409
- * returns: The value of the parameter. Must be destroyed with `duckdb_destroy_value`.
3246
+ * @param info The info object
3247
+ * @param name The name of the parameter
3248
+ * @return The value of the parameter. Must be destroyed with `duckdb_destroy_value`.
2410
3249
  */
2411
3250
  DUCKDB_API duckdb_value duckdb_bind_get_named_parameter(duckdb_bind_info info, const char *name);
2412
3251
 
2413
3252
  /*!
2414
3253
  Sets the user-provided bind data in the bind object. This object can be retrieved again during execution.
2415
3254
 
2416
- * info: The info object
2417
- * extra_data: The bind data object.
2418
- * destroy: The callback that will be called to destroy the bind data (if any)
3255
+ * @param info The info object
3256
+ * @param bind_data The bind data object.
3257
+ * @param destroy The callback that will be called to destroy the bind data (if any)
2419
3258
  */
2420
3259
  DUCKDB_API void duckdb_bind_set_bind_data(duckdb_bind_info info, void *bind_data, duckdb_delete_callback_t destroy);
2421
3260
 
2422
3261
  /*!
2423
3262
  Sets the cardinality estimate for the table function, used for optimization.
2424
3263
 
2425
- * info: The bind data object.
2426
- * is_exact: Whether or not the cardinality estimate is exact, or an approximation
3264
+ * @param info The bind data object.
3265
+ * @param is_exact Whether or not the cardinality estimate is exact, or an approximation
2427
3266
  */
2428
3267
  DUCKDB_API void duckdb_bind_set_cardinality(duckdb_bind_info info, idx_t cardinality, bool is_exact);
2429
3268
 
2430
3269
  /*!
2431
3270
  Report that an error has occurred while calling bind.
2432
3271
 
2433
- * info: The info object
2434
- * error: The error message
3272
+ * @param info The info object
3273
+ * @param error The error message
2435
3274
  */
2436
3275
  DUCKDB_API void duckdb_bind_set_error(duckdb_bind_info info, const char *error);
2437
3276
 
@@ -2442,8 +3281,8 @@ DUCKDB_API void duckdb_bind_set_error(duckdb_bind_info info, const char *error);
2442
3281
  /*!
2443
3282
  Retrieves the extra info of the function as set in `duckdb_table_function_set_extra_info`.
2444
3283
 
2445
- * info: The info object
2446
- * returns: The extra info
3284
+ * @param info The info object
3285
+ * @return The extra info
2447
3286
  */
2448
3287
  DUCKDB_API void *duckdb_init_get_extra_info(duckdb_init_info info);
2449
3288
 
@@ -2453,17 +3292,17 @@ Gets the bind data set by `duckdb_bind_set_bind_data` during the bind.
2453
3292
  Note that the bind data should be considered as read-only.
2454
3293
  For tracking state, use the init data instead.
2455
3294
 
2456
- * info: The info object
2457
- * returns: The bind data object
3295
+ * @param info The info object
3296
+ * @return The bind data object
2458
3297
  */
2459
3298
  DUCKDB_API void *duckdb_init_get_bind_data(duckdb_init_info info);
2460
3299
 
2461
3300
  /*!
2462
3301
  Sets the user-provided init data in the init object. This object can be retrieved again during execution.
2463
3302
 
2464
- * info: The info object
2465
- * extra_data: The init data object.
2466
- * destroy: The callback that will be called to destroy the init data (if any)
3303
+ * @param info The info object
3304
+ * @param init_data The init data object.
3305
+ * @param destroy The callback that will be called to destroy the init data (if any)
2467
3306
  */
2468
3307
  DUCKDB_API void duckdb_init_set_init_data(duckdb_init_info info, void *init_data, duckdb_delete_callback_t destroy);
2469
3308
 
@@ -2472,8 +3311,8 @@ Returns the number of projected columns.
2472
3311
 
2473
3312
  This function must be used if projection pushdown is enabled to figure out which columns to emit.
2474
3313
 
2475
- * info: The info object
2476
- * returns: The number of projected columns.
3314
+ * @param info The info object
3315
+ * @return The number of projected columns.
2477
3316
  */
2478
3317
  DUCKDB_API idx_t duckdb_init_get_column_count(duckdb_init_info info);
2479
3318
 
@@ -2482,25 +3321,25 @@ Returns the column index of the projected column at the specified position.
2482
3321
 
2483
3322
  This function must be used if projection pushdown is enabled to figure out which columns to emit.
2484
3323
 
2485
- * info: The info object
2486
- * column_index: The index at which to get the projected column index, from 0..duckdb_init_get_column_count(info)
2487
- * returns: The column index of the projected column.
3324
+ * @param info The info object
3325
+ * @param column_index The index at which to get the projected column index, from 0..duckdb_init_get_column_count(info)
3326
+ * @return The column index of the projected column.
2488
3327
  */
2489
3328
  DUCKDB_API idx_t duckdb_init_get_column_index(duckdb_init_info info, idx_t column_index);
2490
3329
 
2491
3330
  /*!
2492
3331
  Sets how many threads can process this table function in parallel (default: 1)
2493
3332
 
2494
- * info: The info object
2495
- * max_threads: The maximum amount of threads that can process this table function
3333
+ * @param info The info object
3334
+ * @param max_threads The maximum amount of threads that can process this table function
2496
3335
  */
2497
3336
  DUCKDB_API void duckdb_init_set_max_threads(duckdb_init_info info, idx_t max_threads);
2498
3337
 
2499
3338
  /*!
2500
3339
  Report that an error has occurred while calling init.
2501
3340
 
2502
- * info: The info object
2503
- * error: The error message
3341
+ * @param info The info object
3342
+ * @param error The error message
2504
3343
  */
2505
3344
  DUCKDB_API void duckdb_init_set_error(duckdb_init_info info, const char *error);
2506
3345
 
@@ -2511,8 +3350,8 @@ DUCKDB_API void duckdb_init_set_error(duckdb_init_info info, const char *error);
2511
3350
  /*!
2512
3351
  Retrieves the extra info of the function as set in `duckdb_table_function_set_extra_info`.
2513
3352
 
2514
- * info: The info object
2515
- * returns: The extra info
3353
+ * @param info The info object
3354
+ * @return The extra info
2516
3355
  */
2517
3356
  DUCKDB_API void *duckdb_function_get_extra_info(duckdb_function_info info);
2518
3357
 
@@ -2522,32 +3361,32 @@ Gets the bind data set by `duckdb_bind_set_bind_data` during the bind.
2522
3361
  Note that the bind data should be considered as read-only.
2523
3362
  For tracking state, use the init data instead.
2524
3363
 
2525
- * info: The info object
2526
- * returns: The bind data object
3364
+ * @param info The info object
3365
+ * @return The bind data object
2527
3366
  */
2528
3367
  DUCKDB_API void *duckdb_function_get_bind_data(duckdb_function_info info);
2529
3368
 
2530
3369
  /*!
2531
3370
  Gets the init data set by `duckdb_init_set_init_data` during the init.
2532
3371
 
2533
- * info: The info object
2534
- * returns: The init data object
3372
+ * @param info The info object
3373
+ * @return The init data object
2535
3374
  */
2536
3375
  DUCKDB_API void *duckdb_function_get_init_data(duckdb_function_info info);
2537
3376
 
2538
3377
  /*!
2539
3378
  Gets the thread-local init data set by `duckdb_init_set_init_data` during the local_init.
2540
3379
 
2541
- * info: The info object
2542
- * returns: The init data object
3380
+ * @param info The info object
3381
+ * @return The init data object
2543
3382
  */
2544
3383
  DUCKDB_API void *duckdb_function_get_local_init_data(duckdb_function_info info);
2545
3384
 
2546
3385
  /*!
2547
3386
  Report that an error has occurred while executing the function.
2548
3387
 
2549
- * info: The info object
2550
- * error: The error message
3388
+ * @param info The info object
3389
+ * @param error The error message
2551
3390
  */
2552
3391
  DUCKDB_API void duckdb_function_set_error(duckdb_function_info info, const char *error);
2553
3392
 
@@ -2558,10 +3397,10 @@ DUCKDB_API void duckdb_function_set_error(duckdb_function_info info, const char
2558
3397
  /*!
2559
3398
  Add a replacement scan definition to the specified database.
2560
3399
 
2561
- * db: The database object to add the replacement scan to
2562
- * replacement: The replacement scan callback
2563
- * extra_data: Extra data that is passed back into the specified callback
2564
- * delete_callback: The delete callback to call on the extra data, if any
3400
+ * @param db The database object to add the replacement scan to
3401
+ * @param replacement The replacement scan callback
3402
+ * @param extra_data Extra data that is passed back into the specified callback
3403
+ * @param delete_callback The delete callback to call on the extra data, if any
2565
3404
  */
2566
3405
  DUCKDB_API void duckdb_add_replacement_scan(duckdb_database db, duckdb_replacement_callback_t replacement,
2567
3406
  void *extra_data, duckdb_delete_callback_t delete_callback);
@@ -2570,27 +3409,75 @@ DUCKDB_API void duckdb_add_replacement_scan(duckdb_database db, duckdb_replaceme
2570
3409
  Sets the replacement function name. If this function is called in the replacement callback,
2571
3410
  the replacement scan is performed. If it is not called, the replacement callback is not performed.
2572
3411
 
2573
- * info: The info object
2574
- * function_name: The function name to substitute.
3412
+ * @param info The info object
3413
+ * @param function_name The function name to substitute.
2575
3414
  */
2576
3415
  DUCKDB_API void duckdb_replacement_scan_set_function_name(duckdb_replacement_scan_info info, const char *function_name);
2577
3416
 
2578
3417
  /*!
2579
3418
  Adds a parameter to the replacement scan function.
2580
3419
 
2581
- * info: The info object
2582
- * parameter: The parameter to add.
3420
+ * @param info The info object
3421
+ * @param parameter The parameter to add.
2583
3422
  */
2584
3423
  DUCKDB_API void duckdb_replacement_scan_add_parameter(duckdb_replacement_scan_info info, duckdb_value parameter);
2585
3424
 
2586
3425
  /*!
2587
3426
  Report that an error has occurred while executing the replacement scan.
2588
3427
 
2589
- * info: The info object
2590
- * error: The error message
3428
+ * @param info The info object
3429
+ * @param error The error message
2591
3430
  */
2592
3431
  DUCKDB_API void duckdb_replacement_scan_set_error(duckdb_replacement_scan_info info, const char *error);
2593
- #endif
3432
+
3433
+ //===--------------------------------------------------------------------===//
3434
+ // Profiling Info
3435
+ //===--------------------------------------------------------------------===//
3436
+
3437
+ /*!
3438
+ Returns the root node of the profiling information. Returns nullptr, if profiling is not enabled.
3439
+
3440
+ * @param connection A connection object.
3441
+ * @return A profiling information object.
3442
+ */
3443
+ DUCKDB_API duckdb_profiling_info duckdb_get_profiling_info(duckdb_connection connection);
3444
+
3445
+ /*!
3446
+ Returns the value of the metric of the current profiling info node. Returns nullptr, if the metric does
3447
+ not exist or is not enabled. Currently, the value holds a string, and you can retrieve the string
3448
+ by calling the corresponding function: char *duckdb_get_varchar(duckdb_value value).
3449
+
3450
+ * @param info A profiling information object.
3451
+ * @param key The name of the requested metric.
3452
+ * @return The value of the metric. Must be freed with `duckdb_destroy_value`
3453
+ */
3454
+ DUCKDB_API duckdb_value duckdb_profiling_info_get_value(duckdb_profiling_info info, const char *key);
3455
+
3456
+ /*!
3457
+ Returns the key-value metric map of this profiling node as a MAP duckdb_value.
3458
+ The individual elements are accessible via the duckdb_value MAP functions.
3459
+
3460
+ * @param info A profiling information object.
3461
+ * @return The key-value metric map as a MAP duckdb_value.
3462
+ */
3463
+ DUCKDB_API duckdb_value duckdb_profiling_info_get_metrics(duckdb_profiling_info info);
3464
+
3465
+ /*!
3466
+ Returns the number of children in the current profiling info node.
3467
+
3468
+ * @param info A profiling information object.
3469
+ * @return The number of children in the current node.
3470
+ */
3471
+ DUCKDB_API idx_t duckdb_profiling_info_get_child_count(duckdb_profiling_info info);
3472
+
3473
+ /*!
3474
+ Returns the child node at the specified index.
3475
+
3476
+ * @param info A profiling information object.
3477
+ * @param index The index of the child node.
3478
+ * @return The child node at the specified index.
3479
+ */
3480
+ DUCKDB_API duckdb_profiling_info duckdb_profiling_info_get_child(duckdb_profiling_info info, idx_t index);
2594
3481
 
2595
3482
  //===--------------------------------------------------------------------===//
2596
3483
  // Appender
@@ -2608,17 +3495,16 @@ DUCKDB_API void duckdb_replacement_scan_set_error(duckdb_replacement_scan_info i
2608
3495
 
2609
3496
  // Note that `duckdb_appender_destroy` should always be called on the resulting appender, even if the function returns
2610
3497
  // `DuckDBError`.
2611
-
2612
3498
  /*!
2613
3499
  Creates an appender object.
2614
3500
 
2615
3501
  Note that the object must be destroyed with `duckdb_appender_destroy`.
2616
3502
 
2617
- * connection: The connection context to create the appender in.
2618
- * schema: The schema of the table to append to, or `nullptr` for the default schema.
2619
- * table: The table name to append to.
2620
- * out_appender: The resulting appender object.
2621
- * returns: `DuckDBSuccess` on success or `DuckDBError` on failure.
3503
+ * @param connection The connection context to create the appender in.
3504
+ * @param schema The schema of the table to append to, or `nullptr` for the default schema.
3505
+ * @param table The table name to append to.
3506
+ * @param out_appender The resulting appender object.
3507
+ * @return `DuckDBSuccess` on success or `DuckDBError` on failure.
2622
3508
  */
2623
3509
  DUCKDB_API duckdb_state duckdb_appender_create(duckdb_connection connection, const char *schema, const char *table,
2624
3510
  duckdb_appender *out_appender);
@@ -2626,8 +3512,8 @@ DUCKDB_API duckdb_state duckdb_appender_create(duckdb_connection connection, con
2626
3512
  /*!
2627
3513
  Returns the number of columns in the table that belongs to the appender.
2628
3514
 
2629
- * appender The appender to get the column count from.
2630
- * returns: The number of columns in the table.
3515
+ * @param appender The appender to get the column count from.
3516
+ * @return The number of columns in the table.
2631
3517
  */
2632
3518
  DUCKDB_API idx_t duckdb_appender_column_count(duckdb_appender appender);
2633
3519
 
@@ -2636,9 +3522,9 @@ Returns the type of the column at the specified index.
2636
3522
 
2637
3523
  Note: The resulting type should be destroyed with `duckdb_destroy_logical_type`.
2638
3524
 
2639
- * appender The appender to get the column type from.
2640
- * col_idx The index of the column to get the type of.
2641
- * returns: The duckdb_logical_type of the column.
3525
+ * @param appender The appender to get the column type from.
3526
+ * @param col_idx The index of the column to get the type of.
3527
+ * @return The duckdb_logical_type of the column.
2642
3528
  */
2643
3529
  DUCKDB_API duckdb_logical_type duckdb_appender_column_type(duckdb_appender appender, idx_t col_idx);
2644
3530
 
@@ -2648,8 +3534,8 @@ If the appender has no error message, this returns `nullptr` instead.
2648
3534
 
2649
3535
  The error message should not be freed. It will be de-allocated when `duckdb_appender_destroy` is called.
2650
3536
 
2651
- * appender: The appender to get the error from.
2652
- * returns: The error message, or `nullptr` if there is none.
3537
+ * @param appender The appender to get the error from.
3538
+ * @return The error message, or `nullptr` if there is none.
2653
3539
  */
2654
3540
  DUCKDB_API const char *duckdb_appender_error(duckdb_appender appender);
2655
3541
 
@@ -2659,8 +3545,8 @@ constraint violation or any other error, then all data is invalidated, and this
2659
3545
  It is not possible to append more values. Call duckdb_appender_error to obtain the error message followed by
2660
3546
  duckdb_appender_destroy to destroy the invalidated appender.
2661
3547
 
2662
- * appender: The appender to flush.
2663
- * returns: `DuckDBSuccess` on success or `DuckDBError` on failure.
3548
+ * @param appender The appender to flush.
3549
+ * @return `DuckDBSuccess` on success or `DuckDBError` on failure.
2664
3550
  */
2665
3551
  DUCKDB_API duckdb_state duckdb_appender_flush(duckdb_appender appender);
2666
3552
 
@@ -2670,8 +3556,8 @@ triggers a constraint violation or any other error, then all data is invalidated
2670
3556
  Call duckdb_appender_error to obtain the error message followed by duckdb_appender_destroy to destroy the invalidated
2671
3557
  appender.
2672
3558
 
2673
- * appender: The appender to flush and close.
2674
- * returns: `DuckDBSuccess` on success or `DuckDBError` on failure.
3559
+ * @param appender The appender to flush and close.
3560
+ * @return `DuckDBSuccess` on success or `DuckDBError` on failure.
2675
3561
  */
2676
3562
  DUCKDB_API duckdb_state duckdb_appender_close(duckdb_appender appender);
2677
3563
 
@@ -2682,8 +3568,8 @@ then all data is invalidated, and this function returns DuckDBError. Due to the
2682
3568
  longer possible to obtain the specific error message with duckdb_appender_error. Therefore, call duckdb_appender_close
2683
3569
  before destroying the appender, if you need insights into the specific error.
2684
3570
 
2685
- * appender: The appender to flush, close and destroy.
2686
- * returns: `DuckDBSuccess` on success or `DuckDBError` on failure.
3571
+ * @param appender The appender to flush, close and destroy.
3572
+ * @return `DuckDBSuccess` on success or `DuckDBError` on failure.
2687
3573
  */
2688
3574
  DUCKDB_API duckdb_state duckdb_appender_destroy(duckdb_appender *appender);
2689
3575
 
@@ -2695,11 +3581,16 @@ DUCKDB_API duckdb_state duckdb_appender_begin_row(duckdb_appender appender);
2695
3581
  /*!
2696
3582
  Finish the current row of appends. After end_row is called, the next row can be appended.
2697
3583
 
2698
- * appender: The appender.
2699
- * returns: `DuckDBSuccess` on success or `DuckDBError` on failure.
3584
+ * @param appender The appender.
3585
+ * @return `DuckDBSuccess` on success or `DuckDBError` on failure.
2700
3586
  */
2701
3587
  DUCKDB_API duckdb_state duckdb_appender_end_row(duckdb_appender appender);
2702
3588
 
3589
+ /*!
3590
+ Append a DEFAULT value (NULL if DEFAULT not available for column) to the appender.
3591
+ */
3592
+ DUCKDB_API duckdb_state duckdb_append_default(duckdb_appender appender);
3593
+
2703
3594
  /*!
2704
3595
  Append a bool value to the appender.
2705
3596
  */
@@ -2812,17 +3703,61 @@ The types of the data chunk must exactly match the types of the table, no castin
2812
3703
  If the types do not match or the appender is in an invalid state, DuckDBError is returned.
2813
3704
  If the append is successful, DuckDBSuccess is returned.
2814
3705
 
2815
- * appender: The appender to append to.
2816
- * chunk: The data chunk to append.
2817
- * returns: The return state.
3706
+ * @param appender The appender to append to.
3707
+ * @param chunk The data chunk to append.
3708
+ * @return The return state.
2818
3709
  */
2819
3710
  DUCKDB_API duckdb_state duckdb_append_data_chunk(duckdb_appender appender, duckdb_data_chunk chunk);
2820
3711
 
2821
- #ifndef DUCKDB_API_NO_DEPRECATED
3712
+ //===--------------------------------------------------------------------===//
3713
+ // Table Description
3714
+ //===--------------------------------------------------------------------===//
3715
+
3716
+ /*!
3717
+ Creates a table description object. Note that `duckdb_table_description_destroy` should always be called on the
3718
+ resulting table_description, even if the function returns `DuckDBError`.
3719
+
3720
+ * @param connection The connection context.
3721
+ * @param schema The schema of the table, or `nullptr` for the default schema.
3722
+ * @param table The table name.
3723
+ * @param out The resulting table description object.
3724
+ * @return `DuckDBSuccess` on success or `DuckDBError` on failure.
3725
+ */
3726
+ DUCKDB_API duckdb_state duckdb_table_description_create(duckdb_connection connection, const char *schema,
3727
+ const char *table, duckdb_table_description *out);
3728
+
3729
+ /*!
3730
+ Destroy the TableDescription object.
3731
+
3732
+ * @param table_description The table_description to destroy.
3733
+ */
3734
+ DUCKDB_API void duckdb_table_description_destroy(duckdb_table_description *table_description);
3735
+
3736
+ /*!
3737
+ Returns the error message associated with the given table_description.
3738
+ If the table_description has no error message, this returns `nullptr` instead.
3739
+ The error message should not be freed. It will be de-allocated when `duckdb_table_description_destroy` is called.
3740
+
3741
+ * @param table_description The table_description to get the error from.
3742
+ * @return The error message, or `nullptr` if there is none.
3743
+ */
3744
+ DUCKDB_API const char *duckdb_table_description_error(duckdb_table_description table_description);
3745
+
3746
+ /*!
3747
+ Check if the column at 'index' index of the table has a DEFAULT expression.
3748
+
3749
+ * @param table_description The table_description to query.
3750
+ * @param index The index of the column to query.
3751
+ * @param out The out-parameter used to store the result.
3752
+ * @return `DuckDBSuccess` on success or `DuckDBError` on failure.
3753
+ */
3754
+ DUCKDB_API duckdb_state duckdb_column_has_default(duckdb_table_description table_description, idx_t index, bool *out);
3755
+
2822
3756
  //===--------------------------------------------------------------------===//
2823
3757
  // Arrow Interface
2824
3758
  //===--------------------------------------------------------------------===//
2825
3759
 
3760
+ #ifndef DUCKDB_API_NO_DEPRECATED
2826
3761
  /*!
2827
3762
  **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
2828
3763
 
@@ -2833,10 +3768,10 @@ If the query fails to execute, DuckDBError is returned and the error message can
2833
3768
  Note that after running `duckdb_query_arrow`, `duckdb_destroy_arrow` must be called on the result object even if the
2834
3769
  query fails, otherwise the error stored within the result will not be freed correctly.
2835
3770
 
2836
- * connection: The connection to perform the query in.
2837
- * query: The SQL query to run.
2838
- * out_result: The query result.
2839
- * returns: `DuckDBSuccess` on success or `DuckDBError` on failure.
3771
+ * @param connection The connection to perform the query in.
3772
+ * @param query The SQL query to run.
3773
+ * @param out_result The query result.
3774
+ * @return `DuckDBSuccess` on success or `DuckDBError` on failure.
2840
3775
  */
2841
3776
  DUCKDB_API duckdb_state duckdb_query_arrow(duckdb_connection connection, const char *query, duckdb_arrow *out_result);
2842
3777
 
@@ -2846,9 +3781,9 @@ DUCKDB_API duckdb_state duckdb_query_arrow(duckdb_connection connection, const c
2846
3781
  Fetch the internal arrow schema from the arrow result. Remember to call release on the respective
2847
3782
  ArrowSchema object.
2848
3783
 
2849
- * result: The result to fetch the schema from.
2850
- * out_schema: The output schema.
2851
- * returns: `DuckDBSuccess` on success or `DuckDBError` on failure.
3784
+ * @param result The result to fetch the schema from.
3785
+ * @param out_schema The output schema.
3786
+ * @return `DuckDBSuccess` on success or `DuckDBError` on failure.
2852
3787
  */
2853
3788
  DUCKDB_API duckdb_state duckdb_query_arrow_schema(duckdb_arrow result, duckdb_arrow_schema *out_schema);
2854
3789
 
@@ -2858,21 +3793,22 @@ DUCKDB_API duckdb_state duckdb_query_arrow_schema(duckdb_arrow result, duckdb_ar
2858
3793
  Fetch the internal arrow schema from the prepared statement. Remember to call release on the respective
2859
3794
  ArrowSchema object.
2860
3795
 
2861
- * result: The prepared statement to fetch the schema from.
2862
- * out_schema: The output schema.
2863
- * returns: `DuckDBSuccess` on success or `DuckDBError` on failure.
3796
+ * @param prepared The prepared statement to fetch the schema from.
3797
+ * @param out_schema The output schema.
3798
+ * @return `DuckDBSuccess` on success or `DuckDBError` on failure.
2864
3799
  */
2865
3800
  DUCKDB_API duckdb_state duckdb_prepared_arrow_schema(duckdb_prepared_statement prepared,
2866
3801
  duckdb_arrow_schema *out_schema);
3802
+
2867
3803
  /*!
2868
3804
  **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
2869
3805
 
2870
3806
  Convert a data chunk into an arrow struct array. Remember to call release on the respective
2871
3807
  ArrowArray object.
2872
3808
 
2873
- * result: The result object the data chunk have been fetched from.
2874
- * chunk: The data chunk to convert.
2875
- * out_array: The output array.
3809
+ * @param result The result object the data chunk have been fetched from.
3810
+ * @param chunk The data chunk to convert.
3811
+ * @param out_array The output array.
2876
3812
  */
2877
3813
  DUCKDB_API void duckdb_result_arrow_array(duckdb_result result, duckdb_data_chunk chunk, duckdb_arrow_array *out_array);
2878
3814
 
@@ -2885,9 +3821,9 @@ ArrowArray object.
2885
3821
  This function can be called multiple time to get next chunks, which will free the previous out_array.
2886
3822
  So consume the out_array before calling this function again.
2887
3823
 
2888
- * result: The result to fetch the array from.
2889
- * out_array: The output array.
2890
- * returns: `DuckDBSuccess` on success or `DuckDBError` on failure.
3824
+ * @param result The result to fetch the array from.
3825
+ * @param out_array The output array.
3826
+ * @return `DuckDBSuccess` on success or `DuckDBError` on failure.
2891
3827
  */
2892
3828
  DUCKDB_API duckdb_state duckdb_query_arrow_array(duckdb_arrow result, duckdb_arrow_array *out_array);
2893
3829
 
@@ -2896,8 +3832,8 @@ DUCKDB_API duckdb_state duckdb_query_arrow_array(duckdb_arrow result, duckdb_arr
2896
3832
 
2897
3833
  Returns the number of columns present in the arrow result object.
2898
3834
 
2899
- * result: The result object.
2900
- * returns: The number of columns present in the result object.
3835
+ * @param result The result object.
3836
+ * @return The number of columns present in the result object.
2901
3837
  */
2902
3838
  DUCKDB_API idx_t duckdb_arrow_column_count(duckdb_arrow result);
2903
3839
 
@@ -2906,8 +3842,8 @@ DUCKDB_API idx_t duckdb_arrow_column_count(duckdb_arrow result);
2906
3842
 
2907
3843
  Returns the number of rows present in the arrow result object.
2908
3844
 
2909
- * result: The result object.
2910
- * returns: The number of rows present in the result object.
3845
+ * @param result The result object.
3846
+ * @return The number of rows present in the result object.
2911
3847
  */
2912
3848
  DUCKDB_API idx_t duckdb_arrow_row_count(duckdb_arrow result);
2913
3849
 
@@ -2917,8 +3853,8 @@ DUCKDB_API idx_t duckdb_arrow_row_count(duckdb_arrow result);
2917
3853
  Returns the number of rows changed by the query stored in the arrow result. This is relevant only for
2918
3854
  INSERT/UPDATE/DELETE queries. For other queries the rows_changed will be 0.
2919
3855
 
2920
- * result: The result object.
2921
- * returns: The number of rows changed.
3856
+ * @param result The result object.
3857
+ * @return The number of rows changed.
2922
3858
  */
2923
3859
  DUCKDB_API idx_t duckdb_arrow_rows_changed(duckdb_arrow result);
2924
3860
 
@@ -2930,8 +3866,8 @@ DUCKDB_API idx_t duckdb_arrow_rows_changed(duckdb_arrow result);
2930
3866
 
2931
3867
  The error message should not be freed. It will be de-allocated when `duckdb_destroy_arrow` is called.
2932
3868
 
2933
- * result: The result object to fetch the error from.
2934
- * returns: The error of the result.
3869
+ * @param result The result object to fetch the error from.
3870
+ * @return The error of the result.
2935
3871
  */
2936
3872
  DUCKDB_API const char *duckdb_query_arrow_error(duckdb_arrow result);
2937
3873
 
@@ -2940,7 +3876,7 @@ DUCKDB_API const char *duckdb_query_arrow_error(duckdb_arrow result);
2940
3876
 
2941
3877
  Closes the result and de-allocates all memory allocated for the arrow result.
2942
3878
 
2943
- * result: The result to destroy.
3879
+ * @param result The result to destroy.
2944
3880
  */
2945
3881
  DUCKDB_API void duckdb_destroy_arrow(duckdb_arrow *result);
2946
3882
 
@@ -2949,7 +3885,7 @@ DUCKDB_API void duckdb_destroy_arrow(duckdb_arrow *result);
2949
3885
 
2950
3886
  Releases the arrow array stream and de-allocates its memory.
2951
3887
 
2952
- * stream: The arrow array stream to destroy.
3888
+ * @param stream_p The arrow array stream to destroy.
2953
3889
  */
2954
3890
  DUCKDB_API void duckdb_destroy_arrow_stream(duckdb_arrow_stream *stream_p);
2955
3891
 
@@ -2959,9 +3895,9 @@ DUCKDB_API void duckdb_destroy_arrow_stream(duckdb_arrow_stream *stream_p);
2959
3895
  Executes the prepared statement with the given bound parameters, and returns an arrow query result.
2960
3896
  Note that after running `duckdb_execute_prepared_arrow`, `duckdb_destroy_arrow` must be called on the result object.
2961
3897
 
2962
- * prepared_statement: The prepared statement to execute.
2963
- * out_result: The query result.
2964
- * returns: `DuckDBSuccess` on success or `DuckDBError` on failure.
3898
+ * @param prepared_statement The prepared statement to execute.
3899
+ * @param out_result The query result.
3900
+ * @return `DuckDBSuccess` on success or `DuckDBError` on failure.
2965
3901
  */
2966
3902
  DUCKDB_API duckdb_state duckdb_execute_prepared_arrow(duckdb_prepared_statement prepared_statement,
2967
3903
  duckdb_arrow *out_result);
@@ -2971,10 +3907,10 @@ DUCKDB_API duckdb_state duckdb_execute_prepared_arrow(duckdb_prepared_statement
2971
3907
 
2972
3908
  Scans the Arrow stream and creates a view with the given name.
2973
3909
 
2974
- * connection: The connection on which to execute the scan.
2975
- * table_name: Name of the temporary view to create.
2976
- * arrow: Arrow stream wrapper.
2977
- * returns: `DuckDBSuccess` on success or `DuckDBError` on failure.
3910
+ * @param connection The connection on which to execute the scan.
3911
+ * @param table_name Name of the temporary view to create.
3912
+ * @param arrow Arrow stream wrapper.
3913
+ * @return `DuckDBSuccess` on success or `DuckDBError` on failure.
2978
3914
  */
2979
3915
  DUCKDB_API duckdb_state duckdb_arrow_scan(duckdb_connection connection, const char *table_name,
2980
3916
  duckdb_arrow_stream arrow);
@@ -2985,19 +3921,18 @@ DUCKDB_API duckdb_state duckdb_arrow_scan(duckdb_connection connection, const ch
2985
3921
  Scans the Arrow array and creates a view with the given name.
2986
3922
  Note that after running `duckdb_arrow_array_scan`, `duckdb_destroy_arrow_stream` must be called on the out stream.
2987
3923
 
2988
- * connection: The connection on which to execute the scan.
2989
- * table_name: Name of the temporary view to create.
2990
- * arrow_schema: Arrow schema wrapper.
2991
- * arrow_array: Arrow array wrapper.
2992
- * out_stream: Output array stream that wraps around the passed schema, for releasing/deleting once done.
2993
- * returns: `DuckDBSuccess` on success or `DuckDBError` on failure.
3924
+ * @param connection The connection on which to execute the scan.
3925
+ * @param table_name Name of the temporary view to create.
3926
+ * @param arrow_schema Arrow schema wrapper.
3927
+ * @param arrow_array Arrow array wrapper.
3928
+ * @param out_stream Output array stream that wraps around the passed schema, for releasing/deleting once done.
3929
+ * @return `DuckDBSuccess` on success or `DuckDBError` on failure.
2994
3930
  */
2995
3931
  DUCKDB_API duckdb_state duckdb_arrow_array_scan(duckdb_connection connection, const char *table_name,
2996
3932
  duckdb_arrow_schema arrow_schema, duckdb_arrow_array arrow_array,
2997
3933
  duckdb_arrow_stream *out_stream);
2998
- #endif
2999
3934
 
3000
- #ifndef DUCKDB_NO_EXTENSION_FUNCTIONS
3935
+ #endif
3001
3936
  //===--------------------------------------------------------------------===//
3002
3937
  // Threading Information
3003
3938
  //===--------------------------------------------------------------------===//
@@ -3007,8 +3942,8 @@ Execute DuckDB tasks on this thread.
3007
3942
 
3008
3943
  Will return after `max_tasks` have been executed, or if there are no more tasks present.
3009
3944
 
3010
- * database: The database object to execute tasks for
3011
- * max_tasks: The maximum amount of tasks to execute
3945
+ * @param database The database object to execute tasks for
3946
+ * @param max_tasks The maximum amount of tasks to execute
3012
3947
  */
3013
3948
  DUCKDB_API void duckdb_execute_tasks(duckdb_database database, idx_t max_tasks);
3014
3949
 
@@ -3018,8 +3953,8 @@ Creates a task state that can be used with duckdb_execute_tasks_state to execute
3018
3953
 
3019
3954
  `duckdb_destroy_state` must be called on the result.
3020
3955
 
3021
- * database: The database object to create the task state for
3022
- * returns: The task state that can be used with duckdb_execute_tasks_state.
3956
+ * @param database The database object to create the task state for
3957
+ * @return The task state that can be used with duckdb_execute_tasks_state.
3023
3958
  */
3024
3959
  DUCKDB_API duckdb_task_state duckdb_create_task_state(duckdb_database database);
3025
3960
 
@@ -3029,7 +3964,7 @@ Execute DuckDB tasks on this thread.
3029
3964
  The thread will keep on executing tasks forever, until duckdb_finish_execution is called on the state.
3030
3965
  Multiple threads can share the same duckdb_task_state.
3031
3966
 
3032
- * state: The task state of the executor
3967
+ * @param state The task state of the executor
3033
3968
  */
3034
3969
  DUCKDB_API void duckdb_execute_tasks_state(duckdb_task_state state);
3035
3970
 
@@ -3041,24 +3976,24 @@ max_tasks tasks have been executed or there are no more tasks to be executed.
3041
3976
 
3042
3977
  Multiple threads can share the same duckdb_task_state.
3043
3978
 
3044
- * state: The task state of the executor
3045
- * max_tasks: The maximum amount of tasks to execute
3046
- * returns: The amount of tasks that have actually been executed
3979
+ * @param state The task state of the executor
3980
+ * @param max_tasks The maximum amount of tasks to execute
3981
+ * @return The amount of tasks that have actually been executed
3047
3982
  */
3048
3983
  DUCKDB_API idx_t duckdb_execute_n_tasks_state(duckdb_task_state state, idx_t max_tasks);
3049
3984
 
3050
3985
  /*!
3051
3986
  Finish execution on a specific task.
3052
3987
 
3053
- * state: The task state to finish execution
3988
+ * @param state The task state to finish execution
3054
3989
  */
3055
3990
  DUCKDB_API void duckdb_finish_execution(duckdb_task_state state);
3056
3991
 
3057
3992
  /*!
3058
3993
  Check if the provided duckdb_task_state has finished execution
3059
3994
 
3060
- * state: The task state to inspect
3061
- * returns: Whether or not duckdb_finish_execution has been called on the task state
3995
+ * @param state The task state to inspect
3996
+ * @return Whether or not duckdb_finish_execution has been called on the task state
3062
3997
  */
3063
3998
  DUCKDB_API bool duckdb_task_state_is_finished(duckdb_task_state state);
3064
3999
 
@@ -3068,21 +4003,21 @@ Destroys the task state returned from duckdb_create_task_state.
3068
4003
  Note that this should not be called while there is an active duckdb_execute_tasks_state running
3069
4004
  on the task state.
3070
4005
 
3071
- * state: The task state to clean up
4006
+ * @param state The task state to clean up
3072
4007
  */
3073
4008
  DUCKDB_API void duckdb_destroy_task_state(duckdb_task_state state);
3074
4009
 
3075
4010
  /*!
3076
4011
  Returns true if the execution of the current query is finished.
3077
4012
 
3078
- * con: The connection on which to check
4013
+ * @param con The connection on which to check
3079
4014
  */
3080
4015
  DUCKDB_API bool duckdb_execution_is_finished(duckdb_connection con);
3081
- #endif
3082
4016
 
3083
4017
  //===--------------------------------------------------------------------===//
3084
4018
  // Streaming Result Interface
3085
4019
  //===--------------------------------------------------------------------===//
4020
+
3086
4021
  #ifndef DUCKDB_API_NO_DEPRECATED
3087
4022
  /*!
3088
4023
  **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
@@ -3099,8 +4034,8 @@ mixed with the legacy result functions or the materialized result functions).
3099
4034
 
3100
4035
  It is not known beforehand how many chunks will be returned by this result.
3101
4036
 
3102
- * result: The result object to fetch the data chunk from.
3103
- * returns: The resulting data chunk. Returns `NULL` if the result has an error.
4037
+ * @param result The result object to fetch the data chunk from.
4038
+ * @return The resulting data chunk. Returns `NULL` if the result has an error.
3104
4039
  */
3105
4040
  DUCKDB_API duckdb_data_chunk duckdb_stream_fetch_chunk(duckdb_result result);
3106
4041
  #endif
@@ -3112,11 +4047,116 @@ The result must be destroyed with `duckdb_destroy_data_chunk`.
3112
4047
 
3113
4048
  It is not known beforehand how many chunks will be returned by this result.
3114
4049
 
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.
4050
+ * @param result The result object to fetch the data chunk from.
4051
+ * @return The resulting data chunk. Returns `NULL` if the result has an error.
3117
4052
  */
3118
4053
  DUCKDB_API duckdb_data_chunk duckdb_fetch_chunk(duckdb_result result);
3119
4054
 
4055
+ //===--------------------------------------------------------------------===//
4056
+ // Cast Functions
4057
+ //===--------------------------------------------------------------------===//
4058
+
4059
+ /*!
4060
+ Creates a new cast function object.
4061
+
4062
+ * @return The cast function object.
4063
+ */
4064
+ DUCKDB_API duckdb_cast_function duckdb_create_cast_function();
4065
+
4066
+ /*!
4067
+ Sets the source type of the cast function.
4068
+
4069
+ * @param cast_function The cast function object.
4070
+ * @param source_type The source type to set.
4071
+ */
4072
+ DUCKDB_API void duckdb_cast_function_set_source_type(duckdb_cast_function cast_function,
4073
+ duckdb_logical_type source_type);
4074
+
4075
+ /*!
4076
+ Sets the target type of the cast function.
4077
+
4078
+ * @param cast_function The cast function object.
4079
+ * @param target_type The target type to set.
4080
+ */
4081
+ DUCKDB_API void duckdb_cast_function_set_target_type(duckdb_cast_function cast_function,
4082
+ duckdb_logical_type target_type);
4083
+
4084
+ /*!
4085
+ Sets the "cost" of implicitly casting the source type to the target type using this function.
4086
+
4087
+ * @param cast_function The cast function object.
4088
+ * @param cost The cost to set.
4089
+ */
4090
+ DUCKDB_API void duckdb_cast_function_set_implicit_cast_cost(duckdb_cast_function cast_function, int64_t cost);
4091
+
4092
+ /*!
4093
+ Sets the actual cast function to use.
4094
+
4095
+ * @param cast_function The cast function object.
4096
+ * @param function The function to set.
4097
+ */
4098
+ DUCKDB_API void duckdb_cast_function_set_function(duckdb_cast_function cast_function, duckdb_cast_function_t function);
4099
+
4100
+ /*!
4101
+ Assigns extra information to the cast function that can be fetched during execution, etc.
4102
+
4103
+ * @param extra_info The extra information
4104
+ * @param destroy The callback that will be called to destroy the extra information (if any)
4105
+ */
4106
+ DUCKDB_API void duckdb_cast_function_set_extra_info(duckdb_cast_function cast_function, void *extra_info,
4107
+ duckdb_delete_callback_t destroy);
4108
+
4109
+ /*!
4110
+ Retrieves the extra info of the function as set in `duckdb_cast_function_set_extra_info`.
4111
+
4112
+ * @param info The info object.
4113
+ * @return The extra info.
4114
+ */
4115
+ DUCKDB_API void *duckdb_cast_function_get_extra_info(duckdb_function_info info);
4116
+
4117
+ /*!
4118
+ Get the cast execution mode from the given function info.
4119
+
4120
+ * @param info The info object.
4121
+ * @return The cast mode.
4122
+ */
4123
+ DUCKDB_API duckdb_cast_mode duckdb_cast_function_get_cast_mode(duckdb_function_info info);
4124
+
4125
+ /*!
4126
+ Report that an error has occurred while executing the cast function.
4127
+
4128
+ * @param info The info object.
4129
+ * @param error The error message.
4130
+ */
4131
+ DUCKDB_API void duckdb_cast_function_set_error(duckdb_function_info info, const char *error);
4132
+
4133
+ /*!
4134
+ Report that an error has occurred while executing the cast function, setting the corresponding output row to NULL.
4135
+
4136
+ * @param info The info object.
4137
+ * @param error The error message.
4138
+ * @param row The index of the row within the output vector to set to NULL.
4139
+ * @param output The output vector.
4140
+ */
4141
+ DUCKDB_API void duckdb_cast_function_set_row_error(duckdb_function_info info, const char *error, idx_t row,
4142
+ duckdb_vector output);
4143
+
4144
+ /*!
4145
+ Registers a cast function within the given connection.
4146
+
4147
+ * @param con The connection to use.
4148
+ * @param cast_function The cast function to register.
4149
+ * @return Whether or not the registration was successful.
4150
+ */
4151
+ DUCKDB_API duckdb_state duckdb_register_cast_function(duckdb_connection con, duckdb_cast_function cast_function);
4152
+
4153
+ /*!
4154
+ Destroys the cast function object.
4155
+
4156
+ * @param cast_function The cast function object.
4157
+ */
4158
+ DUCKDB_API void duckdb_destroy_cast_function(duckdb_cast_function *cast_function);
4159
+
3120
4160
  #ifdef __cplusplus
3121
4161
  }
3122
4162
  #endif