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
@@ -0,0 +1,544 @@
|
|
1
|
+
//===----------------------------------------------------------------------===//
|
2
|
+
// DuckDB
|
3
|
+
//
|
4
|
+
// duckdb/core_functions/scalar/date_functions.hpp
|
5
|
+
//
|
6
|
+
//
|
7
|
+
//===----------------------------------------------------------------------===//
|
8
|
+
// This file is generated by scripts/generate_functions.py
|
9
|
+
|
10
|
+
#pragma once
|
11
|
+
|
12
|
+
#include "duckdb/function/function_set.hpp"
|
13
|
+
|
14
|
+
namespace duckdb {
|
15
|
+
|
16
|
+
struct AgeFun {
|
17
|
+
static constexpr const char *Name = "age";
|
18
|
+
static constexpr const char *Parameters = "timestamp,timestamp";
|
19
|
+
static constexpr const char *Description = "Subtract arguments, resulting in the time difference between the two timestamps";
|
20
|
+
static constexpr const char *Example = "age(TIMESTAMP '2001-04-10', TIMESTAMP '1992-09-20')";
|
21
|
+
|
22
|
+
static ScalarFunctionSet GetFunctions();
|
23
|
+
};
|
24
|
+
|
25
|
+
struct CenturyFun {
|
26
|
+
static constexpr const char *Name = "century";
|
27
|
+
static constexpr const char *Parameters = "ts";
|
28
|
+
static constexpr const char *Description = "Extract the century component from a date or timestamp";
|
29
|
+
static constexpr const char *Example = "century(timestamp '2021-08-03 11:59:44.123456')";
|
30
|
+
|
31
|
+
static ScalarFunctionSet GetFunctions();
|
32
|
+
};
|
33
|
+
|
34
|
+
struct CurrentDateFun {
|
35
|
+
static constexpr const char *Name = "current_date";
|
36
|
+
static constexpr const char *Parameters = "";
|
37
|
+
static constexpr const char *Description = "Returns the current date";
|
38
|
+
static constexpr const char *Example = "current_date()";
|
39
|
+
|
40
|
+
static ScalarFunction GetFunction();
|
41
|
+
};
|
42
|
+
|
43
|
+
struct TodayFun {
|
44
|
+
using ALIAS = CurrentDateFun;
|
45
|
+
|
46
|
+
static constexpr const char *Name = "today";
|
47
|
+
};
|
48
|
+
|
49
|
+
struct DateDiffFun {
|
50
|
+
static constexpr const char *Name = "date_diff";
|
51
|
+
static constexpr const char *Parameters = "part,startdate,enddate";
|
52
|
+
static constexpr const char *Description = "The number of partition boundaries between the timestamps";
|
53
|
+
static constexpr const char *Example = "date_diff('hour', TIMESTAMPTZ '1992-09-30 23:59:59', TIMESTAMPTZ '1992-10-01 01:58:00')";
|
54
|
+
|
55
|
+
static ScalarFunctionSet GetFunctions();
|
56
|
+
};
|
57
|
+
|
58
|
+
struct DatediffFun {
|
59
|
+
using ALIAS = DateDiffFun;
|
60
|
+
|
61
|
+
static constexpr const char *Name = "datediff";
|
62
|
+
};
|
63
|
+
|
64
|
+
struct DatePartFun {
|
65
|
+
static constexpr const char *Name = "date_part";
|
66
|
+
static constexpr const char *Parameters = "ts";
|
67
|
+
static constexpr const char *Description = "Get subfield (equivalent to extract)";
|
68
|
+
static constexpr const char *Example = "date_part('minute', TIMESTAMP '1992-09-20 20:38:40')";
|
69
|
+
|
70
|
+
static ScalarFunctionSet GetFunctions();
|
71
|
+
};
|
72
|
+
|
73
|
+
struct DatepartFun {
|
74
|
+
using ALIAS = DatePartFun;
|
75
|
+
|
76
|
+
static constexpr const char *Name = "datepart";
|
77
|
+
};
|
78
|
+
|
79
|
+
struct DateSubFun {
|
80
|
+
static constexpr const char *Name = "date_sub";
|
81
|
+
static constexpr const char *Parameters = "part,startdate,enddate";
|
82
|
+
static constexpr const char *Description = "The number of complete partitions between the timestamps";
|
83
|
+
static constexpr const char *Example = "date_sub('hour', TIMESTAMPTZ '1992-09-30 23:59:59', TIMESTAMPTZ '1992-10-01 01:58:00')";
|
84
|
+
|
85
|
+
static ScalarFunctionSet GetFunctions();
|
86
|
+
};
|
87
|
+
|
88
|
+
struct DatesubFun {
|
89
|
+
using ALIAS = DateSubFun;
|
90
|
+
|
91
|
+
static constexpr const char *Name = "datesub";
|
92
|
+
};
|
93
|
+
|
94
|
+
struct DateTruncFun {
|
95
|
+
static constexpr const char *Name = "date_trunc";
|
96
|
+
static constexpr const char *Parameters = "part,timestamp";
|
97
|
+
static constexpr const char *Description = "Truncate to specified precision";
|
98
|
+
static constexpr const char *Example = "date_trunc('hour', TIMESTAMPTZ '1992-09-20 20:38:40')";
|
99
|
+
|
100
|
+
static ScalarFunctionSet GetFunctions();
|
101
|
+
};
|
102
|
+
|
103
|
+
struct DatetruncFun {
|
104
|
+
using ALIAS = DateTruncFun;
|
105
|
+
|
106
|
+
static constexpr const char *Name = "datetrunc";
|
107
|
+
};
|
108
|
+
|
109
|
+
struct DayFun {
|
110
|
+
static constexpr const char *Name = "day";
|
111
|
+
static constexpr const char *Parameters = "ts";
|
112
|
+
static constexpr const char *Description = "Extract the day component from a date or timestamp";
|
113
|
+
static constexpr const char *Example = "day(timestamp '2021-08-03 11:59:44.123456')";
|
114
|
+
|
115
|
+
static ScalarFunctionSet GetFunctions();
|
116
|
+
};
|
117
|
+
|
118
|
+
struct DayNameFun {
|
119
|
+
static constexpr const char *Name = "dayname";
|
120
|
+
static constexpr const char *Parameters = "ts";
|
121
|
+
static constexpr const char *Description = "The (English) name of the weekday.";
|
122
|
+
static constexpr const char *Example = "dayname(TIMESTAMP '1992-03-22')";
|
123
|
+
|
124
|
+
static ScalarFunctionSet GetFunctions();
|
125
|
+
};
|
126
|
+
|
127
|
+
struct DayOfMonthFun {
|
128
|
+
static constexpr const char *Name = "dayofmonth";
|
129
|
+
static constexpr const char *Parameters = "ts";
|
130
|
+
static constexpr const char *Description = "Extract the dayofmonth component from a date or timestamp";
|
131
|
+
static constexpr const char *Example = "dayofmonth(timestamp '2021-08-03 11:59:44.123456')";
|
132
|
+
|
133
|
+
static ScalarFunctionSet GetFunctions();
|
134
|
+
};
|
135
|
+
|
136
|
+
struct DayOfWeekFun {
|
137
|
+
static constexpr const char *Name = "dayofweek";
|
138
|
+
static constexpr const char *Parameters = "ts";
|
139
|
+
static constexpr const char *Description = "Extract the dayofweek component from a date or timestamp";
|
140
|
+
static constexpr const char *Example = "dayofweek(timestamp '2021-08-03 11:59:44.123456')";
|
141
|
+
|
142
|
+
static ScalarFunctionSet GetFunctions();
|
143
|
+
};
|
144
|
+
|
145
|
+
struct DayOfYearFun {
|
146
|
+
static constexpr const char *Name = "dayofyear";
|
147
|
+
static constexpr const char *Parameters = "ts";
|
148
|
+
static constexpr const char *Description = "Extract the dayofyear component from a date or timestamp";
|
149
|
+
static constexpr const char *Example = "dayofyear(timestamp '2021-08-03 11:59:44.123456')";
|
150
|
+
|
151
|
+
static ScalarFunctionSet GetFunctions();
|
152
|
+
};
|
153
|
+
|
154
|
+
struct DecadeFun {
|
155
|
+
static constexpr const char *Name = "decade";
|
156
|
+
static constexpr const char *Parameters = "ts";
|
157
|
+
static constexpr const char *Description = "Extract the decade component from a date or timestamp";
|
158
|
+
static constexpr const char *Example = "decade(timestamp '2021-08-03 11:59:44.123456')";
|
159
|
+
|
160
|
+
static ScalarFunctionSet GetFunctions();
|
161
|
+
};
|
162
|
+
|
163
|
+
struct EpochFun {
|
164
|
+
static constexpr const char *Name = "epoch";
|
165
|
+
static constexpr const char *Parameters = "ts";
|
166
|
+
static constexpr const char *Description = "Extract the epoch component from a date or timestamp";
|
167
|
+
static constexpr const char *Example = "epoch(timestamp '2021-08-03 11:59:44.123456')";
|
168
|
+
|
169
|
+
static ScalarFunctionSet GetFunctions();
|
170
|
+
};
|
171
|
+
|
172
|
+
struct EpochMsFun {
|
173
|
+
static constexpr const char *Name = "epoch_ms";
|
174
|
+
static constexpr const char *Parameters = "ms";
|
175
|
+
static constexpr const char *Description = "Converts ms since epoch to a timestamp";
|
176
|
+
static constexpr const char *Example = "epoch_ms(701222400000)";
|
177
|
+
|
178
|
+
static ScalarFunction GetFunction();
|
179
|
+
};
|
180
|
+
|
181
|
+
struct EraFun {
|
182
|
+
static constexpr const char *Name = "era";
|
183
|
+
static constexpr const char *Parameters = "ts";
|
184
|
+
static constexpr const char *Description = "Extract the era component from a date or timestamp";
|
185
|
+
static constexpr const char *Example = "era(timestamp '2021-08-03 11:59:44.123456')";
|
186
|
+
|
187
|
+
static ScalarFunctionSet GetFunctions();
|
188
|
+
};
|
189
|
+
|
190
|
+
struct CurrentTimeFun {
|
191
|
+
static constexpr const char *Name = "get_current_time";
|
192
|
+
static constexpr const char *Parameters = "";
|
193
|
+
static constexpr const char *Description = "Returns the current time";
|
194
|
+
static constexpr const char *Example = "get_current_time()";
|
195
|
+
|
196
|
+
static ScalarFunction GetFunction();
|
197
|
+
};
|
198
|
+
|
199
|
+
struct GetCurrentTimestampFun {
|
200
|
+
static constexpr const char *Name = "get_current_timestamp";
|
201
|
+
static constexpr const char *Parameters = "";
|
202
|
+
static constexpr const char *Description = "Returns the current timestamp";
|
203
|
+
static constexpr const char *Example = "get_current_timestamp()";
|
204
|
+
|
205
|
+
static ScalarFunction GetFunction();
|
206
|
+
};
|
207
|
+
|
208
|
+
struct NowFun {
|
209
|
+
using ALIAS = GetCurrentTimestampFun;
|
210
|
+
|
211
|
+
static constexpr const char *Name = "now";
|
212
|
+
};
|
213
|
+
|
214
|
+
struct TransactionTimestampFun {
|
215
|
+
using ALIAS = GetCurrentTimestampFun;
|
216
|
+
|
217
|
+
static constexpr const char *Name = "transaction_timestamp";
|
218
|
+
};
|
219
|
+
|
220
|
+
struct HoursFun {
|
221
|
+
static constexpr const char *Name = "hour";
|
222
|
+
static constexpr const char *Parameters = "ts";
|
223
|
+
static constexpr const char *Description = "Extract the hour component from a date or timestamp";
|
224
|
+
static constexpr const char *Example = "hour(timestamp '2021-08-03 11:59:44.123456')";
|
225
|
+
|
226
|
+
static ScalarFunctionSet GetFunctions();
|
227
|
+
};
|
228
|
+
|
229
|
+
struct ISODayOfWeekFun {
|
230
|
+
static constexpr const char *Name = "isodow";
|
231
|
+
static constexpr const char *Parameters = "ts";
|
232
|
+
static constexpr const char *Description = "Extract the isodow component from a date or timestamp";
|
233
|
+
static constexpr const char *Example = "isodow(timestamp '2021-08-03 11:59:44.123456')";
|
234
|
+
|
235
|
+
static ScalarFunctionSet GetFunctions();
|
236
|
+
};
|
237
|
+
|
238
|
+
struct ISOYearFun {
|
239
|
+
static constexpr const char *Name = "isoyear";
|
240
|
+
static constexpr const char *Parameters = "ts";
|
241
|
+
static constexpr const char *Description = "Extract the isoyear component from a date or timestamp";
|
242
|
+
static constexpr const char *Example = "isoyear(timestamp '2021-08-03 11:59:44.123456')";
|
243
|
+
|
244
|
+
static ScalarFunctionSet GetFunctions();
|
245
|
+
};
|
246
|
+
|
247
|
+
struct LastDayFun {
|
248
|
+
static constexpr const char *Name = "last_day";
|
249
|
+
static constexpr const char *Parameters = "ts";
|
250
|
+
static constexpr const char *Description = "Returns the last day of the month";
|
251
|
+
static constexpr const char *Example = "last_day(TIMESTAMP '1992-03-22 01:02:03.1234')";
|
252
|
+
|
253
|
+
static ScalarFunctionSet GetFunctions();
|
254
|
+
};
|
255
|
+
|
256
|
+
struct MakeDateFun {
|
257
|
+
static constexpr const char *Name = "make_date";
|
258
|
+
static constexpr const char *Parameters = "year,month,day";
|
259
|
+
static constexpr const char *Description = "The date for the given parts";
|
260
|
+
static constexpr const char *Example = "make_date(1992, 9, 20)";
|
261
|
+
|
262
|
+
static ScalarFunctionSet GetFunctions();
|
263
|
+
};
|
264
|
+
|
265
|
+
struct MakeTimeFun {
|
266
|
+
static constexpr const char *Name = "make_time";
|
267
|
+
static constexpr const char *Parameters = "hour,minute,seconds";
|
268
|
+
static constexpr const char *Description = "The time for the given parts";
|
269
|
+
static constexpr const char *Example = "make_time(13, 34, 27.123456)";
|
270
|
+
|
271
|
+
static ScalarFunction GetFunction();
|
272
|
+
};
|
273
|
+
|
274
|
+
struct MakeTimestampFun {
|
275
|
+
static constexpr const char *Name = "make_timestamp";
|
276
|
+
static constexpr const char *Parameters = "year,month,day,hour,minute,seconds";
|
277
|
+
static constexpr const char *Description = "The timestamp for the given parts";
|
278
|
+
static constexpr const char *Example = "make_timestamp(1992, 9, 20, 13, 34, 27.123456)";
|
279
|
+
|
280
|
+
static ScalarFunction GetFunction();
|
281
|
+
};
|
282
|
+
|
283
|
+
struct MicrosecondsFun {
|
284
|
+
static constexpr const char *Name = "microsecond";
|
285
|
+
static constexpr const char *Parameters = "ts";
|
286
|
+
static constexpr const char *Description = "Extract the microsecond component from a date or timestamp";
|
287
|
+
static constexpr const char *Example = "microsecond(timestamp '2021-08-03 11:59:44.123456')";
|
288
|
+
|
289
|
+
static ScalarFunctionSet GetFunctions();
|
290
|
+
};
|
291
|
+
|
292
|
+
struct MillenniumFun {
|
293
|
+
static constexpr const char *Name = "millennium";
|
294
|
+
static constexpr const char *Parameters = "ts";
|
295
|
+
static constexpr const char *Description = "Extract the millennium component from a date or timestamp";
|
296
|
+
static constexpr const char *Example = "millennium(timestamp '2021-08-03 11:59:44.123456')";
|
297
|
+
|
298
|
+
static ScalarFunctionSet GetFunctions();
|
299
|
+
};
|
300
|
+
|
301
|
+
struct MillisecondsFun {
|
302
|
+
static constexpr const char *Name = "millisecond";
|
303
|
+
static constexpr const char *Parameters = "ts";
|
304
|
+
static constexpr const char *Description = "Extract the millisecond component from a date or timestamp";
|
305
|
+
static constexpr const char *Example = "millisecond(timestamp '2021-08-03 11:59:44.123456')";
|
306
|
+
|
307
|
+
static ScalarFunctionSet GetFunctions();
|
308
|
+
};
|
309
|
+
|
310
|
+
struct MinutesFun {
|
311
|
+
static constexpr const char *Name = "minute";
|
312
|
+
static constexpr const char *Parameters = "ts";
|
313
|
+
static constexpr const char *Description = "Extract the minute component from a date or timestamp";
|
314
|
+
static constexpr const char *Example = "minute(timestamp '2021-08-03 11:59:44.123456')";
|
315
|
+
|
316
|
+
static ScalarFunctionSet GetFunctions();
|
317
|
+
};
|
318
|
+
|
319
|
+
struct MonthFun {
|
320
|
+
static constexpr const char *Name = "month";
|
321
|
+
static constexpr const char *Parameters = "ts";
|
322
|
+
static constexpr const char *Description = "Extract the month component from a date or timestamp";
|
323
|
+
static constexpr const char *Example = "month(timestamp '2021-08-03 11:59:44.123456')";
|
324
|
+
|
325
|
+
static ScalarFunctionSet GetFunctions();
|
326
|
+
};
|
327
|
+
|
328
|
+
struct MonthNameFun {
|
329
|
+
static constexpr const char *Name = "monthname";
|
330
|
+
static constexpr const char *Parameters = "ts";
|
331
|
+
static constexpr const char *Description = "The (English) name of the month.";
|
332
|
+
static constexpr const char *Example = "monthname(TIMESTAMP '1992-09-20')";
|
333
|
+
|
334
|
+
static ScalarFunctionSet GetFunctions();
|
335
|
+
};
|
336
|
+
|
337
|
+
struct QuarterFun {
|
338
|
+
static constexpr const char *Name = "quarter";
|
339
|
+
static constexpr const char *Parameters = "ts";
|
340
|
+
static constexpr const char *Description = "Extract the quarter component from a date or timestamp";
|
341
|
+
static constexpr const char *Example = "quarter(timestamp '2021-08-03 11:59:44.123456')";
|
342
|
+
|
343
|
+
static ScalarFunctionSet GetFunctions();
|
344
|
+
};
|
345
|
+
|
346
|
+
struct SecondsFun {
|
347
|
+
static constexpr const char *Name = "second";
|
348
|
+
static constexpr const char *Parameters = "ts";
|
349
|
+
static constexpr const char *Description = "Extract the second component from a date or timestamp";
|
350
|
+
static constexpr const char *Example = "second(timestamp '2021-08-03 11:59:44.123456')";
|
351
|
+
|
352
|
+
static ScalarFunctionSet GetFunctions();
|
353
|
+
};
|
354
|
+
|
355
|
+
struct StrfTimeFun {
|
356
|
+
static constexpr const char *Name = "strftime";
|
357
|
+
static constexpr const char *Parameters = "text,format";
|
358
|
+
static constexpr const char *Description = "Converts timestamp to string according to the format string";
|
359
|
+
static constexpr const char *Example = "strftime(timestamp '1992-01-01 20:38:40', '%a, %-d %B %Y - %I:%M:%S %p')";
|
360
|
+
|
361
|
+
static ScalarFunctionSet GetFunctions();
|
362
|
+
};
|
363
|
+
|
364
|
+
struct StrpTimeFun {
|
365
|
+
static constexpr const char *Name = "strptime";
|
366
|
+
static constexpr const char *Parameters = "text,format";
|
367
|
+
static constexpr const char *Description = "Converts string to timestamp with time zone according to the format string if %Z is specified.";
|
368
|
+
static constexpr const char *Example = "strptime('Wed, 1 January 1992 - 08:38:40 PST', '%a, %-d %B %Y - %H:%M:%S %Z')";
|
369
|
+
|
370
|
+
static ScalarFunctionSet GetFunctions();
|
371
|
+
};
|
372
|
+
|
373
|
+
struct TimeBucketFun {
|
374
|
+
static constexpr const char *Name = "time_bucket";
|
375
|
+
static constexpr const char *Parameters = "bucket_width,timestamp,origin";
|
376
|
+
static constexpr const char *Description = "Truncate timestamptz by the specified interval bucket_width. Buckets are aligned relative to origin timestamptz. origin defaults to 2000-01-03 00:00:00+00 for buckets that don’t include a month or year interval, and to 2000-01-01 00:00:00+00 for month and year buckets.";
|
377
|
+
static constexpr const char *Example = "time_bucket(INTERVAL '2 weeks', TIMESTAMP '1992-04-20 15:26:00-07', TIMESTAMP '1992-04-01 00:00:00-07')";
|
378
|
+
|
379
|
+
static ScalarFunctionSet GetFunctions();
|
380
|
+
};
|
381
|
+
|
382
|
+
struct TimezoneFun {
|
383
|
+
static constexpr const char *Name = "timezone";
|
384
|
+
static constexpr const char *Parameters = "ts";
|
385
|
+
static constexpr const char *Description = "Extract the timezone component from a date or timestamp";
|
386
|
+
static constexpr const char *Example = "timezone(timestamp '2021-08-03 11:59:44.123456')";
|
387
|
+
|
388
|
+
static ScalarFunctionSet GetFunctions();
|
389
|
+
};
|
390
|
+
|
391
|
+
struct TimezoneHourFun {
|
392
|
+
static constexpr const char *Name = "timezone_hour";
|
393
|
+
static constexpr const char *Parameters = "ts";
|
394
|
+
static constexpr const char *Description = "Extract the timezone_hour component from a date or timestamp";
|
395
|
+
static constexpr const char *Example = "timezone_hour(timestamp '2021-08-03 11:59:44.123456')";
|
396
|
+
|
397
|
+
static ScalarFunctionSet GetFunctions();
|
398
|
+
};
|
399
|
+
|
400
|
+
struct TimezoneMinuteFun {
|
401
|
+
static constexpr const char *Name = "timezone_minute";
|
402
|
+
static constexpr const char *Parameters = "ts";
|
403
|
+
static constexpr const char *Description = "Extract the timezone_minute component from a date or timestamp";
|
404
|
+
static constexpr const char *Example = "timezone_minute(timestamp '2021-08-03 11:59:44.123456')";
|
405
|
+
|
406
|
+
static ScalarFunctionSet GetFunctions();
|
407
|
+
};
|
408
|
+
|
409
|
+
struct ToDaysFun {
|
410
|
+
static constexpr const char *Name = "to_days";
|
411
|
+
static constexpr const char *Parameters = "integer";
|
412
|
+
static constexpr const char *Description = "Construct a day interval";
|
413
|
+
static constexpr const char *Example = "to_days(5)";
|
414
|
+
|
415
|
+
static ScalarFunction GetFunction();
|
416
|
+
};
|
417
|
+
|
418
|
+
struct ToHoursFun {
|
419
|
+
static constexpr const char *Name = "to_hours";
|
420
|
+
static constexpr const char *Parameters = "integer";
|
421
|
+
static constexpr const char *Description = "Construct a hour interval";
|
422
|
+
static constexpr const char *Example = "to_hours(5)";
|
423
|
+
|
424
|
+
static ScalarFunction GetFunction();
|
425
|
+
};
|
426
|
+
|
427
|
+
struct ToMicrosecondsFun {
|
428
|
+
static constexpr const char *Name = "to_microseconds";
|
429
|
+
static constexpr const char *Parameters = "integer";
|
430
|
+
static constexpr const char *Description = "Construct a microsecond interval";
|
431
|
+
static constexpr const char *Example = "to_microseconds(5)";
|
432
|
+
|
433
|
+
static ScalarFunction GetFunction();
|
434
|
+
};
|
435
|
+
|
436
|
+
struct ToMillisecondsFun {
|
437
|
+
static constexpr const char *Name = "to_milliseconds";
|
438
|
+
static constexpr const char *Parameters = "integer";
|
439
|
+
static constexpr const char *Description = "Construct a millisecond interval";
|
440
|
+
static constexpr const char *Example = "to_milliseconds(5)";
|
441
|
+
|
442
|
+
static ScalarFunction GetFunction();
|
443
|
+
};
|
444
|
+
|
445
|
+
struct ToMinutesFun {
|
446
|
+
static constexpr const char *Name = "to_minutes";
|
447
|
+
static constexpr const char *Parameters = "integer";
|
448
|
+
static constexpr const char *Description = "Construct a minute interval";
|
449
|
+
static constexpr const char *Example = "to_minutes(5)";
|
450
|
+
|
451
|
+
static ScalarFunction GetFunction();
|
452
|
+
};
|
453
|
+
|
454
|
+
struct ToMonthsFun {
|
455
|
+
static constexpr const char *Name = "to_months";
|
456
|
+
static constexpr const char *Parameters = "integer";
|
457
|
+
static constexpr const char *Description = "Construct a month interval";
|
458
|
+
static constexpr const char *Example = "to_months(5)";
|
459
|
+
|
460
|
+
static ScalarFunction GetFunction();
|
461
|
+
};
|
462
|
+
|
463
|
+
struct ToSecondsFun {
|
464
|
+
static constexpr const char *Name = "to_seconds";
|
465
|
+
static constexpr const char *Parameters = "integer";
|
466
|
+
static constexpr const char *Description = "Construct a second interval";
|
467
|
+
static constexpr const char *Example = "to_seconds(5)";
|
468
|
+
|
469
|
+
static ScalarFunction GetFunction();
|
470
|
+
};
|
471
|
+
|
472
|
+
struct ToTimestampFun {
|
473
|
+
static constexpr const char *Name = "to_timestamp";
|
474
|
+
static constexpr const char *Parameters = "sec";
|
475
|
+
static constexpr const char *Description = "Converts sec since epoch to a timestamp";
|
476
|
+
static constexpr const char *Example = "to_timestamp(701222400)";
|
477
|
+
|
478
|
+
static ScalarFunction GetFunction();
|
479
|
+
};
|
480
|
+
|
481
|
+
struct ToYearsFun {
|
482
|
+
static constexpr const char *Name = "to_years";
|
483
|
+
static constexpr const char *Parameters = "integer";
|
484
|
+
static constexpr const char *Description = "Construct a year interval";
|
485
|
+
static constexpr const char *Example = "to_years(5)";
|
486
|
+
|
487
|
+
static ScalarFunction GetFunction();
|
488
|
+
};
|
489
|
+
|
490
|
+
struct TryStrpTimeFun {
|
491
|
+
static constexpr const char *Name = "try_strptime";
|
492
|
+
static constexpr const char *Parameters = "text,format";
|
493
|
+
static constexpr const char *Description = "Converts string to timestamp with time zone according to the format string if %Z is specified. Returns NULL on failure.";
|
494
|
+
static constexpr const char *Example = "try_strptime('Wed, 1 January 1992 - 08:38:40 PM', '%a, %-d %B %Y - %I:%M:%S %p')";
|
495
|
+
|
496
|
+
static ScalarFunctionSet GetFunctions();
|
497
|
+
};
|
498
|
+
|
499
|
+
struct WeekFun {
|
500
|
+
static constexpr const char *Name = "week";
|
501
|
+
static constexpr const char *Parameters = "ts";
|
502
|
+
static constexpr const char *Description = "Extract the week component from a date or timestamp";
|
503
|
+
static constexpr const char *Example = "week(timestamp '2021-08-03 11:59:44.123456')";
|
504
|
+
|
505
|
+
static ScalarFunctionSet GetFunctions();
|
506
|
+
};
|
507
|
+
|
508
|
+
struct WeekDayFun {
|
509
|
+
static constexpr const char *Name = "weekday";
|
510
|
+
static constexpr const char *Parameters = "ts";
|
511
|
+
static constexpr const char *Description = "Extract the weekday component from a date or timestamp";
|
512
|
+
static constexpr const char *Example = "weekday(timestamp '2021-08-03 11:59:44.123456')";
|
513
|
+
|
514
|
+
static ScalarFunctionSet GetFunctions();
|
515
|
+
};
|
516
|
+
|
517
|
+
struct WeekOfYearFun {
|
518
|
+
static constexpr const char *Name = "weekofyear";
|
519
|
+
static constexpr const char *Parameters = "ts";
|
520
|
+
static constexpr const char *Description = "Extract the weekofyear component from a date or timestamp";
|
521
|
+
static constexpr const char *Example = "weekofyear(timestamp '2021-08-03 11:59:44.123456')";
|
522
|
+
|
523
|
+
static ScalarFunctionSet GetFunctions();
|
524
|
+
};
|
525
|
+
|
526
|
+
struct YearFun {
|
527
|
+
static constexpr const char *Name = "year";
|
528
|
+
static constexpr const char *Parameters = "ts";
|
529
|
+
static constexpr const char *Description = "Extract the year component from a date or timestamp";
|
530
|
+
static constexpr const char *Example = "year(timestamp '2021-08-03 11:59:44.123456')";
|
531
|
+
|
532
|
+
static ScalarFunctionSet GetFunctions();
|
533
|
+
};
|
534
|
+
|
535
|
+
struct YearWeekFun {
|
536
|
+
static constexpr const char *Name = "yearweek";
|
537
|
+
static constexpr const char *Parameters = "ts";
|
538
|
+
static constexpr const char *Description = "Extract the yearweek component from a date or timestamp";
|
539
|
+
static constexpr const char *Example = "yearweek(timestamp '2021-08-03 11:59:44.123456')";
|
540
|
+
|
541
|
+
static ScalarFunctionSet GetFunctions();
|
542
|
+
};
|
543
|
+
|
544
|
+
} // namespace duckdb
|
@@ -0,0 +1,61 @@
|
|
1
|
+
//===----------------------------------------------------------------------===//
|
2
|
+
// DuckDB
|
3
|
+
//
|
4
|
+
// duckdb/core_functions/scalar/enum_functions.hpp
|
5
|
+
//
|
6
|
+
//
|
7
|
+
//===----------------------------------------------------------------------===//
|
8
|
+
// This file is generated by scripts/generate_functions.py
|
9
|
+
|
10
|
+
#pragma once
|
11
|
+
|
12
|
+
#include "duckdb/function/function_set.hpp"
|
13
|
+
|
14
|
+
namespace duckdb {
|
15
|
+
|
16
|
+
struct EnumFirstFun {
|
17
|
+
static constexpr const char *Name = "enum_first";
|
18
|
+
static constexpr const char *Parameters = "enum";
|
19
|
+
static constexpr const char *Description = "Returns the first value of the input enum type.";
|
20
|
+
static constexpr const char *Example = "enum_first(null::mood)";
|
21
|
+
|
22
|
+
static ScalarFunction GetFunction();
|
23
|
+
};
|
24
|
+
|
25
|
+
struct EnumLastFun {
|
26
|
+
static constexpr const char *Name = "enum_last";
|
27
|
+
static constexpr const char *Parameters = "enum";
|
28
|
+
static constexpr const char *Description = "Returns the last value of the input enum type.";
|
29
|
+
static constexpr const char *Example = "enum_last(null::mood)";
|
30
|
+
|
31
|
+
static ScalarFunction GetFunction();
|
32
|
+
};
|
33
|
+
|
34
|
+
struct EnumCodeFun {
|
35
|
+
static constexpr const char *Name = "enum_code";
|
36
|
+
static constexpr const char *Parameters = "enum";
|
37
|
+
static constexpr const char *Description = "Returns the numeric value backing the given enum value";
|
38
|
+
static constexpr const char *Example = "enum_code('happy'::mood)";
|
39
|
+
|
40
|
+
static ScalarFunction GetFunction();
|
41
|
+
};
|
42
|
+
|
43
|
+
struct EnumRangeFun {
|
44
|
+
static constexpr const char *Name = "enum_range";
|
45
|
+
static constexpr const char *Parameters = "enum";
|
46
|
+
static constexpr const char *Description = "Returns all values of the input enum type as an array.";
|
47
|
+
static constexpr const char *Example = "enum_range(null::mood)";
|
48
|
+
|
49
|
+
static ScalarFunction GetFunction();
|
50
|
+
};
|
51
|
+
|
52
|
+
struct EnumRangeBoundaryFun {
|
53
|
+
static constexpr const char *Name = "enum_range_boundary";
|
54
|
+
static constexpr const char *Parameters = "start,end";
|
55
|
+
static constexpr const char *Description = "Returns the range between the two given enum values as an array. The values must be of the same enum type. When the first parameter is NULL, the result starts with the first value of the enum type. When the second parameter is NULL, the result ends with the last value of the enum type.";
|
56
|
+
static constexpr const char *Example = "enum_range_boundary(NULL, 'happy'::mood)";
|
57
|
+
|
58
|
+
static ScalarFunction GetFunction();
|
59
|
+
};
|
60
|
+
|
61
|
+
} // namespace duckdb
|