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.
- package/binding.gyp +21 -13
- package/package.json +1 -1
- package/src/duckdb/extension/icu/icu-datepart.cpp +51 -1
- package/src/duckdb/extension/icu/icu-strptime.cpp +1 -1
- package/src/duckdb/extension/json/include/json_functions.hpp +35 -37
- package/src/duckdb/extension/json/include/json_scan.hpp +1 -1
- package/src/duckdb/extension/json/include/json_transform.hpp +1 -1
- package/src/duckdb/extension/json/json-extension.cpp +10 -20
- package/src/duckdb/extension/json/json_functions/copy_json.cpp +2 -2
- package/src/duckdb/extension/json/json_functions/json_array_length.cpp +2 -3
- package/src/duckdb/extension/json/json_functions/json_contains.cpp +2 -2
- package/src/duckdb/extension/json/json_functions/json_create.cpp +20 -20
- package/src/duckdb/extension/json/json_functions/json_extract.cpp +4 -6
- package/src/duckdb/extension/json/json_functions/json_keys.cpp +2 -3
- package/src/duckdb/extension/json/json_functions/json_merge_patch.cpp +2 -2
- package/src/duckdb/extension/json/json_functions/json_serialize_sql.cpp +8 -8
- package/src/duckdb/extension/json/json_functions/json_structure.cpp +2 -2
- package/src/duckdb/extension/json/json_functions/json_transform.cpp +4 -4
- package/src/duckdb/extension/json/json_functions/json_type.cpp +2 -3
- package/src/duckdb/extension/json/json_functions/json_valid.cpp +2 -2
- package/src/duckdb/extension/json/json_functions/read_json.cpp +6 -6
- package/src/duckdb/extension/json/json_functions/read_json_objects.cpp +4 -4
- package/src/duckdb/extension/json/json_functions.cpp +6 -6
- package/src/duckdb/extension/parquet/parquet-extension.cpp +16 -28
- package/src/duckdb/src/catalog/catalog_entry/pragma_function_catalog_entry.cpp +1 -2
- package/src/duckdb/src/catalog/catalog_entry/scalar_function_catalog_entry.cpp +1 -1
- package/src/duckdb/src/catalog/catalog_entry/scalar_macro_catalog_entry.cpp +2 -2
- package/src/duckdb/src/catalog/catalog_entry/table_function_catalog_entry.cpp +1 -2
- package/src/duckdb/src/catalog/catalog_transaction.cpp +4 -0
- package/src/duckdb/src/catalog/duck_catalog.cpp +8 -1
- package/src/duckdb/src/common/enums/date_part_specifier.cpp +82 -0
- package/src/duckdb/src/common/local_file_system.cpp +1 -3
- package/src/duckdb/src/common/multi_file_reader.cpp +11 -8
- package/src/duckdb/src/common/types/vector.cpp +136 -3
- package/src/duckdb/src/{function → core_functions}/aggregate/algebraic/avg.cpp +9 -12
- package/src/duckdb/src/core_functions/aggregate/algebraic/corr.cpp +13 -0
- package/src/duckdb/src/core_functions/aggregate/algebraic/covar.cpp +21 -0
- package/src/duckdb/src/core_functions/aggregate/algebraic/stddev.cpp +34 -0
- package/src/duckdb/src/{function → core_functions}/aggregate/distributive/approx_count.cpp +3 -3
- package/src/duckdb/src/{function → core_functions}/aggregate/distributive/arg_min_max.cpp +7 -23
- package/src/duckdb/src/{function → core_functions}/aggregate/distributive/bitagg.cpp +10 -10
- package/src/duckdb/src/{function → core_functions}/aggregate/distributive/bitstring_agg.cpp +4 -4
- package/src/duckdb/src/{function → core_functions}/aggregate/distributive/bool.cpp +1 -17
- package/src/duckdb/src/{function → core_functions}/aggregate/distributive/entropy.cpp +5 -4
- package/src/duckdb/src/{function → core_functions}/aggregate/distributive/kurtosis.cpp +5 -6
- package/src/duckdb/src/{function → core_functions}/aggregate/distributive/minmax.cpp +5 -5
- package/src/duckdb/src/{function → core_functions}/aggregate/distributive/product.cpp +2 -11
- package/src/duckdb/src/{function → core_functions}/aggregate/distributive/skew.cpp +5 -6
- package/src/duckdb/src/{function → core_functions}/aggregate/distributive/string_agg.cpp +4 -6
- package/src/duckdb/src/{function → core_functions}/aggregate/distributive/sum.cpp +38 -46
- package/src/duckdb/src/{function → core_functions}/aggregate/holistic/approximate_quantile.cpp +4 -5
- package/src/duckdb/src/{function → core_functions}/aggregate/holistic/mode.cpp +4 -5
- package/src/duckdb/src/{function → core_functions}/aggregate/holistic/quantile.cpp +31 -23
- package/src/duckdb/src/{function → core_functions}/aggregate/holistic/reservoir_quantile.cpp +4 -5
- package/src/duckdb/src/{function → core_functions}/aggregate/nested/histogram.cpp +4 -4
- package/src/duckdb/src/{function → core_functions}/aggregate/nested/list.cpp +6 -10
- package/src/duckdb/src/{function → core_functions}/aggregate/regression/regr_avg.cpp +7 -11
- package/src/duckdb/src/{function → core_functions}/aggregate/regression/regr_count.cpp +4 -4
- package/src/duckdb/src/{function → core_functions}/aggregate/regression/regr_intercept.cpp +5 -8
- package/src/duckdb/src/{function → core_functions}/aggregate/regression/regr_r2.cpp +5 -7
- package/src/duckdb/src/{function → core_functions}/aggregate/regression/regr_slope.cpp +5 -7
- package/src/duckdb/src/{function → core_functions}/aggregate/regression/regr_sxx_syy.cpp +8 -12
- package/src/duckdb/src/{function → core_functions}/aggregate/regression/regr_sxy.cpp +6 -8
- package/src/duckdb/src/core_functions/core_functions.cpp +50 -0
- package/src/duckdb/src/core_functions/function_list.cpp +352 -0
- package/src/duckdb/src/{function → core_functions}/scalar/bit/bitstring.cpp +12 -15
- package/src/duckdb/src/{function → core_functions}/scalar/blob/base64.cpp +6 -6
- package/src/duckdb/src/{function → core_functions}/scalar/blob/encode.cpp +7 -6
- package/src/duckdb/src/{function → core_functions}/scalar/date/age.cpp +3 -3
- package/src/duckdb/src/{function → core_functions}/scalar/date/current.cpp +8 -8
- package/src/duckdb/src/{function → core_functions}/scalar/date/date_diff.cpp +3 -6
- package/src/duckdb/src/{function → core_functions}/scalar/date/date_part.cpp +144 -148
- package/src/duckdb/src/{function → core_functions}/scalar/date/date_sub.cpp +3 -6
- package/src/duckdb/src/{function → core_functions}/scalar/date/date_trunc.cpp +3 -6
- package/src/duckdb/src/{function → core_functions}/scalar/date/epoch.cpp +7 -8
- package/src/duckdb/src/{function → core_functions}/scalar/date/make_date.cpp +14 -14
- package/src/duckdb/src/core_functions/scalar/date/strftime.cpp +251 -0
- package/src/duckdb/src/{function → core_functions}/scalar/date/time_bucket.cpp +4 -5
- package/src/duckdb/src/{function → core_functions}/scalar/date/to_interval.cpp +39 -19
- package/src/duckdb/src/{function/scalar/enum/enum_functions_implementation.cpp → core_functions/scalar/enum/enum_functions.cpp} +18 -22
- package/src/duckdb/src/{function → core_functions}/scalar/generic/alias.cpp +4 -4
- package/src/duckdb/src/{function → core_functions}/scalar/generic/current_setting.cpp +4 -5
- package/src/duckdb/src/{function → core_functions}/scalar/generic/error.cpp +4 -4
- package/src/duckdb/src/{function → core_functions}/scalar/generic/hash.cpp +4 -4
- package/src/duckdb/src/{function → core_functions}/scalar/generic/least.cpp +8 -9
- package/src/duckdb/src/{function → core_functions}/scalar/generic/stats.cpp +4 -4
- package/src/duckdb/src/{function/scalar/system → core_functions/scalar/generic}/system_functions.cpp +24 -13
- package/src/duckdb/src/{function → core_functions}/scalar/generic/typeof.cpp +4 -4
- package/src/duckdb/src/{function → core_functions}/scalar/list/array_slice.cpp +3 -13
- package/src/duckdb/src/{function → core_functions}/scalar/list/flatten.cpp +5 -5
- package/src/duckdb/src/{function → core_functions}/scalar/list/list_aggregates.cpp +2 -13
- package/src/duckdb/src/{function → core_functions}/scalar/list/list_lambdas.cpp +9 -24
- package/src/duckdb/src/{function → core_functions}/scalar/list/list_sort.cpp +8 -22
- package/src/duckdb/src/{function → core_functions}/scalar/list/list_value.cpp +4 -5
- package/src/duckdb/src/{function → core_functions}/scalar/list/range.cpp +8 -6
- package/src/duckdb/src/{function → core_functions}/scalar/map/cardinality.cpp +5 -4
- package/src/duckdb/src/{function → core_functions}/scalar/map/map.cpp +6 -63
- package/src/duckdb/src/{function → core_functions}/scalar/map/map_entries.cpp +5 -4
- package/src/duckdb/src/{function → core_functions}/scalar/map/map_extract.cpp +22 -7
- package/src/duckdb/src/{function → core_functions}/scalar/map/map_from_entries.cpp +6 -5
- package/src/duckdb/src/{function → core_functions}/scalar/map/map_keys_values.cpp +8 -7
- package/src/duckdb/src/{function → core_functions}/scalar/math/numeric.cpp +110 -138
- package/src/duckdb/src/{function → core_functions}/scalar/operators/bitwise.cpp +19 -20
- package/src/duckdb/src/{function/scalar/math → core_functions/scalar/random}/random.cpp +5 -6
- package/src/duckdb/src/{function/scalar/math → core_functions/scalar/random}/setseed.cpp +3 -3
- package/src/duckdb/src/{function → core_functions}/scalar/string/ascii.cpp +4 -5
- package/src/duckdb/src/{function → core_functions}/scalar/string/bar.cpp +4 -4
- package/src/duckdb/src/{function → core_functions}/scalar/string/chr.cpp +5 -6
- package/src/duckdb/src/{function → core_functions}/scalar/string/damerau_levenshtein.cpp +4 -6
- package/src/duckdb/src/{function/scalar/string/mismatches.cpp → core_functions/scalar/string/hamming.cpp} +3 -12
- package/src/duckdb/src/{function → core_functions}/scalar/string/hex.cpp +15 -25
- package/src/duckdb/src/{function → core_functions}/scalar/string/instr.cpp +6 -13
- package/src/duckdb/src/{function → core_functions}/scalar/string/jaccard.cpp +3 -6
- package/src/duckdb/src/{function → core_functions}/scalar/string/jaro_winkler.cpp +7 -6
- package/src/duckdb/src/{function → core_functions}/scalar/string/left_right.cpp +18 -11
- package/src/duckdb/src/{function → core_functions}/scalar/string/levenshtein.cpp +3 -12
- package/src/duckdb/src/{function → core_functions}/scalar/string/md5.cpp +15 -21
- package/src/duckdb/src/{function → core_functions}/scalar/string/pad.cpp +7 -13
- package/src/duckdb/src/{function → core_functions}/scalar/string/printf.cpp +10 -10
- package/src/duckdb/src/{function → core_functions}/scalar/string/repeat.cpp +3 -6
- package/src/duckdb/src/{function → core_functions}/scalar/string/replace.cpp +4 -7
- package/src/duckdb/src/{function → core_functions}/scalar/string/reverse.cpp +3 -3
- package/src/duckdb/src/{function → core_functions}/scalar/string/starts_with.cpp +4 -8
- package/src/duckdb/src/{function → core_functions}/scalar/string/string_split.cpp +11 -11
- package/src/duckdb/src/{function → core_functions}/scalar/string/translate.cpp +4 -7
- package/src/duckdb/src/{function → core_functions}/scalar/string/trim.cpp +19 -14
- package/src/duckdb/src/core_functions/scalar/string/unicode.cpp +28 -0
- package/src/duckdb/src/{function → core_functions}/scalar/struct/struct_insert.cpp +4 -4
- package/src/duckdb/src/{function → core_functions}/scalar/struct/struct_pack.cpp +3 -4
- package/src/duckdb/src/{function → core_functions}/scalar/union/union_extract.cpp +4 -8
- package/src/duckdb/src/{function → core_functions}/scalar/union/union_tag.cpp +4 -8
- package/src/duckdb/src/{function → core_functions}/scalar/union/union_value.cpp +4 -59
- package/src/duckdb/src/execution/operator/persistent/base_csv_reader.cpp +1 -1
- package/src/duckdb/src/execution/operator/persistent/buffered_csv_reader.cpp +1 -1
- package/src/duckdb/src/execution/operator/persistent/parallel_csv_reader.cpp +1 -1
- package/src/duckdb/src/execution/operator/schema/physical_create_type.cpp +11 -2
- package/src/duckdb/src/function/aggregate/distributive_functions.cpp +0 -17
- package/src/duckdb/src/function/cast/string_cast.cpp +1 -1
- package/src/duckdb/src/function/function.cpp +0 -8
- package/src/duckdb/src/function/function_set.cpp +25 -0
- package/src/duckdb/src/function/scalar/generic_functions.cpp +1 -9
- package/src/duckdb/src/function/scalar/nested_functions.cpp +0 -22
- package/src/duckdb/src/function/scalar/operators.cpp +0 -6
- package/src/duckdb/src/function/scalar/{date/strftime.cpp → strftime_format.cpp} +1 -249
- package/src/duckdb/src/function/scalar/string/length.cpp +0 -19
- package/src/duckdb/src/function/scalar/string_functions.cpp +0 -40
- package/src/duckdb/src/function/scalar/system/aggregate_export.cpp +5 -0
- package/src/duckdb/src/function/table/arrow_conversion.cpp +1 -1
- package/src/duckdb/src/function/table/read_csv.cpp +7 -4
- package/src/duckdb/src/function/table/system/duckdb_functions.cpp +27 -40
- package/src/duckdb/src/function/table/version/pragma_version.cpp +2 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/aggregate_function_catalog_entry.hpp +3 -3
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/function_entry.hpp +33 -0
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/macro_catalog_entry.hpp +2 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/pragma_function_catalog_entry.hpp +2 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/scalar_function_catalog_entry.hpp +2 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_function_catalog_entry.hpp +2 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog_transaction.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/algorithm.hpp +1 -0
- package/src/duckdb/src/include/duckdb/common/multi_file_reader.hpp +5 -4
- package/src/duckdb/src/include/duckdb/common/types/vector.hpp +11 -1
- package/src/duckdb/src/include/duckdb/{function → core_functions}/aggregate/algebraic/corr.hpp +3 -4
- package/src/duckdb/src/include/duckdb/{function → core_functions}/aggregate/algebraic/covar.hpp +1 -1
- package/src/duckdb/src/include/duckdb/{function → core_functions}/aggregate/algebraic/stddev.hpp +1 -1
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/algebraic_functions.hpp +124 -0
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/distributive_functions.hpp +229 -0
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/holistic_functions.hpp +85 -0
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/nested_functions.hpp +41 -0
- package/src/duckdb/src/include/duckdb/{function → core_functions}/aggregate/regression/regr_count.hpp +3 -4
- package/src/duckdb/src/include/duckdb/{function → core_functions}/aggregate/regression/regr_slope.hpp +2 -2
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/regression_functions.hpp +97 -0
- package/src/duckdb/src/include/duckdb/{function → core_functions}/aggregate/sum_helpers.hpp +1 -1
- package/src/duckdb/src/include/duckdb/{function/scalar/uuid_functions.hpp → core_functions/core_functions.hpp} +7 -5
- package/src/duckdb/src/include/duckdb/core_functions/function_list.hpp +33 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/bit_functions.hpp +52 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/blob_functions.hpp +58 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/date_functions.hpp +544 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/enum_functions.hpp +61 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/generic_functions.hpp +142 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/list_functions.hpp +220 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/map_functions.hpp +85 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/math_functions.hpp +394 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/operators_functions.hpp +70 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/random_functions.hpp +49 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/string_functions.hpp +439 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/struct_functions.hpp +40 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/union_functions.hpp +43 -0
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/base_csv_reader.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/csv_reader_options.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_type.hpp +4 -0
- package/src/duckdb/src/include/duckdb/function/aggregate/distributive_functions.hpp +0 -85
- package/src/duckdb/src/include/duckdb/function/built_in_functions.hpp +0 -8
- package/src/duckdb/src/include/duckdb/function/function_set.hpp +7 -2
- package/src/duckdb/src/include/duckdb/function/scalar/generic_functions.hpp +1 -36
- package/src/duckdb/src/include/duckdb/function/scalar/nested_functions.hpp +0 -120
- package/src/duckdb/src/include/duckdb/function/scalar/operators.hpp +0 -24
- package/src/duckdb/src/include/duckdb/function/scalar/string_functions.hpp +1 -97
- package/src/duckdb/src/include/duckdb/function/table/read_csv.hpp +1 -1
- package/src/duckdb/src/include/duckdb/main/database.hpp +1 -0
- package/src/duckdb/src/include/duckdb/main/database_manager.hpp +3 -0
- package/src/duckdb/src/include/duckdb/main/extension_helper.hpp +0 -2
- package/src/duckdb/src/include/duckdb/main/extension_util.hpp +48 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_function_info.hpp +6 -0
- package/src/duckdb/src/include/duckdb/parser/tableref/pivotref.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/transformer.hpp +5 -1
- package/src/duckdb/src/main/attached_database.cpp +5 -3
- package/src/duckdb/src/main/database.cpp +34 -37
- package/src/duckdb/src/main/extension/extension_helper.cpp +1 -0
- package/src/duckdb/src/main/extension/extension_load.cpp +61 -38
- package/src/duckdb/src/main/extension/extension_util.cpp +90 -0
- package/src/duckdb/src/parser/transform/statement/transform_create_function.cpp +1 -4
- package/src/duckdb/src/parser/transform/statement/transform_create_view.cpp +2 -4
- package/src/duckdb/src/parser/transform/statement/transform_pivot_stmt.cpp +43 -24
- package/src/duckdb/src/parser/transform/tableref/transform_pivot.cpp +3 -0
- package/src/duckdb/src/planner/binder/statement/bind_create.cpp +17 -28
- package/src/duckdb/src/planner/binder/statement/bind_create_table.cpp +6 -7
- package/src/duckdb/third_party/fmt/format.cc +0 -5
- package/src/duckdb/third_party/fmt/include/fmt/core.h +10 -12
- package/src/duckdb/third_party/fmt/include/fmt/format-inl.h +2 -33
- package/src/duckdb/third_party/fmt/include/fmt/format.h +61 -24
- package/src/duckdb/third_party/fmt/include/fmt/printf.h +15 -1
- package/src/duckdb/third_party/libpg_query/include/nodes/parsenodes.hpp +1 -0
- package/src/duckdb/third_party/libpg_query/src_backend_parser_gram.cpp +10735 -10674
- package/src/duckdb/ub_src_common_enums.cpp +2 -0
- package/src/duckdb/ub_src_core_functions.cpp +4 -0
- package/src/duckdb/ub_src_core_functions_aggregate_algebraic.cpp +8 -0
- package/src/duckdb/ub_src_core_functions_aggregate_distributive.cpp +24 -0
- package/src/duckdb/ub_src_core_functions_aggregate_holistic.cpp +8 -0
- package/src/duckdb/ub_src_core_functions_aggregate_nested.cpp +4 -0
- package/src/duckdb/ub_src_core_functions_aggregate_regression.cpp +14 -0
- package/src/duckdb/ub_src_core_functions_scalar_bit.cpp +2 -0
- package/src/duckdb/ub_src_core_functions_scalar_blob.cpp +4 -0
- package/src/duckdb/ub_src_core_functions_scalar_date.cpp +22 -0
- package/src/duckdb/ub_src_core_functions_scalar_enum.cpp +2 -0
- package/src/duckdb/ub_src_core_functions_scalar_generic.cpp +16 -0
- package/src/duckdb/ub_src_core_functions_scalar_list.cpp +14 -0
- package/src/duckdb/ub_src_core_functions_scalar_map.cpp +12 -0
- package/src/duckdb/ub_src_core_functions_scalar_math.cpp +2 -0
- package/src/duckdb/ub_src_core_functions_scalar_operators.cpp +2 -0
- package/src/duckdb/ub_src_core_functions_scalar_random.cpp +4 -0
- package/src/duckdb/ub_src_core_functions_scalar_string.cpp +44 -0
- package/src/duckdb/ub_src_core_functions_scalar_struct.cpp +4 -0
- package/src/duckdb/ub_src_core_functions_scalar_union.cpp +6 -0
- package/src/duckdb/ub_src_function_aggregate.cpp +0 -8
- package/src/duckdb/ub_src_function_aggregate_distributive.cpp +0 -24
- package/src/duckdb/ub_src_function_scalar.cpp +2 -8
- package/src/duckdb/ub_src_function_scalar_generic.cpp +0 -14
- package/src/duckdb/ub_src_function_scalar_list.cpp +0 -14
- package/src/duckdb/ub_src_function_scalar_operators.cpp +0 -2
- package/src/duckdb/ub_src_function_scalar_string.cpp +0 -42
- package/src/duckdb/ub_src_function_scalar_struct.cpp +0 -4
- package/src/duckdb/ub_src_function_scalar_system.cpp +0 -2
- package/src/duckdb/ub_src_main_extension.cpp +2 -0
- package/src/duckdb/src/function/aggregate/algebraic/corr.cpp +0 -14
- package/src/duckdb/src/function/aggregate/algebraic/covar.cpp +0 -25
- package/src/duckdb/src/function/aggregate/algebraic/stddev.cpp +0 -54
- package/src/duckdb/src/function/aggregate/algebraic_functions.cpp +0 -21
- package/src/duckdb/src/function/aggregate/holistic_functions.cpp +0 -12
- package/src/duckdb/src/function/aggregate/nested_functions.cpp +0 -10
- package/src/duckdb/src/function/aggregate/regression_functions.cpp +0 -21
- package/src/duckdb/src/function/scalar/date_functions.cpp +0 -22
- package/src/duckdb/src/function/scalar/enum_functions.cpp +0 -13
- package/src/duckdb/src/function/scalar/math_functions.cpp +0 -50
- package/src/duckdb/src/function/scalar/trigonometrics_functions.cpp +0 -18
- package/src/duckdb/src/include/duckdb/function/aggregate/algebraic_functions.hpp +0 -56
- package/src/duckdb/src/include/duckdb/function/aggregate/holistic_functions.hpp +0 -33
- package/src/duckdb/src/include/duckdb/function/aggregate/nested_functions.hpp +0 -26
- package/src/duckdb/src/include/duckdb/function/aggregate/regression_functions.hpp +0 -53
- package/src/duckdb/src/include/duckdb/function/scalar/bit_functions.hpp +0 -32
- package/src/duckdb/src/include/duckdb/function/scalar/blob_functions.hpp +0 -24
- package/src/duckdb/src/include/duckdb/function/scalar/date_functions.hpp +0 -73
- package/src/duckdb/src/include/duckdb/function/scalar/enum_functions.hpp +0 -37
- package/src/duckdb/src/include/duckdb/function/scalar/math_functions.hpp +0 -137
- package/src/duckdb/src/include/duckdb/function/scalar/trigonometric_functions.hpp +0 -49
- package/src/duckdb/ub_src_function_aggregate_algebraic.cpp +0 -8
- package/src/duckdb/ub_src_function_aggregate_holistic.cpp +0 -8
- package/src/duckdb/ub_src_function_aggregate_nested.cpp +0 -4
- package/src/duckdb/ub_src_function_aggregate_regression.cpp +0 -14
- package/src/duckdb/ub_src_function_scalar_bit.cpp +0 -2
- package/src/duckdb/ub_src_function_scalar_blob.cpp +0 -4
- package/src/duckdb/ub_src_function_scalar_date.cpp +0 -22
- package/src/duckdb/ub_src_function_scalar_enum.cpp +0 -2
- package/src/duckdb/ub_src_function_scalar_map.cpp +0 -12
- package/src/duckdb/ub_src_function_scalar_math.cpp +0 -6
- package/src/duckdb/ub_src_function_scalar_union.cpp +0 -6
- /package/src/duckdb/src/include/duckdb/function/scalar/{strftime.hpp → strftime_format.hpp} +0 -0
@@ -63,14 +63,18 @@ public:
|
|
63
63
|
|
64
64
|
class ScalarFunctionSet : public FunctionSet<ScalarFunction> {
|
65
65
|
public:
|
66
|
+
DUCKDB_API explicit ScalarFunctionSet();
|
66
67
|
DUCKDB_API explicit ScalarFunctionSet(string name);
|
68
|
+
DUCKDB_API explicit ScalarFunctionSet(ScalarFunction fun);
|
67
69
|
|
68
70
|
DUCKDB_API ScalarFunction GetFunctionByArguments(ClientContext &context, const vector<LogicalType> &arguments);
|
69
71
|
};
|
70
72
|
|
71
73
|
class AggregateFunctionSet : public FunctionSet<AggregateFunction> {
|
72
74
|
public:
|
75
|
+
DUCKDB_API explicit AggregateFunctionSet();
|
73
76
|
DUCKDB_API explicit AggregateFunctionSet(string name);
|
77
|
+
DUCKDB_API explicit AggregateFunctionSet(AggregateFunction fun);
|
74
78
|
|
75
79
|
DUCKDB_API AggregateFunction GetFunctionByArguments(ClientContext &context, const vector<LogicalType> &arguments);
|
76
80
|
};
|
@@ -78,14 +82,15 @@ public:
|
|
78
82
|
class TableFunctionSet : public FunctionSet<TableFunction> {
|
79
83
|
public:
|
80
84
|
DUCKDB_API explicit TableFunctionSet(string name);
|
85
|
+
DUCKDB_API explicit TableFunctionSet(TableFunction fun);
|
81
86
|
|
82
87
|
TableFunction GetFunctionByArguments(ClientContext &context, const vector<LogicalType> &arguments);
|
83
88
|
};
|
84
89
|
|
85
90
|
class PragmaFunctionSet : public FunctionSet<PragmaFunction> {
|
86
91
|
public:
|
87
|
-
explicit PragmaFunctionSet(string name)
|
88
|
-
|
92
|
+
DUCKDB_API explicit PragmaFunctionSet(string name);
|
93
|
+
DUCKDB_API explicit PragmaFunctionSet(PragmaFunction fun);
|
89
94
|
};
|
90
95
|
|
91
96
|
} // namespace duckdb
|
@@ -15,34 +15,6 @@
|
|
15
15
|
namespace duckdb {
|
16
16
|
class BoundFunctionExpression;
|
17
17
|
|
18
|
-
struct AliasFun {
|
19
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
20
|
-
};
|
21
|
-
|
22
|
-
struct HashFun {
|
23
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
24
|
-
};
|
25
|
-
|
26
|
-
struct LeastFun {
|
27
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
28
|
-
};
|
29
|
-
|
30
|
-
struct GreatestFun {
|
31
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
32
|
-
};
|
33
|
-
|
34
|
-
struct StatsFun {
|
35
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
36
|
-
};
|
37
|
-
|
38
|
-
struct TypeOfFun {
|
39
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
40
|
-
};
|
41
|
-
|
42
|
-
struct ErrorFun {
|
43
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
44
|
-
};
|
45
|
-
|
46
18
|
struct ConstantOrNull {
|
47
19
|
static ScalarFunction GetFunction(const LogicalType &return_type);
|
48
20
|
static unique_ptr<FunctionData> Bind(Value value);
|
@@ -50,14 +22,6 @@ struct ConstantOrNull {
|
|
50
22
|
static void RegisterFunction(BuiltinFunctions &set);
|
51
23
|
};
|
52
24
|
|
53
|
-
struct CurrentSettingFun {
|
54
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
55
|
-
};
|
56
|
-
|
57
|
-
struct SystemFun {
|
58
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
59
|
-
};
|
60
|
-
|
61
25
|
struct ExportAggregateFunctionBindData : public FunctionData {
|
62
26
|
unique_ptr<BoundAggregateExpression> aggregate;
|
63
27
|
explicit ExportAggregateFunctionBindData(unique_ptr<Expression> aggregate_p);
|
@@ -69,6 +33,7 @@ struct ExportAggregateFunction {
|
|
69
33
|
static unique_ptr<BoundAggregateExpression> Bind(unique_ptr<BoundAggregateExpression> child_aggregate);
|
70
34
|
static ScalarFunction GetCombine();
|
71
35
|
static ScalarFunction GetFinalize();
|
36
|
+
static void RegisterFunction(BuiltinFunctions &set);
|
72
37
|
};
|
73
38
|
|
74
39
|
} // namespace duckdb
|
@@ -18,9 +18,6 @@
|
|
18
18
|
|
19
19
|
namespace duckdb {
|
20
20
|
|
21
|
-
enum class MapInvalidReason : uint8_t { VALID, NULL_KEY_LIST, NULL_KEY, DUPLICATE_KEY };
|
22
|
-
enum class UnionInvalidReason : uint8_t { VALID, TAG_OUT_OF_RANGE, NO_MEMBERS, VALIDITY_OVERLAP };
|
23
|
-
|
24
21
|
struct ListArgFunctor {
|
25
22
|
static Vector &GetList(Vector &list) {
|
26
23
|
return list;
|
@@ -33,22 +30,6 @@ struct ListArgFunctor {
|
|
33
30
|
}
|
34
31
|
};
|
35
32
|
|
36
|
-
struct MapKeyArgFunctor {
|
37
|
-
// MAP is a LIST(STRUCT(K,V))
|
38
|
-
// meaning the MAP itself is a List, but the child vector that we're interested in (the keys)
|
39
|
-
// are a level deeper than the initial child vector
|
40
|
-
|
41
|
-
static Vector &GetList(Vector &map) {
|
42
|
-
return map;
|
43
|
-
}
|
44
|
-
static idx_t GetListSize(Vector &map) {
|
45
|
-
return ListVector::GetListSize(map);
|
46
|
-
}
|
47
|
-
static Vector &GetEntry(Vector &map) {
|
48
|
-
return MapVector::GetKeys(map);
|
49
|
-
}
|
50
|
-
};
|
51
|
-
|
52
33
|
struct ContainsFunctor {
|
53
34
|
static inline bool Initialize() {
|
54
35
|
return false;
|
@@ -99,76 +80,10 @@ struct HistogramAggState {
|
|
99
80
|
MAP_TYPE *hist;
|
100
81
|
};
|
101
82
|
|
102
|
-
struct ArraySliceFun {
|
103
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
104
|
-
};
|
105
|
-
|
106
|
-
struct StructPackFun {
|
107
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
108
|
-
};
|
109
|
-
|
110
|
-
struct StructInsertFun {
|
111
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
112
|
-
};
|
113
|
-
|
114
|
-
struct ListValueFun {
|
115
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
116
|
-
};
|
117
|
-
|
118
|
-
struct ListRangeFun {
|
119
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
120
|
-
};
|
121
|
-
|
122
|
-
struct MapFun {
|
123
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
124
|
-
};
|
125
|
-
|
126
|
-
struct MapFromEntriesFun {
|
127
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
128
|
-
};
|
129
|
-
|
130
|
-
struct MapEntriesFun {
|
131
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
132
|
-
};
|
133
|
-
|
134
|
-
struct MapValuesFun {
|
135
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
136
|
-
};
|
137
|
-
|
138
|
-
struct MapKeysFun {
|
139
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
140
|
-
};
|
141
|
-
|
142
|
-
struct MapExtractFun {
|
143
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
144
|
-
};
|
145
|
-
|
146
|
-
struct UnionValueFun {
|
147
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
148
|
-
};
|
149
|
-
|
150
|
-
struct UnionExtractFun {
|
151
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
152
|
-
};
|
153
|
-
|
154
|
-
struct UnionTagFun {
|
155
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
156
|
-
};
|
157
|
-
|
158
83
|
struct ListExtractFun {
|
159
84
|
static void RegisterFunction(BuiltinFunctions &set);
|
160
85
|
};
|
161
86
|
|
162
|
-
struct ListTransformFun {
|
163
|
-
static ScalarFunction GetFunction();
|
164
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
165
|
-
};
|
166
|
-
|
167
|
-
struct ListFilterFun {
|
168
|
-
static ScalarFunction GetFunction();
|
169
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
170
|
-
};
|
171
|
-
|
172
87
|
struct ListConcatFun {
|
173
88
|
static ScalarFunction GetFunction();
|
174
89
|
static void RegisterFunction(BuiltinFunctions &set);
|
@@ -179,49 +94,14 @@ struct ListContainsFun {
|
|
179
94
|
static void RegisterFunction(BuiltinFunctions &set);
|
180
95
|
};
|
181
96
|
|
182
|
-
struct ListFlattenFun {
|
183
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
184
|
-
};
|
185
|
-
|
186
97
|
struct ListPositionFun {
|
187
98
|
static ScalarFunction GetFunction();
|
188
99
|
static void RegisterFunction(BuiltinFunctions &set);
|
189
100
|
};
|
190
101
|
|
191
|
-
struct ListAggregateFun {
|
192
|
-
static ScalarFunction GetFunction();
|
193
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
194
|
-
};
|
195
|
-
|
196
|
-
struct ListDistinctFun {
|
197
|
-
static ScalarFunction GetFunction();
|
198
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
199
|
-
};
|
200
|
-
|
201
|
-
struct ListUniqueFun {
|
202
|
-
static ScalarFunction GetFunction();
|
203
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
204
|
-
};
|
205
|
-
|
206
|
-
struct ListSortFun {
|
207
|
-
static ScalarFunction GetFunction();
|
208
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
209
|
-
};
|
210
|
-
|
211
|
-
struct CardinalityFun {
|
212
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
213
|
-
};
|
214
|
-
|
215
102
|
struct StructExtractFun {
|
216
103
|
static ScalarFunction GetFunction();
|
217
104
|
static void RegisterFunction(BuiltinFunctions &set);
|
218
105
|
};
|
219
106
|
|
220
|
-
MapInvalidReason CheckMapValidity(Vector &map, idx_t count,
|
221
|
-
const SelectionVector &sel = *FlatVector::IncrementalSelectionVector());
|
222
|
-
void MapConversionVerify(Vector &vector, idx_t count);
|
223
|
-
|
224
|
-
UnionInvalidReason CheckUnionValidity(Vector &vector, idx_t count,
|
225
|
-
const SelectionVector &sel = *FlatVector::IncrementalSelectionVector());
|
226
|
-
|
227
107
|
} // namespace duckdb
|
@@ -38,28 +38,4 @@ struct ModFun {
|
|
38
38
|
static void RegisterFunction(BuiltinFunctions &set);
|
39
39
|
};
|
40
40
|
|
41
|
-
struct LeftShiftFun {
|
42
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
43
|
-
};
|
44
|
-
|
45
|
-
struct RightShiftFun {
|
46
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
47
|
-
};
|
48
|
-
|
49
|
-
struct BitwiseAndFun {
|
50
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
51
|
-
};
|
52
|
-
|
53
|
-
struct BitwiseOrFun {
|
54
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
55
|
-
};
|
56
|
-
|
57
|
-
struct BitwiseXorFun {
|
58
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
59
|
-
};
|
60
|
-
|
61
|
-
struct BitwiseNotFun {
|
62
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
63
|
-
};
|
64
|
-
|
65
41
|
} // namespace duckdb
|
@@ -18,10 +18,6 @@ class RE2;
|
|
18
18
|
|
19
19
|
namespace duckdb {
|
20
20
|
|
21
|
-
struct ReverseFun {
|
22
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
23
|
-
};
|
24
|
-
|
25
21
|
struct LowerFun {
|
26
22
|
static uint8_t ascii_to_lower_map[];
|
27
23
|
|
@@ -96,75 +92,27 @@ struct LikeEscapeFun {
|
|
96
92
|
static void RegisterFunction(BuiltinFunctions &set);
|
97
93
|
};
|
98
94
|
|
99
|
-
struct LpadFun {
|
100
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
101
|
-
};
|
102
|
-
|
103
|
-
struct LeftFun {
|
104
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
105
|
-
};
|
106
|
-
|
107
|
-
struct MD5Fun {
|
108
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
109
|
-
};
|
110
|
-
|
111
95
|
struct NFCNormalizeFun {
|
112
96
|
static ScalarFunction GetFunction();
|
113
97
|
static void RegisterFunction(BuiltinFunctions &set);
|
114
98
|
};
|
115
99
|
|
116
|
-
struct RightFun {
|
117
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
118
|
-
};
|
119
|
-
|
120
|
-
struct RegexpFun {
|
121
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
122
|
-
};
|
123
|
-
|
124
100
|
struct SubstringFun {
|
125
101
|
static void RegisterFunction(BuiltinFunctions &set);
|
126
102
|
static string_t SubstringUnicode(Vector &result, string_t input, int64_t offset, int64_t length);
|
127
103
|
static string_t SubstringGrapheme(Vector &result, string_t input, int64_t offset, int64_t length);
|
128
104
|
};
|
129
105
|
|
130
|
-
struct PrintfFun {
|
131
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
132
|
-
};
|
133
|
-
|
134
|
-
struct InstrFun {
|
135
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
136
|
-
};
|
137
|
-
|
138
106
|
struct PrefixFun {
|
139
107
|
static ScalarFunction GetFunction();
|
140
108
|
static void RegisterFunction(BuiltinFunctions &set);
|
141
109
|
};
|
142
110
|
|
143
|
-
struct RepeatFun {
|
144
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
145
|
-
};
|
146
|
-
|
147
|
-
struct ReplaceFun {
|
148
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
149
|
-
};
|
150
|
-
|
151
|
-
struct TranslateFun {
|
152
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
153
|
-
};
|
154
|
-
|
155
|
-
struct RpadFun {
|
156
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
157
|
-
};
|
158
|
-
|
159
111
|
struct SuffixFun {
|
160
112
|
static ScalarFunction GetFunction();
|
161
113
|
static void RegisterFunction(BuiltinFunctions &set);
|
162
114
|
};
|
163
115
|
|
164
|
-
struct TrimFun {
|
165
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
166
|
-
};
|
167
|
-
|
168
116
|
struct ContainsFun {
|
169
117
|
static ScalarFunction GetFunction();
|
170
118
|
static void RegisterFunction(BuiltinFunctions &set);
|
@@ -173,51 +121,7 @@ struct ContainsFun {
|
|
173
121
|
idx_t needle_size);
|
174
122
|
};
|
175
123
|
|
176
|
-
struct
|
177
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
178
|
-
};
|
179
|
-
|
180
|
-
struct UnicodeFun {
|
181
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
182
|
-
};
|
183
|
-
|
184
|
-
struct StringSplitFun {
|
185
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
186
|
-
};
|
187
|
-
|
188
|
-
struct BarFun {
|
189
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
190
|
-
};
|
191
|
-
|
192
|
-
struct ASCII {
|
193
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
194
|
-
};
|
195
|
-
|
196
|
-
struct CHR {
|
197
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
198
|
-
};
|
199
|
-
|
200
|
-
struct MismatchesFun {
|
201
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
202
|
-
};
|
203
|
-
|
204
|
-
struct LevenshteinFun {
|
205
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
206
|
-
};
|
207
|
-
|
208
|
-
struct DamerauLevenshteinFun {
|
209
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
210
|
-
};
|
211
|
-
|
212
|
-
struct JaccardFun {
|
213
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
214
|
-
};
|
215
|
-
|
216
|
-
struct JaroWinklerFun {
|
217
|
-
static void RegisterFunction(BuiltinFunctions &set);
|
218
|
-
};
|
219
|
-
|
220
|
-
struct HexFun {
|
124
|
+
struct RegexpFun {
|
221
125
|
static void RegisterFunction(BuiltinFunctions &set);
|
222
126
|
};
|
223
127
|
|
@@ -9,7 +9,7 @@
|
|
9
9
|
#pragma once
|
10
10
|
|
11
11
|
#include "duckdb/function/table_function.hpp"
|
12
|
-
#include "duckdb/function/scalar/
|
12
|
+
#include "duckdb/function/scalar/strftime_format.hpp"
|
13
13
|
#include "duckdb/execution/operator/persistent/csv_reader_options.hpp"
|
14
14
|
#include "duckdb/execution/operator/persistent/buffered_csv_reader.hpp"
|
15
15
|
#include "duckdb/execution/operator/persistent/parallel_csv_reader.hpp"
|
@@ -56,8 +56,6 @@ public:
|
|
56
56
|
|
57
57
|
static const vector<string> GetPublicKeys();
|
58
58
|
|
59
|
-
static void StorageInit(string &extension, DBConfig &config);
|
60
|
-
|
61
59
|
// Returns extension name, or empty string if not a replacement open path
|
62
60
|
static string ExtractExtensionPrefixFromPath(const string &path);
|
63
61
|
|
@@ -0,0 +1,48 @@
|
|
1
|
+
//===----------------------------------------------------------------------===//
|
2
|
+
// DuckDB
|
3
|
+
//
|
4
|
+
// duckdb/main/extension_util.hpp
|
5
|
+
//
|
6
|
+
//
|
7
|
+
//===----------------------------------------------------------------------===//
|
8
|
+
|
9
|
+
#pragma once
|
10
|
+
|
11
|
+
#include "duckdb/common/constants.hpp"
|
12
|
+
#include "duckdb/function/cast/cast_function_set.hpp"
|
13
|
+
#include "duckdb/function/function_set.hpp"
|
14
|
+
|
15
|
+
namespace duckdb {
|
16
|
+
struct CreateMacroInfo;
|
17
|
+
class DatabaseInstance;
|
18
|
+
|
19
|
+
//! The ExtensionUtil class contains methods that are useful for extensions
|
20
|
+
class ExtensionUtil {
|
21
|
+
public:
|
22
|
+
//! Register a new scalar function - throw an exception if the function already exists
|
23
|
+
DUCKDB_API static void RegisterFunction(DatabaseInstance &db, ScalarFunction function);
|
24
|
+
//! Register a new scalar function set - throw an exception if the function already exists
|
25
|
+
DUCKDB_API static void RegisterFunction(DatabaseInstance &db, ScalarFunctionSet function);
|
26
|
+
//! Register a new table function - throw an exception if the function already exists
|
27
|
+
DUCKDB_API static void RegisterFunction(DatabaseInstance &db, TableFunction function);
|
28
|
+
//! Register a new table function set - throw an exception if the function already exists
|
29
|
+
DUCKDB_API static void RegisterFunction(DatabaseInstance &db, TableFunctionSet function);
|
30
|
+
//! Register a new pragma function - throw an exception if the function already exists
|
31
|
+
DUCKDB_API static void RegisterFunction(DatabaseInstance &db, PragmaFunction function);
|
32
|
+
//! Register a new pragma function set - throw an exception if the function already exists
|
33
|
+
DUCKDB_API static void RegisterFunction(DatabaseInstance &db, PragmaFunctionSet function);
|
34
|
+
//! Register a new copy function - throw an exception if the function already exists
|
35
|
+
DUCKDB_API static void RegisterFunction(DatabaseInstance &db, CopyFunction function);
|
36
|
+
//! Register a new macro function - throw an exception if the function already exists
|
37
|
+
DUCKDB_API static void RegisterFunction(DatabaseInstance &db, CreateMacroInfo &info);
|
38
|
+
|
39
|
+
//! Registers a new type
|
40
|
+
DUCKDB_API static void RegisterType(DatabaseInstance &db, string type_name, LogicalType type);
|
41
|
+
|
42
|
+
//! Registers a cast between two types
|
43
|
+
DUCKDB_API static void RegisterCastFunction(DatabaseInstance &db, const LogicalType &source,
|
44
|
+
const LogicalType &target, BoundCastInfo function,
|
45
|
+
int64_t implicit_cast_cost = -1);
|
46
|
+
};
|
47
|
+
|
48
|
+
} // namespace duckdb
|
@@ -22,6 +22,12 @@ struct CreateFunctionInfo : public CreateInfo {
|
|
22
22
|
|
23
23
|
//! Function name
|
24
24
|
string name;
|
25
|
+
//! The description (if any)
|
26
|
+
string description;
|
27
|
+
//! Parameter names (if any)
|
28
|
+
vector<string> parameter_names;
|
29
|
+
//! The example (if any)
|
30
|
+
string example;
|
25
31
|
|
26
32
|
protected:
|
27
33
|
void SerializeInternal(Serializer &serializer) const override {
|
@@ -9,6 +9,7 @@
|
|
9
9
|
#pragma once
|
10
10
|
|
11
11
|
#include "duckdb/parser/tableref.hpp"
|
12
|
+
#include "duckdb/parser/query_node/select_node.hpp"
|
12
13
|
|
13
14
|
namespace duckdb {
|
14
15
|
|
@@ -43,6 +44,8 @@ struct PivotColumn {
|
|
43
44
|
vector<PivotColumnEntry> entries;
|
44
45
|
//! The enum to read pivot values from (if any)
|
45
46
|
string pivot_enum;
|
47
|
+
//! Subquery (if any) - used during transform only
|
48
|
+
unique_ptr<QueryNode> subquery;
|
46
49
|
|
47
50
|
string ToString() const;
|
48
51
|
bool Equals(const PivotColumn &other) const;
|
@@ -45,6 +45,7 @@ class Transformer {
|
|
45
45
|
string enum_name;
|
46
46
|
unique_ptr<SelectNode> base;
|
47
47
|
unique_ptr<ParsedExpression> column;
|
48
|
+
unique_ptr<QueryNode> subquery;
|
48
49
|
};
|
49
50
|
|
50
51
|
public:
|
@@ -85,10 +86,13 @@ private:
|
|
85
86
|
bool GetNamedParam(const string &name, int32_t &index);
|
86
87
|
bool HasNamedParameters() const;
|
87
88
|
|
88
|
-
void AddPivotEntry(string enum_name, unique_ptr<SelectNode> source, unique_ptr<ParsedExpression> column
|
89
|
+
void AddPivotEntry(string enum_name, unique_ptr<SelectNode> source, unique_ptr<ParsedExpression> column,
|
90
|
+
unique_ptr<QueryNode> subquery);
|
89
91
|
unique_ptr<SQLStatement> GenerateCreateEnumStmt(unique_ptr<CreatePivotEntry> entry);
|
90
92
|
bool HasPivotEntries();
|
91
93
|
idx_t PivotEntryCount();
|
94
|
+
vector<unique_ptr<CreatePivotEntry>> &GetPivotEntries();
|
95
|
+
void PivotEntryCheck(const string &type);
|
92
96
|
void ExtractCTEsRecursive(CommonTableExpressionMap &cte_map);
|
93
97
|
|
94
98
|
private:
|
@@ -1,9 +1,11 @@
|
|
1
1
|
#include "duckdb/main/attached_database.hpp"
|
2
|
-
|
3
|
-
#include "duckdb/transaction/duck_transaction_manager.hpp"
|
4
|
-
#include "duckdb/common/file_system.hpp"
|
2
|
+
|
5
3
|
#include "duckdb/catalog/duck_catalog.hpp"
|
4
|
+
#include "duckdb/common/file_system.hpp"
|
5
|
+
#include "duckdb/parser/parsed_data/attach_info.hpp"
|
6
6
|
#include "duckdb/storage/storage_extension.hpp"
|
7
|
+
#include "duckdb/storage/storage_manager.hpp"
|
8
|
+
#include "duckdb/transaction/duck_transaction_manager.hpp"
|
7
9
|
|
8
10
|
namespace duckdb {
|
9
11
|
|
@@ -149,8 +149,9 @@ duckdb::unique_ptr<AttachedDatabase> DatabaseInstance::CreateAttachedDatabase(At
|
|
149
149
|
AccessMode access_mode) {
|
150
150
|
duckdb::unique_ptr<AttachedDatabase> attached_database;
|
151
151
|
if (!type.empty()) {
|
152
|
-
// find the storage
|
153
|
-
auto
|
152
|
+
// find the storage extension
|
153
|
+
auto extension_name = ExtensionHelper::ApplyExtensionAlias(type);
|
154
|
+
auto entry = config.storage_extensions.find(extension_name);
|
154
155
|
if (entry == config.storage_extensions.end()) {
|
155
156
|
throw BinderException("Unrecognized storage type \"%s\"", type);
|
156
157
|
}
|
@@ -171,6 +172,33 @@ duckdb::unique_ptr<AttachedDatabase> DatabaseInstance::CreateAttachedDatabase(At
|
|
171
172
|
return attached_database;
|
172
173
|
}
|
173
174
|
|
175
|
+
void DatabaseInstance::CreateDatabase(const string &database_type) {
|
176
|
+
AttachInfo info;
|
177
|
+
info.name = AttachedDatabase::ExtractDatabaseName(config.options.database_path);
|
178
|
+
info.path = config.options.database_path;
|
179
|
+
|
180
|
+
auto attached_database = CreateAttachedDatabase(info, database_type, config.options.access_mode);
|
181
|
+
auto initial_database = attached_database.get();
|
182
|
+
{
|
183
|
+
Connection con(*this);
|
184
|
+
con.BeginTransaction();
|
185
|
+
db_manager->AddDatabase(*con.context, std::move(attached_database));
|
186
|
+
con.Commit();
|
187
|
+
}
|
188
|
+
|
189
|
+
// initialize the database
|
190
|
+
initial_database->Initialize();
|
191
|
+
}
|
192
|
+
|
193
|
+
void ThrowExtensionSetUnrecognizedOptions(const unordered_map<string, Value> &unrecognized_options) {
|
194
|
+
auto unrecognized_options_iter = unrecognized_options.begin();
|
195
|
+
string unrecognized_option_keys = unrecognized_options_iter->first;
|
196
|
+
for (; unrecognized_options_iter == unrecognized_options.end(); ++unrecognized_options_iter) {
|
197
|
+
unrecognized_option_keys = "," + unrecognized_options_iter->first;
|
198
|
+
}
|
199
|
+
throw InvalidInputException("Unrecognized configuration property \"%s\"", unrecognized_option_keys);
|
200
|
+
}
|
201
|
+
|
174
202
|
void DatabaseInstance::Initialize(const char *database_path, DBConfig *user_config) {
|
175
203
|
DBConfig default_config;
|
176
204
|
DBConfig *config_ptr = &default_config;
|
@@ -208,27 +236,9 @@ void DatabaseInstance::Initialize(const char *database_path, DBConfig *user_conf
|
|
208
236
|
|
209
237
|
// check if we are opening a standard DuckDB database or an extension database
|
210
238
|
auto database_type = ExtractDatabaseType(config.options.database_path);
|
211
|
-
if (!database_type.empty()) {
|
212
|
-
// we are opening an extension database, run storage_init
|
213
|
-
ExtensionHelper::StorageInit(database_type, config);
|
214
|
-
}
|
215
|
-
AttachInfo info;
|
216
|
-
info.name = AttachedDatabase::ExtractDatabaseName(config.options.database_path);
|
217
|
-
info.path = config.options.database_path;
|
218
|
-
|
219
|
-
auto attached_database = CreateAttachedDatabase(info, database_type, config.options.access_mode);
|
220
|
-
auto initial_database = attached_database.get();
|
221
|
-
{
|
222
|
-
Connection con(*this);
|
223
|
-
con.BeginTransaction();
|
224
|
-
db_manager->AddDatabase(*con.context, std::move(attached_database));
|
225
|
-
con.Commit();
|
226
|
-
}
|
227
239
|
|
228
240
|
// initialize the system catalog
|
229
241
|
db_manager->InitializeSystemCatalog();
|
230
|
-
// initialize the database
|
231
|
-
initial_database->Initialize();
|
232
242
|
|
233
243
|
if (!database_type.empty()) {
|
234
244
|
// if we are opening an extension database - load the extension
|
@@ -236,24 +246,11 @@ void DatabaseInstance::Initialize(const char *database_path, DBConfig *user_conf
|
|
236
246
|
}
|
237
247
|
|
238
248
|
if (!config.options.unrecognized_options.empty()) {
|
239
|
-
|
240
|
-
|
241
|
-
auto entry = config.extension_parameters.find(unrecognized_option.first);
|
242
|
-
if (entry == config.extension_parameters.end()) {
|
243
|
-
throw InvalidInputException("Unrecognized configuration property \"%s\"", unrecognized_option.first);
|
244
|
-
}
|
245
|
-
}
|
249
|
+
ThrowExtensionSetUnrecognizedOptions(config.options.unrecognized_options);
|
250
|
+
}
|
246
251
|
|
247
|
-
|
248
|
-
|
249
|
-
con.BeginTransaction();
|
250
|
-
for (auto &unrecognized_option : config.options.unrecognized_options) {
|
251
|
-
auto entry = config.extension_parameters.find(unrecognized_option.first);
|
252
|
-
D_ASSERT(entry != config.extension_parameters.end());
|
253
|
-
PhysicalSet::SetExtensionVariable(*con.context, entry->second, unrecognized_option.first, SetScope::GLOBAL,
|
254
|
-
unrecognized_option.second);
|
255
|
-
}
|
256
|
-
con.Commit();
|
252
|
+
if (!db_manager->HasDefaultDatabase()) {
|
253
|
+
CreateDatabase(database_type);
|
257
254
|
}
|
258
255
|
|
259
256
|
// only increase thread count after storage init because we get races on catalog otherwise
|
@@ -109,6 +109,7 @@ static DefaultExtension internal_extensions[] = {
|
|
109
109
|
{"sqlite_scanner", "Adds support for reading SQLite database files", false},
|
110
110
|
{"postgres_scanner", "Adds support for reading from a Postgres database", false},
|
111
111
|
{"inet", "Adds support for IP-related data types and functions", false},
|
112
|
+
{"spatial", "Geospatial extension that adds support for working with spatial data and functions", false},
|
112
113
|
{nullptr, nullptr, false}};
|
113
114
|
|
114
115
|
idx_t ExtensionHelper::DefaultExtensionCount() {
|