duckdb 0.7.2-dev2706.0 → 0.7.2-dev2820.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 (268) hide show
  1. package/binding.gyp +21 -13
  2. package/package.json +1 -1
  3. package/src/duckdb/extension/icu/icu-strptime.cpp +1 -1
  4. package/src/duckdb/extension/json/include/json_functions.hpp +35 -37
  5. package/src/duckdb/extension/json/include/json_scan.hpp +1 -1
  6. package/src/duckdb/extension/json/include/json_transform.hpp +1 -1
  7. package/src/duckdb/extension/json/json-extension.cpp +10 -20
  8. package/src/duckdb/extension/json/json_functions/copy_json.cpp +2 -2
  9. package/src/duckdb/extension/json/json_functions/json_array_length.cpp +2 -3
  10. package/src/duckdb/extension/json/json_functions/json_contains.cpp +2 -2
  11. package/src/duckdb/extension/json/json_functions/json_create.cpp +20 -20
  12. package/src/duckdb/extension/json/json_functions/json_extract.cpp +4 -6
  13. package/src/duckdb/extension/json/json_functions/json_keys.cpp +2 -3
  14. package/src/duckdb/extension/json/json_functions/json_merge_patch.cpp +2 -2
  15. package/src/duckdb/extension/json/json_functions/json_serialize_sql.cpp +8 -8
  16. package/src/duckdb/extension/json/json_functions/json_structure.cpp +2 -2
  17. package/src/duckdb/extension/json/json_functions/json_transform.cpp +4 -4
  18. package/src/duckdb/extension/json/json_functions/json_type.cpp +2 -3
  19. package/src/duckdb/extension/json/json_functions/json_valid.cpp +2 -2
  20. package/src/duckdb/extension/json/json_functions/read_json.cpp +6 -6
  21. package/src/duckdb/extension/json/json_functions/read_json_objects.cpp +4 -4
  22. package/src/duckdb/extension/json/json_functions.cpp +6 -6
  23. package/src/duckdb/extension/parquet/parquet-extension.cpp +11 -24
  24. package/src/duckdb/extension/parquet/parquet_metadata.cpp +46 -20
  25. package/src/duckdb/src/catalog/catalog_entry/pragma_function_catalog_entry.cpp +1 -2
  26. package/src/duckdb/src/catalog/catalog_entry/scalar_function_catalog_entry.cpp +1 -1
  27. package/src/duckdb/src/catalog/catalog_entry/scalar_macro_catalog_entry.cpp +2 -2
  28. package/src/duckdb/src/catalog/catalog_entry/table_function_catalog_entry.cpp +1 -2
  29. package/src/duckdb/src/catalog/catalog_transaction.cpp +4 -0
  30. package/src/duckdb/src/catalog/duck_catalog.cpp +8 -1
  31. package/src/duckdb/src/common/enums/date_part_specifier.cpp +82 -0
  32. package/src/duckdb/src/common/types/vector.cpp +136 -3
  33. package/src/duckdb/src/{function → core_functions}/aggregate/algebraic/avg.cpp +9 -12
  34. package/src/duckdb/src/core_functions/aggregate/algebraic/corr.cpp +13 -0
  35. package/src/duckdb/src/core_functions/aggregate/algebraic/covar.cpp +21 -0
  36. package/src/duckdb/src/core_functions/aggregate/algebraic/stddev.cpp +34 -0
  37. package/src/duckdb/src/{function → core_functions}/aggregate/distributive/approx_count.cpp +3 -3
  38. package/src/duckdb/src/{function → core_functions}/aggregate/distributive/arg_min_max.cpp +7 -23
  39. package/src/duckdb/src/{function → core_functions}/aggregate/distributive/bitagg.cpp +10 -10
  40. package/src/duckdb/src/{function → core_functions}/aggregate/distributive/bitstring_agg.cpp +4 -4
  41. package/src/duckdb/src/{function → core_functions}/aggregate/distributive/bool.cpp +1 -17
  42. package/src/duckdb/src/{function → core_functions}/aggregate/distributive/entropy.cpp +5 -4
  43. package/src/duckdb/src/{function → core_functions}/aggregate/distributive/kurtosis.cpp +5 -6
  44. package/src/duckdb/src/{function → core_functions}/aggregate/distributive/minmax.cpp +5 -5
  45. package/src/duckdb/src/{function → core_functions}/aggregate/distributive/product.cpp +2 -11
  46. package/src/duckdb/src/{function → core_functions}/aggregate/distributive/skew.cpp +5 -6
  47. package/src/duckdb/src/{function → core_functions}/aggregate/distributive/string_agg.cpp +4 -6
  48. package/src/duckdb/src/{function → core_functions}/aggregate/distributive/sum.cpp +38 -46
  49. package/src/duckdb/src/{function → core_functions}/aggregate/holistic/approximate_quantile.cpp +4 -5
  50. package/src/duckdb/src/{function → core_functions}/aggregate/holistic/mode.cpp +4 -5
  51. package/src/duckdb/src/{function → core_functions}/aggregate/holistic/quantile.cpp +31 -23
  52. package/src/duckdb/src/{function → core_functions}/aggregate/holistic/reservoir_quantile.cpp +4 -5
  53. package/src/duckdb/src/{function → core_functions}/aggregate/nested/histogram.cpp +4 -4
  54. package/src/duckdb/src/{function → core_functions}/aggregate/nested/list.cpp +6 -10
  55. package/src/duckdb/src/{function → core_functions}/aggregate/regression/regr_avg.cpp +7 -11
  56. package/src/duckdb/src/{function → core_functions}/aggregate/regression/regr_count.cpp +4 -4
  57. package/src/duckdb/src/{function → core_functions}/aggregate/regression/regr_intercept.cpp +5 -8
  58. package/src/duckdb/src/{function → core_functions}/aggregate/regression/regr_r2.cpp +5 -7
  59. package/src/duckdb/src/{function → core_functions}/aggregate/regression/regr_slope.cpp +5 -7
  60. package/src/duckdb/src/{function → core_functions}/aggregate/regression/regr_sxx_syy.cpp +8 -12
  61. package/src/duckdb/src/{function → core_functions}/aggregate/regression/regr_sxy.cpp +6 -8
  62. package/src/duckdb/src/core_functions/core_functions.cpp +50 -0
  63. package/src/duckdb/src/core_functions/function_list.cpp +352 -0
  64. package/src/duckdb/src/{function → core_functions}/scalar/bit/bitstring.cpp +12 -15
  65. package/src/duckdb/src/{function → core_functions}/scalar/blob/base64.cpp +6 -6
  66. package/src/duckdb/src/{function → core_functions}/scalar/blob/encode.cpp +7 -6
  67. package/src/duckdb/src/{function → core_functions}/scalar/date/age.cpp +3 -3
  68. package/src/duckdb/src/{function → core_functions}/scalar/date/current.cpp +8 -8
  69. package/src/duckdb/src/{function → core_functions}/scalar/date/date_diff.cpp +3 -6
  70. package/src/duckdb/src/{function → core_functions}/scalar/date/date_part.cpp +144 -148
  71. package/src/duckdb/src/{function → core_functions}/scalar/date/date_sub.cpp +3 -6
  72. package/src/duckdb/src/{function → core_functions}/scalar/date/date_trunc.cpp +3 -6
  73. package/src/duckdb/src/{function → core_functions}/scalar/date/epoch.cpp +7 -8
  74. package/src/duckdb/src/{function → core_functions}/scalar/date/make_date.cpp +14 -14
  75. package/src/duckdb/src/core_functions/scalar/date/strftime.cpp +251 -0
  76. package/src/duckdb/src/{function → core_functions}/scalar/date/time_bucket.cpp +4 -5
  77. package/src/duckdb/src/{function → core_functions}/scalar/date/to_interval.cpp +39 -19
  78. package/src/duckdb/src/{function/scalar/enum/enum_functions_implementation.cpp → core_functions/scalar/enum/enum_functions.cpp} +18 -22
  79. package/src/duckdb/src/{function → core_functions}/scalar/generic/alias.cpp +4 -4
  80. package/src/duckdb/src/{function → core_functions}/scalar/generic/current_setting.cpp +4 -5
  81. package/src/duckdb/src/{function → core_functions}/scalar/generic/error.cpp +4 -4
  82. package/src/duckdb/src/{function → core_functions}/scalar/generic/hash.cpp +4 -4
  83. package/src/duckdb/src/{function → core_functions}/scalar/generic/least.cpp +8 -9
  84. package/src/duckdb/src/{function → core_functions}/scalar/generic/stats.cpp +4 -4
  85. package/src/duckdb/src/{function/scalar/system → core_functions/scalar/generic}/system_functions.cpp +24 -13
  86. package/src/duckdb/src/{function → core_functions}/scalar/generic/typeof.cpp +4 -4
  87. package/src/duckdb/src/{function → core_functions}/scalar/list/array_slice.cpp +3 -13
  88. package/src/duckdb/src/{function → core_functions}/scalar/list/flatten.cpp +5 -5
  89. package/src/duckdb/src/{function → core_functions}/scalar/list/list_aggregates.cpp +2 -13
  90. package/src/duckdb/src/{function → core_functions}/scalar/list/list_lambdas.cpp +9 -24
  91. package/src/duckdb/src/{function → core_functions}/scalar/list/list_sort.cpp +8 -22
  92. package/src/duckdb/src/{function → core_functions}/scalar/list/list_value.cpp +4 -5
  93. package/src/duckdb/src/{function → core_functions}/scalar/list/range.cpp +8 -6
  94. package/src/duckdb/src/{function → core_functions}/scalar/map/cardinality.cpp +5 -4
  95. package/src/duckdb/src/{function → core_functions}/scalar/map/map.cpp +6 -63
  96. package/src/duckdb/src/{function → core_functions}/scalar/map/map_entries.cpp +5 -4
  97. package/src/duckdb/src/{function → core_functions}/scalar/map/map_extract.cpp +22 -7
  98. package/src/duckdb/src/{function → core_functions}/scalar/map/map_from_entries.cpp +6 -5
  99. package/src/duckdb/src/{function → core_functions}/scalar/map/map_keys_values.cpp +8 -7
  100. package/src/duckdb/src/{function → core_functions}/scalar/math/numeric.cpp +110 -138
  101. package/src/duckdb/src/{function → core_functions}/scalar/operators/bitwise.cpp +19 -20
  102. package/src/duckdb/src/{function/scalar/math → core_functions/scalar/random}/random.cpp +5 -6
  103. package/src/duckdb/src/{function/scalar/math → core_functions/scalar/random}/setseed.cpp +3 -3
  104. package/src/duckdb/src/{function → core_functions}/scalar/string/ascii.cpp +4 -5
  105. package/src/duckdb/src/{function → core_functions}/scalar/string/bar.cpp +4 -4
  106. package/src/duckdb/src/{function → core_functions}/scalar/string/chr.cpp +5 -6
  107. package/src/duckdb/src/{function → core_functions}/scalar/string/damerau_levenshtein.cpp +4 -6
  108. package/src/duckdb/src/{function/scalar/string/mismatches.cpp → core_functions/scalar/string/hamming.cpp} +3 -12
  109. package/src/duckdb/src/{function → core_functions}/scalar/string/hex.cpp +15 -25
  110. package/src/duckdb/src/{function → core_functions}/scalar/string/instr.cpp +6 -13
  111. package/src/duckdb/src/{function → core_functions}/scalar/string/jaccard.cpp +3 -6
  112. package/src/duckdb/src/{function → core_functions}/scalar/string/jaro_winkler.cpp +7 -6
  113. package/src/duckdb/src/{function → core_functions}/scalar/string/left_right.cpp +18 -11
  114. package/src/duckdb/src/{function → core_functions}/scalar/string/levenshtein.cpp +3 -12
  115. package/src/duckdb/src/{function → core_functions}/scalar/string/md5.cpp +15 -21
  116. package/src/duckdb/src/{function → core_functions}/scalar/string/pad.cpp +7 -13
  117. package/src/duckdb/src/{function → core_functions}/scalar/string/printf.cpp +10 -10
  118. package/src/duckdb/src/{function → core_functions}/scalar/string/repeat.cpp +3 -6
  119. package/src/duckdb/src/{function → core_functions}/scalar/string/replace.cpp +4 -7
  120. package/src/duckdb/src/{function → core_functions}/scalar/string/reverse.cpp +3 -3
  121. package/src/duckdb/src/{function → core_functions}/scalar/string/starts_with.cpp +4 -8
  122. package/src/duckdb/src/{function → core_functions}/scalar/string/string_split.cpp +11 -11
  123. package/src/duckdb/src/{function → core_functions}/scalar/string/translate.cpp +4 -7
  124. package/src/duckdb/src/{function → core_functions}/scalar/string/trim.cpp +19 -14
  125. package/src/duckdb/src/core_functions/scalar/string/unicode.cpp +28 -0
  126. package/src/duckdb/src/{function → core_functions}/scalar/struct/struct_insert.cpp +4 -4
  127. package/src/duckdb/src/{function → core_functions}/scalar/struct/struct_pack.cpp +3 -4
  128. package/src/duckdb/src/{function → core_functions}/scalar/union/union_extract.cpp +4 -8
  129. package/src/duckdb/src/{function → core_functions}/scalar/union/union_tag.cpp +4 -8
  130. package/src/duckdb/src/{function → core_functions}/scalar/union/union_value.cpp +4 -59
  131. package/src/duckdb/src/execution/operator/persistent/base_csv_reader.cpp +1 -1
  132. package/src/duckdb/src/execution/operator/persistent/buffered_csv_reader.cpp +1 -1
  133. package/src/duckdb/src/execution/operator/persistent/parallel_csv_reader.cpp +1 -1
  134. package/src/duckdb/src/execution/operator/persistent/physical_insert.cpp +19 -12
  135. package/src/duckdb/src/function/aggregate/distributive_functions.cpp +0 -17
  136. package/src/duckdb/src/function/cast/string_cast.cpp +1 -1
  137. package/src/duckdb/src/function/function.cpp +0 -8
  138. package/src/duckdb/src/function/function_set.cpp +25 -0
  139. package/src/duckdb/src/function/scalar/generic_functions.cpp +1 -9
  140. package/src/duckdb/src/function/scalar/nested_functions.cpp +0 -22
  141. package/src/duckdb/src/function/scalar/operators.cpp +0 -6
  142. package/src/duckdb/src/function/scalar/{date/strftime.cpp → strftime_format.cpp} +1 -249
  143. package/src/duckdb/src/function/scalar/string/length.cpp +0 -19
  144. package/src/duckdb/src/function/scalar/string_functions.cpp +0 -40
  145. package/src/duckdb/src/function/scalar/system/aggregate_export.cpp +5 -0
  146. package/src/duckdb/src/function/table/arrow_conversion.cpp +1 -1
  147. package/src/duckdb/src/function/table/range.cpp +1 -0
  148. package/src/duckdb/src/function/table/repeat_row.cpp +60 -0
  149. package/src/duckdb/src/function/table/system/duckdb_functions.cpp +27 -40
  150. package/src/duckdb/src/function/table/version/pragma_version.cpp +2 -2
  151. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/aggregate_function_catalog_entry.hpp +3 -3
  152. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/function_entry.hpp +33 -0
  153. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/macro_catalog_entry.hpp +2 -2
  154. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/pragma_function_catalog_entry.hpp +2 -2
  155. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/scalar_function_catalog_entry.hpp +2 -2
  156. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_function_catalog_entry.hpp +2 -2
  157. package/src/duckdb/src/include/duckdb/catalog/catalog_transaction.hpp +2 -0
  158. package/src/duckdb/src/include/duckdb/common/algorithm.hpp +1 -0
  159. package/src/duckdb/src/include/duckdb/common/types/vector.hpp +11 -1
  160. package/src/duckdb/src/include/duckdb/{function → core_functions}/aggregate/algebraic/corr.hpp +3 -4
  161. package/src/duckdb/src/include/duckdb/{function → core_functions}/aggregate/algebraic/covar.hpp +1 -1
  162. package/src/duckdb/src/include/duckdb/{function → core_functions}/aggregate/algebraic/stddev.hpp +1 -1
  163. package/src/duckdb/src/include/duckdb/core_functions/aggregate/algebraic_functions.hpp +124 -0
  164. package/src/duckdb/src/include/duckdb/core_functions/aggregate/distributive_functions.hpp +229 -0
  165. package/src/duckdb/src/include/duckdb/core_functions/aggregate/holistic_functions.hpp +85 -0
  166. package/src/duckdb/src/include/duckdb/core_functions/aggregate/nested_functions.hpp +41 -0
  167. package/src/duckdb/src/include/duckdb/{function → core_functions}/aggregate/regression/regr_count.hpp +3 -4
  168. package/src/duckdb/src/include/duckdb/{function → core_functions}/aggregate/regression/regr_slope.hpp +2 -2
  169. package/src/duckdb/src/include/duckdb/core_functions/aggregate/regression_functions.hpp +97 -0
  170. package/src/duckdb/src/include/duckdb/{function → core_functions}/aggregate/sum_helpers.hpp +1 -1
  171. package/src/duckdb/src/include/duckdb/{function/scalar/uuid_functions.hpp → core_functions/core_functions.hpp} +7 -5
  172. package/src/duckdb/src/include/duckdb/core_functions/function_list.hpp +33 -0
  173. package/src/duckdb/src/include/duckdb/core_functions/scalar/bit_functions.hpp +52 -0
  174. package/src/duckdb/src/include/duckdb/core_functions/scalar/blob_functions.hpp +58 -0
  175. package/src/duckdb/src/include/duckdb/core_functions/scalar/date_functions.hpp +544 -0
  176. package/src/duckdb/src/include/duckdb/core_functions/scalar/enum_functions.hpp +61 -0
  177. package/src/duckdb/src/include/duckdb/core_functions/scalar/generic_functions.hpp +142 -0
  178. package/src/duckdb/src/include/duckdb/core_functions/scalar/list_functions.hpp +220 -0
  179. package/src/duckdb/src/include/duckdb/core_functions/scalar/map_functions.hpp +85 -0
  180. package/src/duckdb/src/include/duckdb/core_functions/scalar/math_functions.hpp +394 -0
  181. package/src/duckdb/src/include/duckdb/core_functions/scalar/operators_functions.hpp +70 -0
  182. package/src/duckdb/src/include/duckdb/core_functions/scalar/random_functions.hpp +49 -0
  183. package/src/duckdb/src/include/duckdb/core_functions/scalar/string_functions.hpp +439 -0
  184. package/src/duckdb/src/include/duckdb/core_functions/scalar/struct_functions.hpp +40 -0
  185. package/src/duckdb/src/include/duckdb/core_functions/scalar/union_functions.hpp +43 -0
  186. package/src/duckdb/src/include/duckdb/execution/operator/persistent/base_csv_reader.hpp +1 -1
  187. package/src/duckdb/src/include/duckdb/execution/operator/persistent/csv_reader_options.hpp +1 -1
  188. package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_insert.hpp +4 -3
  189. package/src/duckdb/src/include/duckdb/function/aggregate/distributive_functions.hpp +0 -85
  190. package/src/duckdb/src/include/duckdb/function/built_in_functions.hpp +0 -8
  191. package/src/duckdb/src/include/duckdb/function/function_set.hpp +7 -2
  192. package/src/duckdb/src/include/duckdb/function/scalar/generic_functions.hpp +1 -36
  193. package/src/duckdb/src/include/duckdb/function/scalar/nested_functions.hpp +0 -120
  194. package/src/duckdb/src/include/duckdb/function/scalar/operators.hpp +0 -24
  195. package/src/duckdb/src/include/duckdb/function/scalar/string_functions.hpp +1 -97
  196. package/src/duckdb/src/include/duckdb/function/table/range.hpp +4 -0
  197. package/src/duckdb/src/include/duckdb/function/table/read_csv.hpp +1 -1
  198. package/src/duckdb/src/include/duckdb/main/extension_util.hpp +48 -0
  199. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_function_info.hpp +6 -0
  200. package/src/duckdb/src/main/extension/extension_helper.cpp +1 -0
  201. package/src/duckdb/src/main/extension/extension_load.cpp +48 -4
  202. package/src/duckdb/src/main/extension/extension_util.cpp +90 -0
  203. package/src/duckdb/src/planner/binder/statement/bind_create_table.cpp +6 -7
  204. package/src/duckdb/src/planner/binder/tableref/bind_table_function.cpp +5 -4
  205. package/src/duckdb/ub_src_common_enums.cpp +2 -0
  206. package/src/duckdb/ub_src_core_functions.cpp +4 -0
  207. package/src/duckdb/ub_src_core_functions_aggregate_algebraic.cpp +8 -0
  208. package/src/duckdb/ub_src_core_functions_aggregate_distributive.cpp +24 -0
  209. package/src/duckdb/ub_src_core_functions_aggregate_holistic.cpp +8 -0
  210. package/src/duckdb/ub_src_core_functions_aggregate_nested.cpp +4 -0
  211. package/src/duckdb/ub_src_core_functions_aggregate_regression.cpp +14 -0
  212. package/src/duckdb/ub_src_core_functions_scalar_bit.cpp +2 -0
  213. package/src/duckdb/ub_src_core_functions_scalar_blob.cpp +4 -0
  214. package/src/duckdb/ub_src_core_functions_scalar_date.cpp +22 -0
  215. package/src/duckdb/ub_src_core_functions_scalar_enum.cpp +2 -0
  216. package/src/duckdb/ub_src_core_functions_scalar_generic.cpp +16 -0
  217. package/src/duckdb/ub_src_core_functions_scalar_list.cpp +14 -0
  218. package/src/duckdb/ub_src_core_functions_scalar_map.cpp +12 -0
  219. package/src/duckdb/ub_src_core_functions_scalar_math.cpp +2 -0
  220. package/src/duckdb/ub_src_core_functions_scalar_operators.cpp +2 -0
  221. package/src/duckdb/ub_src_core_functions_scalar_random.cpp +4 -0
  222. package/src/duckdb/ub_src_core_functions_scalar_string.cpp +44 -0
  223. package/src/duckdb/ub_src_core_functions_scalar_struct.cpp +4 -0
  224. package/src/duckdb/ub_src_core_functions_scalar_union.cpp +6 -0
  225. package/src/duckdb/ub_src_function_aggregate.cpp +0 -8
  226. package/src/duckdb/ub_src_function_aggregate_distributive.cpp +0 -24
  227. package/src/duckdb/ub_src_function_scalar.cpp +2 -8
  228. package/src/duckdb/ub_src_function_scalar_generic.cpp +0 -14
  229. package/src/duckdb/ub_src_function_scalar_list.cpp +0 -14
  230. package/src/duckdb/ub_src_function_scalar_operators.cpp +0 -2
  231. package/src/duckdb/ub_src_function_scalar_string.cpp +0 -42
  232. package/src/duckdb/ub_src_function_scalar_struct.cpp +0 -4
  233. package/src/duckdb/ub_src_function_scalar_system.cpp +0 -2
  234. package/src/duckdb/ub_src_function_table.cpp +2 -0
  235. package/src/duckdb/ub_src_main_extension.cpp +2 -0
  236. package/src/duckdb/src/function/aggregate/algebraic/corr.cpp +0 -14
  237. package/src/duckdb/src/function/aggregate/algebraic/covar.cpp +0 -25
  238. package/src/duckdb/src/function/aggregate/algebraic/stddev.cpp +0 -54
  239. package/src/duckdb/src/function/aggregate/algebraic_functions.cpp +0 -21
  240. package/src/duckdb/src/function/aggregate/holistic_functions.cpp +0 -12
  241. package/src/duckdb/src/function/aggregate/nested_functions.cpp +0 -10
  242. package/src/duckdb/src/function/aggregate/regression_functions.cpp +0 -21
  243. package/src/duckdb/src/function/scalar/date_functions.cpp +0 -22
  244. package/src/duckdb/src/function/scalar/enum_functions.cpp +0 -13
  245. package/src/duckdb/src/function/scalar/math_functions.cpp +0 -50
  246. package/src/duckdb/src/function/scalar/trigonometrics_functions.cpp +0 -18
  247. package/src/duckdb/src/include/duckdb/function/aggregate/algebraic_functions.hpp +0 -56
  248. package/src/duckdb/src/include/duckdb/function/aggregate/holistic_functions.hpp +0 -33
  249. package/src/duckdb/src/include/duckdb/function/aggregate/nested_functions.hpp +0 -26
  250. package/src/duckdb/src/include/duckdb/function/aggregate/regression_functions.hpp +0 -53
  251. package/src/duckdb/src/include/duckdb/function/scalar/bit_functions.hpp +0 -32
  252. package/src/duckdb/src/include/duckdb/function/scalar/blob_functions.hpp +0 -24
  253. package/src/duckdb/src/include/duckdb/function/scalar/date_functions.hpp +0 -73
  254. package/src/duckdb/src/include/duckdb/function/scalar/enum_functions.hpp +0 -37
  255. package/src/duckdb/src/include/duckdb/function/scalar/math_functions.hpp +0 -137
  256. package/src/duckdb/src/include/duckdb/function/scalar/trigonometric_functions.hpp +0 -49
  257. package/src/duckdb/ub_src_function_aggregate_algebraic.cpp +0 -8
  258. package/src/duckdb/ub_src_function_aggregate_holistic.cpp +0 -8
  259. package/src/duckdb/ub_src_function_aggregate_nested.cpp +0 -4
  260. package/src/duckdb/ub_src_function_aggregate_regression.cpp +0 -14
  261. package/src/duckdb/ub_src_function_scalar_bit.cpp +0 -2
  262. package/src/duckdb/ub_src_function_scalar_blob.cpp +0 -4
  263. package/src/duckdb/ub_src_function_scalar_date.cpp +0 -22
  264. package/src/duckdb/ub_src_function_scalar_enum.cpp +0 -2
  265. package/src/duckdb/ub_src_function_scalar_map.cpp +0 -12
  266. package/src/duckdb/ub_src_function_scalar_math.cpp +0 -6
  267. package/src/duckdb/ub_src_function_scalar_union.cpp +0 -6
  268. /package/src/duckdb/src/include/duckdb/function/scalar/{strftime.hpp → strftime_format.hpp} +0 -0
package/binding.gyp CHANGED
@@ -36,6 +36,25 @@
36
36
  "src/duckdb/src/common/vector_operations/vector_copy.cpp",
37
37
  "src/duckdb/src/common/vector_operations/vector_hash.cpp",
38
38
  "src/duckdb/src/common/vector_operations/vector_storage.cpp",
39
+ "src/duckdb/ub_src_core_functions_aggregate_algebraic.cpp",
40
+ "src/duckdb/ub_src_core_functions_aggregate_distributive.cpp",
41
+ "src/duckdb/ub_src_core_functions_aggregate_holistic.cpp",
42
+ "src/duckdb/ub_src_core_functions_aggregate_nested.cpp",
43
+ "src/duckdb/ub_src_core_functions_aggregate_regression.cpp",
44
+ "src/duckdb/ub_src_core_functions.cpp",
45
+ "src/duckdb/ub_src_core_functions_scalar_bit.cpp",
46
+ "src/duckdb/ub_src_core_functions_scalar_blob.cpp",
47
+ "src/duckdb/ub_src_core_functions_scalar_date.cpp",
48
+ "src/duckdb/ub_src_core_functions_scalar_enum.cpp",
49
+ "src/duckdb/ub_src_core_functions_scalar_generic.cpp",
50
+ "src/duckdb/ub_src_core_functions_scalar_list.cpp",
51
+ "src/duckdb/ub_src_core_functions_scalar_map.cpp",
52
+ "src/duckdb/ub_src_core_functions_scalar_math.cpp",
53
+ "src/duckdb/ub_src_core_functions_scalar_operators.cpp",
54
+ "src/duckdb/ub_src_core_functions_scalar_random.cpp",
55
+ "src/duckdb/ub_src_core_functions_scalar_string.cpp",
56
+ "src/duckdb/ub_src_core_functions_scalar_struct.cpp",
57
+ "src/duckdb/ub_src_core_functions_scalar_union.cpp",
39
58
  "src/duckdb/ub_src_execution.cpp",
40
59
  "src/duckdb/ub_src_execution_expression_executor.cpp",
41
60
  "src/duckdb/ub_src_execution_index_art.cpp",
@@ -51,31 +70,20 @@
51
70
  "src/duckdb/ub_src_execution_operator_schema.cpp",
52
71
  "src/duckdb/ub_src_execution_operator_set.cpp",
53
72
  "src/duckdb/ub_src_execution_physical_plan.cpp",
54
- "src/duckdb/ub_src_function_aggregate_algebraic.cpp",
55
- "src/duckdb/ub_src_function_aggregate.cpp",
56
73
  "src/duckdb/ub_src_function_aggregate_distributive.cpp",
57
- "src/duckdb/ub_src_function_aggregate_holistic.cpp",
58
- "src/duckdb/ub_src_function_aggregate_nested.cpp",
59
- "src/duckdb/ub_src_function_aggregate_regression.cpp",
74
+ "src/duckdb/ub_src_function_aggregate.cpp",
60
75
  "src/duckdb/ub_src_function.cpp",
61
76
  "src/duckdb/ub_src_function_cast.cpp",
62
77
  "src/duckdb/ub_src_function_pragma.cpp",
63
- "src/duckdb/ub_src_function_scalar_bit.cpp",
64
- "src/duckdb/ub_src_function_scalar_blob.cpp",
65
- "src/duckdb/ub_src_function_scalar_date.cpp",
66
- "src/duckdb/ub_src_function_scalar.cpp",
67
- "src/duckdb/ub_src_function_scalar_enum.cpp",
68
78
  "src/duckdb/ub_src_function_scalar_generic.cpp",
79
+ "src/duckdb/ub_src_function_scalar.cpp",
69
80
  "src/duckdb/ub_src_function_scalar_list.cpp",
70
- "src/duckdb/ub_src_function_scalar_map.cpp",
71
- "src/duckdb/ub_src_function_scalar_math.cpp",
72
81
  "src/duckdb/ub_src_function_scalar_operators.cpp",
73
82
  "src/duckdb/ub_src_function_scalar_sequence.cpp",
74
83
  "src/duckdb/ub_src_function_scalar_string.cpp",
75
84
  "src/duckdb/ub_src_function_scalar_string_regexp.cpp",
76
85
  "src/duckdb/ub_src_function_scalar_struct.cpp",
77
86
  "src/duckdb/ub_src_function_scalar_system.cpp",
78
- "src/duckdb/ub_src_function_scalar_union.cpp",
79
87
  "src/duckdb/ub_src_function_table.cpp",
80
88
  "src/duckdb/ub_src_function_table_system.cpp",
81
89
  "src/duckdb/ub_src_function_table_version.cpp",
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "duckdb",
3
3
  "main": "./lib/duckdb.js",
4
4
  "types": "./lib/duckdb.d.ts",
5
- "version": "0.7.2-dev2706.0",
5
+ "version": "0.7.2-dev2820.0",
6
6
  "description": "DuckDB node.js API",
7
7
  "gypfile": true,
8
8
  "dependencies": {
@@ -9,7 +9,7 @@
9
9
  #include "duckdb/common/types/timestamp.hpp"
10
10
  #include "duckdb/common/vector_operations/binary_executor.hpp"
11
11
  #include "duckdb/execution/expression_executor.hpp"
12
- #include "duckdb/function/scalar/strftime.hpp"
12
+ #include "duckdb/function/scalar/strftime_format.hpp"
13
13
  #include "duckdb/main/client_context.hpp"
14
14
  #include "duckdb/parser/parsed_data/create_scalar_function_info.hpp"
15
15
  #include "duckdb/planner/expression/bound_function_expression.hpp"
@@ -8,9 +8,7 @@
8
8
 
9
9
  #pragma once
10
10
 
11
- #include "duckdb/parser/parsed_data/create_copy_function_info.hpp"
12
- #include "duckdb/parser/parsed_data/create_scalar_function_info.hpp"
13
- #include "duckdb/parser/parsed_data/create_table_function_info.hpp"
11
+ #include "duckdb/main/extension_util.hpp"
14
12
  #include "json_common.hpp"
15
13
 
16
14
  namespace duckdb {
@@ -66,40 +64,40 @@ public:
66
64
 
67
65
  class JSONFunctions {
68
66
  public:
69
- static vector<CreateScalarFunctionInfo> GetScalarFunctions();
70
- static vector<CreatePragmaFunctionInfo> GetPragmaFunctions();
71
- static vector<CreateTableFunctionInfo> GetTableFunctions();
67
+ static vector<ScalarFunctionSet> GetScalarFunctions();
68
+ static vector<PragmaFunctionSet> GetPragmaFunctions();
69
+ static vector<TableFunctionSet> GetTableFunctions();
72
70
  static unique_ptr<TableRef> ReadJSONReplacement(ClientContext &context, const string &table_name,
73
71
  ReplacementScanData *data);
74
72
  static TableFunction GetReadJSONTableFunction(shared_ptr<JSONScanInfo> function_info);
75
- static CreateCopyFunctionInfo GetJSONCopyFunction();
73
+ static CopyFunction GetJSONCopyFunction();
76
74
  static void RegisterCastFunctions(CastFunctionSet &casts);
77
75
 
78
76
  private:
79
77
  // Scalar functions
80
- static CreateScalarFunctionInfo GetExtractFunction();
81
- static CreateScalarFunctionInfo GetExtractStringFunction();
82
-
83
- static CreateScalarFunctionInfo GetArrayFunction();
84
- static CreateScalarFunctionInfo GetObjectFunction();
85
- static CreateScalarFunctionInfo GetToJSONFunction();
86
- static CreateScalarFunctionInfo GetArrayToJSONFunction();
87
- static CreateScalarFunctionInfo GetRowToJSONFunction();
88
- static CreateScalarFunctionInfo GetMergePatchFunction();
89
-
90
- static CreateScalarFunctionInfo GetStructureFunction();
91
- static CreateScalarFunctionInfo GetTransformFunction();
92
- static CreateScalarFunctionInfo GetTransformStrictFunction();
93
-
94
- static CreateScalarFunctionInfo GetArrayLengthFunction();
95
- static CreateScalarFunctionInfo GetContainsFunction();
96
- static CreateScalarFunctionInfo GetKeysFunction();
97
- static CreateScalarFunctionInfo GetTypeFunction();
98
- static CreateScalarFunctionInfo GetValidFunction();
99
- static CreateScalarFunctionInfo GetSerializeSqlFunction();
100
- static CreateScalarFunctionInfo GetDeserializeSqlFunction();
101
-
102
- static CreatePragmaFunctionInfo GetExecuteJsonSerializedSqlPragmaFunction();
78
+ static ScalarFunctionSet GetExtractFunction();
79
+ static ScalarFunctionSet GetExtractStringFunction();
80
+
81
+ static ScalarFunctionSet GetArrayFunction();
82
+ static ScalarFunctionSet GetObjectFunction();
83
+ static ScalarFunctionSet GetToJSONFunction();
84
+ static ScalarFunctionSet GetArrayToJSONFunction();
85
+ static ScalarFunctionSet GetRowToJSONFunction();
86
+ static ScalarFunctionSet GetMergePatchFunction();
87
+
88
+ static ScalarFunctionSet GetStructureFunction();
89
+ static ScalarFunctionSet GetTransformFunction();
90
+ static ScalarFunctionSet GetTransformStrictFunction();
91
+
92
+ static ScalarFunctionSet GetArrayLengthFunction();
93
+ static ScalarFunctionSet GetContainsFunction();
94
+ static ScalarFunctionSet GetKeysFunction();
95
+ static ScalarFunctionSet GetTypeFunction();
96
+ static ScalarFunctionSet GetValidFunction();
97
+ static ScalarFunctionSet GetSerializeSqlFunction();
98
+ static ScalarFunctionSet GetDeserializeSqlFunction();
99
+
100
+ static PragmaFunctionSet GetExecuteJsonSerializedSqlPragmaFunction();
103
101
 
104
102
  template <class FUNCTION_INFO>
105
103
  static void AddAliases(const vector<string> &names, FUNCTION_INFO fun, vector<FUNCTION_INFO> &functions) {
@@ -111,13 +109,13 @@ private:
111
109
 
112
110
  private:
113
111
  // Table functions
114
- static CreateTableFunctionInfo GetReadJSONObjectsFunction();
115
- static CreateTableFunctionInfo GetReadNDJSONObjectsFunction();
116
- static CreateTableFunctionInfo GetReadJSONFunction();
117
- static CreateTableFunctionInfo GetReadNDJSONFunction();
118
- static CreateTableFunctionInfo GetReadJSONAutoFunction();
119
- static CreateTableFunctionInfo GetReadNDJSONAutoFunction();
120
- static CreateTableFunctionInfo GetExecuteJsonSerializedSqlFunction();
112
+ static TableFunctionSet GetReadJSONObjectsFunction();
113
+ static TableFunctionSet GetReadNDJSONObjectsFunction();
114
+ static TableFunctionSet GetReadJSONFunction();
115
+ static TableFunctionSet GetReadNDJSONFunction();
116
+ static TableFunctionSet GetReadJSONAutoFunction();
117
+ static TableFunctionSet GetReadNDJSONAutoFunction();
118
+ static TableFunctionSet GetExecuteJsonSerializedSqlFunction();
121
119
  };
122
120
 
123
121
  } // namespace duckdb
@@ -10,7 +10,7 @@
10
10
 
11
11
  #include "buffered_json_reader.hpp"
12
12
  #include "duckdb/common/mutex.hpp"
13
- #include "duckdb/function/scalar/strftime.hpp"
13
+ #include "duckdb/function/scalar/strftime_format.hpp"
14
14
  #include "duckdb/function/table_function.hpp"
15
15
  #include "json_transform.hpp"
16
16
 
@@ -8,7 +8,7 @@
8
8
 
9
9
  #pragma once
10
10
 
11
- #include "duckdb/function/scalar/strftime.hpp"
11
+ #include "duckdb/function/scalar/strftime_format.hpp"
12
12
  #include "json_common.hpp"
13
13
 
14
14
  namespace duckdb {
@@ -3,13 +3,12 @@
3
3
 
4
4
  #include "duckdb/catalog/catalog_entry/macro_catalog_entry.hpp"
5
5
  #include "duckdb/catalog/default/default_functions.hpp"
6
+ #include "duckdb/main/extension_util.hpp"
6
7
  #include "duckdb/common/string_util.hpp"
7
- #include "duckdb/function/cast/cast_function_set.hpp"
8
8
  #include "duckdb/parser/expression/constant_expression.hpp"
9
9
  #include "duckdb/parser/expression/function_expression.hpp"
10
- #include "duckdb/parser/parsed_data/create_type_info.hpp"
11
- #include "duckdb/parser/parsed_data/create_pragma_function_info.hpp"
12
10
  #include "duckdb/parser/tableref/table_function_ref.hpp"
11
+ #include "duckdb/function/copy_function.hpp"
13
12
  #include "json_common.hpp"
14
13
  #include "json_functions.hpp"
15
14
 
@@ -23,34 +22,27 @@ static DefaultMacro json_macros[] = {
23
22
  {nullptr, nullptr, {nullptr}, nullptr}};
24
23
 
25
24
  void JSONExtension::Load(DuckDB &db) {
26
- Connection con(db);
27
- con.BeginTransaction();
28
- auto &context = *con.context;
29
- auto &catalog = Catalog::GetSystemCatalog(context);
30
-
25
+ auto &db_instance = *db.instance;
31
26
  // JSON type
32
27
  auto json_type = JSONCommon::JSONType();
33
- CreateTypeInfo type_info(JSONCommon::JSON_TYPE_NAME, json_type);
34
- type_info.temporary = true;
35
- type_info.internal = true;
36
- catalog.CreateType(context, type_info);
28
+ ExtensionUtil::RegisterType(db_instance, JSONCommon::JSON_TYPE_NAME, std::move(json_type));
37
29
 
38
30
  // JSON casts
39
- JSONFunctions::RegisterCastFunctions(DBConfig::GetConfig(context).GetCastFunctions());
31
+ JSONFunctions::RegisterCastFunctions(DBConfig::GetConfig(db_instance).GetCastFunctions());
40
32
 
41
33
  // JSON scalar functions
42
34
  for (auto &fun : JSONFunctions::GetScalarFunctions()) {
43
- catalog.CreateFunction(context, fun);
35
+ ExtensionUtil::RegisterFunction(db_instance, fun);
44
36
  }
45
37
 
46
38
  // JSON table functions
47
39
  for (auto &fun : JSONFunctions::GetTableFunctions()) {
48
- catalog.CreateTableFunction(context, fun);
40
+ ExtensionUtil::RegisterFunction(db_instance, fun);
49
41
  }
50
42
 
51
43
  // JSON pragma functions
52
44
  for (auto &fun : JSONFunctions::GetPragmaFunctions()) {
53
- catalog.CreatePragmaFunction(context, fun);
45
+ ExtensionUtil::RegisterFunction(db_instance, fun);
54
46
  }
55
47
 
56
48
  // JSON replacement scan
@@ -59,15 +51,13 @@ void JSONExtension::Load(DuckDB &db) {
59
51
 
60
52
  // JSON copy function
61
53
  auto copy_fun = JSONFunctions::GetJSONCopyFunction();
62
- catalog.CreateCopyFunction(context, copy_fun);
54
+ ExtensionUtil::RegisterFunction(db_instance, std::move(copy_fun));
63
55
 
64
56
  // JSON macro's
65
57
  for (idx_t index = 0; json_macros[index].name != nullptr; index++) {
66
58
  auto info = DefaultFunctionGenerator::CreateInternalMacroInfo(json_macros[index]);
67
- catalog.CreateFunction(context, *info);
59
+ ExtensionUtil::RegisterFunction(db_instance, *info);
68
60
  }
69
-
70
- con.Commit();
71
61
  }
72
62
 
73
63
  std::string JSONExtension::Name() {
@@ -106,7 +106,7 @@ static duckdb::unique_ptr<FunctionData> CopyFromJSONBind(ClientContext &context,
106
106
  return std::move(bind_data);
107
107
  }
108
108
 
109
- CreateCopyFunctionInfo JSONFunctions::GetJSONCopyFunction() {
109
+ CopyFunction JSONFunctions::GetJSONCopyFunction() {
110
110
  CopyFunction function("json");
111
111
  function.extension = "json";
112
112
 
@@ -116,7 +116,7 @@ CreateCopyFunctionInfo JSONFunctions::GetJSONCopyFunction() {
116
116
  function.copy_from_function = JSONFunctions::GetReadJSONTableFunction(
117
117
  make_shared<JSONScanInfo>(JSONScanType::READ_JSON, JSONFormat::AUTO_DETECT, JSONRecordType::RECORDS, false));
118
118
 
119
- return CreateCopyFunctionInfo(function);
119
+ return function;
120
120
  }
121
121
 
122
122
  } // namespace duckdb
@@ -28,12 +28,11 @@ static void GetArrayLengthFunctionsInternal(ScalarFunctionSet &set, const Logica
28
28
  JSONReadManyFunctionData::Bind, nullptr, nullptr, JSONFunctionLocalState::Init));
29
29
  }
30
30
 
31
- CreateScalarFunctionInfo JSONFunctions::GetArrayLengthFunction() {
31
+ ScalarFunctionSet JSONFunctions::GetArrayLengthFunction() {
32
32
  ScalarFunctionSet set("json_array_length");
33
33
  GetArrayLengthFunctionsInternal(set, LogicalType::VARCHAR);
34
34
  GetArrayLengthFunctionsInternal(set, JSONCommon::JSONType());
35
-
36
- return CreateScalarFunctionInfo(std::move(set));
35
+ return set;
37
36
  }
38
37
 
39
38
  } // namespace duckdb
@@ -139,7 +139,7 @@ static void GetContainsFunctionInternal(ScalarFunctionSet &set, const LogicalTyp
139
139
  JSONFunctionLocalState::Init));
140
140
  }
141
141
 
142
- CreateScalarFunctionInfo JSONFunctions::GetContainsFunction() {
142
+ ScalarFunctionSet JSONFunctions::GetContainsFunction() {
143
143
  ScalarFunctionSet set("json_contains");
144
144
  GetContainsFunctionInternal(set, LogicalType::VARCHAR, LogicalType::VARCHAR);
145
145
  GetContainsFunctionInternal(set, LogicalType::VARCHAR, JSONCommon::JSONType());
@@ -147,7 +147,7 @@ CreateScalarFunctionInfo JSONFunctions::GetContainsFunction() {
147
147
  GetContainsFunctionInternal(set, JSONCommon::JSONType(), JSONCommon::JSONType());
148
148
  // TODO: implement json_contains that accepts path argument as well
149
149
 
150
- return CreateScalarFunctionInfo(std::move(set));
150
+ return set;
151
151
  }
152
152
 
153
153
  } // namespace duckdb
@@ -515,41 +515,41 @@ static void ToJSONFunction(DataChunk &args, ExpressionState &state, Vector &resu
515
515
  }
516
516
  }
517
517
 
518
- CreateScalarFunctionInfo JSONFunctions::GetObjectFunction() {
519
- auto fun = ScalarFunction("json_object", {}, JSONCommon::JSONType(), ObjectFunction, JSONObjectBind, nullptr,
520
- nullptr, JSONFunctionLocalState::Init);
518
+ ScalarFunctionSet JSONFunctions::GetObjectFunction() {
519
+ ScalarFunction fun("json_object", {}, JSONCommon::JSONType(), ObjectFunction, JSONObjectBind, nullptr, nullptr,
520
+ JSONFunctionLocalState::Init);
521
521
  fun.varargs = LogicalType::ANY;
522
522
  fun.null_handling = FunctionNullHandling::SPECIAL_HANDLING;
523
- return CreateScalarFunctionInfo(fun);
523
+ return ScalarFunctionSet(fun);
524
524
  }
525
525
 
526
- CreateScalarFunctionInfo JSONFunctions::GetArrayFunction() {
527
- auto fun = ScalarFunction("json_array", {}, JSONCommon::JSONType(), ArrayFunction, JSONArrayBind, nullptr, nullptr,
528
- JSONFunctionLocalState::Init);
526
+ ScalarFunctionSet JSONFunctions::GetArrayFunction() {
527
+ ScalarFunction fun("json_array", {}, JSONCommon::JSONType(), ArrayFunction, JSONArrayBind, nullptr, nullptr,
528
+ JSONFunctionLocalState::Init);
529
529
  fun.varargs = LogicalType::ANY;
530
530
  fun.null_handling = FunctionNullHandling::SPECIAL_HANDLING;
531
- return CreateScalarFunctionInfo(fun);
531
+ return ScalarFunctionSet(fun);
532
532
  }
533
533
 
534
- CreateScalarFunctionInfo JSONFunctions::GetToJSONFunction() {
535
- auto fun = ScalarFunction("to_json", {}, JSONCommon::JSONType(), ToJSONFunction, ToJSONBind, nullptr, nullptr,
536
- JSONFunctionLocalState::Init);
534
+ ScalarFunctionSet JSONFunctions::GetToJSONFunction() {
535
+ ScalarFunction fun("to_json", {}, JSONCommon::JSONType(), ToJSONFunction, ToJSONBind, nullptr, nullptr,
536
+ JSONFunctionLocalState::Init);
537
537
  fun.varargs = LogicalType::ANY;
538
- return CreateScalarFunctionInfo(fun);
538
+ return ScalarFunctionSet(fun);
539
539
  }
540
540
 
541
- CreateScalarFunctionInfo JSONFunctions::GetArrayToJSONFunction() {
542
- auto fun = ScalarFunction("array_to_json", {}, JSONCommon::JSONType(), ToJSONFunction, ArrayToJSONBind, nullptr,
543
- nullptr, JSONFunctionLocalState::Init);
541
+ ScalarFunctionSet JSONFunctions::GetArrayToJSONFunction() {
542
+ ScalarFunction fun("array_to_json", {}, JSONCommon::JSONType(), ToJSONFunction, ArrayToJSONBind, nullptr, nullptr,
543
+ JSONFunctionLocalState::Init);
544
544
  fun.varargs = LogicalType::ANY;
545
- return CreateScalarFunctionInfo(fun);
545
+ return ScalarFunctionSet(fun);
546
546
  }
547
547
 
548
- CreateScalarFunctionInfo JSONFunctions::GetRowToJSONFunction() {
549
- auto fun = ScalarFunction("row_to_json", {}, JSONCommon::JSONType(), ToJSONFunction, RowToJSONBind, nullptr,
550
- nullptr, JSONFunctionLocalState::Init);
548
+ ScalarFunctionSet JSONFunctions::GetRowToJSONFunction() {
549
+ ScalarFunction fun("row_to_json", {}, JSONCommon::JSONType(), ToJSONFunction, RowToJSONBind, nullptr, nullptr,
550
+ JSONFunctionLocalState::Init);
551
551
  fun.varargs = LogicalType::ANY;
552
- return CreateScalarFunctionInfo(fun);
552
+ return ScalarFunctionSet(fun);
553
553
  }
554
554
 
555
555
  } // namespace duckdb
@@ -35,13 +35,12 @@ static void GetExtractFunctionsInternal(ScalarFunctionSet &set, const LogicalTyp
35
35
  JSONReadManyFunctionData::Bind, nullptr, nullptr, JSONFunctionLocalState::Init));
36
36
  }
37
37
 
38
- CreateScalarFunctionInfo JSONFunctions::GetExtractFunction() {
38
+ ScalarFunctionSet JSONFunctions::GetExtractFunction() {
39
39
  // Generic extract function
40
40
  ScalarFunctionSet set("json_extract");
41
41
  GetExtractFunctionsInternal(set, LogicalType::VARCHAR);
42
42
  GetExtractFunctionsInternal(set, JSONCommon::JSONType());
43
-
44
- return CreateScalarFunctionInfo(set);
43
+ return set;
45
44
  }
46
45
 
47
46
  static void GetExtractStringFunctionsInternal(ScalarFunctionSet &set, const LogicalType &input_type) {
@@ -52,13 +51,12 @@ static void GetExtractStringFunctionsInternal(ScalarFunctionSet &set, const Logi
52
51
  JSONReadManyFunctionData::Bind, nullptr, nullptr, JSONFunctionLocalState::Init));
53
52
  }
54
53
 
55
- CreateScalarFunctionInfo JSONFunctions::GetExtractStringFunction() {
54
+ ScalarFunctionSet JSONFunctions::GetExtractStringFunction() {
56
55
  // String extract function
57
56
  ScalarFunctionSet set("json_extract_string");
58
57
  GetExtractStringFunctionsInternal(set, LogicalType::VARCHAR);
59
58
  GetExtractStringFunctionsInternal(set, JSONCommon::JSONType());
60
-
61
- return CreateScalarFunctionInfo(set);
59
+ return set;
62
60
  }
63
61
 
64
62
  } // namespace duckdb
@@ -49,12 +49,11 @@ static void GetJSONKeysFunctionsInternal(ScalarFunctionSet &set, const LogicalTy
49
49
  JSONReadManyFunctionData::Bind, nullptr, nullptr, JSONFunctionLocalState::Init));
50
50
  }
51
51
 
52
- CreateScalarFunctionInfo JSONFunctions::GetKeysFunction() {
52
+ ScalarFunctionSet JSONFunctions::GetKeysFunction() {
53
53
  ScalarFunctionSet set("json_keys");
54
54
  GetJSONKeysFunctionsInternal(set, LogicalType::VARCHAR);
55
55
  GetJSONKeysFunctionsInternal(set, JSONCommon::JSONType());
56
-
57
- return CreateScalarFunctionInfo(std::move(set));
56
+ return set;
58
57
  }
59
58
 
60
59
  } // namespace duckdb
@@ -96,13 +96,13 @@ static void MergePatchFunction(DataChunk &args, ExpressionState &state, Vector &
96
96
  }
97
97
  }
98
98
 
99
- CreateScalarFunctionInfo JSONFunctions::GetMergePatchFunction() {
99
+ ScalarFunctionSet JSONFunctions::GetMergePatchFunction() {
100
100
  ScalarFunction fun("json_merge_patch", {}, JSONCommon::JSONType(), MergePatchFunction, JSONMergePatchBind, nullptr,
101
101
  nullptr, JSONFunctionLocalState::Init);
102
102
  fun.varargs = LogicalType::ANY;
103
103
  fun.null_handling = FunctionNullHandling::SPECIAL_HANDLING;
104
104
 
105
- return CreateScalarFunctionInfo(fun);
105
+ return ScalarFunctionSet(fun);
106
106
  }
107
107
 
108
108
  } // namespace duckdb
@@ -132,7 +132,7 @@ static void JsonSerializeFunction(DataChunk &args, ExpressionState &state, Vecto
132
132
  });
133
133
  }
134
134
 
135
- CreateScalarFunctionInfo JSONFunctions::GetSerializeSqlFunction() {
135
+ ScalarFunctionSet JSONFunctions::GetSerializeSqlFunction() {
136
136
  ScalarFunctionSet set("json_serialize_sql");
137
137
  set.AddFunction(ScalarFunction({LogicalType::VARCHAR}, JSONCommon::JSONType(), JsonSerializeFunction,
138
138
  JsonSerializeBind, nullptr, nullptr, JSONFunctionLocalState::Init));
@@ -150,7 +150,7 @@ CreateScalarFunctionInfo JSONFunctions::GetSerializeSqlFunction() {
150
150
  JSONCommon::JSONType(), JsonSerializeFunction, JsonSerializeBind, nullptr, nullptr,
151
151
  JSONFunctionLocalState::Init));
152
152
 
153
- return CreateScalarFunctionInfo(set);
153
+ return set;
154
154
  }
155
155
 
156
156
  //----------------------------------------------------------------------
@@ -204,11 +204,11 @@ static void JsonDeserializeFunction(DataChunk &args, ExpressionState &state, Vec
204
204
  });
205
205
  }
206
206
 
207
- CreateScalarFunctionInfo JSONFunctions::GetDeserializeSqlFunction() {
207
+ ScalarFunctionSet JSONFunctions::GetDeserializeSqlFunction() {
208
208
  ScalarFunctionSet set("json_deserialize_sql");
209
209
  set.AddFunction(ScalarFunction({JSONCommon::JSONType()}, LogicalType::VARCHAR, JsonDeserializeFunction, nullptr,
210
210
  nullptr, nullptr, JSONFunctionLocalState::Init));
211
- return CreateScalarFunctionInfo(set);
211
+ return set;
212
212
  }
213
213
 
214
214
  //----------------------------------------------------------------------
@@ -223,8 +223,8 @@ static string ExecuteJsonSerializedSqlPragmaFunction(ClientContext &context, con
223
223
  return stmt->ToString();
224
224
  }
225
225
 
226
- CreatePragmaFunctionInfo JSONFunctions::GetExecuteJsonSerializedSqlPragmaFunction() {
227
- return CreatePragmaFunctionInfo(PragmaFunction::PragmaCall(
226
+ PragmaFunctionSet JSONFunctions::GetExecuteJsonSerializedSqlPragmaFunction() {
227
+ return PragmaFunctionSet(PragmaFunction::PragmaCall(
228
228
  "json_execute_serialized_sql", ExecuteJsonSerializedSqlPragmaFunction, {LogicalType::VARCHAR}));
229
229
  }
230
230
 
@@ -270,10 +270,10 @@ struct ExecuteSqlTableFunction {
270
270
  }
271
271
  };
272
272
 
273
- CreateTableFunctionInfo JSONFunctions::GetExecuteJsonSerializedSqlFunction() {
273
+ TableFunctionSet JSONFunctions::GetExecuteJsonSerializedSqlFunction() {
274
274
  TableFunction func("json_execute_serialized_sql", {LogicalType::VARCHAR}, ExecuteSqlTableFunction::Function,
275
275
  ExecuteSqlTableFunction::Bind);
276
- return CreateTableFunctionInfo(func);
276
+ return TableFunctionSet(func);
277
277
  }
278
278
 
279
279
  } // namespace duckdb
@@ -476,11 +476,11 @@ static void GetStructureFunctionInternal(ScalarFunctionSet &set, const LogicalTy
476
476
  JSONFunctionLocalState::Init));
477
477
  }
478
478
 
479
- CreateScalarFunctionInfo JSONFunctions::GetStructureFunction() {
479
+ ScalarFunctionSet JSONFunctions::GetStructureFunction() {
480
480
  ScalarFunctionSet set("json_structure");
481
481
  GetStructureFunctionInternal(set, LogicalType::VARCHAR);
482
482
  GetStructureFunctionInternal(set, JSONCommon::JSONType());
483
- return CreateScalarFunctionInfo(set);
483
+ return set;
484
484
  }
485
485
 
486
486
  static LogicalType StructureToTypeArray(ClientContext &context, const JSONStructureNode &node, const idx_t max_depth,
@@ -685,11 +685,11 @@ static void GetTransformFunctionInternal(ScalarFunctionSet &set, const LogicalTy
685
685
  JSONTransformBind, nullptr, nullptr, JSONFunctionLocalState::Init));
686
686
  }
687
687
 
688
- CreateScalarFunctionInfo JSONFunctions::GetTransformFunction() {
688
+ ScalarFunctionSet JSONFunctions::GetTransformFunction() {
689
689
  ScalarFunctionSet set("json_transform");
690
690
  GetTransformFunctionInternal(set, LogicalType::VARCHAR);
691
691
  GetTransformFunctionInternal(set, JSONCommon::JSONType());
692
- return CreateScalarFunctionInfo(set);
692
+ return set;
693
693
  }
694
694
 
695
695
  static void GetTransformStrictFunctionInternal(ScalarFunctionSet &set, const LogicalType &input_type) {
@@ -697,11 +697,11 @@ static void GetTransformStrictFunctionInternal(ScalarFunctionSet &set, const Log
697
697
  JSONTransformBind, nullptr, nullptr, JSONFunctionLocalState::Init));
698
698
  }
699
699
 
700
- CreateScalarFunctionInfo JSONFunctions::GetTransformStrictFunction() {
700
+ ScalarFunctionSet JSONFunctions::GetTransformStrictFunction() {
701
701
  ScalarFunctionSet set("json_transform_strict");
702
702
  GetTransformStrictFunctionInternal(set, LogicalType::VARCHAR);
703
703
  GetTransformStrictFunctionInternal(set, JSONCommon::JSONType());
704
- return CreateScalarFunctionInfo(set);
704
+ return set;
705
705
  }
706
706
 
707
707
  } // namespace duckdb
@@ -28,12 +28,11 @@ static void GetTypeFunctionsInternal(ScalarFunctionSet &set, const LogicalType &
28
28
  JSONReadManyFunctionData::Bind, nullptr, nullptr, JSONFunctionLocalState::Init));
29
29
  }
30
30
 
31
- CreateScalarFunctionInfo JSONFunctions::GetTypeFunction() {
31
+ ScalarFunctionSet JSONFunctions::GetTypeFunction() {
32
32
  ScalarFunctionSet set("json_type");
33
33
  GetTypeFunctionsInternal(set, LogicalType::VARCHAR);
34
34
  GetTypeFunctionsInternal(set, JSONCommon::JSONType());
35
-
36
- return CreateScalarFunctionInfo(std::move(set));
35
+ return set;
37
36
  }
38
37
 
39
38
  } // namespace duckdb
@@ -16,12 +16,12 @@ static void GetValidFunctionInternal(ScalarFunctionSet &set, const LogicalType &
16
16
  nullptr, JSONFunctionLocalState::Init));
17
17
  }
18
18
 
19
- CreateScalarFunctionInfo JSONFunctions::GetValidFunction() {
19
+ ScalarFunctionSet JSONFunctions::GetValidFunction() {
20
20
  ScalarFunctionSet set("json_valid");
21
21
  GetValidFunctionInternal(set, LogicalType::VARCHAR);
22
22
  GetValidFunctionInternal(set, JSONCommon::JSONType());
23
23
 
24
- return CreateScalarFunctionInfo(set);
24
+ return set;
25
25
  }
26
26
 
27
27
  } // namespace duckdb
@@ -293,33 +293,33 @@ TableFunction JSONFunctions::GetReadJSONTableFunction(shared_ptr<JSONScanInfo> f
293
293
  return table_function;
294
294
  }
295
295
 
296
- CreateTableFunctionInfo CreateJSONFunctionInfo(string name, shared_ptr<JSONScanInfo> info, bool auto_function = false) {
296
+ TableFunctionSet CreateJSONFunctionInfo(string name, shared_ptr<JSONScanInfo> info, bool auto_function = false) {
297
297
  auto table_function = JSONFunctions::GetReadJSONTableFunction(std::move(info));
298
298
  table_function.name = std::move(name);
299
299
  if (auto_function) {
300
300
  table_function.named_parameters["maximum_depth"] = LogicalType::BIGINT;
301
301
  }
302
- return CreateTableFunctionInfo(MultiFileReader::CreateFunctionSet(table_function));
302
+ return MultiFileReader::CreateFunctionSet(table_function);
303
303
  }
304
304
 
305
- CreateTableFunctionInfo JSONFunctions::GetReadJSONFunction() {
305
+ TableFunctionSet JSONFunctions::GetReadJSONFunction() {
306
306
  auto info =
307
307
  make_shared<JSONScanInfo>(JSONScanType::READ_JSON, JSONFormat::UNSTRUCTURED, JSONRecordType::RECORDS, false);
308
308
  return CreateJSONFunctionInfo("read_json", std::move(info));
309
309
  }
310
310
 
311
- CreateTableFunctionInfo JSONFunctions::GetReadNDJSONFunction() {
311
+ TableFunctionSet JSONFunctions::GetReadNDJSONFunction() {
312
312
  auto info = make_shared<JSONScanInfo>(JSONScanType::READ_JSON, JSONFormat::NEWLINE_DELIMITED,
313
313
  JSONRecordType::RECORDS, false);
314
314
  return CreateJSONFunctionInfo("read_ndjson", std::move(info));
315
315
  }
316
316
 
317
- CreateTableFunctionInfo JSONFunctions::GetReadJSONAutoFunction() {
317
+ TableFunctionSet JSONFunctions::GetReadJSONAutoFunction() {
318
318
  auto info = make_shared<JSONScanInfo>(JSONScanType::READ_JSON, JSONFormat::AUTO_DETECT, JSONRecordType::AUTO, true);
319
319
  return CreateJSONFunctionInfo("read_json_auto", std::move(info), true);
320
320
  }
321
321
 
322
- CreateTableFunctionInfo JSONFunctions::GetReadNDJSONAutoFunction() {
322
+ TableFunctionSet JSONFunctions::GetReadNDJSONAutoFunction() {
323
323
  auto info =
324
324
  make_shared<JSONScanInfo>(JSONScanType::READ_JSON, JSONFormat::NEWLINE_DELIMITED, JSONRecordType::AUTO, true);
325
325
  return CreateJSONFunctionInfo("read_ndjson_auto", std::move(info), true);