duckdb 0.7.2-dev2740.0 → 0.7.2-dev2867.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 (286) hide show
  1. package/binding.gyp +21 -13
  2. package/package.json +1 -1
  3. package/src/duckdb/extension/icu/icu-datepart.cpp +51 -1
  4. package/src/duckdb/extension/icu/icu-strptime.cpp +1 -1
  5. package/src/duckdb/extension/json/include/json_functions.hpp +35 -37
  6. package/src/duckdb/extension/json/include/json_scan.hpp +1 -1
  7. package/src/duckdb/extension/json/include/json_transform.hpp +1 -1
  8. package/src/duckdb/extension/json/json-extension.cpp +10 -20
  9. package/src/duckdb/extension/json/json_functions/copy_json.cpp +2 -2
  10. package/src/duckdb/extension/json/json_functions/json_array_length.cpp +2 -3
  11. package/src/duckdb/extension/json/json_functions/json_contains.cpp +2 -2
  12. package/src/duckdb/extension/json/json_functions/json_create.cpp +20 -20
  13. package/src/duckdb/extension/json/json_functions/json_extract.cpp +4 -6
  14. package/src/duckdb/extension/json/json_functions/json_keys.cpp +2 -3
  15. package/src/duckdb/extension/json/json_functions/json_merge_patch.cpp +2 -2
  16. package/src/duckdb/extension/json/json_functions/json_serialize_sql.cpp +8 -8
  17. package/src/duckdb/extension/json/json_functions/json_structure.cpp +2 -2
  18. package/src/duckdb/extension/json/json_functions/json_transform.cpp +4 -4
  19. package/src/duckdb/extension/json/json_functions/json_type.cpp +2 -3
  20. package/src/duckdb/extension/json/json_functions/json_valid.cpp +2 -2
  21. package/src/duckdb/extension/json/json_functions/read_json.cpp +6 -6
  22. package/src/duckdb/extension/json/json_functions/read_json_objects.cpp +4 -4
  23. package/src/duckdb/extension/json/json_functions.cpp +6 -6
  24. package/src/duckdb/extension/parquet/parquet-extension.cpp +16 -28
  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/local_file_system.cpp +1 -3
  33. package/src/duckdb/src/common/multi_file_reader.cpp +11 -8
  34. package/src/duckdb/src/common/types/vector.cpp +136 -3
  35. package/src/duckdb/src/{function → core_functions}/aggregate/algebraic/avg.cpp +9 -12
  36. package/src/duckdb/src/core_functions/aggregate/algebraic/corr.cpp +13 -0
  37. package/src/duckdb/src/core_functions/aggregate/algebraic/covar.cpp +21 -0
  38. package/src/duckdb/src/core_functions/aggregate/algebraic/stddev.cpp +34 -0
  39. package/src/duckdb/src/{function → core_functions}/aggregate/distributive/approx_count.cpp +3 -3
  40. package/src/duckdb/src/{function → core_functions}/aggregate/distributive/arg_min_max.cpp +7 -23
  41. package/src/duckdb/src/{function → core_functions}/aggregate/distributive/bitagg.cpp +10 -10
  42. package/src/duckdb/src/{function → core_functions}/aggregate/distributive/bitstring_agg.cpp +4 -4
  43. package/src/duckdb/src/{function → core_functions}/aggregate/distributive/bool.cpp +1 -17
  44. package/src/duckdb/src/{function → core_functions}/aggregate/distributive/entropy.cpp +5 -4
  45. package/src/duckdb/src/{function → core_functions}/aggregate/distributive/kurtosis.cpp +5 -6
  46. package/src/duckdb/src/{function → core_functions}/aggregate/distributive/minmax.cpp +5 -5
  47. package/src/duckdb/src/{function → core_functions}/aggregate/distributive/product.cpp +2 -11
  48. package/src/duckdb/src/{function → core_functions}/aggregate/distributive/skew.cpp +5 -6
  49. package/src/duckdb/src/{function → core_functions}/aggregate/distributive/string_agg.cpp +4 -6
  50. package/src/duckdb/src/{function → core_functions}/aggregate/distributive/sum.cpp +38 -46
  51. package/src/duckdb/src/{function → core_functions}/aggregate/holistic/approximate_quantile.cpp +4 -5
  52. package/src/duckdb/src/{function → core_functions}/aggregate/holistic/mode.cpp +4 -5
  53. package/src/duckdb/src/{function → core_functions}/aggregate/holistic/quantile.cpp +31 -23
  54. package/src/duckdb/src/{function → core_functions}/aggregate/holistic/reservoir_quantile.cpp +4 -5
  55. package/src/duckdb/src/{function → core_functions}/aggregate/nested/histogram.cpp +4 -4
  56. package/src/duckdb/src/{function → core_functions}/aggregate/nested/list.cpp +6 -10
  57. package/src/duckdb/src/{function → core_functions}/aggregate/regression/regr_avg.cpp +7 -11
  58. package/src/duckdb/src/{function → core_functions}/aggregate/regression/regr_count.cpp +4 -4
  59. package/src/duckdb/src/{function → core_functions}/aggregate/regression/regr_intercept.cpp +5 -8
  60. package/src/duckdb/src/{function → core_functions}/aggregate/regression/regr_r2.cpp +5 -7
  61. package/src/duckdb/src/{function → core_functions}/aggregate/regression/regr_slope.cpp +5 -7
  62. package/src/duckdb/src/{function → core_functions}/aggregate/regression/regr_sxx_syy.cpp +8 -12
  63. package/src/duckdb/src/{function → core_functions}/aggregate/regression/regr_sxy.cpp +6 -8
  64. package/src/duckdb/src/core_functions/core_functions.cpp +50 -0
  65. package/src/duckdb/src/core_functions/function_list.cpp +352 -0
  66. package/src/duckdb/src/{function → core_functions}/scalar/bit/bitstring.cpp +12 -15
  67. package/src/duckdb/src/{function → core_functions}/scalar/blob/base64.cpp +6 -6
  68. package/src/duckdb/src/{function → core_functions}/scalar/blob/encode.cpp +7 -6
  69. package/src/duckdb/src/{function → core_functions}/scalar/date/age.cpp +3 -3
  70. package/src/duckdb/src/{function → core_functions}/scalar/date/current.cpp +8 -8
  71. package/src/duckdb/src/{function → core_functions}/scalar/date/date_diff.cpp +3 -6
  72. package/src/duckdb/src/{function → core_functions}/scalar/date/date_part.cpp +144 -148
  73. package/src/duckdb/src/{function → core_functions}/scalar/date/date_sub.cpp +3 -6
  74. package/src/duckdb/src/{function → core_functions}/scalar/date/date_trunc.cpp +3 -6
  75. package/src/duckdb/src/{function → core_functions}/scalar/date/epoch.cpp +7 -8
  76. package/src/duckdb/src/{function → core_functions}/scalar/date/make_date.cpp +14 -14
  77. package/src/duckdb/src/core_functions/scalar/date/strftime.cpp +251 -0
  78. package/src/duckdb/src/{function → core_functions}/scalar/date/time_bucket.cpp +4 -5
  79. package/src/duckdb/src/{function → core_functions}/scalar/date/to_interval.cpp +39 -19
  80. package/src/duckdb/src/{function/scalar/enum/enum_functions_implementation.cpp → core_functions/scalar/enum/enum_functions.cpp} +18 -22
  81. package/src/duckdb/src/{function → core_functions}/scalar/generic/alias.cpp +4 -4
  82. package/src/duckdb/src/{function → core_functions}/scalar/generic/current_setting.cpp +4 -5
  83. package/src/duckdb/src/{function → core_functions}/scalar/generic/error.cpp +4 -4
  84. package/src/duckdb/src/{function → core_functions}/scalar/generic/hash.cpp +4 -4
  85. package/src/duckdb/src/{function → core_functions}/scalar/generic/least.cpp +8 -9
  86. package/src/duckdb/src/{function → core_functions}/scalar/generic/stats.cpp +4 -4
  87. package/src/duckdb/src/{function/scalar/system → core_functions/scalar/generic}/system_functions.cpp +24 -13
  88. package/src/duckdb/src/{function → core_functions}/scalar/generic/typeof.cpp +4 -4
  89. package/src/duckdb/src/{function → core_functions}/scalar/list/array_slice.cpp +3 -13
  90. package/src/duckdb/src/{function → core_functions}/scalar/list/flatten.cpp +5 -5
  91. package/src/duckdb/src/{function → core_functions}/scalar/list/list_aggregates.cpp +2 -13
  92. package/src/duckdb/src/{function → core_functions}/scalar/list/list_lambdas.cpp +9 -24
  93. package/src/duckdb/src/{function → core_functions}/scalar/list/list_sort.cpp +8 -22
  94. package/src/duckdb/src/{function → core_functions}/scalar/list/list_value.cpp +4 -5
  95. package/src/duckdb/src/{function → core_functions}/scalar/list/range.cpp +8 -6
  96. package/src/duckdb/src/{function → core_functions}/scalar/map/cardinality.cpp +5 -4
  97. package/src/duckdb/src/{function → core_functions}/scalar/map/map.cpp +6 -63
  98. package/src/duckdb/src/{function → core_functions}/scalar/map/map_entries.cpp +5 -4
  99. package/src/duckdb/src/{function → core_functions}/scalar/map/map_extract.cpp +22 -7
  100. package/src/duckdb/src/{function → core_functions}/scalar/map/map_from_entries.cpp +6 -5
  101. package/src/duckdb/src/{function → core_functions}/scalar/map/map_keys_values.cpp +8 -7
  102. package/src/duckdb/src/{function → core_functions}/scalar/math/numeric.cpp +110 -138
  103. package/src/duckdb/src/{function → core_functions}/scalar/operators/bitwise.cpp +19 -20
  104. package/src/duckdb/src/{function/scalar/math → core_functions/scalar/random}/random.cpp +5 -6
  105. package/src/duckdb/src/{function/scalar/math → core_functions/scalar/random}/setseed.cpp +3 -3
  106. package/src/duckdb/src/{function → core_functions}/scalar/string/ascii.cpp +4 -5
  107. package/src/duckdb/src/{function → core_functions}/scalar/string/bar.cpp +4 -4
  108. package/src/duckdb/src/{function → core_functions}/scalar/string/chr.cpp +5 -6
  109. package/src/duckdb/src/{function → core_functions}/scalar/string/damerau_levenshtein.cpp +4 -6
  110. package/src/duckdb/src/{function/scalar/string/mismatches.cpp → core_functions/scalar/string/hamming.cpp} +3 -12
  111. package/src/duckdb/src/{function → core_functions}/scalar/string/hex.cpp +15 -25
  112. package/src/duckdb/src/{function → core_functions}/scalar/string/instr.cpp +6 -13
  113. package/src/duckdb/src/{function → core_functions}/scalar/string/jaccard.cpp +3 -6
  114. package/src/duckdb/src/{function → core_functions}/scalar/string/jaro_winkler.cpp +7 -6
  115. package/src/duckdb/src/{function → core_functions}/scalar/string/left_right.cpp +18 -11
  116. package/src/duckdb/src/{function → core_functions}/scalar/string/levenshtein.cpp +3 -12
  117. package/src/duckdb/src/{function → core_functions}/scalar/string/md5.cpp +15 -21
  118. package/src/duckdb/src/{function → core_functions}/scalar/string/pad.cpp +7 -13
  119. package/src/duckdb/src/{function → core_functions}/scalar/string/printf.cpp +10 -10
  120. package/src/duckdb/src/{function → core_functions}/scalar/string/repeat.cpp +3 -6
  121. package/src/duckdb/src/{function → core_functions}/scalar/string/replace.cpp +4 -7
  122. package/src/duckdb/src/{function → core_functions}/scalar/string/reverse.cpp +3 -3
  123. package/src/duckdb/src/{function → core_functions}/scalar/string/starts_with.cpp +4 -8
  124. package/src/duckdb/src/{function → core_functions}/scalar/string/string_split.cpp +11 -11
  125. package/src/duckdb/src/{function → core_functions}/scalar/string/translate.cpp +4 -7
  126. package/src/duckdb/src/{function → core_functions}/scalar/string/trim.cpp +19 -14
  127. package/src/duckdb/src/core_functions/scalar/string/unicode.cpp +28 -0
  128. package/src/duckdb/src/{function → core_functions}/scalar/struct/struct_insert.cpp +4 -4
  129. package/src/duckdb/src/{function → core_functions}/scalar/struct/struct_pack.cpp +3 -4
  130. package/src/duckdb/src/{function → core_functions}/scalar/union/union_extract.cpp +4 -8
  131. package/src/duckdb/src/{function → core_functions}/scalar/union/union_tag.cpp +4 -8
  132. package/src/duckdb/src/{function → core_functions}/scalar/union/union_value.cpp +4 -59
  133. package/src/duckdb/src/execution/operator/persistent/base_csv_reader.cpp +1 -1
  134. package/src/duckdb/src/execution/operator/persistent/buffered_csv_reader.cpp +1 -1
  135. package/src/duckdb/src/execution/operator/persistent/parallel_csv_reader.cpp +1 -1
  136. package/src/duckdb/src/execution/operator/schema/physical_create_type.cpp +11 -2
  137. package/src/duckdb/src/function/aggregate/distributive_functions.cpp +0 -17
  138. package/src/duckdb/src/function/cast/string_cast.cpp +1 -1
  139. package/src/duckdb/src/function/function.cpp +0 -8
  140. package/src/duckdb/src/function/function_set.cpp +25 -0
  141. package/src/duckdb/src/function/scalar/generic_functions.cpp +1 -9
  142. package/src/duckdb/src/function/scalar/nested_functions.cpp +0 -22
  143. package/src/duckdb/src/function/scalar/operators.cpp +0 -6
  144. package/src/duckdb/src/function/scalar/{date/strftime.cpp → strftime_format.cpp} +1 -249
  145. package/src/duckdb/src/function/scalar/string/length.cpp +0 -19
  146. package/src/duckdb/src/function/scalar/string_functions.cpp +0 -40
  147. package/src/duckdb/src/function/scalar/system/aggregate_export.cpp +5 -0
  148. package/src/duckdb/src/function/table/arrow_conversion.cpp +1 -1
  149. package/src/duckdb/src/function/table/read_csv.cpp +7 -4
  150. package/src/duckdb/src/function/table/system/duckdb_functions.cpp +27 -40
  151. package/src/duckdb/src/function/table/version/pragma_version.cpp +2 -2
  152. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/aggregate_function_catalog_entry.hpp +3 -3
  153. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/function_entry.hpp +33 -0
  154. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/macro_catalog_entry.hpp +2 -2
  155. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/pragma_function_catalog_entry.hpp +2 -2
  156. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/scalar_function_catalog_entry.hpp +2 -2
  157. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_function_catalog_entry.hpp +2 -2
  158. package/src/duckdb/src/include/duckdb/catalog/catalog_transaction.hpp +2 -0
  159. package/src/duckdb/src/include/duckdb/common/algorithm.hpp +1 -0
  160. package/src/duckdb/src/include/duckdb/common/multi_file_reader.hpp +5 -4
  161. package/src/duckdb/src/include/duckdb/common/types/vector.hpp +11 -1
  162. package/src/duckdb/src/include/duckdb/{function → core_functions}/aggregate/algebraic/corr.hpp +3 -4
  163. package/src/duckdb/src/include/duckdb/{function → core_functions}/aggregate/algebraic/covar.hpp +1 -1
  164. package/src/duckdb/src/include/duckdb/{function → core_functions}/aggregate/algebraic/stddev.hpp +1 -1
  165. package/src/duckdb/src/include/duckdb/core_functions/aggregate/algebraic_functions.hpp +124 -0
  166. package/src/duckdb/src/include/duckdb/core_functions/aggregate/distributive_functions.hpp +229 -0
  167. package/src/duckdb/src/include/duckdb/core_functions/aggregate/holistic_functions.hpp +85 -0
  168. package/src/duckdb/src/include/duckdb/core_functions/aggregate/nested_functions.hpp +41 -0
  169. package/src/duckdb/src/include/duckdb/{function → core_functions}/aggregate/regression/regr_count.hpp +3 -4
  170. package/src/duckdb/src/include/duckdb/{function → core_functions}/aggregate/regression/regr_slope.hpp +2 -2
  171. package/src/duckdb/src/include/duckdb/core_functions/aggregate/regression_functions.hpp +97 -0
  172. package/src/duckdb/src/include/duckdb/{function → core_functions}/aggregate/sum_helpers.hpp +1 -1
  173. package/src/duckdb/src/include/duckdb/{function/scalar/uuid_functions.hpp → core_functions/core_functions.hpp} +7 -5
  174. package/src/duckdb/src/include/duckdb/core_functions/function_list.hpp +33 -0
  175. package/src/duckdb/src/include/duckdb/core_functions/scalar/bit_functions.hpp +52 -0
  176. package/src/duckdb/src/include/duckdb/core_functions/scalar/blob_functions.hpp +58 -0
  177. package/src/duckdb/src/include/duckdb/core_functions/scalar/date_functions.hpp +544 -0
  178. package/src/duckdb/src/include/duckdb/core_functions/scalar/enum_functions.hpp +61 -0
  179. package/src/duckdb/src/include/duckdb/core_functions/scalar/generic_functions.hpp +142 -0
  180. package/src/duckdb/src/include/duckdb/core_functions/scalar/list_functions.hpp +220 -0
  181. package/src/duckdb/src/include/duckdb/core_functions/scalar/map_functions.hpp +85 -0
  182. package/src/duckdb/src/include/duckdb/core_functions/scalar/math_functions.hpp +394 -0
  183. package/src/duckdb/src/include/duckdb/core_functions/scalar/operators_functions.hpp +70 -0
  184. package/src/duckdb/src/include/duckdb/core_functions/scalar/random_functions.hpp +49 -0
  185. package/src/duckdb/src/include/duckdb/core_functions/scalar/string_functions.hpp +439 -0
  186. package/src/duckdb/src/include/duckdb/core_functions/scalar/struct_functions.hpp +40 -0
  187. package/src/duckdb/src/include/duckdb/core_functions/scalar/union_functions.hpp +43 -0
  188. package/src/duckdb/src/include/duckdb/execution/operator/persistent/base_csv_reader.hpp +1 -1
  189. package/src/duckdb/src/include/duckdb/execution/operator/persistent/csv_reader_options.hpp +1 -1
  190. package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_type.hpp +4 -0
  191. package/src/duckdb/src/include/duckdb/function/aggregate/distributive_functions.hpp +0 -85
  192. package/src/duckdb/src/include/duckdb/function/built_in_functions.hpp +0 -8
  193. package/src/duckdb/src/include/duckdb/function/function_set.hpp +7 -2
  194. package/src/duckdb/src/include/duckdb/function/scalar/generic_functions.hpp +1 -36
  195. package/src/duckdb/src/include/duckdb/function/scalar/nested_functions.hpp +0 -120
  196. package/src/duckdb/src/include/duckdb/function/scalar/operators.hpp +0 -24
  197. package/src/duckdb/src/include/duckdb/function/scalar/string_functions.hpp +1 -97
  198. package/src/duckdb/src/include/duckdb/function/table/read_csv.hpp +1 -1
  199. package/src/duckdb/src/include/duckdb/main/database.hpp +1 -0
  200. package/src/duckdb/src/include/duckdb/main/database_manager.hpp +3 -0
  201. package/src/duckdb/src/include/duckdb/main/extension_helper.hpp +0 -2
  202. package/src/duckdb/src/include/duckdb/main/extension_util.hpp +48 -0
  203. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_function_info.hpp +6 -0
  204. package/src/duckdb/src/include/duckdb/parser/tableref/pivotref.hpp +3 -0
  205. package/src/duckdb/src/include/duckdb/parser/transformer.hpp +5 -1
  206. package/src/duckdb/src/main/attached_database.cpp +5 -3
  207. package/src/duckdb/src/main/database.cpp +34 -37
  208. package/src/duckdb/src/main/extension/extension_helper.cpp +1 -0
  209. package/src/duckdb/src/main/extension/extension_load.cpp +61 -38
  210. package/src/duckdb/src/main/extension/extension_util.cpp +90 -0
  211. package/src/duckdb/src/parser/transform/statement/transform_create_function.cpp +1 -4
  212. package/src/duckdb/src/parser/transform/statement/transform_create_view.cpp +2 -4
  213. package/src/duckdb/src/parser/transform/statement/transform_pivot_stmt.cpp +43 -24
  214. package/src/duckdb/src/parser/transform/tableref/transform_pivot.cpp +3 -0
  215. package/src/duckdb/src/planner/binder/statement/bind_create.cpp +17 -28
  216. package/src/duckdb/src/planner/binder/statement/bind_create_table.cpp +6 -7
  217. package/src/duckdb/third_party/fmt/format.cc +0 -5
  218. package/src/duckdb/third_party/fmt/include/fmt/core.h +10 -12
  219. package/src/duckdb/third_party/fmt/include/fmt/format-inl.h +2 -33
  220. package/src/duckdb/third_party/fmt/include/fmt/format.h +61 -24
  221. package/src/duckdb/third_party/fmt/include/fmt/printf.h +15 -1
  222. package/src/duckdb/third_party/libpg_query/include/nodes/parsenodes.hpp +1 -0
  223. package/src/duckdb/third_party/libpg_query/src_backend_parser_gram.cpp +10735 -10674
  224. package/src/duckdb/ub_src_common_enums.cpp +2 -0
  225. package/src/duckdb/ub_src_core_functions.cpp +4 -0
  226. package/src/duckdb/ub_src_core_functions_aggregate_algebraic.cpp +8 -0
  227. package/src/duckdb/ub_src_core_functions_aggregate_distributive.cpp +24 -0
  228. package/src/duckdb/ub_src_core_functions_aggregate_holistic.cpp +8 -0
  229. package/src/duckdb/ub_src_core_functions_aggregate_nested.cpp +4 -0
  230. package/src/duckdb/ub_src_core_functions_aggregate_regression.cpp +14 -0
  231. package/src/duckdb/ub_src_core_functions_scalar_bit.cpp +2 -0
  232. package/src/duckdb/ub_src_core_functions_scalar_blob.cpp +4 -0
  233. package/src/duckdb/ub_src_core_functions_scalar_date.cpp +22 -0
  234. package/src/duckdb/ub_src_core_functions_scalar_enum.cpp +2 -0
  235. package/src/duckdb/ub_src_core_functions_scalar_generic.cpp +16 -0
  236. package/src/duckdb/ub_src_core_functions_scalar_list.cpp +14 -0
  237. package/src/duckdb/ub_src_core_functions_scalar_map.cpp +12 -0
  238. package/src/duckdb/ub_src_core_functions_scalar_math.cpp +2 -0
  239. package/src/duckdb/ub_src_core_functions_scalar_operators.cpp +2 -0
  240. package/src/duckdb/ub_src_core_functions_scalar_random.cpp +4 -0
  241. package/src/duckdb/ub_src_core_functions_scalar_string.cpp +44 -0
  242. package/src/duckdb/ub_src_core_functions_scalar_struct.cpp +4 -0
  243. package/src/duckdb/ub_src_core_functions_scalar_union.cpp +6 -0
  244. package/src/duckdb/ub_src_function_aggregate.cpp +0 -8
  245. package/src/duckdb/ub_src_function_aggregate_distributive.cpp +0 -24
  246. package/src/duckdb/ub_src_function_scalar.cpp +2 -8
  247. package/src/duckdb/ub_src_function_scalar_generic.cpp +0 -14
  248. package/src/duckdb/ub_src_function_scalar_list.cpp +0 -14
  249. package/src/duckdb/ub_src_function_scalar_operators.cpp +0 -2
  250. package/src/duckdb/ub_src_function_scalar_string.cpp +0 -42
  251. package/src/duckdb/ub_src_function_scalar_struct.cpp +0 -4
  252. package/src/duckdb/ub_src_function_scalar_system.cpp +0 -2
  253. package/src/duckdb/ub_src_main_extension.cpp +2 -0
  254. package/src/duckdb/src/function/aggregate/algebraic/corr.cpp +0 -14
  255. package/src/duckdb/src/function/aggregate/algebraic/covar.cpp +0 -25
  256. package/src/duckdb/src/function/aggregate/algebraic/stddev.cpp +0 -54
  257. package/src/duckdb/src/function/aggregate/algebraic_functions.cpp +0 -21
  258. package/src/duckdb/src/function/aggregate/holistic_functions.cpp +0 -12
  259. package/src/duckdb/src/function/aggregate/nested_functions.cpp +0 -10
  260. package/src/duckdb/src/function/aggregate/regression_functions.cpp +0 -21
  261. package/src/duckdb/src/function/scalar/date_functions.cpp +0 -22
  262. package/src/duckdb/src/function/scalar/enum_functions.cpp +0 -13
  263. package/src/duckdb/src/function/scalar/math_functions.cpp +0 -50
  264. package/src/duckdb/src/function/scalar/trigonometrics_functions.cpp +0 -18
  265. package/src/duckdb/src/include/duckdb/function/aggregate/algebraic_functions.hpp +0 -56
  266. package/src/duckdb/src/include/duckdb/function/aggregate/holistic_functions.hpp +0 -33
  267. package/src/duckdb/src/include/duckdb/function/aggregate/nested_functions.hpp +0 -26
  268. package/src/duckdb/src/include/duckdb/function/aggregate/regression_functions.hpp +0 -53
  269. package/src/duckdb/src/include/duckdb/function/scalar/bit_functions.hpp +0 -32
  270. package/src/duckdb/src/include/duckdb/function/scalar/blob_functions.hpp +0 -24
  271. package/src/duckdb/src/include/duckdb/function/scalar/date_functions.hpp +0 -73
  272. package/src/duckdb/src/include/duckdb/function/scalar/enum_functions.hpp +0 -37
  273. package/src/duckdb/src/include/duckdb/function/scalar/math_functions.hpp +0 -137
  274. package/src/duckdb/src/include/duckdb/function/scalar/trigonometric_functions.hpp +0 -49
  275. package/src/duckdb/ub_src_function_aggregate_algebraic.cpp +0 -8
  276. package/src/duckdb/ub_src_function_aggregate_holistic.cpp +0 -8
  277. package/src/duckdb/ub_src_function_aggregate_nested.cpp +0 -4
  278. package/src/duckdb/ub_src_function_aggregate_regression.cpp +0 -14
  279. package/src/duckdb/ub_src_function_scalar_bit.cpp +0 -2
  280. package/src/duckdb/ub_src_function_scalar_blob.cpp +0 -4
  281. package/src/duckdb/ub_src_function_scalar_date.cpp +0 -22
  282. package/src/duckdb/ub_src_function_scalar_enum.cpp +0 -2
  283. package/src/duckdb/ub_src_function_scalar_map.cpp +0 -12
  284. package/src/duckdb/ub_src_function_scalar_math.cpp +0 -6
  285. package/src/duckdb/ub_src_function_scalar_union.cpp +0 -6
  286. /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-dev2740.0",
5
+ "version": "0.7.2-dev2867.0",
6
6
  "description": "DuckDB node.js API",
7
7
  "gypfile": true,
8
8
  "dependencies": {
@@ -203,6 +203,14 @@ struct ICUDatePart : public ICUDateFunc {
203
203
  return Date::EpochToDate(ExtractEpoch(calendar, 0));
204
204
  }
205
205
 
206
+ static string_t MonthName(icu::Calendar *calendar, const uint64_t micros) {
207
+ return Date::MONTH_NAMES[ExtractMonth(calendar, micros) - 1];
208
+ }
209
+
210
+ static string_t DayName(icu::Calendar *calendar, const uint64_t micros) {
211
+ return Date::DAY_NAMES[ExtractDayOfWeek(calendar, micros)];
212
+ }
213
+
206
214
  template <typename RESULT_TYPE>
207
215
  struct BindAdapterData : public BindData {
208
216
  using result_t = RESULT_TYPE;
@@ -246,7 +254,7 @@ struct ICUDatePart : public ICUDateFunc {
246
254
  return info.adapters[0](calendar, micros);
247
255
  } else {
248
256
  mask.SetInvalid(idx);
249
- return RESULT_TYPE(0);
257
+ return RESULT_TYPE();
250
258
  }
251
259
  });
252
260
  }
@@ -482,6 +490,44 @@ struct ICUDatePart : public ICUDateFunc {
482
490
  CreateScalarFunctionInfo func_info(set);
483
491
  catalog.AddFunction(context, func_info);
484
492
  }
493
+
494
+ static unique_ptr<FunctionData> BindMonthName(ClientContext &context, ScalarFunction &bound_function,
495
+ vector<unique_ptr<Expression>> &arguments) {
496
+ using data_t = BindAdapterData<string_t>;
497
+ return BindAdapter<data_t>(context, bound_function, arguments, MonthName);
498
+ }
499
+
500
+ template <typename INPUT_TYPE>
501
+ static ScalarFunction GetMonthNameFunction(const LogicalType &temporal_type) {
502
+ return ScalarFunction({temporal_type}, LogicalType::VARCHAR, UnaryTimestampFunction<INPUT_TYPE, string_t>,
503
+ BindMonthName);
504
+ }
505
+ static void AddMonthNameFunctions(const string &name, ClientContext &context) {
506
+ auto &catalog = Catalog::GetSystemCatalog(context);
507
+ ScalarFunctionSet set(name);
508
+ set.AddFunction(GetMonthNameFunction<timestamp_t>(LogicalType::TIMESTAMP_TZ));
509
+ CreateScalarFunctionInfo func_info(set);
510
+ catalog.AddFunction(context, func_info);
511
+ }
512
+
513
+ static unique_ptr<FunctionData> BindDayName(ClientContext &context, ScalarFunction &bound_function,
514
+ vector<unique_ptr<Expression>> &arguments) {
515
+ using data_t = BindAdapterData<string_t>;
516
+ return BindAdapter<data_t>(context, bound_function, arguments, DayName);
517
+ }
518
+
519
+ template <typename INPUT_TYPE>
520
+ static ScalarFunction GetDayNameFunction(const LogicalType &temporal_type) {
521
+ return ScalarFunction({temporal_type}, LogicalType::VARCHAR, UnaryTimestampFunction<INPUT_TYPE, string_t>,
522
+ BindDayName);
523
+ }
524
+ static void AddDayNameFunctions(const string &name, ClientContext &context) {
525
+ auto &catalog = Catalog::GetSystemCatalog(context);
526
+ ScalarFunctionSet set(name);
527
+ set.AddFunction(GetDayNameFunction<timestamp_t>(LogicalType::TIMESTAMP_TZ));
528
+ CreateScalarFunctionInfo func_info(set);
529
+ catalog.AddFunction(context, func_info);
530
+ }
485
531
  };
486
532
 
487
533
  void RegisterICUDatePartFunctions(ClientContext &context) {
@@ -520,6 +566,10 @@ void RegisterICUDatePartFunctions(ClientContext &context) {
520
566
  // register the last_day function
521
567
  ICUDatePart::AddLastDayFunctions("last_day", context);
522
568
 
569
+ // register the dayname/monthname functions
570
+ ICUDatePart::AddMonthNameFunctions("monthname", context);
571
+ ICUDatePart::AddDayNameFunctions("dayname", context);
572
+
523
573
  // finally the actual date_part function
524
574
  ICUDatePart::AddDatePartFunctions("date_part", context);
525
575
  ICUDatePart::AddDatePartFunctions("datepart", context);
@@ -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