duckdb 0.7.2-dev314.0 → 0.7.2-dev3154.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 (1793) hide show
  1. package/binding.gyp +36 -19
  2. package/lib/duckdb.d.ts +55 -2
  3. package/lib/duckdb.js +20 -1
  4. package/package.json +2 -2
  5. package/src/connection.cpp +14 -15
  6. package/src/data_chunk.cpp +14 -2
  7. package/src/database.cpp +15 -16
  8. package/src/duckdb/extension/icu/icu-dateadd.cpp +5 -5
  9. package/src/duckdb/extension/icu/icu-datefunc.cpp +23 -11
  10. package/src/duckdb/extension/icu/icu-datepart.cpp +76 -22
  11. package/src/duckdb/extension/icu/icu-datesub.cpp +4 -4
  12. package/src/duckdb/extension/icu/icu-datetrunc.cpp +2 -2
  13. package/src/duckdb/extension/icu/icu-extension.cpp +37 -34
  14. package/src/duckdb/extension/icu/icu-list-range.cpp +207 -0
  15. package/src/duckdb/extension/icu/icu-makedate.cpp +54 -2
  16. package/src/duckdb/extension/icu/icu-strptime.cpp +138 -50
  17. package/src/duckdb/extension/icu/icu-table-range.cpp +12 -12
  18. package/src/duckdb/extension/icu/icu-timebucket.cpp +7 -7
  19. package/src/duckdb/extension/icu/icu-timezone.cpp +23 -22
  20. package/src/duckdb/extension/icu/include/icu-datefunc.hpp +10 -8
  21. package/src/duckdb/extension/icu/include/icu-list-range.hpp +17 -0
  22. package/src/duckdb/extension/icu/third_party/icu/common/unicode/localpointer.h +22 -22
  23. package/src/duckdb/extension/icu/third_party/icu/i18n/calendar.cpp +4 -0
  24. package/src/duckdb/extension/icu/third_party/icu/i18n/dangical.cpp +28 -28
  25. package/src/duckdb/extension/icu/third_party/icu/i18n/dangical.h +4 -4
  26. package/src/duckdb/extension/icu/third_party/icu/i18n/unicode/numberformatter.h +1 -1
  27. package/src/duckdb/extension/icu/third_party/icu/stubdata/stubdata.cpp +1 -1
  28. package/src/duckdb/extension/json/buffered_json_reader.cpp +3 -3
  29. package/src/duckdb/extension/json/include/buffered_json_reader.hpp +5 -5
  30. package/src/duckdb/extension/json/include/json_common.hpp +2 -1
  31. package/src/duckdb/extension/json/include/json_deserializer.hpp +93 -0
  32. package/src/duckdb/extension/json/include/json_executors.hpp +2 -2
  33. package/src/duckdb/extension/json/include/json_functions.hpp +37 -32
  34. package/src/duckdb/extension/json/include/json_scan.hpp +10 -11
  35. package/src/duckdb/extension/json/include/json_serializer.hpp +89 -0
  36. package/src/duckdb/extension/json/include/json_structure.hpp +1 -1
  37. package/src/duckdb/extension/json/include/json_transform.hpp +1 -1
  38. package/src/duckdb/extension/json/json-extension.cpp +14 -18
  39. package/src/duckdb/extension/json/json_deserializer.cpp +306 -0
  40. package/src/duckdb/extension/json/json_functions/copy_json.cpp +21 -21
  41. package/src/duckdb/extension/json/json_functions/json_array_length.cpp +2 -3
  42. package/src/duckdb/extension/json/json_functions/json_contains.cpp +2 -2
  43. package/src/duckdb/extension/json/json_functions/json_create.cpp +48 -47
  44. package/src/duckdb/extension/json/json_functions/json_extract.cpp +4 -6
  45. package/src/duckdb/extension/json/json_functions/json_keys.cpp +2 -3
  46. package/src/duckdb/extension/json/json_functions/json_merge_patch.cpp +4 -4
  47. package/src/duckdb/extension/json/json_functions/json_serialize_sql.cpp +277 -0
  48. package/src/duckdb/extension/json/json_functions/json_structure.cpp +6 -6
  49. package/src/duckdb/extension/json/json_functions/json_transform.cpp +11 -10
  50. package/src/duckdb/extension/json/json_functions/json_type.cpp +2 -3
  51. package/src/duckdb/extension/json/json_functions/json_valid.cpp +2 -2
  52. package/src/duckdb/extension/json/json_functions/read_json.cpp +30 -39
  53. package/src/duckdb/extension/json/json_functions/read_json_objects.cpp +4 -4
  54. package/src/duckdb/extension/json/json_functions.cpp +41 -24
  55. package/src/duckdb/extension/json/json_scan.cpp +9 -32
  56. package/src/duckdb/extension/json/json_serializer.cpp +253 -0
  57. package/src/duckdb/extension/parquet/column_reader.cpp +158 -94
  58. package/src/duckdb/extension/parquet/column_writer.cpp +109 -108
  59. package/src/duckdb/extension/parquet/include/boolean_column_reader.hpp +5 -3
  60. package/src/duckdb/extension/parquet/include/callback_column_reader.hpp +3 -0
  61. package/src/duckdb/extension/parquet/include/cast_column_reader.hpp +7 -4
  62. package/src/duckdb/extension/parquet/include/column_reader.hpp +25 -8
  63. package/src/duckdb/extension/parquet/include/column_writer.hpp +7 -8
  64. package/src/duckdb/extension/parquet/include/decode_utils.hpp +5 -4
  65. package/src/duckdb/extension/parquet/include/list_column_reader.hpp +6 -4
  66. package/src/duckdb/extension/parquet/include/parquet_dbp_decoder.hpp +3 -3
  67. package/src/duckdb/extension/parquet/include/parquet_decimal_utils.hpp +3 -3
  68. package/src/duckdb/extension/parquet/include/parquet_file_metadata_cache.hpp +2 -2
  69. package/src/duckdb/extension/parquet/include/parquet_metadata.hpp +1 -0
  70. package/src/duckdb/extension/parquet/include/parquet_reader.hpp +27 -52
  71. package/src/duckdb/extension/parquet/include/parquet_statistics.hpp +2 -2
  72. package/src/duckdb/extension/parquet/include/parquet_support.hpp +10 -9
  73. package/src/duckdb/extension/parquet/include/parquet_timestamp.hpp +2 -1
  74. package/src/duckdb/extension/parquet/include/parquet_writer.hpp +10 -3
  75. package/src/duckdb/extension/parquet/include/row_number_column_reader.hpp +6 -3
  76. package/src/duckdb/extension/parquet/include/string_column_reader.hpp +4 -1
  77. package/src/duckdb/extension/parquet/include/struct_column_reader.hpp +7 -3
  78. package/src/duckdb/extension/parquet/include/templated_column_reader.hpp +3 -0
  79. package/src/duckdb/extension/parquet/include/zstd_file_system.hpp +2 -2
  80. package/src/duckdb/extension/parquet/parquet-extension.cpp +175 -282
  81. package/src/duckdb/extension/parquet/parquet_metadata.cpp +57 -39
  82. package/src/duckdb/extension/parquet/parquet_reader.cpp +120 -255
  83. package/src/duckdb/extension/parquet/parquet_statistics.cpp +31 -9
  84. package/src/duckdb/extension/parquet/parquet_timestamp.cpp +16 -6
  85. package/src/duckdb/extension/parquet/parquet_writer.cpp +24 -10
  86. package/src/duckdb/extension/parquet/zstd_file_system.cpp +4 -4
  87. package/src/duckdb/src/catalog/catalog.cpp +211 -142
  88. package/src/duckdb/src/catalog/catalog_entry/copy_function_catalog_entry.cpp +3 -3
  89. package/src/duckdb/src/catalog/catalog_entry/duck_index_entry.cpp +4 -4
  90. package/src/duckdb/src/catalog/catalog_entry/duck_schema_entry.cpp +100 -92
  91. package/src/duckdb/src/catalog/catalog_entry/duck_table_entry.cpp +100 -125
  92. package/src/duckdb/src/catalog/catalog_entry/index_catalog_entry.cpp +8 -8
  93. package/src/duckdb/src/catalog/catalog_entry/pragma_function_catalog_entry.cpp +3 -4
  94. package/src/duckdb/src/catalog/catalog_entry/scalar_function_catalog_entry.cpp +8 -8
  95. package/src/duckdb/src/catalog/catalog_entry/scalar_macro_catalog_entry.cpp +19 -19
  96. package/src/duckdb/src/catalog/catalog_entry/schema_catalog_entry.cpp +9 -9
  97. package/src/duckdb/src/catalog/catalog_entry/sequence_catalog_entry.cpp +9 -9
  98. package/src/duckdb/src/catalog/catalog_entry/table_catalog_entry.cpp +30 -20
  99. package/src/duckdb/src/catalog/catalog_entry/table_function_catalog_entry.cpp +8 -9
  100. package/src/duckdb/src/catalog/catalog_entry/type_catalog_entry.cpp +16 -10
  101. package/src/duckdb/src/catalog/catalog_entry/view_catalog_entry.cpp +27 -27
  102. package/src/duckdb/src/catalog/catalog_entry.cpp +29 -8
  103. package/src/duckdb/src/catalog/catalog_search_path.cpp +2 -2
  104. package/src/duckdb/src/catalog/catalog_set.cpp +132 -132
  105. package/src/duckdb/src/catalog/catalog_transaction.cpp +5 -1
  106. package/src/duckdb/src/catalog/default/default_functions.cpp +17 -11
  107. package/src/duckdb/src/catalog/default/default_schemas.cpp +1 -1
  108. package/src/duckdb/src/catalog/default/default_types.cpp +4 -4
  109. package/src/duckdb/src/catalog/default/default_views.cpp +5 -5
  110. package/src/duckdb/src/catalog/dependency_list.cpp +15 -2
  111. package/src/duckdb/src/catalog/dependency_manager.cpp +51 -46
  112. package/src/duckdb/src/catalog/duck_catalog.cpp +64 -26
  113. package/src/duckdb/src/catalog/similar_catalog_entry.cpp +1 -1
  114. package/src/duckdb/src/common/adbc/adbc.cpp +444 -0
  115. package/src/duckdb/src/common/adbc/driver_manager.cpp +749 -0
  116. package/src/duckdb/src/common/allocator.cpp +2 -2
  117. package/src/duckdb/src/common/arrow/arrow_appender.cpp +125 -56
  118. package/src/duckdb/src/common/arrow/arrow_converter.cpp +7 -7
  119. package/src/duckdb/src/common/arrow/arrow_wrapper.cpp +21 -3
  120. package/src/duckdb/src/common/box_renderer.cpp +113 -25
  121. package/src/duckdb/src/common/compressed_file_system.cpp +15 -0
  122. package/src/duckdb/src/common/constants.cpp +10 -1
  123. package/src/duckdb/src/common/enum_util.cpp +5908 -0
  124. package/src/duckdb/src/common/enums/date_part_specifier.cpp +82 -0
  125. package/src/duckdb/src/common/enums/expression_type.cpp +83 -85
  126. package/src/duckdb/src/common/enums/join_type.cpp +6 -24
  127. package/src/duckdb/src/common/enums/logical_operator_type.cpp +4 -0
  128. package/src/duckdb/src/common/enums/physical_operator_type.cpp +8 -0
  129. package/src/duckdb/src/common/exception.cpp +20 -2
  130. package/src/duckdb/src/common/exception_format_value.cpp +1 -1
  131. package/src/duckdb/src/common/field_writer.cpp +2 -1
  132. package/src/duckdb/src/common/file_buffer.cpp +8 -0
  133. package/src/duckdb/src/common/file_system.cpp +5 -3
  134. package/src/duckdb/src/common/filename_pattern.cpp +41 -0
  135. package/src/duckdb/src/common/gzip_file_system.cpp +69 -5
  136. package/src/duckdb/src/common/hive_partitioning.cpp +150 -19
  137. package/src/duckdb/src/common/local_file_system.cpp +80 -14
  138. package/src/duckdb/src/common/multi_file_reader.cpp +390 -0
  139. package/src/duckdb/src/common/operator/cast_operators.cpp +25 -26
  140. package/src/duckdb/src/common/pipe_file_system.cpp +2 -1
  141. package/src/duckdb/src/common/preserved_error.cpp +7 -5
  142. package/src/duckdb/src/common/progress_bar/progress_bar.cpp +8 -1
  143. package/src/duckdb/src/common/radix_partitioning.cpp +115 -349
  144. package/src/duckdb/src/common/random_engine.cpp +1 -1
  145. package/src/duckdb/src/common/re2_regex.cpp +4 -4
  146. package/src/duckdb/src/common/row_operations/row_aggregate.cpp +22 -17
  147. package/src/duckdb/src/common/row_operations/row_external.cpp +1 -1
  148. package/src/duckdb/src/common/row_operations/row_gather.cpp +5 -3
  149. package/src/duckdb/src/common/row_operations/row_heap_scatter.cpp +2 -2
  150. package/src/duckdb/src/common/row_operations/row_match.cpp +117 -22
  151. package/src/duckdb/src/common/row_operations/row_scatter.cpp +7 -5
  152. package/src/duckdb/src/common/serializer/binary_deserializer.cpp +143 -0
  153. package/src/duckdb/src/common/serializer/binary_serializer.cpp +160 -0
  154. package/src/duckdb/src/common/serializer/buffered_deserializer.cpp +4 -0
  155. package/src/duckdb/src/common/serializer/buffered_file_reader.cpp +21 -3
  156. package/src/duckdb/src/common/sort/comparators.cpp +14 -5
  157. package/src/duckdb/src/common/sort/merge_sorter.cpp +3 -3
  158. package/src/duckdb/src/common/sort/partition_state.cpp +564 -0
  159. package/src/duckdb/src/common/sort/sort_state.cpp +13 -12
  160. package/src/duckdb/src/common/sort/sorted_block.cpp +23 -18
  161. package/src/duckdb/src/common/string_util.cpp +49 -4
  162. package/src/duckdb/src/common/tree_renderer.cpp +7 -9
  163. package/src/duckdb/src/common/types/batched_data_collection.cpp +5 -4
  164. package/src/duckdb/src/common/types/bit.cpp +107 -65
  165. package/src/duckdb/src/common/types/blob.cpp +10 -10
  166. package/src/duckdb/src/common/types/chunk_collection.cpp +4 -4
  167. package/src/duckdb/src/common/types/{column_data_allocator.cpp → column/column_data_allocator.cpp} +4 -3
  168. package/src/duckdb/src/common/types/{column_data_collection.cpp → column/column_data_collection.cpp} +68 -8
  169. package/src/duckdb/src/common/types/{column_data_collection_segment.cpp → column/column_data_collection_segment.cpp} +14 -11
  170. package/src/duckdb/src/common/types/{column_data_consumer.cpp → column/column_data_consumer.cpp} +1 -1
  171. package/src/duckdb/src/common/types/{partitioned_column_data.cpp → column/partitioned_column_data.cpp} +14 -12
  172. package/src/duckdb/src/common/types/conflict_manager.cpp +5 -4
  173. package/src/duckdb/src/common/types/data_chunk.cpp +1 -1
  174. package/src/duckdb/src/common/types/hash.cpp +1 -1
  175. package/src/duckdb/src/common/types/hyperloglog.cpp +3 -3
  176. package/src/duckdb/src/common/types/interval.cpp +0 -41
  177. package/src/duckdb/src/common/types/list_segment.cpp +658 -0
  178. package/src/duckdb/src/common/types/row/partitioned_tuple_data.cpp +316 -0
  179. package/src/duckdb/src/common/types/{row_data_collection.cpp → row/row_data_collection.cpp} +2 -2
  180. package/src/duckdb/src/common/types/{row_data_collection_scanner.cpp → row/row_data_collection_scanner.cpp} +3 -3
  181. package/src/duckdb/src/common/types/{row_layout.cpp → row/row_layout.cpp} +1 -1
  182. package/src/duckdb/src/common/types/row/tuple_data_allocator.cpp +465 -0
  183. package/src/duckdb/src/common/types/row/tuple_data_collection.cpp +511 -0
  184. package/src/duckdb/src/common/types/row/tuple_data_iterator.cpp +96 -0
  185. package/src/duckdb/src/common/types/row/tuple_data_layout.cpp +119 -0
  186. package/src/duckdb/src/common/types/row/tuple_data_scatter_gather.cpp +1200 -0
  187. package/src/duckdb/src/common/types/row/tuple_data_segment.cpp +170 -0
  188. package/src/duckdb/src/common/types/string_heap.cpp +3 -3
  189. package/src/duckdb/src/common/types/string_type.cpp +3 -3
  190. package/src/duckdb/src/common/types/time.cpp +13 -0
  191. package/src/duckdb/src/common/types/timestamp.cpp +1 -1
  192. package/src/duckdb/src/common/types/validity_mask.cpp +24 -7
  193. package/src/duckdb/src/common/types/value.cpp +184 -101
  194. package/src/duckdb/src/common/types/vector.cpp +347 -154
  195. package/src/duckdb/src/common/types/vector_buffer.cpp +4 -4
  196. package/src/duckdb/src/common/types/vector_cache.cpp +4 -4
  197. package/src/duckdb/src/common/types.cpp +326 -175
  198. package/src/duckdb/src/common/value_operations/comparison_operations.cpp +14 -22
  199. package/src/duckdb/src/common/vector_operations/comparison_operators.cpp +10 -10
  200. package/src/duckdb/src/common/vector_operations/is_distinct_from.cpp +13 -12
  201. package/src/duckdb/src/common/vector_operations/vector_cast.cpp +2 -1
  202. package/src/duckdb/src/common/vector_operations/vector_copy.cpp +14 -11
  203. package/src/duckdb/src/common/virtual_file_system.cpp +1 -1
  204. package/src/duckdb/src/{function → core_functions}/aggregate/algebraic/avg.cpp +13 -16
  205. package/src/duckdb/src/core_functions/aggregate/algebraic/corr.cpp +13 -0
  206. package/src/duckdb/src/core_functions/aggregate/algebraic/covar.cpp +21 -0
  207. package/src/duckdb/src/core_functions/aggregate/algebraic/stddev.cpp +34 -0
  208. package/src/duckdb/src/{function → core_functions}/aggregate/distributive/approx_count.cpp +4 -4
  209. package/src/duckdb/src/{function → core_functions}/aggregate/distributive/arg_min_max.cpp +10 -26
  210. package/src/duckdb/src/{function → core_functions}/aggregate/distributive/bitagg.cpp +13 -13
  211. package/src/duckdb/src/{function → core_functions}/aggregate/distributive/bitstring_agg.cpp +33 -18
  212. package/src/duckdb/src/{function → core_functions}/aggregate/distributive/bool.cpp +3 -17
  213. package/src/duckdb/src/{function → core_functions}/aggregate/distributive/entropy.cpp +6 -5
  214. package/src/duckdb/src/{function → core_functions}/aggregate/distributive/kurtosis.cpp +8 -8
  215. package/src/duckdb/src/{function → core_functions}/aggregate/distributive/minmax.cpp +30 -30
  216. package/src/duckdb/src/{function → core_functions}/aggregate/distributive/product.cpp +2 -11
  217. package/src/duckdb/src/{function → core_functions}/aggregate/distributive/skew.cpp +10 -7
  218. package/src/duckdb/src/{function → core_functions}/aggregate/distributive/string_agg.cpp +13 -15
  219. package/src/duckdb/src/{function → core_functions}/aggregate/distributive/sum.cpp +44 -44
  220. package/src/duckdb/src/{function → core_functions}/aggregate/holistic/approximate_quantile.cpp +14 -12
  221. package/src/duckdb/src/{function → core_functions}/aggregate/holistic/mode.cpp +6 -7
  222. package/src/duckdb/src/{function → core_functions}/aggregate/holistic/quantile.cpp +56 -33
  223. package/src/duckdb/src/{function → core_functions}/aggregate/holistic/reservoir_quantile.cpp +10 -11
  224. package/src/duckdb/src/{function → core_functions}/aggregate/nested/histogram.cpp +6 -6
  225. package/src/duckdb/src/core_functions/aggregate/nested/list.cpp +190 -0
  226. package/src/duckdb/src/{function → core_functions}/aggregate/regression/regr_avg.cpp +7 -11
  227. package/src/duckdb/src/{function → core_functions}/aggregate/regression/regr_count.cpp +4 -4
  228. package/src/duckdb/src/{function → core_functions}/aggregate/regression/regr_intercept.cpp +5 -8
  229. package/src/duckdb/src/{function → core_functions}/aggregate/regression/regr_r2.cpp +5 -7
  230. package/src/duckdb/src/{function → core_functions}/aggregate/regression/regr_slope.cpp +5 -7
  231. package/src/duckdb/src/{function → core_functions}/aggregate/regression/regr_sxx_syy.cpp +8 -12
  232. package/src/duckdb/src/{function → core_functions}/aggregate/regression/regr_sxy.cpp +6 -8
  233. package/src/duckdb/src/core_functions/core_functions.cpp +50 -0
  234. package/src/duckdb/src/core_functions/function_list.cpp +355 -0
  235. package/src/duckdb/src/{function → core_functions}/scalar/bit/bitstring.cpp +16 -18
  236. package/src/duckdb/src/{function → core_functions}/scalar/blob/base64.cpp +6 -6
  237. package/src/duckdb/src/{function → core_functions}/scalar/blob/encode.cpp +8 -7
  238. package/src/duckdb/src/{function → core_functions}/scalar/date/age.cpp +3 -3
  239. package/src/duckdb/src/{function → core_functions}/scalar/date/current.cpp +8 -10
  240. package/src/duckdb/src/{function → core_functions}/scalar/date/date_diff.cpp +3 -6
  241. package/src/duckdb/src/{function → core_functions}/scalar/date/date_part.cpp +153 -156
  242. package/src/duckdb/src/{function → core_functions}/scalar/date/date_sub.cpp +3 -6
  243. package/src/duckdb/src/{function → core_functions}/scalar/date/date_trunc.cpp +5 -8
  244. package/src/duckdb/src/{function → core_functions}/scalar/date/epoch.cpp +7 -8
  245. package/src/duckdb/src/{function → core_functions}/scalar/date/make_date.cpp +14 -14
  246. package/src/duckdb/src/core_functions/scalar/date/strftime.cpp +251 -0
  247. package/src/duckdb/src/{function → core_functions}/scalar/date/time_bucket.cpp +4 -5
  248. package/src/duckdb/src/{function → core_functions}/scalar/date/to_interval.cpp +39 -19
  249. package/src/duckdb/src/{function/scalar/enum/enum_functions_implementation.cpp → core_functions/scalar/enum/enum_functions.cpp} +18 -22
  250. package/src/duckdb/src/{function → core_functions}/scalar/generic/alias.cpp +5 -5
  251. package/src/duckdb/src/{function → core_functions}/scalar/generic/current_setting.cpp +9 -10
  252. package/src/duckdb/src/core_functions/scalar/generic/error.cpp +21 -0
  253. package/src/duckdb/src/{function → core_functions}/scalar/generic/hash.cpp +4 -4
  254. package/src/duckdb/src/{function → core_functions}/scalar/generic/least.cpp +8 -9
  255. package/src/duckdb/src/{function → core_functions}/scalar/generic/stats.cpp +9 -9
  256. package/src/duckdb/src/{function/scalar/system → core_functions/scalar/generic}/system_functions.cpp +24 -13
  257. package/src/duckdb/src/{function → core_functions}/scalar/generic/typeof.cpp +4 -4
  258. package/src/duckdb/src/{function → core_functions}/scalar/list/array_slice.cpp +4 -14
  259. package/src/duckdb/src/{function → core_functions}/scalar/list/flatten.cpp +7 -7
  260. package/src/duckdb/src/{function → core_functions}/scalar/list/list_aggregates.cpp +18 -29
  261. package/src/duckdb/src/{function → core_functions}/scalar/list/list_lambdas.cpp +18 -29
  262. package/src/duckdb/src/{function → core_functions}/scalar/list/list_sort.cpp +47 -81
  263. package/src/duckdb/src/{function → core_functions}/scalar/list/list_value.cpp +6 -7
  264. package/src/duckdb/src/{function → core_functions}/scalar/list/range.cpp +8 -6
  265. package/src/duckdb/src/{function → core_functions}/scalar/map/cardinality.cpp +6 -5
  266. package/src/duckdb/src/{function → core_functions}/scalar/map/map.cpp +54 -65
  267. package/src/duckdb/src/core_functions/scalar/map/map_concat.cpp +186 -0
  268. package/src/duckdb/src/{function → core_functions}/scalar/map/map_entries.cpp +7 -6
  269. package/src/duckdb/src/core_functions/scalar/map/map_extract.cpp +152 -0
  270. package/src/duckdb/src/{function → core_functions}/scalar/map/map_from_entries.cpp +7 -6
  271. package/src/duckdb/src/{function → core_functions}/scalar/map/map_keys_values.cpp +9 -8
  272. package/src/duckdb/src/{function → core_functions}/scalar/math/numeric.cpp +242 -126
  273. package/src/duckdb/src/{function → core_functions}/scalar/operators/bitwise.cpp +19 -20
  274. package/src/duckdb/src/{function/scalar/math → core_functions/scalar/random}/random.cpp +8 -9
  275. package/src/duckdb/src/{function/scalar/math → core_functions/scalar/random}/setseed.cpp +7 -7
  276. package/src/duckdb/src/{function → core_functions}/scalar/string/ascii.cpp +5 -6
  277. package/src/duckdb/src/{function → core_functions}/scalar/string/bar.cpp +4 -4
  278. package/src/duckdb/src/{function → core_functions}/scalar/string/chr.cpp +5 -6
  279. package/src/duckdb/src/core_functions/scalar/string/damerau_levenshtein.cpp +104 -0
  280. package/src/duckdb/src/core_functions/scalar/string/format_bytes.cpp +29 -0
  281. package/src/duckdb/src/{function/scalar/string/mismatches.cpp → core_functions/scalar/string/hamming.cpp} +5 -14
  282. package/src/duckdb/src/core_functions/scalar/string/hex.cpp +374 -0
  283. package/src/duckdb/src/{function → core_functions}/scalar/string/instr.cpp +7 -14
  284. package/src/duckdb/src/{function → core_functions}/scalar/string/jaccard.cpp +4 -7
  285. package/src/duckdb/src/{function → core_functions}/scalar/string/jaro_winkler.cpp +12 -11
  286. package/src/duckdb/src/{function → core_functions}/scalar/string/left_right.cpp +18 -11
  287. package/src/duckdb/src/{function → core_functions}/scalar/string/levenshtein.cpp +7 -16
  288. package/src/duckdb/src/{function → core_functions}/scalar/string/md5.cpp +15 -21
  289. package/src/duckdb/src/{function → core_functions}/scalar/string/pad.cpp +10 -16
  290. package/src/duckdb/src/{function → core_functions}/scalar/string/printf.cpp +15 -15
  291. package/src/duckdb/src/{function → core_functions}/scalar/string/repeat.cpp +4 -7
  292. package/src/duckdb/src/{function → core_functions}/scalar/string/replace.cpp +7 -10
  293. package/src/duckdb/src/{function → core_functions}/scalar/string/reverse.cpp +4 -4
  294. package/src/duckdb/src/{function → core_functions}/scalar/string/starts_with.cpp +6 -10
  295. package/src/duckdb/src/{function → core_functions}/scalar/string/string_split.cpp +17 -17
  296. package/src/duckdb/src/{function → core_functions}/scalar/string/translate.cpp +7 -10
  297. package/src/duckdb/src/{function → core_functions}/scalar/string/trim.cpp +22 -17
  298. package/src/duckdb/src/core_functions/scalar/string/unicode.cpp +28 -0
  299. package/src/duckdb/src/{function → core_functions}/scalar/struct/struct_insert.cpp +6 -6
  300. package/src/duckdb/src/{function → core_functions}/scalar/struct/struct_pack.cpp +7 -8
  301. package/src/duckdb/src/{function → core_functions}/scalar/union/union_extract.cpp +9 -13
  302. package/src/duckdb/src/{function → core_functions}/scalar/union/union_tag.cpp +4 -8
  303. package/src/duckdb/src/{function → core_functions}/scalar/union/union_value.cpp +6 -61
  304. package/src/duckdb/src/execution/adaptive_filter.cpp +1 -1
  305. package/src/duckdb/src/execution/aggregate_hashtable.cpp +332 -340
  306. package/src/duckdb/src/execution/column_binding_resolver.cpp +22 -12
  307. package/src/duckdb/src/execution/expression_executor/execute_between.cpp +1 -1
  308. package/src/duckdb/src/execution/expression_executor/execute_case.cpp +1 -1
  309. package/src/duckdb/src/execution/expression_executor/execute_cast.cpp +3 -2
  310. package/src/duckdb/src/execution/expression_executor/execute_comparison.cpp +3 -3
  311. package/src/duckdb/src/execution/expression_executor/execute_conjunction.cpp +6 -6
  312. package/src/duckdb/src/execution/expression_executor/execute_constant.cpp +1 -1
  313. package/src/duckdb/src/execution/expression_executor/execute_function.cpp +1 -1
  314. package/src/duckdb/src/execution/expression_executor/execute_operator.cpp +1 -1
  315. package/src/duckdb/src/execution/expression_executor/execute_parameter.cpp +1 -1
  316. package/src/duckdb/src/execution/expression_executor/execute_reference.cpp +1 -1
  317. package/src/duckdb/src/execution/expression_executor.cpp +5 -4
  318. package/src/duckdb/src/execution/expression_executor_state.cpp +3 -4
  319. package/src/duckdb/src/execution/index/art/art.cpp +309 -276
  320. package/src/duckdb/src/execution/index/art/art_key.cpp +24 -34
  321. package/src/duckdb/src/execution/index/art/fixed_size_allocator.cpp +224 -0
  322. package/src/duckdb/src/execution/index/art/iterator.cpp +142 -123
  323. package/src/duckdb/src/execution/index/art/leaf.cpp +319 -170
  324. package/src/duckdb/src/execution/index/art/leaf_segment.cpp +42 -0
  325. package/src/duckdb/src/execution/index/art/node.cpp +444 -379
  326. package/src/duckdb/src/execution/index/art/node16.cpp +178 -114
  327. package/src/duckdb/src/execution/index/art/node256.cpp +117 -79
  328. package/src/duckdb/src/execution/index/art/node4.cpp +169 -114
  329. package/src/duckdb/src/execution/index/art/node48.cpp +175 -105
  330. package/src/duckdb/src/execution/index/art/prefix.cpp +405 -127
  331. package/src/duckdb/src/execution/index/art/prefix_segment.cpp +42 -0
  332. package/src/duckdb/src/execution/index/art/swizzleable_pointer.cpp +10 -85
  333. package/src/duckdb/src/execution/join_hashtable.cpp +203 -337
  334. package/src/duckdb/src/execution/operator/aggregate/aggregate_object.cpp +12 -3
  335. package/src/duckdb/src/execution/operator/aggregate/distinct_aggregate_data.cpp +13 -13
  336. package/src/duckdb/src/execution/operator/aggregate/grouped_aggregate_data.cpp +4 -4
  337. package/src/duckdb/src/execution/operator/aggregate/physical_hash_aggregate.cpp +103 -83
  338. package/src/duckdb/src/execution/operator/aggregate/physical_perfecthash_aggregate.cpp +34 -28
  339. package/src/duckdb/src/execution/operator/aggregate/physical_streaming_window.cpp +13 -9
  340. package/src/duckdb/src/execution/operator/aggregate/physical_ungrouped_aggregate.cpp +71 -64
  341. package/src/duckdb/src/execution/operator/aggregate/physical_window.cpp +250 -816
  342. package/src/duckdb/src/execution/operator/filter/physical_filter.cpp +4 -4
  343. package/src/duckdb/src/execution/operator/helper/physical_batch_collector.cpp +12 -12
  344. package/src/duckdb/src/execution/operator/helper/physical_execute.cpp +3 -8
  345. package/src/duckdb/src/execution/operator/helper/physical_explain_analyze.cpp +8 -23
  346. package/src/duckdb/src/execution/operator/helper/physical_limit.cpp +22 -19
  347. package/src/duckdb/src/execution/operator/helper/physical_limit_percent.cpp +21 -21
  348. package/src/duckdb/src/execution/operator/helper/physical_load.cpp +3 -2
  349. package/src/duckdb/src/execution/operator/helper/physical_materialized_collector.cpp +17 -13
  350. package/src/duckdb/src/execution/operator/helper/physical_pragma.cpp +4 -2
  351. package/src/duckdb/src/execution/operator/helper/physical_prepare.cpp +4 -2
  352. package/src/duckdb/src/execution/operator/helper/physical_reservoir_sample.cpp +14 -12
  353. package/src/duckdb/src/execution/operator/helper/physical_reset.cpp +4 -3
  354. package/src/duckdb/src/execution/operator/helper/physical_result_collector.cpp +8 -14
  355. package/src/duckdb/src/execution/operator/helper/physical_set.cpp +7 -6
  356. package/src/duckdb/src/execution/operator/helper/physical_streaming_limit.cpp +6 -6
  357. package/src/duckdb/src/execution/operator/helper/physical_streaming_sample.cpp +5 -4
  358. package/src/duckdb/src/execution/operator/helper/physical_transaction.cpp +4 -2
  359. package/src/duckdb/src/execution/operator/helper/physical_vacuum.cpp +17 -14
  360. package/src/duckdb/src/execution/operator/join/perfect_hash_join_executor.cpp +37 -22
  361. package/src/duckdb/src/execution/operator/join/physical_asof_join.cpp +699 -0
  362. package/src/duckdb/src/execution/operator/join/physical_blockwise_nl_join.cpp +66 -42
  363. package/src/duckdb/src/execution/operator/join/physical_comparison_join.cpp +2 -1
  364. package/src/duckdb/src/execution/operator/join/physical_cross_product.cpp +9 -10
  365. package/src/duckdb/src/execution/operator/join/physical_delim_join.cpp +22 -21
  366. package/src/duckdb/src/execution/operator/join/physical_hash_join.cpp +205 -180
  367. package/src/duckdb/src/execution/operator/join/physical_iejoin.cpp +51 -46
  368. package/src/duckdb/src/execution/operator/join/physical_index_join.cpp +33 -22
  369. package/src/duckdb/src/execution/operator/join/physical_join.cpp +9 -20
  370. package/src/duckdb/src/execution/operator/join/physical_nested_loop_join.cpp +31 -29
  371. package/src/duckdb/src/execution/operator/join/physical_piecewise_merge_join.cpp +39 -42
  372. package/src/duckdb/src/execution/operator/join/physical_positional_join.cpp +13 -12
  373. package/src/duckdb/src/execution/operator/join/physical_range_join.cpp +5 -3
  374. package/src/duckdb/src/execution/operator/order/physical_order.cpp +26 -26
  375. package/src/duckdb/src/execution/operator/order/physical_top_n.cpp +20 -20
  376. package/src/duckdb/src/execution/operator/persistent/base_csv_reader.cpp +58 -50
  377. package/src/duckdb/src/execution/operator/persistent/buffered_csv_reader.cpp +97 -44
  378. package/src/duckdb/src/execution/operator/persistent/csv_buffer.cpp +17 -13
  379. package/src/duckdb/src/execution/operator/persistent/csv_reader_options.cpp +14 -19
  380. package/src/duckdb/src/execution/operator/persistent/parallel_csv_reader.cpp +139 -31
  381. package/src/duckdb/src/execution/operator/persistent/physical_batch_copy_to_file.cpp +209 -0
  382. package/src/duckdb/src/execution/operator/persistent/physical_batch_insert.cpp +196 -175
  383. package/src/duckdb/src/execution/operator/persistent/physical_copy_to_file.cpp +39 -52
  384. package/src/duckdb/src/execution/operator/persistent/physical_delete.cpp +22 -28
  385. package/src/duckdb/src/execution/operator/persistent/physical_export.cpp +44 -41
  386. package/src/duckdb/src/execution/operator/persistent/physical_fixed_batch_copy.cpp +494 -0
  387. package/src/duckdb/src/execution/operator/persistent/physical_insert.cpp +78 -81
  388. package/src/duckdb/src/execution/operator/persistent/physical_update.cpp +26 -29
  389. package/src/duckdb/src/execution/operator/projection/physical_pivot.cpp +81 -0
  390. package/src/duckdb/src/execution/operator/projection/physical_projection.cpp +37 -3
  391. package/src/duckdb/src/execution/operator/projection/physical_tableinout_function.cpp +7 -7
  392. package/src/duckdb/src/execution/operator/projection/physical_unnest.cpp +5 -6
  393. package/src/duckdb/src/execution/operator/scan/physical_column_data_scan.cpp +19 -11
  394. package/src/duckdb/src/execution/operator/scan/physical_dummy_scan.cpp +4 -19
  395. package/src/duckdb/src/execution/operator/scan/physical_empty_result.cpp +3 -2
  396. package/src/duckdb/src/execution/operator/scan/physical_expression_scan.cpp +1 -1
  397. package/src/duckdb/src/execution/operator/scan/physical_positional_scan.cpp +39 -15
  398. package/src/duckdb/src/execution/operator/scan/physical_table_scan.cpp +31 -17
  399. package/src/duckdb/src/execution/operator/schema/physical_alter.cpp +4 -20
  400. package/src/duckdb/src/execution/operator/schema/physical_attach.cpp +13 -25
  401. package/src/duckdb/src/execution/operator/schema/physical_create_function.cpp +5 -20
  402. package/src/duckdb/src/execution/operator/schema/physical_create_index.cpp +36 -36
  403. package/src/duckdb/src/execution/operator/schema/physical_create_schema.cpp +5 -20
  404. package/src/duckdb/src/execution/operator/schema/physical_create_sequence.cpp +5 -20
  405. package/src/duckdb/src/execution/operator/schema/physical_create_table.cpp +6 -21
  406. package/src/duckdb/src/execution/operator/schema/physical_create_type.cpp +41 -68
  407. package/src/duckdb/src/execution/operator/schema/physical_create_view.cpp +5 -20
  408. package/src/duckdb/src/execution/operator/schema/physical_detach.cpp +5 -20
  409. package/src/duckdb/src/execution/operator/schema/physical_drop.cpp +5 -21
  410. package/src/duckdb/src/execution/operator/set/physical_recursive_cte.cpp +27 -30
  411. package/src/duckdb/src/execution/operator/set/physical_union.cpp +15 -4
  412. package/src/duckdb/src/execution/partitionable_hashtable.cpp +32 -45
  413. package/src/duckdb/src/execution/perfect_aggregate_hashtable.cpp +35 -39
  414. package/src/duckdb/src/execution/physical_operator.cpp +33 -42
  415. package/src/duckdb/src/execution/physical_plan/plan_aggregate.cpp +28 -22
  416. package/src/duckdb/src/execution/physical_plan/plan_any_join.cpp +2 -2
  417. package/src/duckdb/src/execution/physical_plan/plan_asof_join.cpp +103 -0
  418. package/src/duckdb/src/execution/physical_plan/plan_column_data_get.cpp +2 -4
  419. package/src/duckdb/src/execution/physical_plan/plan_comparison_join.cpp +103 -60
  420. package/src/duckdb/src/execution/physical_plan/plan_copy_to_file.cpp +38 -7
  421. package/src/duckdb/src/execution/physical_plan/plan_create.cpp +9 -9
  422. package/src/duckdb/src/execution/physical_plan/plan_create_index.cpp +16 -16
  423. package/src/duckdb/src/execution/physical_plan/plan_create_table.cpp +8 -7
  424. package/src/duckdb/src/execution/physical_plan/plan_cross_product.cpp +1 -1
  425. package/src/duckdb/src/execution/physical_plan/plan_delete.cpp +4 -4
  426. package/src/duckdb/src/execution/physical_plan/plan_delim_get.cpp +1 -1
  427. package/src/duckdb/src/execution/physical_plan/plan_delim_join.cpp +12 -13
  428. package/src/duckdb/src/execution/physical_plan/plan_distinct.cpp +15 -16
  429. package/src/duckdb/src/execution/physical_plan/plan_dummy_scan.cpp +1 -1
  430. package/src/duckdb/src/execution/physical_plan/plan_empty_result.cpp +1 -1
  431. package/src/duckdb/src/execution/physical_plan/plan_execute.cpp +2 -2
  432. package/src/duckdb/src/execution/physical_plan/plan_explain.cpp +9 -12
  433. package/src/duckdb/src/execution/physical_plan/plan_export.cpp +2 -2
  434. package/src/duckdb/src/execution/physical_plan/plan_expression_get.cpp +6 -6
  435. package/src/duckdb/src/execution/physical_plan/plan_filter.cpp +3 -3
  436. package/src/duckdb/src/execution/physical_plan/plan_get.cpp +12 -13
  437. package/src/duckdb/src/execution/physical_plan/plan_insert.cpp +28 -8
  438. package/src/duckdb/src/execution/physical_plan/plan_limit.cpp +6 -7
  439. package/src/duckdb/src/execution/physical_plan/plan_limit_percent.cpp +2 -2
  440. package/src/duckdb/src/execution/physical_plan/plan_order.cpp +2 -2
  441. package/src/duckdb/src/execution/physical_plan/plan_pivot.cpp +14 -0
  442. package/src/duckdb/src/execution/physical_plan/plan_positional_join.cpp +14 -5
  443. package/src/duckdb/src/execution/physical_plan/plan_pragma.cpp +1 -1
  444. package/src/duckdb/src/execution/physical_plan/plan_prepare.cpp +1 -1
  445. package/src/duckdb/src/execution/physical_plan/plan_projection.cpp +2 -2
  446. package/src/duckdb/src/execution/physical_plan/plan_recursive_cte.cpp +7 -7
  447. package/src/duckdb/src/execution/physical_plan/plan_reset.cpp +1 -1
  448. package/src/duckdb/src/execution/physical_plan/plan_sample.cpp +6 -5
  449. package/src/duckdb/src/execution/physical_plan/plan_set.cpp +1 -1
  450. package/src/duckdb/src/execution/physical_plan/plan_set_operation.cpp +5 -5
  451. package/src/duckdb/src/execution/physical_plan/plan_show_select.cpp +3 -5
  452. package/src/duckdb/src/execution/physical_plan/plan_simple.cpp +14 -14
  453. package/src/duckdb/src/execution/physical_plan/plan_top_n.cpp +1 -1
  454. package/src/duckdb/src/execution/physical_plan/plan_unnest.cpp +1 -1
  455. package/src/duckdb/src/execution/physical_plan/plan_update.cpp +3 -3
  456. package/src/duckdb/src/execution/physical_plan/plan_window.cpp +13 -13
  457. package/src/duckdb/src/execution/physical_plan_generator.cpp +53 -43
  458. package/src/duckdb/src/execution/radix_partitioned_hashtable.cpp +96 -66
  459. package/src/duckdb/src/execution/reservoir_sample.cpp +3 -3
  460. package/src/duckdb/src/execution/window_segment_tree.cpp +200 -26
  461. package/src/duckdb/src/function/aggregate/distributive/count.cpp +1 -0
  462. package/src/duckdb/src/function/aggregate/distributive/first.cpp +12 -10
  463. package/src/duckdb/src/function/aggregate/distributive_functions.cpp +0 -17
  464. package/src/duckdb/src/function/aggregate/sorted_aggregate_function.cpp +289 -98
  465. package/src/duckdb/src/function/built_in_functions.cpp +10 -10
  466. package/src/duckdb/src/function/cast/cast_function_set.cpp +3 -2
  467. package/src/duckdb/src/function/cast/enum_casts.cpp +28 -6
  468. package/src/duckdb/src/function/cast/list_casts.cpp +20 -7
  469. package/src/duckdb/src/function/cast/map_cast.cpp +6 -3
  470. package/src/duckdb/src/function/cast/string_cast.cpp +40 -14
  471. package/src/duckdb/src/function/cast/struct_cast.cpp +28 -8
  472. package/src/duckdb/src/function/cast/time_casts.cpp +2 -2
  473. package/src/duckdb/src/function/cast/union_casts.cpp +40 -14
  474. package/src/duckdb/src/function/cast/vector_cast_helpers.cpp +5 -6
  475. package/src/duckdb/src/function/cast_rules.cpp +9 -4
  476. package/src/duckdb/src/function/compression_config.cpp +9 -9
  477. package/src/duckdb/src/function/function.cpp +4 -12
  478. package/src/duckdb/src/function/function_binder.cpp +10 -16
  479. package/src/duckdb/src/function/function_set.cpp +25 -0
  480. package/src/duckdb/src/function/macro_function.cpp +3 -3
  481. package/src/duckdb/src/function/pragma/pragma_queries.cpp +25 -2
  482. package/src/duckdb/src/function/pragma_function.cpp +1 -1
  483. package/src/duckdb/src/function/scalar/generic/constant_or_null.cpp +6 -6
  484. package/src/duckdb/src/function/scalar/generic_functions.cpp +1 -8
  485. package/src/duckdb/src/function/scalar/list/contains_or_position.cpp +5 -147
  486. package/src/duckdb/src/function/scalar/list/list_concat.cpp +6 -5
  487. package/src/duckdb/src/function/scalar/list/list_extract.cpp +1 -1
  488. package/src/duckdb/src/function/scalar/nested_functions.cpp +0 -22
  489. package/src/duckdb/src/function/scalar/operators/arithmetic.cpp +38 -31
  490. package/src/duckdb/src/function/scalar/operators/multiply.cpp +5 -0
  491. package/src/duckdb/src/function/scalar/operators.cpp +0 -6
  492. package/src/duckdb/src/function/scalar/sequence/nextval.cpp +41 -40
  493. package/src/duckdb/src/function/scalar/{date/strftime.cpp → strftime_format.cpp} +22 -173
  494. package/src/duckdb/src/function/scalar/string/caseconvert.cpp +2 -2
  495. package/src/duckdb/src/function/scalar/string/concat.cpp +6 -6
  496. package/src/duckdb/src/function/scalar/string/contains.cpp +2 -2
  497. package/src/duckdb/src/function/scalar/string/length.cpp +0 -19
  498. package/src/duckdb/src/function/scalar/string/like.cpp +14 -15
  499. package/src/duckdb/src/function/scalar/string/nfc_normalize.cpp +1 -1
  500. package/src/duckdb/src/function/scalar/string/prefix.cpp +2 -2
  501. package/src/duckdb/src/function/scalar/string/regexp/regexp_extract_all.cpp +243 -0
  502. package/src/duckdb/src/function/scalar/string/regexp/regexp_util.cpp +79 -0
  503. package/src/duckdb/src/function/scalar/string/regexp.cpp +183 -125
  504. package/src/duckdb/src/function/scalar/string/strip_accents.cpp +2 -2
  505. package/src/duckdb/src/function/scalar/string/substring.cpp +3 -3
  506. package/src/duckdb/src/function/scalar/string/suffix.cpp +2 -2
  507. package/src/duckdb/src/function/scalar/string_functions.cpp +0 -38
  508. package/src/duckdb/src/function/scalar/struct/struct_extract.cpp +6 -6
  509. package/src/duckdb/src/function/scalar/system/aggregate_export.cpp +28 -25
  510. package/src/duckdb/src/function/scalar_macro_function.cpp +4 -4
  511. package/src/duckdb/src/function/table/arrow.cpp +48 -44
  512. package/src/duckdb/src/function/table/arrow_conversion.cpp +104 -64
  513. package/src/duckdb/src/function/table/checkpoint.cpp +12 -8
  514. package/src/duckdb/src/function/table/copy_csv.cpp +106 -46
  515. package/src/duckdb/src/function/table/glob.cpp +7 -12
  516. package/src/duckdb/src/function/table/pragma_detailed_profiling_output.cpp +15 -14
  517. package/src/duckdb/src/function/table/pragma_last_profiling_output.cpp +13 -11
  518. package/src/duckdb/src/function/table/range.cpp +11 -10
  519. package/src/duckdb/src/function/table/read_csv.cpp +329 -276
  520. package/src/duckdb/src/function/table/repeat.cpp +4 -4
  521. package/src/duckdb/src/function/table/repeat_row.cpp +60 -0
  522. package/src/duckdb/src/function/table/summary.cpp +1 -1
  523. package/src/duckdb/src/function/table/system/duckdb_columns.cpp +31 -30
  524. package/src/duckdb/src/function/table/system/duckdb_constraints.cpp +31 -30
  525. package/src/duckdb/src/function/table/system/duckdb_databases.cpp +4 -4
  526. package/src/duckdb/src/function/table/system/duckdb_dependencies.cpp +13 -13
  527. package/src/duckdb/src/function/table/system/duckdb_extensions.cpp +4 -4
  528. package/src/duckdb/src/function/table/system/duckdb_functions.cpp +56 -68
  529. package/src/duckdb/src/function/table/system/duckdb_indexes.cpp +15 -14
  530. package/src/duckdb/src/function/table/system/duckdb_keywords.cpp +2 -2
  531. package/src/duckdb/src/function/table/system/duckdb_schemas.cpp +9 -9
  532. package/src/duckdb/src/function/table/system/duckdb_sequences.cpp +10 -11
  533. package/src/duckdb/src/function/table/system/duckdb_settings.cpp +4 -3
  534. package/src/duckdb/src/function/table/system/duckdb_tables.cpp +13 -12
  535. package/src/duckdb/src/function/table/system/duckdb_temporary_files.cpp +2 -2
  536. package/src/duckdb/src/function/table/system/duckdb_types.cpp +17 -16
  537. package/src/duckdb/src/function/table/system/duckdb_views.cpp +12 -11
  538. package/src/duckdb/src/function/table/system/pragma_collations.cpp +4 -4
  539. package/src/duckdb/src/function/table/system/pragma_database_size.cpp +7 -7
  540. package/src/duckdb/src/function/table/system/pragma_storage_info.cpp +11 -9
  541. package/src/duckdb/src/function/table/system/pragma_table_info.cpp +23 -24
  542. package/src/duckdb/src/function/table/system/test_all_types.cpp +6 -6
  543. package/src/duckdb/src/function/table/system/test_vector_types.cpp +6 -6
  544. package/src/duckdb/src/function/table/table_scan.cpp +87 -92
  545. package/src/duckdb/src/function/table/unnest.cpp +10 -10
  546. package/src/duckdb/src/function/table/version/pragma_version.cpp +6 -4
  547. package/src/duckdb/src/function/table_function.cpp +11 -11
  548. package/src/duckdb/src/function/table_macro_function.cpp +3 -3
  549. package/src/duckdb/src/function/udf_function.cpp +2 -2
  550. package/src/duckdb/src/include/duckdb/catalog/catalog.hpp +144 -84
  551. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/aggregate_function_catalog_entry.hpp +4 -5
  552. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/collate_catalog_entry.hpp +3 -3
  553. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/copy_function_catalog_entry.hpp +1 -1
  554. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/duck_index_entry.hpp +3 -3
  555. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/duck_schema_entry.hpp +24 -20
  556. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/duck_table_entry.hpp +6 -7
  557. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/function_entry.hpp +33 -0
  558. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/index_catalog_entry.hpp +6 -6
  559. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/macro_catalog_entry.hpp +7 -6
  560. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/pragma_function_catalog_entry.hpp +3 -3
  561. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/scalar_function_catalog_entry.hpp +4 -4
  562. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/scalar_macro_catalog_entry.hpp +2 -2
  563. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/schema_catalog_entry.hpp +24 -19
  564. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/sequence_catalog_entry.hpp +3 -3
  565. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_catalog_entry.hpp +10 -5
  566. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_function_catalog_entry.hpp +4 -4
  567. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_macro_catalog_entry.hpp +2 -2
  568. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/type_catalog_entry.hpp +3 -3
  569. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/view_catalog_entry.hpp +6 -6
  570. package/src/duckdb/src/include/duckdb/catalog/catalog_entry.hpp +42 -10
  571. package/src/duckdb/src/include/duckdb/catalog/catalog_entry_map.hpp +38 -0
  572. package/src/duckdb/src/include/duckdb/catalog/catalog_set.hpp +25 -24
  573. package/src/duckdb/src/include/duckdb/catalog/catalog_transaction.hpp +6 -3
  574. package/src/duckdb/src/include/duckdb/catalog/default/default_functions.hpp +2 -2
  575. package/src/duckdb/src/include/duckdb/catalog/default/default_types.hpp +2 -2
  576. package/src/duckdb/src/include/duckdb/catalog/default/default_views.hpp +2 -2
  577. package/src/duckdb/src/include/duckdb/catalog/dependency.hpp +4 -5
  578. package/src/duckdb/src/include/duckdb/catalog/dependency_list.hpp +6 -4
  579. package/src/duckdb/src/include/duckdb/catalog/dependency_manager.hpp +10 -9
  580. package/src/duckdb/src/include/duckdb/catalog/duck_catalog.hpp +9 -8
  581. package/src/duckdb/src/include/duckdb/catalog/similar_catalog_entry.hpp +2 -1
  582. package/src/duckdb/src/include/duckdb/catalog/standard_entry.hpp +10 -4
  583. package/src/duckdb/src/include/duckdb/common/adbc/adbc-init.hpp +37 -0
  584. package/src/duckdb/src/include/duckdb/common/adbc/adbc.h +1088 -0
  585. package/src/duckdb/src/include/duckdb/common/adbc/adbc.hpp +85 -0
  586. package/src/duckdb/src/include/duckdb/common/adbc/driver_manager.h +84 -0
  587. package/src/duckdb/src/include/duckdb/common/algorithm.hpp +1 -0
  588. package/src/duckdb/src/include/duckdb/common/allocator.hpp +2 -1
  589. package/src/duckdb/src/include/duckdb/common/arrow/arrow_appender.hpp +1 -1
  590. package/src/duckdb/src/include/duckdb/common/bit_utils.hpp +147 -0
  591. package/src/duckdb/src/include/duckdb/common/box_renderer.hpp +8 -2
  592. package/src/duckdb/src/include/duckdb/common/case_insensitive_map.hpp +2 -3
  593. package/src/duckdb/src/include/duckdb/common/common.hpp +1 -0
  594. package/src/duckdb/src/include/duckdb/common/compressed_file_system.hpp +1 -0
  595. package/src/duckdb/src/include/duckdb/common/constants.hpp +9 -29
  596. package/src/duckdb/src/include/duckdb/common/crypto/md5.hpp +1 -1
  597. package/src/duckdb/src/include/duckdb/common/enum_util.hpp +958 -0
  598. package/src/duckdb/src/include/duckdb/common/enums/aggregate_handling.hpp +2 -0
  599. package/src/duckdb/src/include/duckdb/common/enums/debug_initialize.hpp +17 -0
  600. package/src/duckdb/src/include/duckdb/common/enums/expression_type.hpp +2 -3
  601. package/src/duckdb/src/include/duckdb/{function/scalar/uuid_functions.hpp → common/enums/file_glob_options.hpp} +5 -5
  602. package/src/duckdb/src/include/duckdb/common/enums/join_type.hpp +3 -3
  603. package/src/duckdb/src/include/duckdb/common/enums/joinref_type.hpp +7 -4
  604. package/src/duckdb/src/include/duckdb/common/enums/logical_operator_type.hpp +2 -0
  605. package/src/duckdb/src/include/duckdb/common/enums/on_entry_not_found.hpp +17 -0
  606. package/src/duckdb/src/include/duckdb/common/enums/operator_result_type.hpp +16 -4
  607. package/src/duckdb/src/include/duckdb/common/enums/order_preservation_type.hpp +24 -0
  608. package/src/duckdb/src/include/duckdb/common/enums/order_type.hpp +10 -0
  609. package/src/duckdb/src/include/duckdb/common/enums/physical_operator_type.hpp +5 -0
  610. package/src/duckdb/src/include/duckdb/common/enums/set_operation_type.hpp +2 -1
  611. package/src/duckdb/src/include/duckdb/common/exception.hpp +81 -9
  612. package/src/duckdb/src/include/duckdb/common/exception_format_value.hpp +8 -3
  613. package/src/duckdb/src/include/duckdb/common/fast_mem.hpp +528 -0
  614. package/src/duckdb/src/include/duckdb/common/field_writer.hpp +12 -4
  615. package/src/duckdb/src/include/duckdb/common/file_buffer.hpp +3 -0
  616. package/src/duckdb/src/include/duckdb/common/file_system.hpp +3 -2
  617. package/src/duckdb/src/include/duckdb/common/filename_pattern.hpp +34 -0
  618. package/src/duckdb/src/include/duckdb/common/gzip_file_system.hpp +4 -1
  619. package/src/duckdb/src/include/duckdb/common/helper.hpp +70 -9
  620. package/src/duckdb/src/include/duckdb/common/hive_partitioning.hpp +16 -6
  621. package/src/duckdb/src/include/duckdb/common/{http_stats.hpp → http_state.hpp} +18 -4
  622. package/src/duckdb/src/include/duckdb/common/hugeint.hpp +63 -0
  623. package/src/duckdb/src/include/duckdb/common/multi_file_reader.hpp +200 -0
  624. package/src/duckdb/src/include/duckdb/common/multi_file_reader_options.hpp +72 -0
  625. package/src/duckdb/src/include/duckdb/common/operator/comparison_operators.hpp +45 -149
  626. package/src/duckdb/src/include/duckdb/common/operator/multiply.hpp +2 -0
  627. package/src/duckdb/src/include/duckdb/common/optional_idx.hpp +45 -0
  628. package/src/duckdb/src/include/duckdb/common/optional_ptr.hpp +76 -0
  629. package/src/duckdb/src/include/duckdb/common/perfect_map_set.hpp +34 -0
  630. package/src/duckdb/src/include/duckdb/common/preserved_error.hpp +6 -1
  631. package/src/duckdb/src/include/duckdb/common/progress_bar/progress_bar.hpp +2 -0
  632. package/src/duckdb/src/include/duckdb/common/queue.hpp +1 -1
  633. package/src/duckdb/src/include/duckdb/common/radix.hpp +1 -1
  634. package/src/duckdb/src/include/duckdb/common/radix_partitioning.hpp +83 -27
  635. package/src/duckdb/src/include/duckdb/common/re2_regex.hpp +3 -3
  636. package/src/duckdb/src/include/duckdb/common/reference_map.hpp +38 -0
  637. package/src/duckdb/src/include/duckdb/common/row_operations/row_operations.hpp +21 -9
  638. package/src/duckdb/src/include/duckdb/common/serializer/binary_deserializer.hpp +93 -0
  639. package/src/duckdb/src/include/duckdb/common/serializer/binary_serializer.hpp +92 -0
  640. package/src/duckdb/src/include/duckdb/common/serializer/buffered_deserializer.hpp +4 -2
  641. package/src/duckdb/src/include/duckdb/common/serializer/buffered_file_reader.hpp +9 -2
  642. package/src/duckdb/src/include/duckdb/common/serializer/format_deserializer.hpp +377 -0
  643. package/src/duckdb/src/include/duckdb/common/serializer/format_serializer.hpp +248 -0
  644. package/src/duckdb/src/include/duckdb/common/serializer/serialization_traits.hpp +109 -0
  645. package/src/duckdb/src/include/duckdb/common/serializer.hpp +13 -0
  646. package/src/duckdb/src/include/duckdb/common/set.hpp +2 -1
  647. package/src/duckdb/src/include/duckdb/common/shared_ptr.hpp +11 -0
  648. package/src/duckdb/src/include/duckdb/common/sort/comparators.hpp +1 -1
  649. package/src/duckdb/src/include/duckdb/common/sort/partition_state.hpp +198 -0
  650. package/src/duckdb/src/include/duckdb/common/sort/sort.hpp +1 -1
  651. package/src/duckdb/src/include/duckdb/common/sort/sorted_block.hpp +2 -2
  652. package/src/duckdb/src/include/duckdb/common/string_util.hpp +39 -0
  653. package/src/duckdb/src/include/duckdb/common/typedefs.hpp +31 -0
  654. package/src/duckdb/src/include/duckdb/common/types/batched_data_collection.hpp +1 -1
  655. package/src/duckdb/src/include/duckdb/common/types/bit.hpp +7 -6
  656. package/src/duckdb/src/include/duckdb/common/types/{column_data_allocator.hpp → column/column_data_allocator.hpp} +4 -4
  657. package/src/duckdb/src/include/duckdb/common/types/{column_data_collection.hpp → column/column_data_collection.hpp} +4 -4
  658. package/src/duckdb/src/include/duckdb/common/types/{column_data_collection_iterators.hpp → column/column_data_collection_iterators.hpp} +2 -2
  659. package/src/duckdb/src/include/duckdb/common/types/{column_data_collection_segment.hpp → column/column_data_collection_segment.hpp} +3 -3
  660. package/src/duckdb/src/include/duckdb/common/types/{column_data_consumer.hpp → column/column_data_consumer.hpp} +8 -4
  661. package/src/duckdb/src/include/duckdb/common/types/{column_data_scan_states.hpp → column/column_data_scan_states.hpp} +1 -1
  662. package/src/duckdb/src/include/duckdb/common/types/{partitioned_column_data.hpp → column/partitioned_column_data.hpp} +16 -8
  663. package/src/duckdb/src/include/duckdb/common/types/conflict_manager.hpp +3 -2
  664. package/src/duckdb/src/include/duckdb/common/types/interval.hpp +39 -3
  665. package/src/duckdb/src/include/duckdb/common/types/list_segment.hpp +62 -0
  666. package/src/duckdb/src/include/duckdb/common/types/row/partitioned_tuple_data.hpp +140 -0
  667. package/src/duckdb/src/include/duckdb/common/types/{row_data_collection.hpp → row/row_data_collection.hpp} +4 -3
  668. package/src/duckdb/src/include/duckdb/common/types/{row_data_collection_scanner.hpp → row/row_data_collection_scanner.hpp} +2 -2
  669. package/src/duckdb/src/include/duckdb/common/types/{row_layout.hpp → row/row_layout.hpp} +3 -1
  670. package/src/duckdb/src/include/duckdb/common/types/row/tuple_data_allocator.hpp +116 -0
  671. package/src/duckdb/src/include/duckdb/common/types/row/tuple_data_collection.hpp +239 -0
  672. package/src/duckdb/src/include/duckdb/common/types/row/tuple_data_iterator.hpp +64 -0
  673. package/src/duckdb/src/include/duckdb/common/types/row/tuple_data_layout.hpp +113 -0
  674. package/src/duckdb/src/include/duckdb/common/types/row/tuple_data_segment.hpp +124 -0
  675. package/src/duckdb/src/include/duckdb/common/types/row/tuple_data_states.hpp +74 -0
  676. package/src/duckdb/src/include/duckdb/common/types/selection_vector.hpp +1 -1
  677. package/src/duckdb/src/include/duckdb/common/types/string_type.hpp +79 -7
  678. package/src/duckdb/src/include/duckdb/common/types/time.hpp +3 -0
  679. package/src/duckdb/src/include/duckdb/common/types/validity_mask.hpp +7 -1
  680. package/src/duckdb/src/include/duckdb/common/types/value.hpp +20 -53
  681. package/src/duckdb/src/include/duckdb/common/types/value_map.hpp +1 -1
  682. package/src/duckdb/src/include/duckdb/common/types/vector.hpp +14 -2
  683. package/src/duckdb/src/include/duckdb/common/types/vector_buffer.hpp +1 -1
  684. package/src/duckdb/src/include/duckdb/common/types.hpp +47 -63
  685. package/src/duckdb/src/include/duckdb/common/union_by_name.hpp +17 -66
  686. package/src/duckdb/src/include/duckdb/common/unique_ptr.hpp +61 -0
  687. package/src/duckdb/src/include/duckdb/common/vector.hpp +92 -2
  688. package/src/duckdb/src/include/duckdb/common/vector_operations/aggregate_executor.hpp +2 -2
  689. package/src/duckdb/src/include/duckdb/common/vector_operations/unary_executor.hpp +2 -2
  690. package/src/duckdb/src/include/duckdb/{function → core_functions}/aggregate/algebraic/corr.hpp +3 -4
  691. package/src/duckdb/src/include/duckdb/{function → core_functions}/aggregate/algebraic/covar.hpp +1 -1
  692. package/src/duckdb/src/include/duckdb/{function → core_functions}/aggregate/algebraic/stddev.hpp +1 -1
  693. package/src/duckdb/src/include/duckdb/core_functions/aggregate/algebraic_functions.hpp +124 -0
  694. package/src/duckdb/src/include/duckdb/core_functions/aggregate/distributive_functions.hpp +229 -0
  695. package/src/duckdb/src/include/duckdb/core_functions/aggregate/holistic_functions.hpp +85 -0
  696. package/src/duckdb/src/include/duckdb/core_functions/aggregate/nested_functions.hpp +41 -0
  697. package/src/duckdb/src/include/duckdb/{function → core_functions}/aggregate/regression/regr_count.hpp +3 -4
  698. package/src/duckdb/src/include/duckdb/{function → core_functions}/aggregate/regression/regr_slope.hpp +2 -2
  699. package/src/duckdb/src/include/duckdb/core_functions/aggregate/regression_functions.hpp +97 -0
  700. package/src/duckdb/src/include/duckdb/{function → core_functions}/aggregate/sum_helpers.hpp +1 -1
  701. package/src/duckdb/src/include/duckdb/core_functions/core_functions.hpp +22 -0
  702. package/src/duckdb/src/include/duckdb/core_functions/function_list.hpp +33 -0
  703. package/src/duckdb/src/include/duckdb/core_functions/scalar/bit_functions.hpp +52 -0
  704. package/src/duckdb/src/include/duckdb/core_functions/scalar/blob_functions.hpp +58 -0
  705. package/src/duckdb/src/include/duckdb/core_functions/scalar/date_functions.hpp +544 -0
  706. package/src/duckdb/src/include/duckdb/core_functions/scalar/enum_functions.hpp +61 -0
  707. package/src/duckdb/src/include/duckdb/core_functions/scalar/generic_functions.hpp +142 -0
  708. package/src/duckdb/src/include/duckdb/core_functions/scalar/list_functions.hpp +220 -0
  709. package/src/duckdb/src/include/duckdb/core_functions/scalar/map_functions.hpp +98 -0
  710. package/src/duckdb/src/include/duckdb/core_functions/scalar/math_functions.hpp +394 -0
  711. package/src/duckdb/src/include/duckdb/core_functions/scalar/operators_functions.hpp +70 -0
  712. package/src/duckdb/src/include/duckdb/core_functions/scalar/random_functions.hpp +49 -0
  713. package/src/duckdb/src/include/duckdb/core_functions/scalar/string_functions.hpp +454 -0
  714. package/src/duckdb/src/include/duckdb/core_functions/scalar/struct_functions.hpp +40 -0
  715. package/src/duckdb/src/include/duckdb/core_functions/scalar/union_functions.hpp +43 -0
  716. package/src/duckdb/src/include/duckdb/execution/aggregate_hashtable.hpp +70 -47
  717. package/src/duckdb/src/include/duckdb/execution/base_aggregate_hashtable.hpp +2 -2
  718. package/src/duckdb/src/include/duckdb/execution/execution_context.hpp +3 -2
  719. package/src/duckdb/src/include/duckdb/execution/executor.hpp +17 -8
  720. package/src/duckdb/src/include/duckdb/execution/expression_executor.hpp +1 -1
  721. package/src/duckdb/src/include/duckdb/execution/expression_executor_state.hpp +1 -3
  722. package/src/duckdb/src/include/duckdb/execution/index/art/art.hpp +56 -59
  723. package/src/duckdb/src/include/duckdb/execution/index/art/art_key.hpp +29 -24
  724. package/src/duckdb/src/include/duckdb/execution/index/art/fixed_size_allocator.hpp +114 -0
  725. package/src/duckdb/src/include/duckdb/execution/index/art/iterator.hpp +26 -20
  726. package/src/duckdb/src/include/duckdb/execution/index/art/leaf.hpp +63 -39
  727. package/src/duckdb/src/include/duckdb/execution/index/art/leaf_segment.hpp +36 -0
  728. package/src/duckdb/src/include/duckdb/execution/index/art/node.hpp +98 -116
  729. package/src/duckdb/src/include/duckdb/execution/index/art/node16.hpp +48 -36
  730. package/src/duckdb/src/include/duckdb/execution/index/art/node256.hpp +52 -35
  731. package/src/duckdb/src/include/duckdb/execution/index/art/node4.hpp +46 -36
  732. package/src/duckdb/src/include/duckdb/execution/index/art/node48.hpp +57 -35
  733. package/src/duckdb/src/include/duckdb/execution/index/art/prefix.hpp +57 -50
  734. package/src/duckdb/src/include/duckdb/execution/index/art/prefix_segment.hpp +40 -0
  735. package/src/duckdb/src/include/duckdb/execution/index/art/swizzleable_pointer.hpp +38 -31
  736. package/src/duckdb/src/include/duckdb/execution/join_hashtable.hpp +41 -67
  737. package/src/duckdb/src/include/duckdb/execution/nested_loop_join.hpp +1 -1
  738. package/src/duckdb/src/include/duckdb/execution/operator/aggregate/aggregate_object.hpp +15 -2
  739. package/src/duckdb/src/include/duckdb/execution/operator/aggregate/distinct_aggregate_data.hpp +2 -2
  740. package/src/duckdb/src/include/duckdb/execution/operator/aggregate/grouped_aggregate_data.hpp +2 -2
  741. package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_hash_aggregate.hpp +20 -13
  742. package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_perfecthash_aggregate.hpp +13 -5
  743. package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_streaming_window.hpp +5 -2
  744. package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_ungrouped_aggregate.hpp +12 -7
  745. package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_window.hpp +11 -7
  746. package/src/duckdb/src/include/duckdb/execution/operator/filter/physical_filter.hpp +3 -0
  747. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_batch_collector.hpp +1 -2
  748. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_execute.hpp +6 -4
  749. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_explain_analyze.hpp +9 -5
  750. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_limit.hpp +10 -5
  751. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_limit_percent.hpp +10 -5
  752. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_load.hpp +8 -2
  753. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_materialized_collector.hpp +2 -2
  754. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_pragma.hpp +8 -2
  755. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_prepare.hpp +8 -2
  756. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_reservoir_sample.hpp +6 -4
  757. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_reset.hpp +8 -2
  758. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_result_collector.hpp +6 -3
  759. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_set.hpp +8 -2
  760. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_streaming_limit.hpp +4 -1
  761. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_streaming_sample.hpp +3 -0
  762. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_transaction.hpp +8 -2
  763. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_vacuum.hpp +9 -4
  764. package/src/duckdb/src/include/duckdb/execution/operator/join/outer_join_marker.hpp +8 -3
  765. package/src/duckdb/src/include/duckdb/execution/operator/join/perfect_hash_join_executor.hpp +2 -2
  766. package/src/duckdb/src/include/duckdb/execution/operator/join/physical_asof_join.hpp +91 -0
  767. package/src/duckdb/src/include/duckdb/execution/operator/join/physical_blockwise_nl_join.hpp +5 -4
  768. package/src/duckdb/src/include/duckdb/execution/operator/join/physical_cross_product.hpp +14 -9
  769. package/src/duckdb/src/include/duckdb/execution/operator/join/physical_delim_join.hpp +11 -6
  770. package/src/duckdb/src/include/duckdb/execution/operator/join/physical_hash_join.hpp +5 -6
  771. package/src/duckdb/src/include/duckdb/execution/operator/join/physical_iejoin.hpp +5 -4
  772. package/src/duckdb/src/include/duckdb/execution/operator/join/physical_index_join.hpp +9 -7
  773. package/src/duckdb/src/include/duckdb/execution/operator/join/physical_join.hpp +11 -2
  774. package/src/duckdb/src/include/duckdb/execution/operator/join/physical_nested_loop_join.hpp +5 -8
  775. package/src/duckdb/src/include/duckdb/execution/operator/join/physical_piecewise_merge_join.hpp +5 -4
  776. package/src/duckdb/src/include/duckdb/execution/operator/join/physical_positional_join.hpp +7 -6
  777. package/src/duckdb/src/include/duckdb/execution/operator/order/physical_order.hpp +13 -5
  778. package/src/duckdb/src/include/duckdb/execution/operator/order/physical_top_n.hpp +12 -4
  779. package/src/duckdb/src/include/duckdb/execution/operator/persistent/base_csv_reader.hpp +16 -11
  780. package/src/duckdb/src/include/duckdb/execution/operator/persistent/buffered_csv_reader.hpp +4 -1
  781. package/src/duckdb/src/include/duckdb/execution/operator/persistent/csv_buffer.hpp +8 -3
  782. package/src/duckdb/src/include/duckdb/execution/operator/persistent/csv_file_handle.hpp +4 -1
  783. package/src/duckdb/src/include/duckdb/execution/operator/persistent/csv_reader_options.hpp +22 -16
  784. package/src/duckdb/src/include/duckdb/execution/operator/persistent/parallel_csv_reader.hpp +5 -1
  785. package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_batch_copy_to_file.hpp +81 -0
  786. package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_batch_insert.hpp +14 -9
  787. package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_copy_to_file.hpp +16 -7
  788. package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_delete.hpp +9 -4
  789. package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_export.hpp +10 -5
  790. package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_fixed_batch_copy.hpp +72 -0
  791. package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_insert.hpp +22 -12
  792. package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_update.hpp +9 -4
  793. package/src/duckdb/src/include/duckdb/execution/operator/projection/physical_pivot.hpp +38 -0
  794. package/src/duckdb/src/include/duckdb/execution/operator/projection/physical_projection.hpp +8 -0
  795. package/src/duckdb/src/include/duckdb/execution/operator/projection/physical_tableinout_function.hpp +4 -2
  796. package/src/duckdb/src/include/duckdb/execution/operator/projection/physical_unnest.hpp +3 -1
  797. package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_column_data_scan.hpp +12 -7
  798. package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_dummy_scan.hpp +8 -3
  799. package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_empty_result.hpp +8 -2
  800. package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_expression_scan.hpp +3 -0
  801. package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_positional_scan.hpp +8 -2
  802. package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_table_scan.hpp +7 -2
  803. package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_alter.hpp +8 -3
  804. package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_attach.hpp +8 -3
  805. package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_function.hpp +8 -3
  806. package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_index.hpp +9 -4
  807. package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_schema.hpp +8 -3
  808. package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_sequence.hpp +8 -3
  809. package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_table.hpp +10 -5
  810. package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_type.hpp +13 -5
  811. package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_view.hpp +8 -3
  812. package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_detach.hpp +8 -3
  813. package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_drop.hpp +8 -3
  814. package/src/duckdb/src/include/duckdb/execution/operator/set/physical_recursive_cte.hpp +11 -6
  815. package/src/duckdb/src/include/duckdb/execution/operator/set/physical_union.hpp +5 -1
  816. package/src/duckdb/src/include/duckdb/execution/partitionable_hashtable.hpp +10 -6
  817. package/src/duckdb/src/include/duckdb/execution/perfect_aggregate_hashtable.hpp +4 -0
  818. package/src/duckdb/src/include/duckdb/execution/physical_operator.hpp +44 -74
  819. package/src/duckdb/src/include/duckdb/execution/physical_operator_states.hpp +170 -0
  820. package/src/duckdb/src/include/duckdb/execution/physical_plan_generator.hpp +2 -3
  821. package/src/duckdb/src/include/duckdb/execution/radix_partitioned_hashtable.hpp +6 -6
  822. package/src/duckdb/src/include/duckdb/execution/window_segment_tree.hpp +55 -5
  823. package/src/duckdb/src/include/duckdb/function/aggregate/distributive_functions.hpp +0 -85
  824. package/src/duckdb/src/include/duckdb/function/aggregate_function.hpp +11 -7
  825. package/src/duckdb/src/include/duckdb/function/built_in_functions.hpp +0 -8
  826. package/src/duckdb/src/include/duckdb/function/cast/bound_cast_data.hpp +84 -0
  827. package/src/duckdb/src/include/duckdb/function/cast/cast_function_set.hpp +3 -3
  828. package/src/duckdb/src/include/duckdb/function/cast/default_casts.hpp +42 -65
  829. package/src/duckdb/src/include/duckdb/function/cast/vector_cast_helpers.hpp +2 -2
  830. package/src/duckdb/src/include/duckdb/function/copy_function.hpp +56 -4
  831. package/src/duckdb/src/include/duckdb/function/function.hpp +22 -4
  832. package/src/duckdb/src/include/duckdb/function/function_binder.hpp +3 -6
  833. package/src/duckdb/src/include/duckdb/function/function_serialization.hpp +4 -4
  834. package/src/duckdb/src/include/duckdb/function/function_set.hpp +7 -2
  835. package/src/duckdb/src/include/duckdb/function/macro_function.hpp +20 -3
  836. package/src/duckdb/src/include/duckdb/function/pragma_function.hpp +1 -1
  837. package/src/duckdb/src/include/duckdb/function/scalar/generic_functions.hpp +1 -32
  838. package/src/duckdb/src/include/duckdb/function/scalar/list/contains_or_position.hpp +138 -0
  839. package/src/duckdb/src/include/duckdb/function/scalar/nested_functions.hpp +33 -106
  840. package/src/duckdb/src/include/duckdb/function/scalar/operators.hpp +0 -24
  841. package/src/duckdb/src/include/duckdb/function/scalar/regexp.hpp +81 -1
  842. package/src/duckdb/src/include/duckdb/function/scalar/{strftime.hpp → strftime_format.hpp} +4 -0
  843. package/src/duckdb/src/include/duckdb/function/scalar/string_functions.hpp +3 -91
  844. package/src/duckdb/src/include/duckdb/function/scalar_function.hpp +14 -2
  845. package/src/duckdb/src/include/duckdb/function/scalar_macro_function.hpp +5 -2
  846. package/src/duckdb/src/include/duckdb/function/table/arrow.hpp +13 -2
  847. package/src/duckdb/src/include/duckdb/function/table/range.hpp +4 -0
  848. package/src/duckdb/src/include/duckdb/function/table/read_csv.hpp +44 -7
  849. package/src/duckdb/src/include/duckdb/function/table/table_scan.hpp +5 -4
  850. package/src/duckdb/src/include/duckdb/function/table_function.hpp +58 -16
  851. package/src/duckdb/src/include/duckdb/function/table_macro_function.hpp +6 -3
  852. package/src/duckdb/src/include/duckdb/main/attached_database.hpp +2 -0
  853. package/src/duckdb/src/include/duckdb/main/capi/cast/utils.hpp +1 -1
  854. package/src/duckdb/src/include/duckdb/main/client_config.hpp +14 -2
  855. package/src/duckdb/src/include/duckdb/main/client_context.hpp +1 -1
  856. package/src/duckdb/src/include/duckdb/main/client_data.hpp +6 -3
  857. package/src/duckdb/src/include/duckdb/main/config.hpp +15 -8
  858. package/src/duckdb/src/include/duckdb/main/connection_manager.hpp +2 -0
  859. package/src/duckdb/src/include/duckdb/main/database.hpp +1 -2
  860. package/src/duckdb/src/include/duckdb/main/database_manager.hpp +9 -4
  861. package/src/duckdb/src/include/duckdb/main/database_path_and_type.hpp +24 -0
  862. package/src/duckdb/src/include/duckdb/main/extension_entries.hpp +5 -0
  863. package/src/duckdb/src/include/duckdb/main/extension_helper.hpp +0 -2
  864. package/src/duckdb/src/include/duckdb/main/extension_util.hpp +48 -0
  865. package/src/duckdb/src/include/duckdb/main/materialized_query_result.hpp +1 -1
  866. package/src/duckdb/src/include/duckdb/main/prepared_statement.hpp +2 -0
  867. package/src/duckdb/src/include/duckdb/main/query_profiler.hpp +10 -9
  868. package/src/duckdb/src/include/duckdb/main/query_result.hpp +19 -5
  869. package/src/duckdb/src/include/duckdb/main/relation/explain_relation.hpp +2 -1
  870. package/src/duckdb/src/include/duckdb/main/relation/setop_relation.hpp +1 -0
  871. package/src/duckdb/src/include/duckdb/main/relation.hpp +2 -1
  872. package/src/duckdb/src/include/duckdb/main/settings.hpp +39 -0
  873. package/src/duckdb/src/include/duckdb/optimizer/cse_optimizer.hpp +1 -1
  874. package/src/duckdb/src/include/duckdb/optimizer/expression_rewriter.hpp +3 -3
  875. package/src/duckdb/src/include/duckdb/optimizer/filter_combiner.hpp +9 -9
  876. package/src/duckdb/src/include/duckdb/optimizer/filter_pushdown.hpp +2 -0
  877. package/src/duckdb/src/include/duckdb/optimizer/join_order/cardinality_estimator.hpp +16 -16
  878. package/src/duckdb/src/include/duckdb/optimizer/join_order/join_node.hpp +8 -8
  879. package/src/duckdb/src/include/duckdb/optimizer/join_order/join_order_optimizer.hpp +23 -15
  880. package/src/duckdb/src/include/duckdb/optimizer/join_order/join_relation.hpp +9 -10
  881. package/src/duckdb/src/include/duckdb/optimizer/join_order/query_graph.hpp +18 -11
  882. package/src/duckdb/src/include/duckdb/optimizer/matcher/expression_matcher.hpp +11 -11
  883. package/src/duckdb/src/include/duckdb/optimizer/matcher/set_matcher.hpp +8 -8
  884. package/src/duckdb/src/include/duckdb/optimizer/rule/arithmetic_simplification.hpp +1 -1
  885. package/src/duckdb/src/include/duckdb/optimizer/rule/case_simplification.hpp +1 -1
  886. package/src/duckdb/src/include/duckdb/optimizer/rule/comparison_simplification.hpp +1 -1
  887. package/src/duckdb/src/include/duckdb/optimizer/rule/conjunction_simplification.hpp +2 -2
  888. package/src/duckdb/src/include/duckdb/optimizer/rule/constant_folding.hpp +1 -1
  889. package/src/duckdb/src/include/duckdb/optimizer/rule/date_part_simplification.hpp +1 -1
  890. package/src/duckdb/src/include/duckdb/optimizer/rule/distributivity.hpp +1 -1
  891. package/src/duckdb/src/include/duckdb/optimizer/rule/empty_needle_removal.hpp +1 -1
  892. package/src/duckdb/src/include/duckdb/optimizer/rule/enum_comparison.hpp +1 -1
  893. package/src/duckdb/src/include/duckdb/optimizer/rule/equal_or_null_simplification.hpp +1 -1
  894. package/src/duckdb/src/include/duckdb/optimizer/rule/in_clause_simplification.hpp +1 -1
  895. package/src/duckdb/src/include/duckdb/optimizer/rule/like_optimizations.hpp +2 -2
  896. package/src/duckdb/src/include/duckdb/optimizer/rule/list.hpp +1 -0
  897. package/src/duckdb/src/include/duckdb/optimizer/rule/move_constants.hpp +1 -1
  898. package/src/duckdb/src/include/duckdb/optimizer/rule/ordered_aggregate_optimizer.hpp +24 -0
  899. package/src/duckdb/src/include/duckdb/optimizer/rule/regex_optimizations.hpp +1 -1
  900. package/src/duckdb/src/include/duckdb/optimizer/rule.hpp +2 -2
  901. package/src/duckdb/src/include/duckdb/parallel/concurrentqueue.hpp +2 -0
  902. package/src/duckdb/src/include/duckdb/parallel/event.hpp +1 -1
  903. package/src/duckdb/src/include/duckdb/parallel/interrupt.hpp +63 -0
  904. package/src/duckdb/src/include/duckdb/parallel/meta_pipeline.hpp +5 -5
  905. package/src/duckdb/src/include/duckdb/parallel/pipeline.hpp +34 -20
  906. package/src/duckdb/src/include/duckdb/parallel/pipeline_executor.hpp +53 -9
  907. package/src/duckdb/src/include/duckdb/parallel/task.hpp +21 -2
  908. package/src/duckdb/src/include/duckdb/parallel/task_counter.hpp +2 -2
  909. package/src/duckdb/src/include/duckdb/parallel/task_scheduler.hpp +2 -2
  910. package/src/duckdb/src/include/duckdb/parser/base_expression.hpp +19 -1
  911. package/src/duckdb/src/include/duckdb/parser/common_table_expression_info.hpp +2 -0
  912. package/src/duckdb/src/include/duckdb/parser/constraint.hpp +18 -0
  913. package/src/duckdb/src/include/duckdb/parser/constraints/check_constraint.hpp +3 -0
  914. package/src/duckdb/src/include/duckdb/parser/constraints/foreign_key_constraint.hpp +3 -0
  915. package/src/duckdb/src/include/duckdb/parser/constraints/not_null_constraint.hpp +3 -0
  916. package/src/duckdb/src/include/duckdb/parser/constraints/unique_constraint.hpp +3 -0
  917. package/src/duckdb/src/include/duckdb/parser/expression/between_expression.hpp +6 -0
  918. package/src/duckdb/src/include/duckdb/parser/expression/bound_expression.hpp +7 -0
  919. package/src/duckdb/src/include/duckdb/parser/expression/case_expression.hpp +8 -0
  920. package/src/duckdb/src/include/duckdb/parser/expression/cast_expression.hpp +5 -0
  921. package/src/duckdb/src/include/duckdb/parser/expression/collate_expression.hpp +5 -0
  922. package/src/duckdb/src/include/duckdb/parser/expression/columnref_expression.hpp +5 -0
  923. package/src/duckdb/src/include/duckdb/parser/expression/comparison_expression.hpp +5 -0
  924. package/src/duckdb/src/include/duckdb/parser/expression/conjunction_expression.hpp +5 -0
  925. package/src/duckdb/src/include/duckdb/parser/expression/constant_expression.hpp +6 -0
  926. package/src/duckdb/src/include/duckdb/parser/expression/default_expression.hpp +4 -0
  927. package/src/duckdb/src/include/duckdb/parser/expression/function_expression.hpp +7 -2
  928. package/src/duckdb/src/include/duckdb/parser/expression/lambda_expression.hpp +5 -0
  929. package/src/duckdb/src/include/duckdb/parser/expression/operator_expression.hpp +5 -0
  930. package/src/duckdb/src/include/duckdb/parser/expression/parameter_expression.hpp +5 -0
  931. package/src/duckdb/src/include/duckdb/parser/expression/positional_reference_expression.hpp +5 -0
  932. package/src/duckdb/src/include/duckdb/parser/expression/star_expression.hpp +7 -2
  933. package/src/duckdb/src/include/duckdb/parser/expression/subquery_expression.hpp +5 -0
  934. package/src/duckdb/src/include/duckdb/parser/expression/window_expression.hpp +14 -2
  935. package/src/duckdb/src/include/duckdb/parser/expression_map.hpp +19 -6
  936. package/src/duckdb/src/include/duckdb/parser/expression_util.hpp +1 -1
  937. package/src/duckdb/src/include/duckdb/parser/keyword_helper.hpp +2 -2
  938. package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_info.hpp +10 -5
  939. package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_table_info.hpp +7 -1
  940. package/src/duckdb/src/include/duckdb/parser/parsed_data/attach_info.hpp +1 -1
  941. package/src/duckdb/src/include/duckdb/parser/parsed_data/copy_info.hpp +1 -1
  942. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_database_info.hpp +2 -2
  943. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_function_info.hpp +6 -0
  944. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_macro_info.hpp +1 -1
  945. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_schema_info.hpp +2 -2
  946. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_sequence_info.hpp +1 -1
  947. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_table_info.hpp +1 -1
  948. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_type_info.hpp +1 -1
  949. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_view_info.hpp +1 -1
  950. package/src/duckdb/src/include/duckdb/parser/parsed_data/detach_info.hpp +4 -3
  951. package/src/duckdb/src/include/duckdb/parser/parsed_data/drop_info.hpp +7 -7
  952. package/src/duckdb/src/include/duckdb/parser/parsed_data/exported_table_data.hpp +6 -2
  953. package/src/duckdb/src/include/duckdb/parser/parsed_data/load_info.hpp +2 -2
  954. package/src/duckdb/src/include/duckdb/parser/parsed_data/parse_info.hpp +13 -0
  955. package/src/duckdb/src/include/duckdb/parser/parsed_data/pragma_info.hpp +1 -1
  956. package/src/duckdb/src/include/duckdb/parser/parsed_data/sample_options.hpp +3 -0
  957. package/src/duckdb/src/include/duckdb/parser/parsed_data/show_select_info.hpp +1 -1
  958. package/src/duckdb/src/include/duckdb/parser/parsed_data/vacuum_info.hpp +4 -3
  959. package/src/duckdb/src/include/duckdb/parser/parsed_expression.hpp +5 -0
  960. package/src/duckdb/src/include/duckdb/parser/parser.hpp +1 -7
  961. package/src/duckdb/src/include/duckdb/parser/parser_options.hpp +23 -0
  962. package/src/duckdb/src/include/duckdb/parser/query_error_context.hpp +4 -2
  963. package/src/duckdb/src/include/duckdb/parser/query_node/list.hpp +3 -0
  964. package/src/duckdb/src/include/duckdb/parser/query_node/recursive_cte_node.hpp +6 -0
  965. package/src/duckdb/src/include/duckdb/parser/query_node/select_node.hpp +8 -0
  966. package/src/duckdb/src/include/duckdb/parser/query_node/set_operation_node.hpp +6 -0
  967. package/src/duckdb/src/include/duckdb/parser/query_node.hpp +29 -1
  968. package/src/duckdb/src/include/duckdb/parser/result_modifier.hpp +24 -1
  969. package/src/duckdb/src/include/duckdb/parser/sql_statement.hpp +20 -1
  970. package/src/duckdb/src/include/duckdb/parser/statement/alter_statement.hpp +3 -0
  971. package/src/duckdb/src/include/duckdb/parser/statement/attach_statement.hpp +3 -0
  972. package/src/duckdb/src/include/duckdb/parser/statement/call_statement.hpp +3 -0
  973. package/src/duckdb/src/include/duckdb/parser/statement/copy_statement.hpp +3 -0
  974. package/src/duckdb/src/include/duckdb/parser/statement/create_statement.hpp +3 -0
  975. package/src/duckdb/src/include/duckdb/parser/statement/delete_statement.hpp +3 -0
  976. package/src/duckdb/src/include/duckdb/parser/statement/detach_statement.hpp +3 -0
  977. package/src/duckdb/src/include/duckdb/parser/statement/drop_statement.hpp +3 -0
  978. package/src/duckdb/src/include/duckdb/parser/statement/execute_statement.hpp +3 -0
  979. package/src/duckdb/src/include/duckdb/parser/statement/explain_statement.hpp +3 -0
  980. package/src/duckdb/src/include/duckdb/parser/statement/export_statement.hpp +3 -0
  981. package/src/duckdb/src/include/duckdb/parser/statement/extension_statement.hpp +3 -0
  982. package/src/duckdb/src/include/duckdb/parser/statement/insert_statement.hpp +7 -1
  983. package/src/duckdb/src/include/duckdb/parser/statement/list.hpp +1 -0
  984. package/src/duckdb/src/include/duckdb/parser/statement/load_statement.hpp +3 -0
  985. package/src/duckdb/src/include/duckdb/parser/statement/logical_plan_statement.hpp +3 -0
  986. package/src/duckdb/src/include/duckdb/parser/statement/multi_statement.hpp +3 -0
  987. package/src/duckdb/src/include/duckdb/parser/statement/pragma_statement.hpp +3 -0
  988. package/src/duckdb/src/include/duckdb/parser/statement/prepare_statement.hpp +3 -0
  989. package/src/duckdb/src/include/duckdb/parser/statement/relation_statement.hpp +3 -0
  990. package/src/duckdb/src/include/duckdb/parser/statement/select_statement.hpp +9 -1
  991. package/src/duckdb/src/include/duckdb/parser/statement/set_statement.hpp +3 -0
  992. package/src/duckdb/src/include/duckdb/parser/statement/show_statement.hpp +3 -0
  993. package/src/duckdb/src/include/duckdb/parser/statement/transaction_statement.hpp +3 -0
  994. package/src/duckdb/src/include/duckdb/parser/statement/update_statement.hpp +3 -0
  995. package/src/duckdb/src/include/duckdb/parser/statement/vacuum_statement.hpp +3 -0
  996. package/src/duckdb/src/include/duckdb/parser/tableref/basetableref.hpp +7 -0
  997. package/src/duckdb/src/include/duckdb/parser/tableref/emptytableref.hpp +5 -0
  998. package/src/duckdb/src/include/duckdb/parser/tableref/expressionlistref.hpp +6 -0
  999. package/src/duckdb/src/include/duckdb/parser/tableref/joinref.hpp +6 -0
  1000. package/src/duckdb/src/include/duckdb/parser/tableref/pivotref.hpp +30 -2
  1001. package/src/duckdb/src/include/duckdb/parser/tableref/subqueryref.hpp +6 -0
  1002. package/src/duckdb/src/include/duckdb/parser/tableref/table_function_ref.hpp +6 -0
  1003. package/src/duckdb/src/include/duckdb/parser/tableref.hpp +23 -1
  1004. package/src/duckdb/src/include/duckdb/parser/transformer.hpp +33 -42
  1005. package/src/duckdb/src/include/duckdb/planner/bind_context.hpp +16 -17
  1006. package/src/duckdb/src/include/duckdb/planner/binder.hpp +41 -35
  1007. package/src/duckdb/src/include/duckdb/planner/bound_constraint.hpp +19 -1
  1008. package/src/duckdb/src/include/duckdb/planner/bound_query_node.hpp +17 -0
  1009. package/src/duckdb/src/include/duckdb/planner/bound_result_modifier.hpp +8 -1
  1010. package/src/duckdb/src/include/duckdb/planner/bound_tableref.hpp +17 -0
  1011. package/src/duckdb/src/include/duckdb/planner/bound_tokens.hpp +1 -0
  1012. package/src/duckdb/src/include/duckdb/planner/column_binding.hpp +6 -0
  1013. package/src/duckdb/src/include/duckdb/planner/constraints/bound_check_constraint.hpp +3 -0
  1014. package/src/duckdb/src/include/duckdb/planner/constraints/bound_foreign_key_constraint.hpp +3 -0
  1015. package/src/duckdb/src/include/duckdb/planner/constraints/bound_not_null_constraint.hpp +3 -0
  1016. package/src/duckdb/src/include/duckdb/planner/constraints/bound_unique_constraint.hpp +3 -0
  1017. package/src/duckdb/src/include/duckdb/planner/expression/bound_aggregate_expression.hpp +7 -0
  1018. package/src/duckdb/src/include/duckdb/planner/expression/bound_between_expression.hpp +3 -0
  1019. package/src/duckdb/src/include/duckdb/planner/expression/bound_case_expression.hpp +3 -0
  1020. package/src/duckdb/src/include/duckdb/planner/expression/bound_cast_expression.hpp +3 -0
  1021. package/src/duckdb/src/include/duckdb/planner/expression/bound_columnref_expression.hpp +4 -0
  1022. package/src/duckdb/src/include/duckdb/planner/expression/bound_comparison_expression.hpp +3 -0
  1023. package/src/duckdb/src/include/duckdb/planner/expression/bound_conjunction_expression.hpp +3 -0
  1024. package/src/duckdb/src/include/duckdb/planner/expression/bound_constant_expression.hpp +3 -0
  1025. package/src/duckdb/src/include/duckdb/planner/expression/bound_default_expression.hpp +4 -1
  1026. package/src/duckdb/src/include/duckdb/planner/expression/bound_function_expression.hpp +3 -0
  1027. package/src/duckdb/src/include/duckdb/planner/expression/bound_lambda_expression.hpp +3 -0
  1028. package/src/duckdb/src/include/duckdb/planner/expression/bound_lambdaref_expression.hpp +3 -0
  1029. package/src/duckdb/src/include/duckdb/planner/expression/bound_operator_expression.hpp +3 -0
  1030. package/src/duckdb/src/include/duckdb/planner/expression/bound_parameter_expression.hpp +3 -0
  1031. package/src/duckdb/src/include/duckdb/planner/expression/bound_reference_expression.hpp +3 -0
  1032. package/src/duckdb/src/include/duckdb/planner/expression/bound_subquery_expression.hpp +3 -0
  1033. package/src/duckdb/src/include/duckdb/planner/expression/bound_unnest_expression.hpp +3 -0
  1034. package/src/duckdb/src/include/duckdb/planner/expression/bound_window_expression.hpp +4 -1
  1035. package/src/duckdb/src/include/duckdb/planner/expression.hpp +5 -2
  1036. package/src/duckdb/src/include/duckdb/planner/expression_binder/aggregate_binder.hpp +1 -1
  1037. package/src/duckdb/src/include/duckdb/planner/expression_binder/alter_binder.hpp +1 -1
  1038. package/src/duckdb/src/include/duckdb/planner/expression_binder/base_select_binder.hpp +66 -0
  1039. package/src/duckdb/src/include/duckdb/planner/expression_binder/check_binder.hpp +1 -1
  1040. package/src/duckdb/src/include/duckdb/planner/expression_binder/constant_binder.hpp +1 -1
  1041. package/src/duckdb/src/include/duckdb/planner/expression_binder/group_binder.hpp +1 -1
  1042. package/src/duckdb/src/include/duckdb/planner/expression_binder/having_binder.hpp +4 -4
  1043. package/src/duckdb/src/include/duckdb/planner/expression_binder/index_binder.hpp +5 -5
  1044. package/src/duckdb/src/include/duckdb/planner/expression_binder/insert_binder.hpp +1 -1
  1045. package/src/duckdb/src/include/duckdb/planner/expression_binder/lateral_binder.hpp +2 -2
  1046. package/src/duckdb/src/include/duckdb/planner/expression_binder/order_binder.hpp +7 -4
  1047. package/src/duckdb/src/include/duckdb/planner/expression_binder/qualify_binder.hpp +4 -4
  1048. package/src/duckdb/src/include/duckdb/planner/expression_binder/relation_binder.hpp +1 -1
  1049. package/src/duckdb/src/include/duckdb/planner/expression_binder/returning_binder.hpp +1 -1
  1050. package/src/duckdb/src/include/duckdb/planner/expression_binder/select_binder.hpp +9 -38
  1051. package/src/duckdb/src/include/duckdb/planner/expression_binder/table_function_binder.hpp +2 -2
  1052. package/src/duckdb/src/include/duckdb/planner/expression_binder/update_binder.hpp +1 -1
  1053. package/src/duckdb/src/include/duckdb/planner/expression_binder/where_binder.hpp +4 -4
  1054. package/src/duckdb/src/include/duckdb/planner/expression_binder.hpp +17 -13
  1055. package/src/duckdb/src/include/duckdb/planner/logical_operator.hpp +17 -0
  1056. package/src/duckdb/src/include/duckdb/planner/logical_tokens.hpp +2 -0
  1057. package/src/duckdb/src/include/duckdb/planner/operator/list.hpp +2 -0
  1058. package/src/duckdb/src/include/duckdb/planner/operator/logical_aggregate.hpp +5 -1
  1059. package/src/duckdb/src/include/duckdb/planner/operator/logical_any_join.hpp +3 -0
  1060. package/src/duckdb/src/include/duckdb/planner/operator/logical_asof_join.hpp +27 -0
  1061. package/src/duckdb/src/include/duckdb/planner/operator/logical_column_data_get.hpp +5 -1
  1062. package/src/duckdb/src/include/duckdb/planner/operator/logical_comparison_join.hpp +8 -2
  1063. package/src/duckdb/src/include/duckdb/planner/operator/logical_copy_to_file.hpp +6 -1
  1064. package/src/duckdb/src/include/duckdb/planner/operator/logical_create.hpp +6 -2
  1065. package/src/duckdb/src/include/duckdb/planner/operator/logical_create_index.hpp +3 -0
  1066. package/src/duckdb/src/include/duckdb/planner/operator/logical_create_table.hpp +5 -2
  1067. package/src/duckdb/src/include/duckdb/planner/operator/logical_cross_product.hpp +3 -0
  1068. package/src/duckdb/src/include/duckdb/planner/operator/logical_cteref.hpp +4 -0
  1069. package/src/duckdb/src/include/duckdb/planner/operator/logical_delete.hpp +6 -2
  1070. package/src/duckdb/src/include/duckdb/planner/operator/logical_delim_get.hpp +4 -0
  1071. package/src/duckdb/src/include/duckdb/planner/operator/logical_delim_join.hpp +3 -0
  1072. package/src/duckdb/src/include/duckdb/planner/operator/logical_distinct.hpp +15 -4
  1073. package/src/duckdb/src/include/duckdb/planner/operator/logical_dummy_scan.hpp +4 -0
  1074. package/src/duckdb/src/include/duckdb/planner/operator/logical_empty_result.hpp +3 -0
  1075. package/src/duckdb/src/include/duckdb/planner/operator/logical_execute.hpp +3 -0
  1076. package/src/duckdb/src/include/duckdb/planner/operator/logical_explain.hpp +3 -0
  1077. package/src/duckdb/src/include/duckdb/planner/operator/logical_export.hpp +3 -0
  1078. package/src/duckdb/src/include/duckdb/planner/operator/logical_expression_get.hpp +4 -0
  1079. package/src/duckdb/src/include/duckdb/planner/operator/logical_extension_operator.hpp +4 -0
  1080. package/src/duckdb/src/include/duckdb/planner/operator/logical_filter.hpp +3 -0
  1081. package/src/duckdb/src/include/duckdb/planner/operator/logical_get.hpp +4 -1
  1082. package/src/duckdb/src/include/duckdb/planner/operator/logical_insert.hpp +6 -2
  1083. package/src/duckdb/src/include/duckdb/planner/operator/logical_join.hpp +3 -0
  1084. package/src/duckdb/src/include/duckdb/planner/operator/logical_limit.hpp +3 -0
  1085. package/src/duckdb/src/include/duckdb/planner/operator/logical_limit_percent.hpp +3 -0
  1086. package/src/duckdb/src/include/duckdb/planner/operator/logical_order.hpp +3 -0
  1087. package/src/duckdb/src/include/duckdb/planner/operator/logical_pivot.hpp +37 -0
  1088. package/src/duckdb/src/include/duckdb/planner/operator/logical_positional_join.hpp +3 -0
  1089. package/src/duckdb/src/include/duckdb/planner/operator/logical_pragma.hpp +3 -0
  1090. package/src/duckdb/src/include/duckdb/planner/operator/logical_prepare.hpp +3 -0
  1091. package/src/duckdb/src/include/duckdb/planner/operator/logical_projection.hpp +4 -0
  1092. package/src/duckdb/src/include/duckdb/planner/operator/logical_recursive_cte.hpp +10 -5
  1093. package/src/duckdb/src/include/duckdb/planner/operator/logical_reset.hpp +3 -0
  1094. package/src/duckdb/src/include/duckdb/planner/operator/logical_sample.hpp +3 -0
  1095. package/src/duckdb/src/include/duckdb/planner/operator/logical_set.hpp +3 -0
  1096. package/src/duckdb/src/include/duckdb/planner/operator/logical_set_operation.hpp +4 -0
  1097. package/src/duckdb/src/include/duckdb/planner/operator/logical_show.hpp +3 -0
  1098. package/src/duckdb/src/include/duckdb/planner/operator/logical_simple.hpp +3 -0
  1099. package/src/duckdb/src/include/duckdb/planner/operator/logical_top_n.hpp +3 -0
  1100. package/src/duckdb/src/include/duckdb/planner/operator/logical_unconditional_join.hpp +3 -0
  1101. package/src/duckdb/src/include/duckdb/planner/operator/logical_unnest.hpp +4 -0
  1102. package/src/duckdb/src/include/duckdb/planner/operator/logical_update.hpp +6 -2
  1103. package/src/duckdb/src/include/duckdb/planner/operator/logical_window.hpp +4 -0
  1104. package/src/duckdb/src/include/duckdb/planner/operator_extension.hpp +2 -2
  1105. package/src/duckdb/src/include/duckdb/planner/parsed_data/bound_create_function_info.hpp +3 -2
  1106. package/src/duckdb/src/include/duckdb/planner/parsed_data/bound_create_table_info.hpp +3 -2
  1107. package/src/duckdb/src/include/duckdb/planner/pragma_handler.hpp +3 -2
  1108. package/src/duckdb/src/include/duckdb/planner/query_node/bound_recursive_cte_node.hpp +3 -0
  1109. package/src/duckdb/src/include/duckdb/planner/query_node/bound_select_node.hpp +12 -3
  1110. package/src/duckdb/src/include/duckdb/planner/query_node/bound_set_operation_node.hpp +3 -0
  1111. package/src/duckdb/src/include/duckdb/planner/query_node/list.hpp +3 -0
  1112. package/src/duckdb/src/include/duckdb/planner/table_binding.hpp +6 -5
  1113. package/src/duckdb/src/include/duckdb/planner/tableref/bound_basetableref.hpp +5 -2
  1114. package/src/duckdb/src/include/duckdb/planner/tableref/bound_cteref.hpp +3 -0
  1115. package/src/duckdb/src/include/duckdb/planner/tableref/bound_dummytableref.hpp +3 -0
  1116. package/src/duckdb/src/include/duckdb/planner/tableref/bound_expressionlistref.hpp +3 -0
  1117. package/src/duckdb/src/include/duckdb/planner/tableref/bound_joinref.hpp +3 -0
  1118. package/src/duckdb/src/include/duckdb/planner/tableref/bound_pivotref.hpp +43 -0
  1119. package/src/duckdb/src/include/duckdb/planner/tableref/bound_pos_join_ref.hpp +3 -0
  1120. package/src/duckdb/src/include/duckdb/planner/tableref/bound_subqueryref.hpp +3 -0
  1121. package/src/duckdb/src/include/duckdb/planner/tableref/bound_table_function.hpp +3 -0
  1122. package/src/duckdb/src/include/duckdb/planner/tableref/list.hpp +1 -0
  1123. package/src/duckdb/src/include/duckdb/storage/arena_allocator.hpp +7 -0
  1124. package/src/duckdb/src/include/duckdb/storage/block_manager.hpp +1 -0
  1125. package/src/duckdb/src/include/duckdb/storage/buffer/block_handle.hpp +16 -9
  1126. package/src/duckdb/src/include/duckdb/storage/buffer/buffer_pool.hpp +80 -0
  1127. package/src/duckdb/src/include/duckdb/storage/buffer/temporary_file_information.hpp +12 -0
  1128. package/src/duckdb/src/include/duckdb/storage/buffer_manager.hpp +47 -185
  1129. package/src/duckdb/src/include/duckdb/storage/checkpoint_manager.hpp +1 -1
  1130. package/src/duckdb/src/include/duckdb/storage/compression/chimp/algorithm/chimp128.hpp +1 -0
  1131. package/src/duckdb/src/include/duckdb/storage/compression/chimp/algorithm/chimp_utils.hpp +0 -97
  1132. package/src/duckdb/src/include/duckdb/storage/compression/chimp/chimp_analyze.hpp +1 -1
  1133. package/src/duckdb/src/include/duckdb/storage/compression/chimp/chimp_compress.hpp +4 -8
  1134. package/src/duckdb/src/include/duckdb/storage/compression/chimp/chimp_scan.hpp +2 -1
  1135. package/src/duckdb/src/include/duckdb/storage/compression/patas/algorithm/patas.hpp +1 -0
  1136. package/src/duckdb/src/include/duckdb/storage/compression/patas/patas_analyze.hpp +1 -1
  1137. package/src/duckdb/src/include/duckdb/storage/compression/patas/patas_compress.hpp +4 -8
  1138. package/src/duckdb/src/include/duckdb/storage/compression/patas/patas_scan.hpp +2 -1
  1139. package/src/duckdb/src/include/duckdb/storage/data_pointer.hpp +0 -2
  1140. package/src/duckdb/src/include/duckdb/storage/data_table.hpp +7 -4
  1141. package/src/duckdb/src/include/duckdb/storage/in_memory_block_manager.hpp +3 -0
  1142. package/src/duckdb/src/include/duckdb/storage/index.hpp +33 -34
  1143. package/src/duckdb/src/include/duckdb/storage/meta_block_reader.hpp +7 -0
  1144. package/src/duckdb/src/include/duckdb/storage/optimistic_data_writer.hpp +46 -0
  1145. package/src/duckdb/src/include/duckdb/storage/partial_block_manager.hpp +26 -4
  1146. package/src/duckdb/src/include/duckdb/storage/single_file_block_manager.hpp +11 -5
  1147. package/src/duckdb/src/include/duckdb/storage/standard_buffer_manager.hpp +157 -0
  1148. package/src/duckdb/src/include/duckdb/storage/statistics/distinct_statistics.hpp +2 -0
  1149. package/src/duckdb/src/include/duckdb/storage/statistics/node_statistics.hpp +3 -3
  1150. package/src/duckdb/src/include/duckdb/storage/statistics/numeric_stats.hpp +9 -52
  1151. package/src/duckdb/src/include/duckdb/storage/statistics/numeric_stats_union.hpp +62 -0
  1152. package/src/duckdb/src/include/duckdb/storage/storage_manager.hpp +1 -1
  1153. package/src/duckdb/src/include/duckdb/storage/string_uncompressed.hpp +3 -3
  1154. package/src/duckdb/src/include/duckdb/storage/table/column_checkpoint_state.hpp +48 -2
  1155. package/src/duckdb/src/include/duckdb/storage/table/column_data.hpp +29 -16
  1156. package/src/duckdb/src/include/duckdb/storage/table/column_data_checkpointer.hpp +5 -3
  1157. package/src/duckdb/src/include/duckdb/storage/table/column_segment.hpp +7 -7
  1158. package/src/duckdb/src/include/duckdb/storage/table/column_segment_tree.hpp +18 -0
  1159. package/src/duckdb/src/include/duckdb/storage/table/list_column_data.hpp +2 -2
  1160. package/src/duckdb/src/include/duckdb/storage/table/persistent_table_data.hpp +4 -2
  1161. package/src/duckdb/src/include/duckdb/storage/table/row_group.hpp +39 -44
  1162. package/src/duckdb/src/include/duckdb/storage/table/row_group_collection.hpp +22 -6
  1163. package/src/duckdb/src/include/duckdb/storage/table/row_group_segment_tree.hpp +35 -0
  1164. package/src/duckdb/src/include/duckdb/storage/table/scan_state.hpp +19 -29
  1165. package/src/duckdb/src/include/duckdb/storage/table/segment_base.hpp +7 -7
  1166. package/src/duckdb/src/include/duckdb/storage/table/segment_tree.hpp +303 -26
  1167. package/src/duckdb/src/include/duckdb/storage/table/standard_column_data.hpp +3 -7
  1168. package/src/duckdb/src/include/duckdb/storage/table/struct_column_data.hpp +2 -2
  1169. package/src/duckdb/src/include/duckdb/storage/table/table_index_list.hpp +1 -1
  1170. package/src/duckdb/src/include/duckdb/storage/table/update_segment.hpp +4 -7
  1171. package/src/duckdb/src/include/duckdb/storage/table/validity_column_data.hpp +1 -2
  1172. package/src/duckdb/src/include/duckdb/storage/write_ahead_log.hpp +21 -21
  1173. package/src/duckdb/src/include/duckdb/transaction/cleanup_state.hpp +8 -3
  1174. package/src/duckdb/src/include/duckdb/transaction/commit_state.hpp +6 -6
  1175. package/src/duckdb/src/include/duckdb/transaction/duck_transaction.hpp +3 -3
  1176. package/src/duckdb/src/include/duckdb/transaction/local_storage.hpp +43 -64
  1177. package/src/duckdb/src/include/duckdb/transaction/meta_transaction.hpp +6 -5
  1178. package/src/duckdb/src/include/duckdb/transaction/transaction.hpp +12 -0
  1179. package/src/duckdb/src/include/duckdb/transaction/transaction_data.hpp +2 -1
  1180. package/src/duckdb/src/include/duckdb/transaction/undo_buffer.hpp +1 -1
  1181. package/src/duckdb/src/include/duckdb/verification/deserialized_statement_verifier_v2.hpp +26 -0
  1182. package/src/duckdb/src/include/duckdb/verification/no_operator_caching_verifier.hpp +25 -0
  1183. package/src/duckdb/src/include/duckdb/verification/statement_verifier.hpp +6 -0
  1184. package/src/duckdb/src/include/duckdb.h +48 -1
  1185. package/src/duckdb/src/main/appender.cpp +9 -9
  1186. package/src/duckdb/src/main/attached_database.cpp +23 -16
  1187. package/src/duckdb/src/main/capi/appender-c.cpp +1 -1
  1188. package/src/duckdb/src/main/capi/cast/from_decimal-c.cpp +1 -1
  1189. package/src/duckdb/src/main/capi/duckdb-c.cpp +1 -1
  1190. package/src/duckdb/src/main/capi/helper-c.cpp +7 -0
  1191. package/src/duckdb/src/main/capi/pending-c.cpp +4 -4
  1192. package/src/duckdb/src/main/capi/replacement_scan-c.cpp +4 -4
  1193. package/src/duckdb/src/main/capi/result-c.cpp +3 -3
  1194. package/src/duckdb/src/main/capi/table_function-c.cpp +53 -29
  1195. package/src/duckdb/src/main/capi/threading-c.cpp +1 -1
  1196. package/src/duckdb/src/main/client_context.cpp +98 -97
  1197. package/src/duckdb/src/main/client_data.cpp +11 -10
  1198. package/src/duckdb/src/main/client_verify.cpp +7 -2
  1199. package/src/duckdb/src/main/config.cpp +38 -1
  1200. package/src/duckdb/src/main/connection.cpp +3 -3
  1201. package/src/duckdb/src/main/database.cpp +80 -85
  1202. package/src/duckdb/src/main/database_manager.cpp +17 -16
  1203. package/src/duckdb/src/main/database_path_and_type.cpp +23 -0
  1204. package/src/duckdb/src/main/extension/extension_helper.cpp +19 -3
  1205. package/src/duckdb/src/main/extension/extension_install.cpp +18 -2
  1206. package/src/duckdb/src/main/extension/extension_load.cpp +97 -44
  1207. package/src/duckdb/src/main/extension/extension_util.cpp +90 -0
  1208. package/src/duckdb/src/main/materialized_query_result.cpp +2 -2
  1209. package/src/duckdb/src/main/pending_query_result.cpp +1 -1
  1210. package/src/duckdb/src/main/prepared_statement.cpp +5 -1
  1211. package/src/duckdb/src/main/query_profiler.cpp +48 -44
  1212. package/src/duckdb/src/main/query_result.cpp +14 -1
  1213. package/src/duckdb/src/main/relation/aggregate_relation.cpp +2 -2
  1214. package/src/duckdb/src/main/relation/create_table_relation.cpp +2 -2
  1215. package/src/duckdb/src/main/relation/create_view_relation.cpp +2 -2
  1216. package/src/duckdb/src/main/relation/cross_product_relation.cpp +3 -3
  1217. package/src/duckdb/src/main/relation/delete_relation.cpp +1 -1
  1218. package/src/duckdb/src/main/relation/explain_relation.cpp +4 -4
  1219. package/src/duckdb/src/main/relation/filter_relation.cpp +4 -4
  1220. package/src/duckdb/src/main/relation/insert_relation.cpp +1 -1
  1221. package/src/duckdb/src/main/relation/join_relation.cpp +5 -4
  1222. package/src/duckdb/src/main/relation/limit_relation.cpp +3 -3
  1223. package/src/duckdb/src/main/relation/order_relation.cpp +3 -3
  1224. package/src/duckdb/src/main/relation/projection_relation.cpp +2 -2
  1225. package/src/duckdb/src/main/relation/query_relation.cpp +1 -1
  1226. package/src/duckdb/src/main/relation/read_csv_relation.cpp +4 -2
  1227. package/src/duckdb/src/main/relation/setop_relation.cpp +4 -5
  1228. package/src/duckdb/src/main/relation/table_function_relation.cpp +11 -11
  1229. package/src/duckdb/src/main/relation/table_relation.cpp +3 -3
  1230. package/src/duckdb/src/main/relation/update_relation.cpp +2 -2
  1231. package/src/duckdb/src/main/relation/value_relation.cpp +4 -4
  1232. package/src/duckdb/src/main/relation/view_relation.cpp +3 -3
  1233. package/src/duckdb/src/main/relation/write_csv_relation.cpp +1 -1
  1234. package/src/duckdb/src/main/relation/write_parquet_relation.cpp +1 -1
  1235. package/src/duckdb/src/main/relation.cpp +8 -7
  1236. package/src/duckdb/src/main/settings/settings.cpp +108 -22
  1237. package/src/duckdb/src/main/stream_query_result.cpp +5 -5
  1238. package/src/duckdb/src/optimizer/column_lifetime_analyzer.cpp +4 -3
  1239. package/src/duckdb/src/optimizer/common_aggregate_optimizer.cpp +3 -3
  1240. package/src/duckdb/src/optimizer/cse_optimizer.cpp +16 -15
  1241. package/src/duckdb/src/optimizer/deliminator.cpp +28 -27
  1242. package/src/duckdb/src/optimizer/expression_heuristics.cpp +11 -11
  1243. package/src/duckdb/src/optimizer/expression_rewriter.cpp +10 -10
  1244. package/src/duckdb/src/optimizer/filter_combiner.cpp +139 -138
  1245. package/src/duckdb/src/optimizer/filter_pullup.cpp +6 -4
  1246. package/src/duckdb/src/optimizer/filter_pushdown.cpp +17 -11
  1247. package/src/duckdb/src/optimizer/in_clause_rewriter.cpp +12 -12
  1248. package/src/duckdb/src/optimizer/join_order/cardinality_estimator.cpp +102 -111
  1249. package/src/duckdb/src/optimizer/join_order/join_node.cpp +8 -11
  1250. package/src/duckdb/src/optimizer/join_order/join_order_optimizer.cpp +224 -213
  1251. package/src/duckdb/src/optimizer/join_order/join_relation_set.cpp +30 -30
  1252. package/src/duckdb/src/optimizer/join_order/query_graph.cpp +37 -38
  1253. package/src/duckdb/src/optimizer/matcher/expression_matcher.cpp +28 -26
  1254. package/src/duckdb/src/optimizer/optimizer.cpp +15 -14
  1255. package/src/duckdb/src/optimizer/pullup/pullup_filter.cpp +1 -1
  1256. package/src/duckdb/src/optimizer/pullup/pullup_from_left.cpp +2 -2
  1257. package/src/duckdb/src/optimizer/pullup/pullup_projection.cpp +3 -3
  1258. package/src/duckdb/src/optimizer/pullup/pullup_set_operation.cpp +3 -3
  1259. package/src/duckdb/src/optimizer/pushdown/pushdown_aggregate.cpp +36 -8
  1260. package/src/duckdb/src/optimizer/pushdown/pushdown_cross_product.cpp +1 -1
  1261. package/src/duckdb/src/optimizer/pushdown/pushdown_filter.cpp +2 -2
  1262. package/src/duckdb/src/optimizer/pushdown/pushdown_get.cpp +2 -2
  1263. package/src/duckdb/src/optimizer/pushdown/pushdown_inner_join.cpp +9 -6
  1264. package/src/duckdb/src/optimizer/pushdown/pushdown_left_join.cpp +11 -18
  1265. package/src/duckdb/src/optimizer/pushdown/pushdown_limit.cpp +2 -2
  1266. package/src/duckdb/src/optimizer/pushdown/pushdown_mark_join.cpp +5 -5
  1267. package/src/duckdb/src/optimizer/pushdown/pushdown_projection.cpp +4 -4
  1268. package/src/duckdb/src/optimizer/pushdown/pushdown_set_operation.cpp +8 -8
  1269. package/src/duckdb/src/optimizer/pushdown/pushdown_single_join.cpp +2 -2
  1270. package/src/duckdb/src/optimizer/regex_range_filter.cpp +9 -9
  1271. package/src/duckdb/src/optimizer/remove_unused_columns.cpp +17 -12
  1272. package/src/duckdb/src/optimizer/rule/arithmetic_simplification.cpp +31 -30
  1273. package/src/duckdb/src/optimizer/rule/case_simplification.cpp +10 -10
  1274. package/src/duckdb/src/optimizer/rule/comparison_simplification.cpp +22 -23
  1275. package/src/duckdb/src/optimizer/rule/conjunction_simplification.cpp +17 -16
  1276. package/src/duckdb/src/optimizer/rule/constant_folding.cpp +9 -9
  1277. package/src/duckdb/src/optimizer/rule/date_part_simplification.cpp +8 -8
  1278. package/src/duckdb/src/optimizer/rule/distributivity.cpp +23 -23
  1279. package/src/duckdb/src/optimizer/rule/empty_needle_removal.cpp +14 -15
  1280. package/src/duckdb/src/optimizer/rule/enum_comparison.cpp +15 -16
  1281. package/src/duckdb/src/optimizer/rule/equal_or_null_simplification.cpp +35 -38
  1282. package/src/duckdb/src/optimizer/rule/in_clause_simplification_rule.cpp +16 -17
  1283. package/src/duckdb/src/optimizer/rule/like_optimizations.cpp +22 -22
  1284. package/src/duckdb/src/optimizer/rule/move_constants.cpp +46 -40
  1285. package/src/duckdb/src/optimizer/rule/ordered_aggregate_optimizer.cpp +30 -0
  1286. package/src/duckdb/src/optimizer/rule/regex_optimizations.cpp +25 -17
  1287. package/src/duckdb/src/optimizer/statistics/expression/propagate_and_compress.cpp +3 -3
  1288. package/src/duckdb/src/optimizer/statistics/expression/propagate_between.cpp +6 -6
  1289. package/src/duckdb/src/optimizer/statistics/expression/propagate_comparison.cpp +2 -2
  1290. package/src/duckdb/src/optimizer/statistics/expression/propagate_conjunction.cpp +2 -2
  1291. package/src/duckdb/src/optimizer/statistics/expression/propagate_operator.cpp +4 -4
  1292. package/src/duckdb/src/optimizer/statistics/operator/propagate_filter.cpp +12 -11
  1293. package/src/duckdb/src/optimizer/statistics/operator/propagate_get.cpp +1 -1
  1294. package/src/duckdb/src/optimizer/statistics/operator/propagate_join.cpp +5 -4
  1295. package/src/duckdb/src/optimizer/statistics/operator/propagate_limit.cpp +1 -1
  1296. package/src/duckdb/src/optimizer/statistics_propagator.cpp +33 -21
  1297. package/src/duckdb/src/optimizer/topn_optimizer.cpp +3 -3
  1298. package/src/duckdb/src/optimizer/unnest_rewriter.cpp +16 -16
  1299. package/src/duckdb/src/parallel/event.cpp +1 -1
  1300. package/src/duckdb/src/parallel/executor.cpp +98 -56
  1301. package/src/duckdb/src/parallel/executor_task.cpp +11 -0
  1302. package/src/duckdb/src/parallel/interrupt.cpp +57 -0
  1303. package/src/duckdb/src/parallel/meta_pipeline.cpp +8 -15
  1304. package/src/duckdb/src/parallel/pipeline.cpp +116 -41
  1305. package/src/duckdb/src/parallel/pipeline_executor.cpp +267 -88
  1306. package/src/duckdb/src/parallel/pipeline_initialize_event.cpp +2 -2
  1307. package/src/duckdb/src/parallel/task_scheduler.cpp +62 -27
  1308. package/src/duckdb/src/parser/base_expression.cpp +6 -0
  1309. package/src/duckdb/src/parser/column_definition.cpp +6 -6
  1310. package/src/duckdb/src/parser/common_table_expression_info.cpp +19 -0
  1311. package/src/duckdb/src/parser/constraints/check_constraint.cpp +2 -2
  1312. package/src/duckdb/src/parser/constraints/foreign_key_constraint.cpp +2 -2
  1313. package/src/duckdb/src/parser/constraints/not_null_constraint.cpp +2 -2
  1314. package/src/duckdb/src/parser/constraints/unique_constraint.cpp +4 -4
  1315. package/src/duckdb/src/parser/expression/between_expression.cpp +19 -2
  1316. package/src/duckdb/src/parser/expression/case_expression.cpp +30 -2
  1317. package/src/duckdb/src/parser/expression/cast_expression.cpp +19 -2
  1318. package/src/duckdb/src/parser/expression/collate_expression.cpp +18 -2
  1319. package/src/duckdb/src/parser/expression/columnref_expression.cpp +19 -7
  1320. package/src/duckdb/src/parser/expression/comparison_expression.cpp +18 -2
  1321. package/src/duckdb/src/parser/expression/conjunction_expression.cpp +20 -3
  1322. package/src/duckdb/src/parser/expression/constant_expression.cpp +17 -3
  1323. package/src/duckdb/src/parser/expression/default_expression.cpp +9 -2
  1324. package/src/duckdb/src/parser/expression/function_expression.cpp +42 -6
  1325. package/src/duckdb/src/parser/expression/lambda_expression.cpp +18 -2
  1326. package/src/duckdb/src/parser/expression/operator_expression.cpp +17 -2
  1327. package/src/duckdb/src/parser/expression/parameter_expression.cpp +17 -2
  1328. package/src/duckdb/src/parser/expression/positional_reference_expression.cpp +16 -2
  1329. package/src/duckdb/src/parser/expression/star_expression.cpp +30 -8
  1330. package/src/duckdb/src/parser/expression/subquery_expression.cpp +22 -2
  1331. package/src/duckdb/src/parser/expression/window_expression.cpp +72 -2
  1332. package/src/duckdb/src/parser/expression_util.cpp +6 -6
  1333. package/src/duckdb/src/parser/parsed_data/alter_info.cpp +3 -3
  1334. package/src/duckdb/src/parser/parsed_data/alter_scalar_function_info.cpp +3 -3
  1335. package/src/duckdb/src/parser/parsed_data/alter_table_function_info.cpp +3 -3
  1336. package/src/duckdb/src/parser/parsed_data/alter_table_info.cpp +35 -36
  1337. package/src/duckdb/src/parser/parsed_data/create_aggregate_function_info.cpp +1 -1
  1338. package/src/duckdb/src/parser/parsed_data/create_collation_info.cpp +1 -1
  1339. package/src/duckdb/src/parser/parsed_data/create_copy_function_info.cpp +1 -1
  1340. package/src/duckdb/src/parser/parsed_data/create_index_info.cpp +2 -2
  1341. package/src/duckdb/src/parser/parsed_data/create_pragma_function_info.cpp +1 -1
  1342. package/src/duckdb/src/parser/parsed_data/create_scalar_function_info.cpp +3 -3
  1343. package/src/duckdb/src/parser/parsed_data/create_table_function_info.cpp +3 -3
  1344. package/src/duckdb/src/parser/parsed_data/create_table_info.cpp +4 -4
  1345. package/src/duckdb/src/parser/parsed_data/create_view_info.cpp +5 -5
  1346. package/src/duckdb/src/parser/parsed_data/sample_options.cpp +24 -12
  1347. package/src/duckdb/src/parser/parsed_expression.cpp +72 -0
  1348. package/src/duckdb/src/parser/parsed_expression_iterator.cpp +26 -20
  1349. package/src/duckdb/src/parser/parser.cpp +12 -12
  1350. package/src/duckdb/src/parser/query_node/recursive_cte_node.cpp +27 -6
  1351. package/src/duckdb/src/parser/query_node/select_node.cpp +44 -13
  1352. package/src/duckdb/src/parser/query_node/set_operation_node.cpp +23 -6
  1353. package/src/duckdb/src/parser/query_node.cpp +54 -4
  1354. package/src/duckdb/src/parser/result_modifier.cpp +97 -8
  1355. package/src/duckdb/src/parser/statement/copy_statement.cpp +1 -1
  1356. package/src/duckdb/src/parser/statement/drop_statement.cpp +1 -1
  1357. package/src/duckdb/src/parser/statement/extension_statement.cpp +1 -1
  1358. package/src/duckdb/src/parser/statement/insert_statement.cpp +16 -7
  1359. package/src/duckdb/src/parser/statement/pragma_statement.cpp +1 -1
  1360. package/src/duckdb/src/parser/statement/select_statement.cpp +15 -3
  1361. package/src/duckdb/src/parser/statement/show_statement.cpp +1 -1
  1362. package/src/duckdb/src/parser/statement/transaction_statement.cpp +2 -2
  1363. package/src/duckdb/src/parser/statement/vacuum_statement.cpp +1 -1
  1364. package/src/duckdb/src/parser/tableref/basetableref.cpp +23 -2
  1365. package/src/duckdb/src/parser/tableref/emptytableref.cpp +6 -2
  1366. package/src/duckdb/src/parser/tableref/expressionlistref.cpp +19 -2
  1367. package/src/duckdb/src/parser/tableref/joinref.cpp +33 -4
  1368. package/src/duckdb/src/parser/tableref/pivotref.cpp +88 -11
  1369. package/src/duckdb/src/parser/tableref/subqueryref.cpp +17 -2
  1370. package/src/duckdb/src/parser/tableref/table_function.cpp +19 -2
  1371. package/src/duckdb/src/parser/tableref.cpp +47 -1
  1372. package/src/duckdb/src/parser/transform/constraint/transform_constraint.cpp +8 -8
  1373. package/src/duckdb/src/parser/transform/expression/transform_array_access.cpp +16 -5
  1374. package/src/duckdb/src/parser/transform/expression/transform_bool_expr.cpp +6 -6
  1375. package/src/duckdb/src/parser/transform/expression/transform_boolean_test.cpp +39 -0
  1376. package/src/duckdb/src/parser/transform/expression/transform_case.cpp +3 -3
  1377. package/src/duckdb/src/parser/transform/expression/transform_cast.cpp +2 -2
  1378. package/src/duckdb/src/parser/transform/expression/transform_coalesce.cpp +1 -1
  1379. package/src/duckdb/src/parser/transform/expression/transform_columnref.cpp +19 -4
  1380. package/src/duckdb/src/parser/transform/expression/transform_constant.cpp +7 -7
  1381. package/src/duckdb/src/parser/transform/expression/transform_expression.cpp +5 -2
  1382. package/src/duckdb/src/parser/transform/expression/transform_function.cpp +111 -121
  1383. package/src/duckdb/src/parser/transform/expression/transform_grouping_function.cpp +1 -1
  1384. package/src/duckdb/src/parser/transform/expression/transform_interval.cpp +5 -5
  1385. package/src/duckdb/src/parser/transform/expression/transform_lambda.cpp +1 -1
  1386. package/src/duckdb/src/parser/transform/expression/transform_operator.cpp +29 -25
  1387. package/src/duckdb/src/parser/transform/expression/transform_param_ref.cpp +1 -1
  1388. package/src/duckdb/src/parser/transform/expression/transform_positional_reference.cpp +1 -1
  1389. package/src/duckdb/src/parser/transform/expression/transform_subquery.cpp +11 -11
  1390. package/src/duckdb/src/parser/transform/helpers/transform_cte.cpp +5 -5
  1391. package/src/duckdb/src/parser/transform/helpers/transform_groupby.cpp +11 -4
  1392. package/src/duckdb/src/parser/transform/helpers/transform_orderby.cpp +0 -7
  1393. package/src/duckdb/src/parser/transform/helpers/transform_sample.cpp +1 -1
  1394. package/src/duckdb/src/parser/transform/helpers/transform_typename.cpp +3 -2
  1395. package/src/duckdb/src/parser/transform/statement/transform_alter_sequence.cpp +5 -4
  1396. package/src/duckdb/src/parser/transform/statement/transform_alter_table.cpp +15 -11
  1397. package/src/duckdb/src/parser/transform/statement/transform_attach.cpp +2 -2
  1398. package/src/duckdb/src/parser/transform/statement/transform_call.cpp +1 -1
  1399. package/src/duckdb/src/parser/transform/statement/transform_checkpoint.cpp +3 -3
  1400. package/src/duckdb/src/parser/transform/statement/transform_copy.cpp +1 -1
  1401. package/src/duckdb/src/parser/transform/statement/transform_create_database.cpp +2 -2
  1402. package/src/duckdb/src/parser/transform/statement/transform_create_function.cpp +5 -8
  1403. package/src/duckdb/src/parser/transform/statement/transform_create_index.cpp +4 -4
  1404. package/src/duckdb/src/parser/transform/statement/transform_create_schema.cpp +2 -2
  1405. package/src/duckdb/src/parser/transform/statement/transform_create_sequence.cpp +2 -2
  1406. package/src/duckdb/src/parser/transform/statement/transform_create_table.cpp +3 -3
  1407. package/src/duckdb/src/parser/transform/statement/transform_create_table_as.cpp +2 -2
  1408. package/src/duckdb/src/parser/transform/statement/transform_create_type.cpp +2 -3
  1409. package/src/duckdb/src/parser/transform/statement/transform_create_view.cpp +4 -6
  1410. package/src/duckdb/src/parser/transform/statement/transform_delete.cpp +1 -1
  1411. package/src/duckdb/src/parser/transform/statement/transform_detach.cpp +3 -3
  1412. package/src/duckdb/src/parser/transform/statement/transform_drop.cpp +2 -2
  1413. package/src/duckdb/src/parser/transform/statement/transform_explain.cpp +1 -1
  1414. package/src/duckdb/src/parser/transform/statement/transform_export.cpp +2 -2
  1415. package/src/duckdb/src/parser/transform/statement/transform_import.cpp +1 -1
  1416. package/src/duckdb/src/parser/transform/statement/transform_insert.cpp +7 -9
  1417. package/src/duckdb/src/parser/transform/statement/transform_load.cpp +2 -2
  1418. package/src/duckdb/src/parser/transform/statement/transform_pivot_stmt.cpp +91 -38
  1419. package/src/duckdb/src/parser/transform/statement/transform_pragma.cpp +7 -7
  1420. package/src/duckdb/src/parser/transform/statement/transform_prepare.cpp +3 -3
  1421. package/src/duckdb/src/parser/transform/statement/transform_rename.cpp +8 -9
  1422. package/src/duckdb/src/parser/transform/statement/transform_select.cpp +1 -1
  1423. package/src/duckdb/src/parser/transform/statement/transform_select_node.cpp +57 -54
  1424. package/src/duckdb/src/parser/transform/statement/transform_set.cpp +2 -2
  1425. package/src/duckdb/src/parser/transform/statement/transform_show.cpp +5 -5
  1426. package/src/duckdb/src/parser/transform/statement/transform_show_select.cpp +1 -1
  1427. package/src/duckdb/src/parser/transform/statement/transform_transaction.cpp +3 -3
  1428. package/src/duckdb/src/parser/transform/statement/transform_update.cpp +2 -2
  1429. package/src/duckdb/src/parser/transform/statement/transform_upsert.cpp +3 -3
  1430. package/src/duckdb/src/parser/transform/statement/transform_use.cpp +1 -1
  1431. package/src/duckdb/src/parser/transform/statement/transform_vacuum.cpp +1 -1
  1432. package/src/duckdb/src/parser/transform/tableref/transform_base_tableref.cpp +1 -1
  1433. package/src/duckdb/src/parser/transform/tableref/transform_from.cpp +3 -3
  1434. package/src/duckdb/src/parser/transform/tableref/transform_join.cpp +9 -2
  1435. package/src/duckdb/src/parser/transform/tableref/transform_pivot.cpp +26 -7
  1436. package/src/duckdb/src/parser/transform/tableref/transform_subquery.cpp +2 -2
  1437. package/src/duckdb/src/parser/transform/tableref/transform_table_function.cpp +1 -1
  1438. package/src/duckdb/src/parser/transformer.cpp +54 -12
  1439. package/src/duckdb/src/planner/bind_context.cpp +89 -105
  1440. package/src/duckdb/src/planner/binder/expression/bind_aggregate_expression.cpp +38 -39
  1441. package/src/duckdb/src/planner/binder/expression/bind_between_expression.cpp +21 -21
  1442. package/src/duckdb/src/planner/binder/expression/bind_case_expression.cpp +10 -10
  1443. package/src/duckdb/src/planner/binder/expression/bind_cast_expression.cpp +7 -7
  1444. package/src/duckdb/src/planner/binder/expression/bind_collate_expression.cpp +7 -7
  1445. package/src/duckdb/src/planner/binder/expression/bind_columnref_expression.cpp +68 -18
  1446. package/src/duckdb/src/planner/binder/expression/bind_comparison_expression.cpp +22 -22
  1447. package/src/duckdb/src/planner/binder/expression/bind_conjunction_expression.cpp +3 -4
  1448. package/src/duckdb/src/planner/binder/expression/bind_constant_expression.cpp +1 -1
  1449. package/src/duckdb/src/planner/binder/expression/bind_function_expression.cpp +62 -51
  1450. package/src/duckdb/src/planner/binder/expression/bind_lambda.cpp +14 -13
  1451. package/src/duckdb/src/planner/binder/expression/bind_macro_expression.cpp +11 -11
  1452. package/src/duckdb/src/planner/binder/expression/bind_operator_expression.cpp +35 -22
  1453. package/src/duckdb/src/planner/binder/expression/bind_parameter_expression.cpp +2 -2
  1454. package/src/duckdb/src/planner/binder/expression/bind_star_expression.cpp +176 -0
  1455. package/src/duckdb/src/planner/binder/expression/bind_subquery_expression.cpp +13 -9
  1456. package/src/duckdb/src/planner/binder/expression/bind_unnest_expression.cpp +167 -28
  1457. package/src/duckdb/src/planner/binder/expression/bind_window_expression.cpp +35 -43
  1458. package/src/duckdb/src/planner/binder/query_node/bind_recursive_cte_node.cpp +1 -1
  1459. package/src/duckdb/src/planner/binder/query_node/bind_select_node.cpp +135 -137
  1460. package/src/duckdb/src/planner/binder/query_node/bind_setop_node.cpp +18 -18
  1461. package/src/duckdb/src/planner/binder/query_node/bind_table_macro_node.cpp +5 -5
  1462. package/src/duckdb/src/planner/binder/query_node/plan_query_node.cpp +17 -6
  1463. package/src/duckdb/src/planner/binder/query_node/plan_recursive_cte_node.cpp +4 -5
  1464. package/src/duckdb/src/planner/binder/query_node/plan_select_node.cpp +28 -24
  1465. package/src/duckdb/src/planner/binder/query_node/plan_setop.cpp +6 -7
  1466. package/src/duckdb/src/planner/binder/query_node/plan_subquery.cpp +34 -36
  1467. package/src/duckdb/src/planner/binder/statement/bind_attach.cpp +1 -1
  1468. package/src/duckdb/src/planner/binder/statement/bind_call.cpp +3 -2
  1469. package/src/duckdb/src/planner/binder/statement/bind_copy.cpp +38 -25
  1470. package/src/duckdb/src/planner/binder/statement/bind_create.cpp +113 -111
  1471. package/src/duckdb/src/planner/binder/statement/bind_create_table.cpp +37 -30
  1472. package/src/duckdb/src/planner/binder/statement/bind_delete.cpp +10 -10
  1473. package/src/duckdb/src/planner/binder/statement/bind_detach.cpp +1 -1
  1474. package/src/duckdb/src/planner/binder/statement/bind_drop.cpp +5 -5
  1475. package/src/duckdb/src/planner/binder/statement/bind_execute.cpp +2 -2
  1476. package/src/duckdb/src/planner/binder/statement/bind_explain.cpp +1 -1
  1477. package/src/duckdb/src/planner/binder/statement/bind_export.cpp +30 -31
  1478. package/src/duckdb/src/planner/binder/statement/bind_extension.cpp +1 -1
  1479. package/src/duckdb/src/planner/binder/statement/bind_insert.cpp +52 -44
  1480. package/src/duckdb/src/planner/binder/statement/bind_load.cpp +1 -1
  1481. package/src/duckdb/src/planner/binder/statement/bind_pragma.cpp +5 -5
  1482. package/src/duckdb/src/planner/binder/statement/bind_prepare.cpp +1 -1
  1483. package/src/duckdb/src/planner/binder/statement/bind_set.cpp +4 -4
  1484. package/src/duckdb/src/planner/binder/statement/bind_show.cpp +1 -1
  1485. package/src/duckdb/src/planner/binder/statement/bind_simple.cpp +7 -6
  1486. package/src/duckdb/src/planner/binder/statement/bind_summarize.cpp +28 -28
  1487. package/src/duckdb/src/planner/binder/statement/bind_update.cpp +29 -27
  1488. package/src/duckdb/src/planner/binder/statement/bind_vacuum.cpp +10 -9
  1489. package/src/duckdb/src/planner/binder/tableref/bind_basetableref.cpp +40 -37
  1490. package/src/duckdb/src/planner/binder/tableref/bind_emptytableref.cpp +1 -1
  1491. package/src/duckdb/src/planner/binder/tableref/bind_expressionlistref.cpp +1 -1
  1492. package/src/duckdb/src/planner/binder/tableref/bind_joinref.cpp +36 -27
  1493. package/src/duckdb/src/planner/binder/tableref/bind_named_parameters.cpp +1 -1
  1494. package/src/duckdb/src/planner/binder/tableref/bind_pivot.cpp +324 -98
  1495. package/src/duckdb/src/planner/binder/tableref/bind_subqueryref.cpp +7 -7
  1496. package/src/duckdb/src/planner/binder/tableref/bind_table_function.cpp +49 -31
  1497. package/src/duckdb/src/planner/binder/tableref/plan_cteref.cpp +2 -1
  1498. package/src/duckdb/src/planner/binder/tableref/plan_dummytableref.cpp +1 -1
  1499. package/src/duckdb/src/planner/binder/tableref/plan_expressionlistref.cpp +3 -3
  1500. package/src/duckdb/src/planner/binder/tableref/plan_joinref.cpp +78 -30
  1501. package/src/duckdb/src/planner/binder/tableref/plan_pivotref.cpp +13 -0
  1502. package/src/duckdb/src/planner/binder.cpp +86 -96
  1503. package/src/duckdb/src/planner/bound_result_modifier.cpp +26 -0
  1504. package/src/duckdb/src/planner/expression/bound_aggregate_expression.cpp +20 -13
  1505. package/src/duckdb/src/planner/expression/bound_between_expression.cpp +9 -9
  1506. package/src/duckdb/src/planner/expression/bound_case_expression.cpp +3 -3
  1507. package/src/duckdb/src/planner/expression/bound_cast_expression.cpp +8 -9
  1508. package/src/duckdb/src/planner/expression/bound_columnref_expression.cpp +21 -7
  1509. package/src/duckdb/src/planner/expression/bound_comparison_expression.cpp +5 -6
  1510. package/src/duckdb/src/planner/expression/bound_conjunction_expression.cpp +4 -4
  1511. package/src/duckdb/src/planner/expression/bound_constant_expression.cpp +4 -4
  1512. package/src/duckdb/src/planner/expression/bound_expression.cpp +15 -2
  1513. package/src/duckdb/src/planner/expression/bound_function_expression.cpp +8 -8
  1514. package/src/duckdb/src/planner/expression/bound_lambda_expression.cpp +5 -5
  1515. package/src/duckdb/src/planner/expression/bound_lambdaref_expression.cpp +5 -5
  1516. package/src/duckdb/src/planner/expression/bound_operator_expression.cpp +4 -4
  1517. package/src/duckdb/src/planner/expression/bound_parameter_expression.cpp +5 -5
  1518. package/src/duckdb/src/planner/expression/bound_reference_expression.cpp +12 -6
  1519. package/src/duckdb/src/planner/expression/bound_unnest_expression.cpp +4 -4
  1520. package/src/duckdb/src/planner/expression/bound_window_expression.cpp +20 -21
  1521. package/src/duckdb/src/planner/expression.cpp +2 -1
  1522. package/src/duckdb/src/planner/expression_binder/aggregate_binder.cpp +2 -2
  1523. package/src/duckdb/src/planner/expression_binder/alter_binder.cpp +4 -4
  1524. package/src/duckdb/src/planner/expression_binder/base_select_binder.cpp +153 -0
  1525. package/src/duckdb/src/planner/expression_binder/check_binder.cpp +7 -7
  1526. package/src/duckdb/src/planner/expression_binder/column_alias_binder.cpp +1 -1
  1527. package/src/duckdb/src/planner/expression_binder/constant_binder.cpp +13 -3
  1528. package/src/duckdb/src/planner/expression_binder/group_binder.cpp +6 -6
  1529. package/src/duckdb/src/planner/expression_binder/having_binder.cpp +11 -8
  1530. package/src/duckdb/src/planner/expression_binder/index_binder.cpp +6 -5
  1531. package/src/duckdb/src/planner/expression_binder/insert_binder.cpp +2 -2
  1532. package/src/duckdb/src/planner/expression_binder/lateral_binder.cpp +6 -6
  1533. package/src/duckdb/src/planner/expression_binder/order_binder.cpp +8 -8
  1534. package/src/duckdb/src/planner/expression_binder/qualify_binder.cpp +9 -8
  1535. package/src/duckdb/src/planner/expression_binder/relation_binder.cpp +2 -2
  1536. package/src/duckdb/src/planner/expression_binder/returning_binder.cpp +2 -2
  1537. package/src/duckdb/src/planner/expression_binder/select_binder.cpp +1 -132
  1538. package/src/duckdb/src/planner/expression_binder/table_function_binder.cpp +10 -6
  1539. package/src/duckdb/src/planner/expression_binder/update_binder.cpp +2 -2
  1540. package/src/duckdb/src/planner/expression_binder/where_binder.cpp +6 -5
  1541. package/src/duckdb/src/planner/expression_binder.cpp +50 -51
  1542. package/src/duckdb/src/planner/expression_iterator.cpp +34 -27
  1543. package/src/duckdb/src/planner/filter/conjunction_filter.cpp +2 -2
  1544. package/src/duckdb/src/planner/filter/constant_filter.cpp +1 -1
  1545. package/src/duckdb/src/planner/filter/null_filter.cpp +2 -2
  1546. package/src/duckdb/src/planner/joinside.cpp +5 -5
  1547. package/src/duckdb/src/planner/logical_operator.cpp +10 -2
  1548. package/src/duckdb/src/planner/logical_operator_visitor.cpp +32 -26
  1549. package/src/duckdb/src/planner/operator/logical_aggregate.cpp +15 -3
  1550. package/src/duckdb/src/planner/operator/logical_any_join.cpp +1 -1
  1551. package/src/duckdb/src/planner/operator/logical_asof_join.cpp +14 -0
  1552. package/src/duckdb/src/planner/operator/logical_column_data_get.cpp +13 -2
  1553. package/src/duckdb/src/planner/operator/logical_comparison_join.cpp +5 -5
  1554. package/src/duckdb/src/planner/operator/logical_copy_to_file.cpp +6 -9
  1555. package/src/duckdb/src/planner/operator/logical_create.cpp +2 -2
  1556. package/src/duckdb/src/planner/operator/logical_create_index.cpp +4 -4
  1557. package/src/duckdb/src/planner/operator/logical_create_table.cpp +2 -2
  1558. package/src/duckdb/src/planner/operator/logical_cross_product.cpp +1 -1
  1559. package/src/duckdb/src/planner/operator/logical_cteref.cpp +12 -1
  1560. package/src/duckdb/src/planner/operator/logical_delete.cpp +20 -8
  1561. package/src/duckdb/src/planner/operator/logical_delim_get.cpp +13 -2
  1562. package/src/duckdb/src/planner/operator/logical_delim_join.cpp +1 -1
  1563. package/src/duckdb/src/planner/operator/logical_distinct.cpp +6 -1
  1564. package/src/duckdb/src/planner/operator/logical_dummy_scan.cpp +13 -2
  1565. package/src/duckdb/src/planner/operator/logical_expression_get.cpp +13 -2
  1566. package/src/duckdb/src/planner/operator/logical_filter.cpp +2 -2
  1567. package/src/duckdb/src/planner/operator/logical_get.cpp +12 -6
  1568. package/src/duckdb/src/planner/operator/logical_insert.cpp +19 -14
  1569. package/src/duckdb/src/planner/operator/logical_join.cpp +1 -1
  1570. package/src/duckdb/src/planner/operator/logical_limit.cpp +1 -1
  1571. package/src/duckdb/src/planner/operator/logical_limit_percent.cpp +1 -1
  1572. package/src/duckdb/src/planner/operator/logical_order.cpp +1 -1
  1573. package/src/duckdb/src/planner/operator/logical_pivot.cpp +46 -0
  1574. package/src/duckdb/src/planner/operator/logical_positional_join.cpp +1 -1
  1575. package/src/duckdb/src/planner/operator/logical_projection.cpp +12 -1
  1576. package/src/duckdb/src/planner/operator/logical_recursive_cte.cpp +12 -1
  1577. package/src/duckdb/src/planner/operator/logical_reset.cpp +1 -1
  1578. package/src/duckdb/src/planner/operator/logical_sample.cpp +1 -1
  1579. package/src/duckdb/src/planner/operator/logical_set.cpp +1 -1
  1580. package/src/duckdb/src/planner/operator/logical_set_operation.cpp +11 -0
  1581. package/src/duckdb/src/planner/operator/logical_simple.cpp +1 -1
  1582. package/src/duckdb/src/planner/operator/logical_top_n.cpp +1 -1
  1583. package/src/duckdb/src/planner/operator/logical_unnest.cpp +13 -2
  1584. package/src/duckdb/src/planner/operator/logical_update.cpp +19 -12
  1585. package/src/duckdb/src/planner/operator/logical_window.cpp +12 -1
  1586. package/src/duckdb/src/planner/parsed_data/bound_create_table_info.cpp +6 -28
  1587. package/src/duckdb/src/planner/planner.cpp +2 -1
  1588. package/src/duckdb/src/planner/pragma_handler.cpp +12 -11
  1589. package/src/duckdb/src/planner/subquery/flatten_dependent_join.cpp +64 -60
  1590. package/src/duckdb/src/planner/subquery/rewrite_correlated_expressions.cpp +5 -6
  1591. package/src/duckdb/src/planner/table_binding.cpp +18 -17
  1592. package/src/duckdb/src/planner/table_filter.cpp +2 -2
  1593. package/src/duckdb/src/storage/arena_allocator.cpp +34 -2
  1594. package/src/duckdb/src/storage/buffer/block_handle.cpp +129 -0
  1595. package/src/duckdb/src/storage/buffer/block_manager.cpp +82 -0
  1596. package/src/duckdb/src/storage/buffer/buffer_handle.cpp +1 -0
  1597. package/src/duckdb/src/storage/buffer/buffer_pool.cpp +136 -0
  1598. package/src/duckdb/src/storage/buffer/buffer_pool_reservation.cpp +35 -0
  1599. package/src/duckdb/src/storage/buffer_manager.cpp +35 -1077
  1600. package/src/duckdb/src/storage/checkpoint/table_data_reader.cpp +4 -12
  1601. package/src/duckdb/src/storage/checkpoint/table_data_writer.cpp +9 -3
  1602. package/src/duckdb/src/storage/checkpoint/write_overflow_strings_to_disk.cpp +2 -2
  1603. package/src/duckdb/src/storage/checkpoint_manager.cpp +84 -76
  1604. package/src/duckdb/src/storage/compression/bitpacking.cpp +9 -10
  1605. package/src/duckdb/src/storage/compression/dictionary_compression.cpp +12 -13
  1606. package/src/duckdb/src/storage/compression/fixed_size_uncompressed.cpp +6 -5
  1607. package/src/duckdb/src/storage/compression/fsst.cpp +15 -17
  1608. package/src/duckdb/src/storage/compression/numeric_constant.cpp +3 -3
  1609. package/src/duckdb/src/storage/compression/rle.cpp +8 -9
  1610. package/src/duckdb/src/storage/compression/string_uncompressed.cpp +7 -7
  1611. package/src/duckdb/src/storage/compression/validity_uncompressed.cpp +4 -4
  1612. package/src/duckdb/src/storage/data_table.cpp +59 -52
  1613. package/src/duckdb/src/storage/index.cpp +32 -10
  1614. package/src/duckdb/src/storage/local_storage.cpp +134 -191
  1615. package/src/duckdb/src/storage/meta_block_reader.cpp +23 -0
  1616. package/src/duckdb/src/storage/meta_block_writer.cpp +4 -0
  1617. package/src/duckdb/src/storage/optimistic_data_writer.cpp +96 -0
  1618. package/src/duckdb/src/storage/partial_block_manager.cpp +83 -12
  1619. package/src/duckdb/src/storage/single_file_block_manager.cpp +19 -10
  1620. package/src/duckdb/src/storage/standard_buffer_manager.cpp +800 -0
  1621. package/src/duckdb/src/storage/statistics/base_statistics.cpp +3 -0
  1622. package/src/duckdb/src/storage/statistics/column_statistics.cpp +2 -3
  1623. package/src/duckdb/src/storage/statistics/distinct_statistics.cpp +7 -3
  1624. package/src/duckdb/src/storage/statistics/list_stats.cpp +6 -2
  1625. package/src/duckdb/src/storage/statistics/numeric_stats.cpp +145 -83
  1626. package/src/duckdb/src/storage/statistics/numeric_stats_union.cpp +65 -0
  1627. package/src/duckdb/src/storage/statistics/string_stats.cpp +2 -2
  1628. package/src/duckdb/src/storage/statistics/struct_stats.cpp +3 -1
  1629. package/src/duckdb/src/storage/storage_info.cpp +2 -2
  1630. package/src/duckdb/src/storage/storage_lock.cpp +2 -2
  1631. package/src/duckdb/src/storage/storage_manager.cpp +25 -21
  1632. package/src/duckdb/src/storage/table/chunk_info.cpp +2 -2
  1633. package/src/duckdb/src/storage/table/column_checkpoint_state.cpp +96 -73
  1634. package/src/duckdb/src/storage/table/column_data.cpp +118 -93
  1635. package/src/duckdb/src/storage/table/column_data_checkpointer.cpp +32 -18
  1636. package/src/duckdb/src/storage/table/column_segment.cpp +52 -66
  1637. package/src/duckdb/src/storage/table/list_column_data.cpp +20 -27
  1638. package/src/duckdb/src/storage/table/persistent_table_data.cpp +2 -1
  1639. package/src/duckdb/src/storage/table/row_group.cpp +220 -152
  1640. package/src/duckdb/src/storage/table/row_group_collection.cpp +150 -98
  1641. package/src/duckdb/src/storage/table/scan_state.cpp +46 -34
  1642. package/src/duckdb/src/storage/table/standard_column_data.cpp +13 -18
  1643. package/src/duckdb/src/storage/table/struct_column_data.cpp +22 -34
  1644. package/src/duckdb/src/storage/table/table_statistics.cpp +1 -1
  1645. package/src/duckdb/src/storage/table/update_segment.cpp +22 -40
  1646. package/src/duckdb/src/storage/table/validity_column_data.cpp +2 -6
  1647. package/src/duckdb/src/storage/table_index_list.cpp +3 -3
  1648. package/src/duckdb/src/storage/wal_replay.cpp +38 -37
  1649. package/src/duckdb/src/storage/write_ahead_log.cpp +47 -47
  1650. package/src/duckdb/src/transaction/cleanup_state.cpp +17 -11
  1651. package/src/duckdb/src/transaction/commit_state.cpp +72 -69
  1652. package/src/duckdb/src/transaction/duck_transaction.cpp +9 -9
  1653. package/src/duckdb/src/transaction/duck_transaction_manager.cpp +4 -4
  1654. package/src/duckdb/src/transaction/meta_transaction.cpp +13 -13
  1655. package/src/duckdb/src/transaction/rollback_state.cpp +2 -2
  1656. package/src/duckdb/src/transaction/transaction.cpp +1 -1
  1657. package/src/duckdb/src/transaction/transaction_context.cpp +2 -2
  1658. package/src/duckdb/src/transaction/undo_buffer.cpp +10 -1
  1659. package/src/duckdb/src/verification/copied_statement_verifier.cpp +1 -1
  1660. package/src/duckdb/src/verification/deserialized_statement_verifier.cpp +4 -4
  1661. package/src/duckdb/src/verification/deserialized_statement_verifier_v2.cpp +20 -0
  1662. package/src/duckdb/src/verification/external_statement_verifier.cpp +1 -1
  1663. package/src/duckdb/src/verification/no_operator_caching_verifier.cpp +13 -0
  1664. package/src/duckdb/src/verification/parsed_statement_verifier.cpp +1 -1
  1665. package/src/duckdb/src/verification/prepared_statement_verifier.cpp +7 -7
  1666. package/src/duckdb/src/verification/statement_verifier.cpp +10 -3
  1667. package/src/duckdb/src/verification/unoptimized_statement_verifier.cpp +1 -1
  1668. package/src/duckdb/third_party/fmt/format.cc +0 -5
  1669. package/src/duckdb/third_party/fmt/include/fmt/core.h +10 -12
  1670. package/src/duckdb/third_party/fmt/include/fmt/format-inl.h +2 -33
  1671. package/src/duckdb/third_party/fmt/include/fmt/format.h +61 -24
  1672. package/src/duckdb/third_party/fmt/include/fmt/printf.h +15 -1
  1673. package/src/duckdb/third_party/libpg_query/include/nodes/nodes.hpp +32 -0
  1674. package/src/duckdb/third_party/libpg_query/include/nodes/parsenodes.hpp +3 -1
  1675. package/src/duckdb/third_party/libpg_query/include/nodes/primnodes.hpp +3 -3
  1676. package/src/duckdb/third_party/libpg_query/include/parser/gram.hpp +949 -965
  1677. package/src/duckdb/third_party/libpg_query/include/parser/kwlist.hpp +2 -11
  1678. package/src/duckdb/third_party/libpg_query/include/postgres_parser.hpp +3 -2
  1679. package/src/duckdb/third_party/libpg_query/postgres_parser.cpp +5 -6
  1680. package/src/duckdb/third_party/libpg_query/src_backend_parser_gram.cpp +18482 -17953
  1681. package/src/duckdb/third_party/libpg_query/src_backend_parser_scan.cpp +503 -493
  1682. package/src/duckdb/third_party/parquet/parquet_types.cpp +32 -32
  1683. package/src/duckdb/third_party/parquet/parquet_types.h +34 -32
  1684. package/src/duckdb/third_party/re2/re2/re2.cc +9 -0
  1685. package/src/duckdb/third_party/re2/re2/re2.h +2 -0
  1686. package/src/duckdb/third_party/thrift/thrift/TToString.h +3 -3
  1687. package/src/duckdb/third_party/thrift/thrift/protocol/TProtocol.h +1 -1
  1688. package/src/duckdb/third_party/thrift/thrift/protocol/TProtocolDecorator.h +2 -1
  1689. package/src/duckdb/third_party/thrift/thrift/protocol/TVirtualProtocol.h +5 -4
  1690. package/src/duckdb/third_party/utf8proc/include/utf8proc_wrapper.hpp +1 -0
  1691. package/src/duckdb/ub_extension_icu_third_party_icu_i18n.cpp +6 -6
  1692. package/src/duckdb/ub_extension_json_json_functions.cpp +2 -0
  1693. package/src/duckdb/ub_src_common.cpp +6 -0
  1694. package/src/duckdb/ub_src_common_adbc.cpp +4 -0
  1695. package/src/duckdb/ub_src_common_enums.cpp +2 -0
  1696. package/src/duckdb/ub_src_common_serializer.cpp +4 -0
  1697. package/src/duckdb/ub_src_common_sort.cpp +2 -0
  1698. package/src/duckdb/ub_src_common_types.cpp +1 -15
  1699. package/src/duckdb/ub_src_common_types_column.cpp +10 -0
  1700. package/src/duckdb/ub_src_common_types_row.cpp +20 -0
  1701. package/src/duckdb/ub_src_core_functions.cpp +4 -0
  1702. package/src/duckdb/ub_src_core_functions_aggregate_algebraic.cpp +8 -0
  1703. package/src/duckdb/ub_src_core_functions_aggregate_distributive.cpp +24 -0
  1704. package/src/duckdb/ub_src_core_functions_aggregate_holistic.cpp +8 -0
  1705. package/src/duckdb/ub_src_core_functions_aggregate_nested.cpp +4 -0
  1706. package/src/duckdb/ub_src_core_functions_aggregate_regression.cpp +14 -0
  1707. package/src/duckdb/ub_src_core_functions_scalar_bit.cpp +2 -0
  1708. package/src/duckdb/ub_src_core_functions_scalar_blob.cpp +4 -0
  1709. package/src/duckdb/ub_src_core_functions_scalar_date.cpp +22 -0
  1710. package/src/duckdb/ub_src_core_functions_scalar_enum.cpp +2 -0
  1711. package/src/duckdb/ub_src_core_functions_scalar_generic.cpp +16 -0
  1712. package/src/duckdb/ub_src_core_functions_scalar_list.cpp +14 -0
  1713. package/src/duckdb/ub_src_core_functions_scalar_map.cpp +14 -0
  1714. package/src/duckdb/ub_src_core_functions_scalar_math.cpp +2 -0
  1715. package/src/duckdb/ub_src_core_functions_scalar_operators.cpp +2 -0
  1716. package/src/duckdb/ub_src_core_functions_scalar_random.cpp +4 -0
  1717. package/src/duckdb/ub_src_core_functions_scalar_string.cpp +46 -0
  1718. package/src/duckdb/ub_src_core_functions_scalar_struct.cpp +4 -0
  1719. package/src/duckdb/ub_src_core_functions_scalar_union.cpp +6 -0
  1720. package/src/duckdb/ub_src_execution_index_art.cpp +7 -1
  1721. package/src/duckdb/ub_src_execution_operator_join.cpp +2 -0
  1722. package/src/duckdb/ub_src_execution_operator_persistent.cpp +4 -0
  1723. package/src/duckdb/ub_src_execution_operator_projection.cpp +2 -0
  1724. package/src/duckdb/ub_src_execution_physical_plan.cpp +4 -0
  1725. package/src/duckdb/ub_src_function_aggregate.cpp +0 -8
  1726. package/src/duckdb/ub_src_function_aggregate_distributive.cpp +0 -24
  1727. package/src/duckdb/ub_src_function_scalar.cpp +2 -8
  1728. package/src/duckdb/ub_src_function_scalar_generic.cpp +0 -12
  1729. package/src/duckdb/ub_src_function_scalar_list.cpp +0 -14
  1730. package/src/duckdb/ub_src_function_scalar_operators.cpp +0 -2
  1731. package/src/duckdb/ub_src_function_scalar_string.cpp +0 -38
  1732. package/src/duckdb/ub_src_function_scalar_string_regexp.cpp +4 -0
  1733. package/src/duckdb/ub_src_function_scalar_struct.cpp +0 -4
  1734. package/src/duckdb/ub_src_function_scalar_system.cpp +0 -2
  1735. package/src/duckdb/ub_src_function_table.cpp +2 -0
  1736. package/src/duckdb/ub_src_main.cpp +2 -0
  1737. package/src/duckdb/ub_src_main_extension.cpp +2 -0
  1738. package/src/duckdb/ub_src_optimizer_rule.cpp +2 -0
  1739. package/src/duckdb/ub_src_parallel.cpp +2 -0
  1740. package/src/duckdb/ub_src_parser.cpp +2 -0
  1741. package/src/duckdb/ub_src_parser_transform_expression.cpp +2 -0
  1742. package/src/duckdb/ub_src_planner_binder_expression.cpp +2 -0
  1743. package/src/duckdb/ub_src_planner_binder_tableref.cpp +2 -0
  1744. package/src/duckdb/ub_src_planner_expression_binder.cpp +2 -0
  1745. package/src/duckdb/ub_src_planner_operator.cpp +4 -0
  1746. package/src/duckdb/ub_src_storage.cpp +4 -0
  1747. package/src/duckdb/ub_src_storage_buffer.cpp +8 -0
  1748. package/src/duckdb/ub_src_storage_statistics.cpp +2 -0
  1749. package/src/duckdb/ub_src_storage_table.cpp +0 -2
  1750. package/src/duckdb_node.hpp +15 -10
  1751. package/src/statement.cpp +31 -27
  1752. package/src/utils.cpp +27 -2
  1753. package/test/extension.test.ts +44 -26
  1754. package/test/syntax_error.test.ts +3 -1
  1755. package/test/udf.test.ts +9 -0
  1756. package/filelist.cache +0 -0
  1757. package/src/duckdb/extension/parquet/include/generated_column_reader.hpp +0 -55
  1758. package/src/duckdb/src/function/aggregate/algebraic/corr.cpp +0 -14
  1759. package/src/duckdb/src/function/aggregate/algebraic/covar.cpp +0 -25
  1760. package/src/duckdb/src/function/aggregate/algebraic/stddev.cpp +0 -54
  1761. package/src/duckdb/src/function/aggregate/algebraic_functions.cpp +0 -21
  1762. package/src/duckdb/src/function/aggregate/holistic_functions.cpp +0 -12
  1763. package/src/duckdb/src/function/aggregate/nested/list.cpp +0 -956
  1764. package/src/duckdb/src/function/aggregate/nested_functions.cpp +0 -10
  1765. package/src/duckdb/src/function/aggregate/regression_functions.cpp +0 -21
  1766. package/src/duckdb/src/function/scalar/date_functions.cpp +0 -22
  1767. package/src/duckdb/src/function/scalar/enum_functions.cpp +0 -13
  1768. package/src/duckdb/src/function/scalar/map/map_extract.cpp +0 -95
  1769. package/src/duckdb/src/function/scalar/math_functions.cpp +0 -46
  1770. package/src/duckdb/src/function/scalar/trigonometrics_functions.cpp +0 -18
  1771. package/src/duckdb/src/include/duckdb/common/single_thread_ptr.hpp +0 -183
  1772. package/src/duckdb/src/include/duckdb/function/aggregate/algebraic_functions.hpp +0 -56
  1773. package/src/duckdb/src/include/duckdb/function/aggregate/holistic_functions.hpp +0 -33
  1774. package/src/duckdb/src/include/duckdb/function/aggregate/nested_functions.hpp +0 -26
  1775. package/src/duckdb/src/include/duckdb/function/aggregate/regression_functions.hpp +0 -53
  1776. package/src/duckdb/src/include/duckdb/function/scalar/bit_functions.hpp +0 -32
  1777. package/src/duckdb/src/include/duckdb/function/scalar/blob_functions.hpp +0 -24
  1778. package/src/duckdb/src/include/duckdb/function/scalar/date_functions.hpp +0 -73
  1779. package/src/duckdb/src/include/duckdb/function/scalar/enum_functions.hpp +0 -37
  1780. package/src/duckdb/src/include/duckdb/function/scalar/math_functions.hpp +0 -125
  1781. package/src/duckdb/src/include/duckdb/function/scalar/trigonometric_functions.hpp +0 -49
  1782. package/src/duckdb/src/storage/table/segment_tree.cpp +0 -179
  1783. package/src/duckdb/ub_src_function_aggregate_algebraic.cpp +0 -8
  1784. package/src/duckdb/ub_src_function_aggregate_holistic.cpp +0 -8
  1785. package/src/duckdb/ub_src_function_aggregate_nested.cpp +0 -4
  1786. package/src/duckdb/ub_src_function_aggregate_regression.cpp +0 -14
  1787. package/src/duckdb/ub_src_function_scalar_bit.cpp +0 -2
  1788. package/src/duckdb/ub_src_function_scalar_blob.cpp +0 -4
  1789. package/src/duckdb/ub_src_function_scalar_date.cpp +0 -22
  1790. package/src/duckdb/ub_src_function_scalar_enum.cpp +0 -2
  1791. package/src/duckdb/ub_src_function_scalar_map.cpp +0 -12
  1792. package/src/duckdb/ub_src_function_scalar_math.cpp +0 -6
  1793. package/src/duckdb/ub_src_function_scalar_union.cpp +0 -6
@@ -0,0 +1,1088 @@
1
+ // Licensed to the Apache Software Foundation (ASF) under one
2
+ // or more contributor license agreements. See the NOTICE file
3
+ // distributed with this work for additional information
4
+ // regarding copyright ownership. The ASF licenses this file
5
+ // to you under the Apache License, Version 2.0 (the
6
+ // "License"); you may not use this file except in compliance
7
+ // with the License. You may obtain a copy of the License at
8
+ //
9
+ // http://www.apache.org/licenses/LICENSE-2.0
10
+ //
11
+ // Unless required by applicable law or agreed to in writing,
12
+ // software distributed under the License is distributed on an
13
+ // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ // KIND, either express or implied. See the License for the
15
+ // specific language governing permissions and limitations
16
+ // under the License.
17
+
18
+ /// \file adbc.h ADBC: Arrow Database connectivity
19
+ ///
20
+ /// An Arrow-based interface between applications and database
21
+ /// drivers. ADBC aims to provide a vendor-independent API for SQL
22
+ /// and Substrait-based database access that is targeted at
23
+ /// analytics/OLAP use cases.
24
+ ///
25
+ /// This API is intended to be implemented directly by drivers and
26
+ /// used directly by client applications. To assist portability
27
+ /// between different vendors, a "driver manager" library is also
28
+ /// provided, which implements this same API, but dynamically loads
29
+ /// drivers internally and forwards calls appropriately.
30
+ ///
31
+ /// ADBC uses structs with free functions that operate on those
32
+ /// structs to model objects.
33
+ ///
34
+ /// In general, objects allow serialized access from multiple threads,
35
+ /// but not concurrent access. Specific implementations may permit
36
+ /// multiple threads.
37
+ ///
38
+ /// \version 1.0.0
39
+
40
+ #pragma once
41
+
42
+ #include <stddef.h>
43
+ #include <stdint.h>
44
+ #include "duckdb/common/arrow/arrow.hpp"
45
+
46
+ /// \defgroup Arrow C Data Interface
47
+ /// Definitions for the C Data Interface/C Stream Interface.
48
+ ///
49
+ /// See https://arrow.apache.org/docs/format/CDataInterface.html
50
+ ///
51
+ /// @{
52
+
53
+ //! @cond Doxygen_Suppress
54
+ namespace duckdb_adbc {
55
+ #ifdef __cplusplus
56
+ extern "C" {
57
+ #endif
58
+
59
+ #ifndef ARROW_ADBC
60
+ #define ARROW_ADBC
61
+
62
+ #ifndef ADBC_EXPORTING
63
+ #define ADBC_EXPORTING
64
+ #endif
65
+
66
+ // Storage class macros for Windows
67
+ // Allow overriding/aliasing with application-defined macros
68
+ #if !defined(ADBC_EXPORT)
69
+ #if defined(_WIN32)
70
+ #if defined(ADBC_EXPORTING)
71
+ #define ADBC_EXPORT __declspec(dllexport)
72
+ #else
73
+ #define ADBC_EXPORT __declspec(dllimport)
74
+ #endif // defined(ADBC_EXPORTING)
75
+ #else
76
+ #define ADBC_EXPORT
77
+ #endif // defined(_WIN32)
78
+ #endif // !defined(ADBC_EXPORT)
79
+
80
+ /// \defgroup adbc-error-handling Error Handling
81
+ /// ADBC uses integer error codes to signal errors. To provide more
82
+ /// detail about errors, functions may also return an AdbcError via an
83
+ /// optional out parameter, which can be inspected. If provided, it is
84
+ /// the responsibility of the caller to zero-initialize the AdbcError
85
+ /// value.
86
+ ///
87
+ /// @{
88
+
89
+ /// \brief Error codes for operations that may fail.
90
+ typedef uint8_t AdbcStatusCode;
91
+
92
+ /// \brief No error.
93
+ #define ADBC_STATUS_OK 0
94
+ /// \brief An unknown error occurred.
95
+ ///
96
+ /// May indicate a driver-side or database-side error.
97
+ #define ADBC_STATUS_UNKNOWN 1
98
+ /// \brief The operation is not implemented or supported.
99
+ ///
100
+ /// May indicate a driver-side or database-side error.
101
+ #define ADBC_STATUS_NOT_IMPLEMENTED 2
102
+ /// \brief A requested resource was not found.
103
+ ///
104
+ /// May indicate a driver-side or database-side error.
105
+ #define ADBC_STATUS_NOT_FOUND 3
106
+ /// \brief A requested resource already exists.
107
+ ///
108
+ /// May indicate a driver-side or database-side error.
109
+ #define ADBC_STATUS_ALREADY_EXISTS 4
110
+ /// \brief The arguments are invalid, likely a programming error.
111
+ ///
112
+ /// For instance, they may be of the wrong format, or out of range.
113
+ ///
114
+ /// May indicate a driver-side or database-side error.
115
+ #define ADBC_STATUS_INVALID_ARGUMENT 5
116
+ /// \brief The preconditions for the operation are not met, likely a
117
+ /// programming error.
118
+ ///
119
+ /// For instance, the object may be uninitialized, or may have not
120
+ /// been fully configured.
121
+ ///
122
+ /// May indicate a driver-side or database-side error.
123
+ #define ADBC_STATUS_INVALID_STATE 6
124
+ /// \brief Invalid data was processed (not a programming error).
125
+ ///
126
+ /// For instance, a division by zero may have occurred during query
127
+ /// execution.
128
+ ///
129
+ /// May indicate a database-side error only.
130
+ #define ADBC_STATUS_INVALID_DATA 7
131
+ /// \brief The database's integrity was affected.
132
+ ///
133
+ /// For instance, a foreign key check may have failed, or a uniqueness
134
+ /// constraint may have been violated.
135
+ ///
136
+ /// May indicate a database-side error only.
137
+ #define ADBC_STATUS_INTEGRITY 8
138
+ /// \brief An error internal to the driver or database occurred.
139
+ ///
140
+ /// May indicate a driver-side or database-side error.
141
+ #define ADBC_STATUS_INTERNAL 9
142
+ /// \brief An I/O error occurred.
143
+ ///
144
+ /// For instance, a remote service may be unavailable.
145
+ ///
146
+ /// May indicate a driver-side or database-side error.
147
+ #define ADBC_STATUS_IO 10
148
+ /// \brief The operation was cancelled, not due to a timeout.
149
+ ///
150
+ /// May indicate a driver-side or database-side error.
151
+ #define ADBC_STATUS_CANCELLED 11
152
+ /// \brief The operation was cancelled due to a timeout.
153
+ ///
154
+ /// May indicate a driver-side or database-side error.
155
+ #define ADBC_STATUS_TIMEOUT 12
156
+ /// \brief Authentication failed.
157
+ ///
158
+ /// May indicate a database-side error only.
159
+ #define ADBC_STATUS_UNAUTHENTICATED 13
160
+ /// \brief The client is not authorized to perform the given operation.
161
+ ///
162
+ /// May indicate a database-side error only.
163
+ #define ADBC_STATUS_UNAUTHORIZED 14
164
+
165
+ /// \brief A detailed error message for an operation.
166
+ struct ADBC_EXPORT AdbcError {
167
+ /// \brief The error message.
168
+ char *message;
169
+
170
+ /// \brief A vendor-specific error code, if applicable.
171
+ int32_t vendor_code;
172
+
173
+ /// \brief A SQLSTATE error code, if provided, as defined by the
174
+ /// SQL:2003 standard. If not set, it should be set to
175
+ /// "\0\0\0\0\0".
176
+ char sqlstate[5];
177
+
178
+ /// \brief Release the contained error.
179
+ ///
180
+ /// Unlike other structures, this is an embedded callback to make it
181
+ /// easier for the driver manager and driver to cooperate.
182
+ void (*release)(struct AdbcError *error);
183
+ };
184
+
185
+ /// @}
186
+
187
+ /// \defgroup adbc-constants Constants
188
+ /// @{
189
+
190
+ /// \brief ADBC revision 1.0.0.
191
+ ///
192
+ /// When passed to an AdbcDriverInitFunc(), the driver parameter must
193
+ /// point to an AdbcDriver.
194
+ #define ADBC_VERSION_1_0_0 1000000
195
+
196
+ /// \brief Canonical option value for enabling an option.
197
+ ///
198
+ /// For use as the value in SetOption calls.
199
+ #define ADBC_OPTION_VALUE_ENABLED "true"
200
+ /// \brief Canonical option value for disabling an option.
201
+ ///
202
+ /// For use as the value in SetOption calls.
203
+ #define ADBC_OPTION_VALUE_DISABLED "false"
204
+
205
+ /// \brief The database vendor/product name (e.g. the server name).
206
+ /// (type: utf8).
207
+ ///
208
+ /// \see AdbcConnectionGetInfo
209
+ #define ADBC_INFO_VENDOR_NAME 0
210
+ /// \brief The database vendor/product version (type: utf8).
211
+ ///
212
+ /// \see AdbcConnectionGetInfo
213
+ #define ADBC_INFO_VENDOR_VERSION 1
214
+ /// \brief The database vendor/product Arrow library version (type:
215
+ /// utf8).
216
+ ///
217
+ /// \see AdbcConnectionGetInfo
218
+ #define ADBC_INFO_VENDOR_ARROW_VERSION 2
219
+
220
+ /// \brief The driver name (type: utf8).
221
+ ///
222
+ /// \see AdbcConnectionGetInfo
223
+ #define ADBC_INFO_DRIVER_NAME 100
224
+ /// \brief The driver version (type: utf8).
225
+ ///
226
+ /// \see AdbcConnectionGetInfo
227
+ #define ADBC_INFO_DRIVER_VERSION 101
228
+ /// \brief The driver Arrow library version (type: utf8).
229
+ ///
230
+ /// \see AdbcConnectionGetInfo
231
+ #define ADBC_INFO_DRIVER_ARROW_VERSION 102
232
+
233
+ /// \brief Return metadata on catalogs, schemas, tables, and columns.
234
+ ///
235
+ /// \see AdbcConnectionGetObjects
236
+ #define ADBC_OBJECT_DEPTH_ALL 0
237
+ /// \brief Return metadata on catalogs only.
238
+ ///
239
+ /// \see AdbcConnectionGetObjects
240
+ #define ADBC_OBJECT_DEPTH_CATALOGS 1
241
+ /// \brief Return metadata on catalogs and schemas.
242
+ ///
243
+ /// \see AdbcConnectionGetObjects
244
+ #define ADBC_OBJECT_DEPTH_DB_SCHEMAS 2
245
+ /// \brief Return metadata on catalogs, schemas, and tables.
246
+ ///
247
+ /// \see AdbcConnectionGetObjects
248
+ #define ADBC_OBJECT_DEPTH_TABLES 3
249
+ /// \brief Return metadata on catalogs, schemas, tables, and columns.
250
+ ///
251
+ /// \see AdbcConnectionGetObjects
252
+ #define ADBC_OBJECT_DEPTH_COLUMNS ADBC_OBJECT_DEPTH_ALL
253
+
254
+ /// \brief The name of the canonical option for whether autocommit is
255
+ /// enabled.
256
+ ///
257
+ /// \see AdbcConnectionSetOption
258
+ #define ADBC_CONNECTION_OPTION_AUTOCOMMIT "adbc.connection.autocommit"
259
+
260
+ /// \brief The name of the canonical option for whether the current
261
+ /// connection should be restricted to being read-only.
262
+ ///
263
+ /// \see AdbcConnectionSetOption
264
+ #define ADBC_CONNECTION_OPTION_READ_ONLY "adbc.connection.readonly"
265
+
266
+ /// \brief The name of the canonical option for setting the isolation
267
+ /// level of a transaction.
268
+ ///
269
+ /// Should only be used in conjunction with autocommit disabled and
270
+ /// AdbcConnectionCommit / AdbcConnectionRollback. If the desired
271
+ /// isolation level is not supported by a driver, it should return an
272
+ /// appropriate error.
273
+ ///
274
+ /// \see AdbcConnectionSetOption
275
+ #define ADBC_CONNECTION_OPTION_ISOLATION_LEVEL "adbc.connection.transaction.isolation_level"
276
+
277
+ /// \brief Use database or driver default isolation level
278
+ ///
279
+ /// \see AdbcConnectionSetOption
280
+ #define ADBC_OPTION_ISOLATION_LEVEL_DEFAULT "adbc.connection.transaction.isolation.default"
281
+
282
+ /// \brief The lowest isolation level. Dirty reads are allowed, so one
283
+ /// transaction may see not-yet-committed changes made by others.
284
+ ///
285
+ /// \see AdbcConnectionSetOption
286
+ #define ADBC_OPTION_ISOLATION_LEVEL_READ_UNCOMMITTED "adbc.connection.transaction.isolation.read_uncommitted"
287
+
288
+ /// \brief Lock-based concurrency control keeps write locks until the
289
+ /// end of the transaction, but read locks are released as soon as a
290
+ /// SELECT is performed. Non-repeatable reads can occur in this
291
+ /// isolation level.
292
+ ///
293
+ /// More simply put, Read Committed is an isolation level that guarantees
294
+ /// that any data read is committed at the moment it is read. It simply
295
+ /// restricts the reader from seeing any intermediate, uncommitted,
296
+ /// 'dirty' reads. It makes no promise whatsoever that if the transaction
297
+ /// re-issues the read, it will find the same data; data is free to change
298
+ /// after it is read.
299
+ ///
300
+ /// \see AdbcConnectionSetOption
301
+ #define ADBC_OPTION_ISOLATION_LEVEL_READ_COMMITTED "adbc.connection.transaction.isolation.read_committed"
302
+
303
+ /// \brief Lock-based concurrency control keeps read AND write locks
304
+ /// (acquired on selection data) until the end of the transaction.
305
+ ///
306
+ /// However, range-locks are not managed, so phantom reads can occur.
307
+ /// Write skew is possible at this isolation level in some systems.
308
+ ///
309
+ /// \see AdbcConnectionSetOption
310
+ #define ADBC_OPTION_ISOLATION_LEVEL_REPEATABLE_READ "adbc.connection.transaction.isolation.repeatable_read"
311
+
312
+ /// \brief This isolation guarantees that all reads in the transaction
313
+ /// will see a consistent snapshot of the database and the transaction
314
+ /// should only successfully commit if no updates conflict with any
315
+ /// concurrent updates made since that snapshot.
316
+ ///
317
+ /// \see AdbcConnectionSetOption
318
+ #define ADBC_OPTION_ISOLATION_LEVEL_SNAPSHOT "adbc.connection.transaction.isolation.snapshot"
319
+
320
+ /// \brief Serializability requires read and write locks to be released
321
+ /// only at the end of the transaction. This includes acquiring range-
322
+ /// locks when a select query uses a ranged WHERE clause to avoid
323
+ /// phantom reads.
324
+ ///
325
+ /// \see AdbcConnectionSetOption
326
+ #define ADBC_OPTION_ISOLATION_LEVEL_SERIALIZABLE "adbc.connection.transaction.isolation.serializable"
327
+
328
+ /// \brief The central distinction between serializability and linearizability
329
+ /// is that serializability is a global property; a property of an entire
330
+ /// history of operations and transactions. Linearizability is a local
331
+ /// property; a property of a single operation/transaction.
332
+ ///
333
+ /// Linearizability can be viewed as a special case of strict serializability
334
+ /// where transactions are restricted to consist of a single operation applied
335
+ /// to a single object.
336
+ ///
337
+ /// \see AdbcConnectionSetOption
338
+ #define ADBC_OPTION_ISOLATION_LEVEL_LINEARIZABLE "adbc.connection.transaction.isolation.linearizable"
339
+
340
+ /// \defgroup adbc-statement-ingestion Bulk Data Ingestion
341
+ /// While it is possible to insert data via prepared statements, it can
342
+ /// be more efficient to explicitly perform a bulk insert. For
343
+ /// compatible drivers, this can be accomplished by setting up and
344
+ /// executing a statement. Instead of setting a SQL query or Substrait
345
+ /// plan, bind the source data via AdbcStatementBind, and set the name
346
+ /// of the table to be created via AdbcStatementSetOption and the
347
+ /// options below. Then, call AdbcStatementExecute with a NULL for
348
+ /// the out parameter (to indicate you do not expect a result set).
349
+ ///
350
+ /// @{
351
+
352
+ /// \brief The name of the target table for a bulk insert.
353
+ ///
354
+ /// The driver should attempt to create the table if it does not
355
+ /// exist. If the table exists but has a different schema,
356
+ /// ADBC_STATUS_ALREADY_EXISTS should be raised. Else, data should be
357
+ /// appended to the target table.
358
+ #define ADBC_INGEST_OPTION_TARGET_TABLE "adbc.ingest.target_table"
359
+ /// \brief Whether to create (the default) or append.
360
+ #define ADBC_INGEST_OPTION_MODE "adbc.ingest.mode"
361
+ /// \brief Create the table and insert data; error if the table exists.
362
+ #define ADBC_INGEST_OPTION_MODE_CREATE "adbc.ingest.mode.create"
363
+ /// \brief Do not create the table, and insert data; error if the
364
+ /// table does not exist (ADBC_STATUS_NOT_FOUND) or does not match
365
+ /// the schema of the data to append (ADBC_STATUS_ALREADY_EXISTS).
366
+ #define ADBC_INGEST_OPTION_MODE_APPEND "adbc.ingest.mode.append"
367
+
368
+ /// @}
369
+
370
+ /// @}
371
+
372
+ /// \defgroup adbc-database Database Initialization
373
+ /// Clients first initialize a database, then create a connection
374
+ /// (below). This gives the implementation a place to initialize and
375
+ /// own any common connection state. For example, in-memory databases
376
+ /// can place ownership of the actual database in this object.
377
+ /// @{
378
+
379
+ /// \brief An instance of a database.
380
+ ///
381
+ /// Must be kept alive as long as any connections exist.
382
+ struct ADBC_EXPORT AdbcDatabase {
383
+ /// \brief Opaque implementation-defined state.
384
+ /// This field is NULLPTR iff the connection is unintialized/freed.
385
+ void *private_data;
386
+ /// \brief The associated driver (used by the driver manager to help
387
+ /// track state).
388
+ struct AdbcDriver *private_driver;
389
+ };
390
+
391
+ /// @}
392
+
393
+ /// \defgroup adbc-connection Connection Establishment
394
+ /// Functions for creating, using, and releasing database connections.
395
+ /// @{
396
+
397
+ /// \brief An active database connection.
398
+ ///
399
+ /// Provides methods for query execution, managing prepared
400
+ /// statements, using transactions, and so on.
401
+ ///
402
+ /// Connections are not required to be thread-safe, but they can be
403
+ /// used from multiple threads so long as clients take care to
404
+ /// serialize accesses to a connection.
405
+ struct ADBC_EXPORT AdbcConnection {
406
+ /// \brief Opaque implementation-defined state.
407
+ /// This field is NULLPTR iff the connection is unintialized/freed.
408
+ void *private_data;
409
+ /// \brief The associated driver (used by the driver manager to help
410
+ /// track state).
411
+ struct AdbcDriver *private_driver;
412
+ };
413
+
414
+ /// @}
415
+
416
+ /// \defgroup adbc-statement Managing Statements
417
+ /// Applications should first initialize a statement with
418
+ /// AdbcStatementNew. Then, the statement should be configured with
419
+ /// functions like AdbcStatementSetSqlQuery and
420
+ /// AdbcStatementSetOption. Finally, the statement can be executed
421
+ /// with AdbcStatementExecuteQuery (or call AdbcStatementPrepare first
422
+ /// to turn it into a prepared statement instead).
423
+ /// @{
424
+
425
+ /// \brief A container for all state needed to execute a database
426
+ /// query, such as the query itself, parameters for prepared
427
+ /// statements, driver parameters, etc.
428
+ ///
429
+ /// Statements may represent queries or prepared statements.
430
+ ///
431
+ /// Statements may be used multiple times and can be reconfigured
432
+ /// (e.g. they can be reused to execute multiple different queries).
433
+ /// However, executing a statement (and changing certain other state)
434
+ /// will invalidate result sets obtained prior to that execution.
435
+ ///
436
+ /// Multiple statements may be created from a single connection.
437
+ /// However, the driver may block or error if they are used
438
+ /// concurrently (whether from a single thread or multiple threads).
439
+ ///
440
+ /// Statements are not required to be thread-safe, but they can be
441
+ /// used from multiple threads so long as clients take care to
442
+ /// serialize accesses to a statement.
443
+ struct ADBC_EXPORT AdbcStatement {
444
+ /// \brief Opaque implementation-defined state.
445
+ /// This field is NULLPTR iff the connection is unintialized/freed.
446
+ void *private_data;
447
+
448
+ /// \brief The associated driver (used by the driver manager to help
449
+ /// track state).
450
+ struct AdbcDriver *private_driver;
451
+ };
452
+
453
+ /// \defgroup adbc-statement-partition Partitioned Results
454
+ /// Some backends may internally partition the results. These
455
+ /// partitions are exposed to clients who may wish to integrate them
456
+ /// with a threaded or distributed execution model, where partitions
457
+ /// can be divided among threads or machines and fetched in parallel.
458
+ ///
459
+ /// To use partitioning, execute the statement with
460
+ /// AdbcStatementExecutePartitions to get the partition descriptors.
461
+ /// Call AdbcConnectionReadPartition to turn the individual
462
+ /// descriptors into ArrowArrayStream instances. This may be done on
463
+ /// a different connection than the one the partition was created
464
+ /// with, or even in a different process on another machine.
465
+ ///
466
+ /// Drivers are not required to support partitioning.
467
+ ///
468
+ /// @{
469
+
470
+ /// \brief The partitions of a distributed/partitioned result set.
471
+ struct AdbcPartitions {
472
+ /// \brief The number of partitions.
473
+ size_t num_partitions;
474
+
475
+ /// \brief The partitions of the result set, where each entry (up to
476
+ /// num_partitions entries) is an opaque identifier that can be
477
+ /// passed to AdbcConnectionReadPartition.
478
+ const uint8_t **partitions;
479
+
480
+ /// \brief The length of each corresponding entry in partitions.
481
+ const size_t *partition_lengths;
482
+
483
+ /// \brief Opaque implementation-defined state.
484
+ /// This field is NULLPTR iff the connection is unintialized/freed.
485
+ void *private_data;
486
+
487
+ /// \brief Release the contained partitions.
488
+ ///
489
+ /// Unlike other structures, this is an embedded callback to make it
490
+ /// easier for the driver manager and driver to cooperate.
491
+ void (*release)(struct AdbcPartitions *partitions);
492
+ };
493
+
494
+ /// @}
495
+
496
+ /// @}
497
+
498
+ /// \defgroup adbc-driver Driver Initialization
499
+ ///
500
+ /// These functions are intended to help support integration between a
501
+ /// driver and the driver manager.
502
+ /// @{
503
+
504
+ /// \brief An instance of an initialized database driver.
505
+ ///
506
+ /// This provides a common interface for vendor-specific driver
507
+ /// initialization routines. Drivers should populate this struct, and
508
+ /// applications can call ADBC functions through this struct, without
509
+ /// worrying about multiple definitions of the same symbol.
510
+ struct ADBC_EXPORT AdbcDriver {
511
+ /// \brief Opaque driver-defined state.
512
+ /// This field is NULL if the driver is unintialized/freed (but
513
+ /// it need not have a value even if the driver is initialized).
514
+ void *private_data;
515
+ /// \brief Opaque driver manager-defined state.
516
+ /// This field is NULL if the driver is unintialized/freed (but
517
+ /// it need not have a value even if the driver is initialized).
518
+ void *private_manager;
519
+
520
+ /// \brief Release the driver and perform any cleanup.
521
+ ///
522
+ /// This is an embedded callback to make it easier for the driver
523
+ /// manager and driver to cooperate.
524
+ AdbcStatusCode (*release)(struct AdbcDriver *driver, struct AdbcError *error);
525
+
526
+ AdbcStatusCode (*DatabaseInit)(struct AdbcDatabase *, struct AdbcError *);
527
+ AdbcStatusCode (*DatabaseNew)(struct AdbcDatabase *, struct AdbcError *);
528
+ AdbcStatusCode (*DatabaseSetOption)(struct AdbcDatabase *, const char *, const char *, struct AdbcError *);
529
+ AdbcStatusCode (*DatabaseRelease)(struct AdbcDatabase *, struct AdbcError *);
530
+
531
+ AdbcStatusCode (*ConnectionCommit)(struct AdbcConnection *, struct AdbcError *);
532
+ AdbcStatusCode (*ConnectionGetInfo)(struct AdbcConnection *, uint32_t *, size_t, struct ArrowArrayStream *,
533
+ struct AdbcError *);
534
+ AdbcStatusCode (*ConnectionGetObjects)(struct AdbcConnection *, int, const char *, const char *, const char *,
535
+ const char **, const char *, struct ArrowArrayStream *, struct AdbcError *);
536
+ AdbcStatusCode (*ConnectionGetTableSchema)(struct AdbcConnection *, const char *, const char *, const char *,
537
+ struct ArrowSchema *, struct AdbcError *);
538
+ AdbcStatusCode (*ConnectionGetTableTypes)(struct AdbcConnection *, struct ArrowArrayStream *, struct AdbcError *);
539
+ AdbcStatusCode (*ConnectionInit)(struct AdbcConnection *, struct AdbcDatabase *, struct AdbcError *);
540
+ AdbcStatusCode (*ConnectionNew)(struct AdbcConnection *, struct AdbcError *);
541
+ AdbcStatusCode (*ConnectionSetOption)(struct AdbcConnection *, const char *, const char *, struct AdbcError *);
542
+ AdbcStatusCode (*ConnectionReadPartition)(struct AdbcConnection *, const uint8_t *, size_t,
543
+ struct ArrowArrayStream *, struct AdbcError *);
544
+ AdbcStatusCode (*ConnectionRelease)(struct AdbcConnection *, struct AdbcError *);
545
+ AdbcStatusCode (*ConnectionRollback)(struct AdbcConnection *, struct AdbcError *);
546
+
547
+ AdbcStatusCode (*StatementBind)(struct AdbcStatement *, struct ArrowArray *, struct ArrowSchema *,
548
+ struct AdbcError *);
549
+ AdbcStatusCode (*StatementBindStream)(struct AdbcStatement *, struct ArrowArrayStream *, struct AdbcError *);
550
+ AdbcStatusCode (*StatementExecuteQuery)(struct AdbcStatement *, struct ArrowArrayStream *, int64_t *,
551
+ struct AdbcError *);
552
+ AdbcStatusCode (*StatementExecutePartitions)(struct AdbcStatement *, struct ArrowSchema *, struct AdbcPartitions *,
553
+ int64_t *, struct AdbcError *);
554
+ AdbcStatusCode (*StatementGetParameterSchema)(struct AdbcStatement *, struct ArrowSchema *, struct AdbcError *);
555
+ AdbcStatusCode (*StatementNew)(struct AdbcConnection *, struct AdbcStatement *, struct AdbcError *);
556
+ AdbcStatusCode (*StatementPrepare)(struct AdbcStatement *, struct AdbcError *);
557
+ AdbcStatusCode (*StatementRelease)(struct AdbcStatement *, struct AdbcError *);
558
+ AdbcStatusCode (*StatementSetOption)(struct AdbcStatement *, const char *, const char *, struct AdbcError *);
559
+ AdbcStatusCode (*StatementSetSqlQuery)(struct AdbcStatement *, const char *, struct AdbcError *);
560
+ AdbcStatusCode (*StatementSetSubstraitPlan)(struct AdbcStatement *, const uint8_t *, size_t, struct AdbcError *);
561
+ };
562
+
563
+ /// @}
564
+
565
+ /// \addtogroup adbc-database
566
+ /// @{
567
+
568
+ /// \brief Allocate a new (but uninitialized) database.
569
+ ///
570
+ /// Callers pass in a zero-initialized AdbcDatabase.
571
+ ///
572
+ /// Drivers should allocate their internal data structure and set the private_data
573
+ /// field to point to the newly allocated struct. This struct should be released
574
+ /// when AdbcDatabaseRelease is called.
575
+ ADBC_EXPORT
576
+ AdbcStatusCode AdbcDatabaseNew(struct AdbcDatabase *database, struct AdbcError *error);
577
+
578
+ /// \brief Set a char* option.
579
+ ///
580
+ /// Options may be set before AdbcDatabaseInit. Some drivers may
581
+ /// support setting options after initialization as well.
582
+ ///
583
+ /// \return ADBC_STATUS_NOT_IMPLEMENTED if the option is not recognized
584
+ ADBC_EXPORT
585
+ AdbcStatusCode AdbcDatabaseSetOption(struct AdbcDatabase *database, const char *key, const char *value,
586
+ struct AdbcError *error);
587
+
588
+ /// \brief Finish setting options and initialize the database.
589
+ ///
590
+ /// Some drivers may support setting options after initialization
591
+ /// as well.
592
+ ADBC_EXPORT
593
+ AdbcStatusCode AdbcDatabaseInit(struct AdbcDatabase *database, struct AdbcError *error);
594
+
595
+ /// \brief Destroy this database. No connections may exist.
596
+ /// \param[in] database The database to release.
597
+ /// \param[out] error An optional location to return an error
598
+ /// message if necessary.
599
+ ADBC_EXPORT
600
+ AdbcStatusCode AdbcDatabaseRelease(struct AdbcDatabase *database, struct AdbcError *error);
601
+
602
+ /// @}
603
+
604
+ /// \addtogroup adbc-connection
605
+ /// @{
606
+
607
+ /// \brief Allocate a new (but uninitialized) connection.
608
+ ///
609
+ /// Callers pass in a zero-initialized AdbcConnection.
610
+ ///
611
+ /// Drivers should allocate their internal data structure and set the private_data
612
+ /// field to point to the newly allocated struct. This struct should be released
613
+ /// when AdbcConnectionRelease is called.
614
+ ADBC_EXPORT
615
+ AdbcStatusCode AdbcConnectionNew(struct AdbcConnection *connection, struct AdbcError *error);
616
+
617
+ /// \brief Set a char* option.
618
+ ///
619
+ /// Options may be set before AdbcConnectionInit. Some drivers may
620
+ /// support setting options after initialization as well.
621
+ ///
622
+ /// \return ADBC_STATUS_NOT_IMPLEMENTED if the option is not recognized
623
+ ADBC_EXPORT
624
+ AdbcStatusCode AdbcConnectionSetOption(struct AdbcConnection *connection, const char *key, const char *value,
625
+ struct AdbcError *error);
626
+
627
+ /// \brief Finish setting options and initialize the connection.
628
+ ///
629
+ /// Some drivers may support setting options after initialization
630
+ /// as well.
631
+ ADBC_EXPORT
632
+ AdbcStatusCode AdbcConnectionInit(struct AdbcConnection *connection, struct AdbcDatabase *database,
633
+ struct AdbcError *error);
634
+
635
+ /// \brief Destroy this connection.
636
+ ///
637
+ /// \param[in] connection The connection to release.
638
+ /// \param[out] error An optional location to return an error
639
+ /// message if necessary.
640
+ ADBC_EXPORT
641
+ AdbcStatusCode AdbcConnectionRelease(struct AdbcConnection *connection, struct AdbcError *error);
642
+
643
+ /// \defgroup adbc-connection-metadata Metadata
644
+ /// Functions for retrieving metadata about the database.
645
+ ///
646
+ /// Generally, these functions return an ArrowArrayStream that can be
647
+ /// consumed to get the metadata as Arrow data. The returned metadata
648
+ /// has an expected schema given in the function docstring. Schema
649
+ /// fields are nullable unless otherwise marked. While no
650
+ /// AdbcStatement is used in these functions, the result set may count
651
+ /// as an active statement to the driver for the purposes of
652
+ /// concurrency management (e.g. if the driver has a limit on
653
+ /// concurrent active statements and it must execute a SQL query
654
+ /// internally in order to implement the metadata function).
655
+ ///
656
+ /// Some functions accept "search pattern" arguments, which are
657
+ /// strings that can contain the special character "%" to match zero
658
+ /// or more characters, or "_" to match exactly one character. (See
659
+ /// the documentation of DatabaseMetaData in JDBC or "Pattern Value
660
+ /// Arguments" in the ODBC documentation.) Escaping is not currently
661
+ /// supported.
662
+ ///
663
+ /// @{
664
+
665
+ /// \brief Get metadata about the database/driver.
666
+ ///
667
+ /// The result is an Arrow dataset with the following schema:
668
+ ///
669
+ /// Field Name | Field Type
670
+ /// ----------------------------|------------------------
671
+ /// info_name | uint32 not null
672
+ /// info_value | INFO_SCHEMA
673
+ ///
674
+ /// INFO_SCHEMA is a dense union with members:
675
+ ///
676
+ /// Field Name (Type Code) | Field Type
677
+ /// ----------------------------|------------------------
678
+ /// string_value (0) | utf8
679
+ /// bool_value (1) | bool
680
+ /// int64_value (2) | int64
681
+ /// int32_bitmask (3) | int32
682
+ /// string_list (4) | list<utf8>
683
+ /// int32_to_int32_list_map (5) | map<int32, list<int32>>
684
+ ///
685
+ /// Each metadatum is identified by an integer code. The recognized
686
+ /// codes are defined as constants. Codes [0, 10_000) are reserved
687
+ /// for ADBC usage. Drivers/vendors will ignore requests for
688
+ /// unrecognized codes (the row will be omitted from the result).
689
+ ///
690
+ /// \param[in] connection The connection to query.
691
+ /// \param[in] info_codes A list of metadata codes to fetch, or NULL
692
+ /// to fetch all.
693
+ /// \param[in] info_codes_length The length of the info_codes
694
+ /// parameter. Ignored if info_codes is NULL.
695
+ /// \param[out] out The result set.
696
+ /// \param[out] error Error details, if an error occurs.
697
+ ADBC_EXPORT
698
+ AdbcStatusCode AdbcConnectionGetInfo(struct AdbcConnection *connection, uint32_t *info_codes, size_t info_codes_length,
699
+ struct ArrowArrayStream *out, struct AdbcError *error);
700
+
701
+ /// \brief Get a hierarchical view of all catalogs, database schemas,
702
+ /// tables, and columns.
703
+ ///
704
+ /// The result is an Arrow dataset with the following schema:
705
+ ///
706
+ /// | Field Name | Field Type |
707
+ /// |--------------------------|-------------------------|
708
+ /// | catalog_name | utf8 |
709
+ /// | catalog_db_schemas | list<DB_SCHEMA_SCHEMA> |
710
+ ///
711
+ /// DB_SCHEMA_SCHEMA is a Struct with fields:
712
+ ///
713
+ /// | Field Name | Field Type |
714
+ /// |--------------------------|-------------------------|
715
+ /// | db_schema_name | utf8 |
716
+ /// | db_schema_tables | list<TABLE_SCHEMA> |
717
+ ///
718
+ /// TABLE_SCHEMA is a Struct with fields:
719
+ ///
720
+ /// | Field Name | Field Type |
721
+ /// |--------------------------|-------------------------|
722
+ /// | table_name | utf8 not null |
723
+ /// | table_type | utf8 not null |
724
+ /// | table_columns | list<COLUMN_SCHEMA> |
725
+ /// | table_constraints | list<CONSTRAINT_SCHEMA> |
726
+ ///
727
+ /// COLUMN_SCHEMA is a Struct with fields:
728
+ ///
729
+ /// | Field Name | Field Type | Comments |
730
+ /// |--------------------------|-------------------------|----------|
731
+ /// | column_name | utf8 not null | |
732
+ /// | ordinal_position | int32 | (1) |
733
+ /// | remarks | utf8 | (2) |
734
+ /// | xdbc_data_type | int16 | (3) |
735
+ /// | xdbc_type_name | utf8 | (3) |
736
+ /// | xdbc_column_size | int32 | (3) |
737
+ /// | xdbc_decimal_digits | int16 | (3) |
738
+ /// | xdbc_num_prec_radix | int16 | (3) |
739
+ /// | xdbc_nullable | int16 | (3) |
740
+ /// | xdbc_column_def | utf8 | (3) |
741
+ /// | xdbc_sql_data_type | int16 | (3) |
742
+ /// | xdbc_datetime_sub | int16 | (3) |
743
+ /// | xdbc_char_octet_length | int32 | (3) |
744
+ /// | xdbc_is_nullable | utf8 | (3) |
745
+ /// | xdbc_scope_catalog | utf8 | (3) |
746
+ /// | xdbc_scope_schema | utf8 | (3) |
747
+ /// | xdbc_scope_table | utf8 | (3) |
748
+ /// | xdbc_is_autoincrement | bool | (3) |
749
+ /// | xdbc_is_generatedcolumn | bool | (3) |
750
+ ///
751
+ /// 1. The column's ordinal position in the table (starting from 1).
752
+ /// 2. Database-specific description of the column.
753
+ /// 3. Optional value. Should be null if not supported by the driver.
754
+ /// xdbc_ values are meant to provide JDBC/ODBC-compatible metadata
755
+ /// in an agnostic manner.
756
+ ///
757
+ /// CONSTRAINT_SCHEMA is a Struct with fields:
758
+ ///
759
+ /// | Field Name | Field Type | Comments |
760
+ /// |--------------------------|-------------------------|----------|
761
+ /// | constraint_name | utf8 | |
762
+ /// | constraint_type | utf8 not null | (1) |
763
+ /// | constraint_column_names | list<utf8> not null | (2) |
764
+ /// | constraint_column_usage | list<USAGE_SCHEMA> | (3) |
765
+ ///
766
+ /// 1. One of 'CHECK', 'FOREIGN KEY', 'PRIMARY KEY', or 'UNIQUE'.
767
+ /// 2. The columns on the current table that are constrained, in
768
+ /// order.
769
+ /// 3. For FOREIGN KEY only, the referenced table and columns.
770
+ ///
771
+ /// USAGE_SCHEMA is a Struct with fields:
772
+ ///
773
+ /// | Field Name | Field Type |
774
+ /// |--------------------------|-------------------------|
775
+ /// | fk_catalog | utf8 |
776
+ /// | fk_db_schema | utf8 |
777
+ /// | fk_table | utf8 not null |
778
+ /// | fk_column_name | utf8 not null |
779
+ ///
780
+ /// \param[in] connection The database connection.
781
+ /// \param[in] depth The level of nesting to display. If 0, display
782
+ /// all levels. If 1, display only catalogs (i.e. catalog_schemas
783
+ /// will be null). If 2, display only catalogs and schemas
784
+ /// (i.e. db_schema_tables will be null), and so on.
785
+ /// \param[in] catalog Only show tables in the given catalog. If NULL,
786
+ /// do not filter by catalog. If an empty string, only show tables
787
+ /// without a catalog. May be a search pattern (see section
788
+ /// documentation).
789
+ /// \param[in] db_schema Only show tables in the given database schema. If
790
+ /// NULL, do not filter by database schema. If an empty string, only show
791
+ /// tables without a database schema. May be a search pattern (see section
792
+ /// documentation).
793
+ /// \param[in] table_name Only show tables with the given name. If NULL, do not
794
+ /// filter by name. May be a search pattern (see section documentation).
795
+ /// \param[in] table_type Only show tables matching one of the given table
796
+ /// types. If NULL, show tables of any type. Valid table types can be fetched
797
+ /// from GetTableTypes. Terminate the list with a NULL entry.
798
+ /// \param[in] column_name Only show columns with the given name. If
799
+ /// NULL, do not filter by name. May be a search pattern (see
800
+ /// section documentation).
801
+ /// \param[out] out The result set.
802
+ /// \param[out] error Error details, if an error occurs.
803
+ ADBC_EXPORT
804
+ AdbcStatusCode AdbcConnectionGetObjects(struct AdbcConnection *connection, int depth, const char *catalog,
805
+ const char *db_schema, const char *table_name, const char **table_type,
806
+ const char *column_name, struct ArrowArrayStream *out, struct AdbcError *error);
807
+
808
+ /// \brief Get the Arrow schema of a table.
809
+ ///
810
+ /// \param[in] connection The database connection.
811
+ /// \param[in] catalog The catalog (or nullptr if not applicable).
812
+ /// \param[in] db_schema The database schema (or nullptr if not applicable).
813
+ /// \param[in] table_name The table name.
814
+ /// \param[out] schema The table schema.
815
+ /// \param[out] error Error details, if an error occurs.
816
+ ADBC_EXPORT
817
+ AdbcStatusCode AdbcConnectionGetTableSchema(struct AdbcConnection *connection, const char *catalog,
818
+ const char *db_schema, const char *table_name, struct ArrowSchema *schema,
819
+ struct AdbcError *error);
820
+
821
+ /// \brief Get a list of table types in the database.
822
+ ///
823
+ /// The result is an Arrow dataset with the following schema:
824
+ ///
825
+ /// Field Name | Field Type
826
+ /// ---------------|--------------
827
+ /// table_type | utf8 not null
828
+ ///
829
+ /// \param[in] connection The database connection.
830
+ /// \param[out] out The result set.
831
+ /// \param[out] error Error details, if an error occurs.
832
+ ADBC_EXPORT
833
+ AdbcStatusCode AdbcConnectionGetTableTypes(struct AdbcConnection *connection, struct ArrowArrayStream *out,
834
+ struct AdbcError *error);
835
+
836
+ /// @}
837
+
838
+ /// \defgroup adbc-connection-partition Partitioned Results
839
+ /// Some databases may internally partition the results. These
840
+ /// partitions are exposed to clients who may wish to integrate them
841
+ /// with a threaded or distributed execution model, where partitions
842
+ /// can be divided among threads or machines for processing.
843
+ ///
844
+ /// Drivers are not required to support partitioning.
845
+ ///
846
+ /// Partitions are not ordered. If the result set is sorted,
847
+ /// implementations should return a single partition.
848
+ ///
849
+ /// @{
850
+
851
+ /// \brief Construct a statement for a partition of a query. The
852
+ /// results can then be read independently.
853
+ ///
854
+ /// A partition can be retrieved from AdbcPartitions.
855
+ ///
856
+ /// \param[in] connection The connection to use. This does not have
857
+ /// to be the same connection that the partition was created on.
858
+ /// \param[in] serialized_partition The partition descriptor.
859
+ /// \param[in] serialized_length The partition descriptor length.
860
+ /// \param[out] out The result set.
861
+ /// \param[out] error Error details, if an error occurs.
862
+ ADBC_EXPORT
863
+ AdbcStatusCode AdbcConnectionReadPartition(struct AdbcConnection *connection, const uint8_t *serialized_partition,
864
+ size_t serialized_length, struct ArrowArrayStream *out,
865
+ struct AdbcError *error);
866
+
867
+ /// @}
868
+
869
+ /// \defgroup adbc-connection-transaction Transaction Semantics
870
+ ///
871
+ /// Connections start out in auto-commit mode by default (if
872
+ /// applicable for the given vendor). Use AdbcConnectionSetOption and
873
+ /// ADBC_CONNECTION_OPTION_AUTO_COMMIT to change this.
874
+ ///
875
+ /// @{
876
+
877
+ /// \brief Commit any pending transactions. Only used if autocommit is
878
+ /// disabled.
879
+ ///
880
+ /// Behavior is undefined if this is mixed with SQL transaction
881
+ /// statements.
882
+ ADBC_EXPORT
883
+ AdbcStatusCode AdbcConnectionCommit(struct AdbcConnection *connection, struct AdbcError *error);
884
+
885
+ /// \brief Roll back any pending transactions. Only used if autocommit
886
+ /// is disabled.
887
+ ///
888
+ /// Behavior is undefined if this is mixed with SQL transaction
889
+ /// statements.
890
+ ADBC_EXPORT
891
+ AdbcStatusCode AdbcConnectionRollback(struct AdbcConnection *connection, struct AdbcError *error);
892
+
893
+ /// @}
894
+
895
+ /// @}
896
+
897
+ /// \addtogroup adbc-statement
898
+ /// @{
899
+
900
+ /// \brief Create a new statement for a given connection.
901
+ ///
902
+ /// Callers pass in a zero-initialized AdbcStatement.
903
+ ///
904
+ /// Drivers should allocate their internal data structure and set the private_data
905
+ /// field to point to the newly allocated struct. This struct should be released
906
+ /// when AdbcStatementRelease is called.
907
+ ADBC_EXPORT
908
+ AdbcStatusCode AdbcStatementNew(struct AdbcConnection *connection, struct AdbcStatement *statement,
909
+ struct AdbcError *error);
910
+
911
+ /// \brief Destroy a statement.
912
+ /// \param[in] statement The statement to release.
913
+ /// \param[out] error An optional location to return an error
914
+ /// message if necessary.
915
+ ADBC_EXPORT
916
+ AdbcStatusCode AdbcStatementRelease(struct AdbcStatement *statement, struct AdbcError *error);
917
+
918
+ /// \brief Execute a statement and get the results.
919
+ ///
920
+ /// This invalidates any prior result sets.
921
+ ///
922
+ /// \param[in] statement The statement to execute.
923
+ /// \param[out] out The results. Pass NULL if the client does not
924
+ /// expect a result set.
925
+ /// \param[out] rows_affected The number of rows affected if known,
926
+ /// else -1. Pass NULL if the client does not want this information.
927
+ /// \param[out] error An optional location to return an error
928
+ /// message if necessary.
929
+ ADBC_EXPORT
930
+ AdbcStatusCode AdbcStatementExecuteQuery(struct AdbcStatement *statement, struct ArrowArrayStream *out,
931
+ int64_t *rows_affected, struct AdbcError *error);
932
+
933
+ /// \brief Turn this statement into a prepared statement to be
934
+ /// executed multiple times.
935
+ ///
936
+ /// This invalidates any prior result sets.
937
+ ADBC_EXPORT
938
+ AdbcStatusCode AdbcStatementPrepare(struct AdbcStatement *statement, struct AdbcError *error);
939
+
940
+ /// \defgroup adbc-statement-sql SQL Semantics
941
+ /// Functions for executing SQL queries, or querying SQL-related
942
+ /// metadata. Drivers are not required to support both SQL and
943
+ /// Substrait semantics. If they do, it may be via converting
944
+ /// between representations internally.
945
+ /// @{
946
+
947
+ /// \brief Set the SQL query to execute.
948
+ ///
949
+ /// The query can then be executed with AdbcStatementExecute. For
950
+ /// queries expected to be executed repeatedly, AdbcStatementPrepare
951
+ /// the statement first.
952
+ ///
953
+ /// \param[in] statement The statement.
954
+ /// \param[in] query The query to execute.
955
+ /// \param[out] error Error details, if an error occurs.
956
+ ADBC_EXPORT
957
+ AdbcStatusCode AdbcStatementSetSqlQuery(struct AdbcStatement *statement, const char *query, struct AdbcError *error);
958
+
959
+ /// @}
960
+
961
+ /// \defgroup adbc-statement-substrait Substrait Semantics
962
+ /// Functions for executing Substrait plans, or querying
963
+ /// Substrait-related metadata. Drivers are not required to support
964
+ /// both SQL and Substrait semantics. If they do, it may be via
965
+ /// converting between representations internally.
966
+ /// @{
967
+
968
+ /// \brief Set the Substrait plan to execute.
969
+ ///
970
+ /// The query can then be executed with AdbcStatementExecute. For
971
+ /// queries expected to be executed repeatedly, AdbcStatementPrepare
972
+ /// the statement first.
973
+ ///
974
+ /// \param[in] statement The statement.
975
+ /// \param[in] plan The serialized substrait.Plan to execute.
976
+ /// \param[in] length The length of the serialized plan.
977
+ /// \param[out] error Error details, if an error occurs.
978
+ ADBC_EXPORT
979
+ AdbcStatusCode AdbcStatementSetSubstraitPlan(struct AdbcStatement *statement, const uint8_t *plan, size_t length,
980
+ struct AdbcError *error);
981
+
982
+ /// @}
983
+
984
+ /// \brief Bind Arrow data. This can be used for bulk inserts or
985
+ /// prepared statements.
986
+ ///
987
+ /// \param[in] statement The statement to bind to.
988
+ /// \param[in] values The values to bind. The driver will call the
989
+ /// release callback itself, although it may not do this until the
990
+ /// statement is released.
991
+ /// \param[in] schema The schema of the values to bind.
992
+ /// \param[out] error An optional location to return an error message
993
+ /// if necessary.
994
+ ADBC_EXPORT
995
+ AdbcStatusCode AdbcStatementBind(struct AdbcStatement *statement, struct ArrowArray *values, struct ArrowSchema *schema,
996
+ struct AdbcError *error);
997
+
998
+ /// \brief Bind Arrow data. This can be used for bulk inserts or
999
+ /// prepared statements.
1000
+ /// \param[in] statement The statement to bind to.
1001
+ /// \param[in] stream The values to bind. The driver will call the
1002
+ /// release callback itself, although it may not do this until the
1003
+ /// statement is released.
1004
+ /// \param[out] error An optional location to return an error message
1005
+ /// if necessary.
1006
+ ADBC_EXPORT
1007
+ AdbcStatusCode AdbcStatementBindStream(struct AdbcStatement *statement, struct ArrowArrayStream *stream,
1008
+ struct AdbcError *error);
1009
+
1010
+ /// \brief Get the schema for bound parameters.
1011
+ ///
1012
+ /// This retrieves an Arrow schema describing the number, names, and
1013
+ /// types of the parameters in a parameterized statement. The fields
1014
+ /// of the schema should be in order of the ordinal position of the
1015
+ /// parameters; named parameters should appear only once.
1016
+ ///
1017
+ /// If the parameter does not have a name, or the name cannot be
1018
+ /// determined, the name of the corresponding field in the schema will
1019
+ /// be an empty string. If the type cannot be determined, the type of
1020
+ /// the corresponding field will be NA (NullType).
1021
+ ///
1022
+ /// This should be called after AdbcStatementPrepare.
1023
+ ///
1024
+ /// \return ADBC_STATUS_NOT_IMPLEMENTED if the schema cannot be determined.
1025
+ ADBC_EXPORT
1026
+ AdbcStatusCode AdbcStatementGetParameterSchema(struct AdbcStatement *statement, struct ArrowSchema *schema,
1027
+ struct AdbcError *error);
1028
+
1029
+ /// \brief Set a string option on a statement.
1030
+ ADBC_EXPORT
1031
+ AdbcStatusCode AdbcStatementSetOption(struct AdbcStatement *statement, const char *key, const char *value,
1032
+ struct AdbcError *error);
1033
+
1034
+ /// \addtogroup adbc-statement-partition
1035
+ /// @{
1036
+
1037
+ /// \brief Execute a statement and get the results as a partitioned
1038
+ /// result set.
1039
+ ///
1040
+ /// \param[in] statement The statement to execute.
1041
+ /// \param[out] schema The schema of the result set.
1042
+ /// \param[out] partitions The result partitions.
1043
+ /// \param[out] rows_affected The number of rows affected if known,
1044
+ /// else -1. Pass NULL if the client does not want this information.
1045
+ /// \param[out] error An optional location to return an error
1046
+ /// message if necessary.
1047
+ /// \return ADBC_STATUS_NOT_IMPLEMENTED if the driver does not support
1048
+ /// partitioned results
1049
+ ADBC_EXPORT
1050
+ AdbcStatusCode AdbcStatementExecutePartitions(struct AdbcStatement *statement, struct ArrowSchema *schema,
1051
+ struct AdbcPartitions *partitions, int64_t *rows_affected,
1052
+ struct AdbcError *error);
1053
+
1054
+ /// @}
1055
+
1056
+ /// @}
1057
+
1058
+ /// \addtogroup adbc-driver
1059
+ /// @{
1060
+
1061
+ /// \brief Common entry point for drivers via the driver manager
1062
+ /// (which uses dlopen(3)/LoadLibrary). The driver manager is told
1063
+ /// to load a library and call a function of this type to load the
1064
+ /// driver.
1065
+ ///
1066
+ /// Although drivers may choose any name for this function, the
1067
+ /// recommended name is "AdbcDriverInit".
1068
+ ///
1069
+ /// \param[in] version The ADBC revision to attempt to initialize (see
1070
+ /// ADBC_VERSION_1_0_0).
1071
+ /// \param[out] driver The table of function pointers to
1072
+ /// initialize. Should be a pointer to the appropriate struct for
1073
+ /// the given version (see the documentation for the version).
1074
+ /// \param[out] error An optional location to return an error message
1075
+ /// if necessary.
1076
+ /// \return ADBC_STATUS_OK if the driver was initialized, or
1077
+ /// ADBC_STATUS_NOT_IMPLEMENTED if the version is not supported. In
1078
+ /// that case, clients may retry with a different version.
1079
+ typedef AdbcStatusCode (*AdbcDriverInitFunc)(int version, void *driver, struct AdbcError *error);
1080
+
1081
+ /// @}
1082
+
1083
+ #endif // ADBC
1084
+
1085
+ #ifdef __cplusplus
1086
+ }
1087
+ #endif
1088
+ } // namespace duckdb_adbc