duckdb 1.0.1-dev21.0 → 1.0.1-dev27.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/.github/workflows/HighPriorityIssues.yml +2 -2
- package/.github/workflows/NodeJS.yml +1 -1
- package/binding.gyp +41 -0
- package/package.json +1 -1
- package/src/duckdb/extension/icu/icu-dateadd.cpp +4 -2
- package/src/duckdb/extension/icu/icu-datefunc.cpp +6 -2
- package/src/duckdb/extension/icu/icu-datesub.cpp +13 -2
- package/src/duckdb/extension/icu/icu-strptime.cpp +6 -6
- package/src/duckdb/extension/icu/icu-table-range.cpp +92 -73
- package/src/duckdb/extension/icu/icu-timebucket.cpp +12 -2
- package/src/duckdb/extension/icu/icu-timezone.cpp +3 -3
- package/src/duckdb/extension/icu/icu_extension.cpp +61 -9
- package/src/duckdb/extension/json/include/json_executors.hpp +20 -23
- package/src/duckdb/extension/json/include/json_functions.hpp +4 -0
- package/src/duckdb/extension/json/include/json_scan.hpp +6 -2
- package/src/duckdb/extension/json/include/json_structure.hpp +12 -9
- package/src/duckdb/extension/json/json_common.cpp +66 -10
- package/src/duckdb/extension/json/json_extension.cpp +13 -5
- package/src/duckdb/extension/json/json_functions/json_array_length.cpp +1 -1
- package/src/duckdb/extension/json/json_functions/json_create.cpp +21 -4
- package/src/duckdb/extension/json/json_functions/json_exists.cpp +32 -0
- package/src/duckdb/extension/json/json_functions/json_extract.cpp +2 -2
- package/src/duckdb/extension/json/json_functions/json_keys.cpp +1 -1
- package/src/duckdb/extension/json/json_functions/json_pretty.cpp +32 -0
- package/src/duckdb/extension/json/json_functions/json_serialize_sql.cpp +5 -1
- package/src/duckdb/extension/json/json_functions/json_structure.cpp +305 -94
- package/src/duckdb/extension/json/json_functions/json_transform.cpp +1 -1
- package/src/duckdb/extension/json/json_functions/json_type.cpp +3 -3
- package/src/duckdb/extension/json/json_functions/json_value.cpp +42 -0
- package/src/duckdb/extension/json/json_functions/read_json.cpp +16 -2
- package/src/duckdb/extension/json/json_functions/read_json_objects.cpp +3 -2
- package/src/duckdb/extension/json/json_functions.cpp +5 -1
- package/src/duckdb/extension/json/json_scan.cpp +13 -12
- package/src/duckdb/extension/json/serialize_json.cpp +5 -3
- package/src/duckdb/extension/parquet/column_reader.cpp +206 -43
- package/src/duckdb/extension/parquet/column_writer.cpp +133 -62
- package/src/duckdb/extension/parquet/geo_parquet.cpp +391 -0
- package/src/duckdb/extension/parquet/include/boolean_column_reader.hpp +16 -5
- package/src/duckdb/extension/parquet/include/column_reader.hpp +37 -12
- package/src/duckdb/extension/parquet/include/column_writer.hpp +10 -11
- package/src/duckdb/extension/parquet/include/expression_column_reader.hpp +52 -0
- package/src/duckdb/extension/parquet/include/geo_parquet.hpp +139 -0
- package/src/duckdb/extension/parquet/include/parquet_crypto.hpp +13 -8
- package/src/duckdb/extension/parquet/include/parquet_decimal_utils.hpp +3 -0
- package/src/duckdb/extension/parquet/include/parquet_file_metadata_cache.hpp +7 -3
- package/src/duckdb/extension/parquet/include/parquet_reader.hpp +55 -8
- package/src/duckdb/extension/parquet/include/parquet_rle_bp_decoder.hpp +3 -3
- package/src/duckdb/extension/parquet/include/parquet_rle_bp_encoder.hpp +1 -1
- package/src/duckdb/extension/parquet/include/parquet_timestamp.hpp +8 -0
- package/src/duckdb/extension/parquet/include/parquet_writer.hpp +21 -7
- package/src/duckdb/extension/parquet/include/resizable_buffer.hpp +33 -11
- package/src/duckdb/extension/parquet/include/string_column_reader.hpp +5 -2
- package/src/duckdb/extension/parquet/include/templated_column_reader.hpp +48 -14
- package/src/duckdb/extension/parquet/parquet_crypto.cpp +109 -61
- package/src/duckdb/extension/parquet/parquet_extension.cpp +305 -72
- package/src/duckdb/extension/parquet/parquet_metadata.cpp +4 -4
- package/src/duckdb/extension/parquet/parquet_reader.cpp +151 -40
- package/src/duckdb/extension/parquet/parquet_statistics.cpp +50 -16
- package/src/duckdb/extension/parquet/parquet_timestamp.cpp +42 -1
- package/src/duckdb/extension/parquet/parquet_writer.cpp +67 -75
- package/src/duckdb/extension/parquet/serialize_parquet.cpp +3 -1
- package/src/duckdb/extension/parquet/zstd_file_system.cpp +5 -1
- package/src/duckdb/src/catalog/catalog.cpp +14 -16
- package/src/duckdb/src/catalog/catalog_entry/duck_index_entry.cpp +14 -11
- package/src/duckdb/src/catalog/catalog_entry/duck_schema_entry.cpp +39 -19
- package/src/duckdb/src/catalog/catalog_entry/duck_table_entry.cpp +92 -78
- package/src/duckdb/src/catalog/catalog_entry/index_catalog_entry.cpp +10 -2
- package/src/duckdb/src/catalog/catalog_entry/macro_catalog_entry.cpp +10 -3
- package/src/duckdb/src/catalog/catalog_entry/schema_catalog_entry.cpp +3 -3
- package/src/duckdb/src/catalog/catalog_entry/table_catalog_entry.cpp +7 -7
- package/src/duckdb/src/catalog/catalog_entry.cpp +6 -3
- package/src/duckdb/src/catalog/catalog_set.cpp +14 -19
- package/src/duckdb/src/catalog/default/default_functions.cpp +179 -166
- package/src/duckdb/src/catalog/default/default_generator.cpp +24 -0
- package/src/duckdb/src/catalog/default/default_schemas.cpp +4 -3
- package/src/duckdb/src/catalog/default/default_table_functions.cpp +148 -0
- package/src/duckdb/src/catalog/default/default_views.cpp +7 -3
- package/src/duckdb/src/catalog/duck_catalog.cpp +7 -1
- package/src/duckdb/src/common/adbc/adbc.cpp +120 -58
- package/src/duckdb/src/common/allocator.cpp +71 -6
- package/src/duckdb/src/common/arrow/appender/bool_data.cpp +8 -7
- package/src/duckdb/src/common/arrow/appender/fixed_size_list_data.cpp +1 -1
- package/src/duckdb/src/common/arrow/appender/union_data.cpp +4 -5
- package/src/duckdb/src/common/arrow/arrow_appender.cpp +55 -21
- package/src/duckdb/src/common/arrow/arrow_converter.cpp +85 -10
- package/src/duckdb/src/common/arrow/arrow_merge_event.cpp +142 -0
- package/src/duckdb/src/common/arrow/arrow_query_result.cpp +56 -0
- package/src/duckdb/src/common/arrow/physical_arrow_batch_collector.cpp +37 -0
- package/src/duckdb/src/common/arrow/physical_arrow_collector.cpp +128 -0
- package/src/duckdb/src/common/arrow/schema_metadata.cpp +101 -0
- package/src/duckdb/src/common/cgroups.cpp +189 -0
- package/src/duckdb/src/common/compressed_file_system.cpp +6 -3
- package/src/duckdb/src/common/encryption_state.cpp +38 -0
- package/src/duckdb/src/common/enum_util.cpp +682 -14
- package/src/duckdb/src/common/enums/file_compression_type.cpp +24 -0
- package/src/duckdb/src/common/enums/metric_type.cpp +208 -0
- package/src/duckdb/src/common/enums/optimizer_type.cpp +8 -2
- package/src/duckdb/src/common/enums/physical_operator_type.cpp +2 -0
- package/src/duckdb/src/common/enums/relation_type.cpp +4 -0
- package/src/duckdb/src/common/enums/statement_type.cpp +15 -0
- package/src/duckdb/src/common/error_data.cpp +22 -20
- package/src/duckdb/src/common/exception/binder_exception.cpp +5 -0
- package/src/duckdb/src/common/exception.cpp +11 -1
- package/src/duckdb/src/common/extra_type_info.cpp +3 -0
- package/src/duckdb/src/common/file_buffer.cpp +1 -1
- package/src/duckdb/src/common/file_system.cpp +25 -3
- package/src/duckdb/src/common/filename_pattern.cpp +1 -0
- package/src/duckdb/src/common/fsst.cpp +15 -14
- package/src/duckdb/src/common/gzip_file_system.cpp +3 -1
- package/src/duckdb/src/common/hive_partitioning.cpp +103 -43
- package/src/duckdb/src/common/http_util.cpp +25 -0
- package/src/duckdb/src/common/local_file_system.cpp +48 -27
- package/src/duckdb/src/common/multi_file_list.cpp +113 -22
- package/src/duckdb/src/common/multi_file_reader.cpp +59 -58
- package/src/duckdb/src/common/operator/cast_operators.cpp +133 -34
- package/src/duckdb/src/common/operator/string_cast.cpp +42 -11
- package/src/duckdb/src/common/progress_bar/progress_bar.cpp +2 -2
- package/src/duckdb/src/common/progress_bar/terminal_progress_bar_display.cpp +1 -1
- package/src/duckdb/src/common/radix_partitioning.cpp +31 -21
- package/src/duckdb/src/common/random_engine.cpp +4 -0
- package/src/duckdb/src/common/re2_regex.cpp +47 -12
- package/src/duckdb/src/common/render_tree.cpp +243 -0
- package/src/duckdb/src/common/row_operations/row_aggregate.cpp +1 -1
- package/src/duckdb/src/common/row_operations/row_gather.cpp +2 -2
- package/src/duckdb/src/common/row_operations/row_matcher.cpp +58 -5
- package/src/duckdb/src/common/row_operations/row_radix_scatter.cpp +79 -43
- package/src/duckdb/src/common/serializer/binary_deserializer.cpp +1 -1
- package/src/duckdb/src/common/serializer/buffered_file_reader.cpp +6 -4
- package/src/duckdb/src/common/serializer/buffered_file_writer.cpp +18 -9
- package/src/duckdb/src/common/serializer/memory_stream.cpp +1 -0
- package/src/duckdb/src/common/sort/partition_state.cpp +33 -18
- package/src/duckdb/src/common/sort/radix_sort.cpp +22 -15
- package/src/duckdb/src/common/sort/sort_state.cpp +19 -16
- package/src/duckdb/src/common/sort/sorted_block.cpp +11 -10
- package/src/duckdb/src/common/string_util.cpp +167 -10
- package/src/duckdb/src/common/tree_renderer/graphviz_tree_renderer.cpp +108 -0
- package/src/duckdb/src/common/tree_renderer/html_tree_renderer.cpp +267 -0
- package/src/duckdb/src/common/tree_renderer/json_tree_renderer.cpp +116 -0
- package/src/duckdb/src/common/tree_renderer/text_tree_renderer.cpp +482 -0
- package/src/duckdb/src/common/tree_renderer/tree_renderer.cpp +12 -0
- package/src/duckdb/src/common/tree_renderer.cpp +16 -508
- package/src/duckdb/src/common/types/batched_data_collection.cpp +78 -9
- package/src/duckdb/src/common/types/bit.cpp +24 -22
- package/src/duckdb/src/common/types/blob.cpp +15 -11
- package/src/duckdb/src/common/types/column/column_data_allocator.cpp +18 -9
- package/src/duckdb/src/common/types/column/column_data_collection.cpp +4 -4
- package/src/duckdb/src/common/types/column/column_data_collection_segment.cpp +3 -4
- package/src/duckdb/src/common/types/column/column_data_consumer.cpp +2 -2
- package/src/duckdb/src/common/types/column/partitioned_column_data.cpp +70 -21
- package/src/duckdb/src/common/types/data_chunk.cpp +10 -1
- package/src/duckdb/src/common/types/date.cpp +8 -19
- package/src/duckdb/src/common/types/decimal.cpp +3 -2
- package/src/duckdb/src/common/types/hugeint.cpp +11 -3
- package/src/duckdb/src/common/types/hyperloglog.cpp +212 -227
- package/src/duckdb/src/common/types/interval.cpp +1 -1
- package/src/duckdb/src/common/types/list_segment.cpp +83 -49
- package/src/duckdb/src/common/types/row/partitioned_tuple_data.cpp +22 -83
- package/src/duckdb/src/common/types/row/row_data_collection.cpp +2 -2
- package/src/duckdb/src/common/types/row/row_data_collection_scanner.cpp +20 -4
- package/src/duckdb/src/common/types/row/tuple_data_allocator.cpp +28 -7
- package/src/duckdb/src/common/types/row/tuple_data_collection.cpp +29 -14
- package/src/duckdb/src/common/types/row/tuple_data_scatter_gather.cpp +152 -102
- package/src/duckdb/src/common/types/row/tuple_data_segment.cpp +4 -1
- package/src/duckdb/src/common/types/selection_vector.cpp +17 -1
- package/src/duckdb/src/common/types/time.cpp +62 -31
- package/src/duckdb/src/common/types/timestamp.cpp +70 -12
- package/src/duckdb/src/common/types/uuid.cpp +1 -1
- package/src/duckdb/src/common/types/validity_mask.cpp +40 -5
- package/src/duckdb/src/common/types/value.cpp +50 -8
- package/src/duckdb/src/common/types/varint.cpp +295 -0
- package/src/duckdb/src/common/types/vector.cpp +165 -54
- package/src/duckdb/src/common/types/vector_buffer.cpp +5 -4
- package/src/duckdb/src/common/types.cpp +106 -26
- package/src/duckdb/src/common/vector_operations/vector_copy.cpp +13 -25
- package/src/duckdb/src/common/vector_operations/vector_hash.cpp +6 -0
- package/src/duckdb/src/common/virtual_file_system.cpp +3 -3
- package/src/duckdb/src/core_functions/aggregate/distributive/approx_count.cpp +35 -82
- package/src/duckdb/src/core_functions/aggregate/distributive/arg_min_max.cpp +283 -46
- package/src/duckdb/src/core_functions/aggregate/distributive/bitagg.cpp +4 -4
- package/src/duckdb/src/core_functions/aggregate/distributive/entropy.cpp +3 -2
- package/src/duckdb/src/core_functions/aggregate/distributive/minmax.cpp +226 -338
- package/src/duckdb/src/core_functions/aggregate/distributive/sum.cpp +2 -0
- package/src/duckdb/src/core_functions/aggregate/holistic/approx_top_k.cpp +388 -0
- package/src/duckdb/src/core_functions/aggregate/holistic/approximate_quantile.cpp +63 -21
- package/src/duckdb/src/core_functions/aggregate/holistic/mad.cpp +330 -0
- package/src/duckdb/src/core_functions/aggregate/holistic/mode.cpp +136 -97
- package/src/duckdb/src/core_functions/aggregate/holistic/quantile.cpp +601 -1485
- package/src/duckdb/src/core_functions/aggregate/nested/binned_histogram.cpp +405 -0
- package/src/duckdb/src/core_functions/aggregate/nested/histogram.cpp +136 -165
- package/src/duckdb/src/core_functions/function_list.cpp +35 -8
- package/src/duckdb/src/core_functions/lambda_functions.cpp +5 -7
- package/src/duckdb/src/core_functions/scalar/array/array_functions.cpp +172 -198
- package/src/duckdb/src/core_functions/scalar/blob/create_sort_key.cpp +341 -54
- package/src/duckdb/src/core_functions/scalar/date/date_diff.cpp +2 -2
- package/src/duckdb/src/core_functions/scalar/date/date_part.cpp +89 -29
- package/src/duckdb/src/core_functions/scalar/date/date_trunc.cpp +1 -1
- package/src/duckdb/src/core_functions/scalar/date/make_date.cpp +2 -2
- package/src/duckdb/src/core_functions/scalar/date/strftime.cpp +133 -71
- package/src/duckdb/src/core_functions/scalar/date/to_interval.cpp +1 -1
- package/src/duckdb/src/core_functions/scalar/enum/enum_functions.cpp +1 -1
- package/src/duckdb/src/core_functions/scalar/generic/can_implicitly_cast.cpp +40 -0
- package/src/duckdb/src/core_functions/scalar/generic/error.cpp +1 -1
- package/src/duckdb/src/core_functions/scalar/generic/least.cpp +161 -58
- package/src/duckdb/src/core_functions/scalar/generic/typeof.cpp +13 -0
- package/src/duckdb/src/core_functions/scalar/list/array_slice.cpp +1 -1
- package/src/duckdb/src/core_functions/scalar/list/list_aggregates.cpp +59 -75
- package/src/duckdb/src/core_functions/scalar/list/list_distance.cpp +93 -40
- package/src/duckdb/src/core_functions/scalar/list/list_has_any_or_all.cpp +227 -0
- package/src/duckdb/src/core_functions/scalar/list/list_reduce.cpp +20 -19
- package/src/duckdb/src/core_functions/scalar/list/list_sort.cpp +0 -2
- package/src/duckdb/src/core_functions/scalar/list/list_value.cpp +106 -8
- package/src/duckdb/src/core_functions/scalar/map/map_contains.cpp +56 -0
- package/src/duckdb/src/core_functions/scalar/map/map_extract.cpp +73 -118
- package/src/duckdb/src/core_functions/scalar/math/numeric.cpp +98 -2
- package/src/duckdb/src/core_functions/scalar/operators/bitwise.cpp +1 -2
- package/src/duckdb/src/core_functions/scalar/random/setseed.cpp +1 -1
- package/src/duckdb/src/core_functions/scalar/string/bar.cpp +1 -1
- package/src/duckdb/src/core_functions/scalar/string/hex.cpp +5 -1
- package/src/duckdb/src/core_functions/scalar/string/md5.cpp +10 -37
- package/src/duckdb/src/core_functions/scalar/string/printf.cpp +18 -2
- package/src/duckdb/src/core_functions/scalar/string/repeat.cpp +45 -0
- package/src/duckdb/src/core_functions/scalar/string/reverse.cpp +4 -5
- package/src/duckdb/src/core_functions/scalar/string/sha1.cpp +35 -0
- package/src/duckdb/src/core_functions/scalar/string/sha256.cpp +5 -2
- package/src/duckdb/src/core_functions/scalar/string/url_encode.cpp +49 -0
- package/src/duckdb/src/core_functions/scalar/struct/struct_pack.cpp +1 -2
- package/src/duckdb/src/core_functions/scalar/union/union_extract.cpp +4 -2
- package/src/duckdb/src/execution/adaptive_filter.cpp +30 -11
- package/src/duckdb/src/execution/aggregate_hashtable.cpp +13 -18
- package/src/duckdb/src/execution/expression_executor/execute_conjunction.cpp +4 -9
- package/src/duckdb/src/execution/expression_executor.cpp +1 -1
- package/src/duckdb/src/execution/index/art/art.cpp +683 -670
- package/src/duckdb/src/execution/index/art/art_key.cpp +121 -38
- package/src/duckdb/src/execution/index/art/base_leaf.cpp +168 -0
- package/src/duckdb/src/execution/index/art/base_node.cpp +163 -0
- package/src/duckdb/src/execution/index/art/iterator.cpp +148 -77
- package/src/duckdb/src/execution/index/art/leaf.cpp +159 -263
- package/src/duckdb/src/execution/index/art/node.cpp +493 -247
- package/src/duckdb/src/execution/index/art/node256.cpp +31 -91
- package/src/duckdb/src/execution/index/art/node256_leaf.cpp +71 -0
- package/src/duckdb/src/execution/index/art/node48.cpp +75 -143
- package/src/duckdb/src/execution/index/art/prefix.cpp +424 -244
- package/src/duckdb/src/execution/index/bound_index.cpp +7 -1
- package/src/duckdb/src/execution/index/fixed_size_allocator.cpp +22 -18
- package/src/duckdb/src/execution/index/fixed_size_buffer.cpp +22 -73
- package/src/duckdb/src/execution/join_hashtable.cpp +637 -179
- package/src/duckdb/src/execution/operator/aggregate/aggregate_object.cpp +4 -4
- package/src/duckdb/src/execution/operator/aggregate/physical_hash_aggregate.cpp +15 -10
- package/src/duckdb/src/execution/operator/aggregate/physical_perfecthash_aggregate.cpp +13 -8
- package/src/duckdb/src/execution/operator/aggregate/physical_streaming_window.cpp +525 -132
- package/src/duckdb/src/execution/operator/aggregate/physical_ungrouped_aggregate.cpp +147 -138
- package/src/duckdb/src/execution/operator/aggregate/physical_window.cpp +531 -312
- package/src/duckdb/src/execution/operator/csv_scanner/buffer_manager/csv_buffer.cpp +1 -1
- package/src/duckdb/src/execution/operator/csv_scanner/buffer_manager/csv_buffer_manager.cpp +4 -3
- package/src/duckdb/src/execution/operator/csv_scanner/buffer_manager/csv_file_handle.cpp +9 -2
- package/src/duckdb/src/execution/operator/csv_scanner/scanner/base_scanner.cpp +13 -17
- package/src/duckdb/src/execution/operator/csv_scanner/scanner/column_count_scanner.cpp +60 -16
- package/src/duckdb/src/execution/operator/csv_scanner/scanner/csv_schema.cpp +105 -0
- package/src/duckdb/src/execution/operator/csv_scanner/scanner/scanner_boundary.cpp +24 -24
- package/src/duckdb/src/execution/operator/csv_scanner/scanner/skip_scanner.cpp +25 -2
- package/src/duckdb/src/execution/operator/csv_scanner/scanner/string_value_scanner.cpp +275 -112
- package/src/duckdb/src/execution/operator/csv_scanner/sniffer/csv_sniffer.cpp +106 -11
- package/src/duckdb/src/execution/operator/csv_scanner/sniffer/dialect_detection.cpp +253 -115
- package/src/duckdb/src/execution/operator/csv_scanner/sniffer/header_detection.cpp +93 -52
- package/src/duckdb/src/execution/operator/csv_scanner/sniffer/type_detection.cpp +116 -76
- package/src/duckdb/src/execution/operator/csv_scanner/sniffer/type_refinement.cpp +29 -14
- package/src/duckdb/src/execution/operator/csv_scanner/sniffer/type_replacement.cpp +1 -1
- package/src/duckdb/src/execution/operator/csv_scanner/state_machine/csv_state_machine_cache.cpp +70 -26
- package/src/duckdb/src/execution/operator/csv_scanner/table_function/csv_file_scanner.cpp +81 -60
- package/src/duckdb/src/execution/operator/csv_scanner/table_function/global_csv_state.cpp +88 -50
- package/src/duckdb/src/execution/operator/csv_scanner/util/csv_error.cpp +161 -51
- package/src/duckdb/src/execution/operator/csv_scanner/util/csv_reader_options.cpp +59 -17
- package/src/duckdb/src/execution/operator/filter/physical_filter.cpp +5 -5
- package/src/duckdb/src/execution/operator/helper/physical_batch_collector.cpp +0 -21
- package/src/duckdb/src/execution/operator/helper/physical_buffered_batch_collector.cpp +109 -0
- package/src/duckdb/src/execution/operator/helper/physical_buffered_collector.cpp +5 -13
- package/src/duckdb/src/execution/operator/helper/physical_explain_analyze.cpp +1 -1
- package/src/duckdb/src/execution/operator/helper/physical_load.cpp +12 -4
- package/src/duckdb/src/execution/operator/helper/physical_materialized_collector.cpp +0 -16
- package/src/duckdb/src/execution/operator/helper/physical_reservoir_sample.cpp +4 -2
- package/src/duckdb/src/execution/operator/helper/physical_reset.cpp +5 -0
- package/src/duckdb/src/execution/operator/helper/physical_result_collector.cpp +3 -1
- package/src/duckdb/src/execution/operator/helper/physical_set_variable.cpp +39 -0
- package/src/duckdb/src/execution/operator/helper/physical_streaming_sample.cpp +4 -2
- package/src/duckdb/src/execution/operator/helper/physical_transaction.cpp +16 -5
- package/src/duckdb/src/execution/operator/join/outer_join_marker.cpp +1 -1
- package/src/duckdb/src/execution/operator/join/perfect_hash_join_executor.cpp +1 -1
- package/src/duckdb/src/execution/operator/join/physical_asof_join.cpp +1 -1
- package/src/duckdb/src/execution/operator/join/physical_blockwise_nl_join.cpp +5 -4
- package/src/duckdb/src/execution/operator/join/physical_comparison_join.cpp +59 -21
- package/src/duckdb/src/execution/operator/join/physical_delim_join.cpp +7 -4
- package/src/duckdb/src/execution/operator/join/physical_hash_join.cpp +333 -176
- package/src/duckdb/src/execution/operator/join/physical_iejoin.cpp +57 -34
- package/src/duckdb/src/execution/operator/join/physical_join.cpp +16 -8
- package/src/duckdb/src/execution/operator/join/physical_left_delim_join.cpp +10 -4
- package/src/duckdb/src/execution/operator/join/physical_nested_loop_join.cpp +2 -5
- package/src/duckdb/src/execution/operator/join/physical_piecewise_merge_join.cpp +3 -3
- package/src/duckdb/src/execution/operator/join/physical_range_join.cpp +5 -5
- package/src/duckdb/src/execution/operator/join/physical_right_delim_join.cpp +7 -2
- package/src/duckdb/src/execution/operator/order/physical_order.cpp +17 -12
- package/src/duckdb/src/execution/operator/order/physical_top_n.cpp +12 -9
- package/src/duckdb/src/execution/operator/persistent/physical_batch_copy_to_file.cpp +35 -17
- package/src/duckdb/src/execution/operator/persistent/physical_batch_insert.cpp +17 -11
- package/src/duckdb/src/execution/operator/persistent/physical_copy_database.cpp +5 -1
- package/src/duckdb/src/execution/operator/persistent/physical_copy_to_file.cpp +156 -47
- package/src/duckdb/src/execution/operator/persistent/physical_insert.cpp +10 -2
- package/src/duckdb/src/execution/operator/persistent/physical_update.cpp +1 -3
- package/src/duckdb/src/execution/operator/projection/physical_pivot.cpp +2 -2
- package/src/duckdb/src/execution/operator/projection/physical_projection.cpp +13 -6
- package/src/duckdb/src/execution/operator/projection/physical_tableinout_function.cpp +22 -3
- package/src/duckdb/src/execution/operator/projection/physical_unnest.cpp +19 -3
- package/src/duckdb/src/execution/operator/scan/physical_column_data_scan.cpp +37 -22
- package/src/duckdb/src/execution/operator/scan/physical_table_scan.cpp +77 -21
- package/src/duckdb/src/execution/operator/schema/physical_attach.cpp +27 -55
- package/src/duckdb/src/execution/operator/schema/physical_create_art_index.cpp +41 -44
- package/src/duckdb/src/execution/operator/set/physical_cte.cpp +4 -6
- package/src/duckdb/src/execution/operator/set/physical_recursive_cte.cpp +4 -6
- package/src/duckdb/src/execution/operator/set/physical_union.cpp +18 -4
- package/src/duckdb/src/execution/perfect_aggregate_hashtable.cpp +3 -2
- package/src/duckdb/src/execution/physical_operator.cpp +45 -4
- package/src/duckdb/src/execution/physical_plan/plan_comparison_join.cpp +18 -7
- package/src/duckdb/src/execution/physical_plan/plan_copy_to_file.cpp +8 -3
- package/src/duckdb/src/execution/physical_plan/plan_delim_join.cpp +13 -6
- package/src/duckdb/src/execution/physical_plan/plan_explain.cpp +3 -3
- package/src/duckdb/src/execution/physical_plan/plan_get.cpp +111 -19
- package/src/duckdb/src/execution/physical_plan/plan_limit.cpp +19 -2
- package/src/duckdb/src/execution/physical_plan/plan_set.cpp +9 -0
- package/src/duckdb/src/execution/physical_plan/plan_window.cpp +3 -1
- package/src/duckdb/src/execution/physical_plan_generator.cpp +3 -3
- package/src/duckdb/src/execution/radix_partitioned_hashtable.cpp +49 -49
- package/src/duckdb/src/execution/reservoir_sample.cpp +2 -2
- package/src/duckdb/src/execution/window_executor.cpp +556 -318
- package/src/duckdb/src/execution/window_segment_tree.cpp +1058 -485
- package/src/duckdb/src/function/aggregate/distributive/count.cpp +5 -5
- package/src/duckdb/src/function/aggregate/distributive/first.cpp +92 -95
- package/src/duckdb/src/function/aggregate/sorted_aggregate_function.cpp +10 -9
- package/src/duckdb/src/function/aggregate_function.cpp +8 -0
- package/src/duckdb/src/function/cast/cast_function_set.cpp +10 -1
- package/src/duckdb/src/function/cast/decimal_cast.cpp +10 -1
- package/src/duckdb/src/function/cast/default_casts.cpp +2 -0
- package/src/duckdb/src/function/cast/numeric_casts.cpp +3 -0
- package/src/duckdb/src/function/cast/string_cast.cpp +8 -5
- package/src/duckdb/src/function/cast/time_casts.cpp +2 -2
- package/src/duckdb/src/function/cast/union_casts.cpp +1 -1
- package/src/duckdb/src/function/cast/varint_casts.cpp +283 -0
- package/src/duckdb/src/function/cast/vector_cast_helpers.cpp +3 -1
- package/src/duckdb/src/function/cast_rules.cpp +104 -15
- package/src/duckdb/src/function/compression_config.cpp +35 -33
- package/src/duckdb/src/function/copy_function.cpp +27 -0
- package/src/duckdb/src/function/function_binder.cpp +39 -11
- package/src/duckdb/src/function/macro_function.cpp +75 -32
- package/src/duckdb/src/function/pragma/pragma_queries.cpp +10 -0
- package/src/duckdb/src/function/scalar/compressed_materialization/compress_string.cpp +1 -0
- package/src/duckdb/src/function/scalar/generic/binning.cpp +507 -0
- package/src/duckdb/src/function/scalar/generic/getvariable.cpp +58 -0
- package/src/duckdb/src/function/scalar/generic_functions.cpp +1 -0
- package/src/duckdb/src/function/scalar/list/contains_or_position.cpp +33 -47
- package/src/duckdb/src/function/scalar/list/list_extract.cpp +70 -143
- package/src/duckdb/src/function/scalar/list/list_resize.cpp +93 -84
- package/src/duckdb/src/function/scalar/list/list_zip.cpp +3 -0
- package/src/duckdb/src/function/scalar/operators/arithmetic.cpp +24 -11
- package/src/duckdb/src/function/scalar/sequence/nextval.cpp +4 -4
- package/src/duckdb/src/function/scalar/strftime_format.cpp +196 -57
- package/src/duckdb/src/function/scalar/string/caseconvert.cpp +9 -7
- package/src/duckdb/src/function/scalar/string/concat.cpp +239 -123
- package/src/duckdb/src/function/scalar/string/concat_ws.cpp +149 -0
- package/src/duckdb/src/function/scalar/string/contains.cpp +18 -7
- package/src/duckdb/src/function/scalar/string/like.cpp +2 -2
- package/src/duckdb/src/function/scalar/string/substring.cpp +6 -11
- package/src/duckdb/src/function/scalar/string_functions.cpp +1 -0
- package/src/duckdb/src/function/scalar/struct/struct_extract.cpp +7 -3
- package/src/duckdb/src/function/scalar/system/aggregate_export.cpp +5 -5
- package/src/duckdb/src/function/scalar_function.cpp +5 -2
- package/src/duckdb/src/function/scalar_macro_function.cpp +2 -2
- package/src/duckdb/src/function/table/arrow/arrow_duck_schema.cpp +20 -39
- package/src/duckdb/src/function/table/arrow/arrow_type_info.cpp +135 -0
- package/src/duckdb/src/function/table/arrow.cpp +194 -52
- package/src/duckdb/src/function/table/arrow_conversion.cpp +212 -69
- package/src/duckdb/src/function/table/copy_csv.cpp +43 -14
- package/src/duckdb/src/function/table/query_function.cpp +80 -0
- package/src/duckdb/src/function/table/range.cpp +222 -142
- package/src/duckdb/src/function/table/read_csv.cpp +25 -13
- package/src/duckdb/src/function/table/sniff_csv.cpp +55 -35
- package/src/duckdb/src/function/table/system/duckdb_constraints.cpp +141 -129
- package/src/duckdb/src/function/table/system/duckdb_extensions.cpp +25 -14
- package/src/duckdb/src/function/table/system/duckdb_functions.cpp +20 -14
- package/src/duckdb/src/function/table/system/duckdb_indexes.cpp +15 -1
- package/src/duckdb/src/function/table/system/duckdb_variables.cpp +84 -0
- package/src/duckdb/src/function/table/system/test_all_types.cpp +1 -0
- package/src/duckdb/src/function/table/system/test_vector_types.cpp +33 -3
- package/src/duckdb/src/function/table/system_functions.cpp +1 -0
- package/src/duckdb/src/function/table/table_scan.cpp +45 -22
- package/src/duckdb/src/function/table/unnest.cpp +2 -2
- package/src/duckdb/src/function/table/version/pragma_version.cpp +4 -4
- package/src/duckdb/src/function/table_function.cpp +5 -4
- package/src/duckdb/src/function/table_macro_function.cpp +2 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog.hpp +8 -4
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/duck_index_entry.hpp +5 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/duck_schema_entry.hpp +3 -0
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/index_catalog_entry.hpp +2 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/macro_catalog_entry.hpp +3 -4
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_catalog_entry.hpp +5 -5
- package/src/duckdb/src/include/duckdb/catalog/default/builtin_types/types.hpp +2 -1
- package/src/duckdb/src/include/duckdb/catalog/default/default_functions.hpp +4 -5
- package/src/duckdb/src/include/duckdb/catalog/default/default_generator.hpp +4 -5
- package/src/duckdb/src/include/duckdb/catalog/default/default_schemas.hpp +2 -1
- package/src/duckdb/src/include/duckdb/catalog/default/default_table_functions.hpp +47 -0
- package/src/duckdb/src/include/duckdb/catalog/duck_catalog.hpp +2 -0
- package/src/duckdb/src/include/duckdb/catalog/similar_catalog_entry.hpp +2 -2
- package/src/duckdb/src/include/duckdb/common/allocator.hpp +9 -1
- package/src/duckdb/src/include/duckdb/common/array_ptr.hpp +120 -0
- package/src/duckdb/src/include/duckdb/common/arrow/appender/append_data.hpp +37 -11
- package/src/duckdb/src/include/duckdb/common/arrow/appender/enum_data.hpp +9 -8
- package/src/duckdb/src/include/duckdb/common/arrow/appender/list.hpp +1 -0
- package/src/duckdb/src/include/duckdb/common/arrow/appender/list_data.hpp +6 -4
- package/src/duckdb/src/include/duckdb/common/arrow/appender/list_view_data.hpp +92 -0
- package/src/duckdb/src/include/duckdb/common/arrow/appender/map_data.hpp +2 -2
- package/src/duckdb/src/include/duckdb/common/arrow/appender/scalar_data.hpp +26 -4
- package/src/duckdb/src/include/duckdb/common/arrow/appender/varchar_data.hpp +90 -11
- package/src/duckdb/src/include/duckdb/common/arrow/arrow_appender.hpp +6 -6
- package/src/duckdb/src/include/duckdb/common/arrow/arrow_buffer.hpp +8 -1
- package/src/duckdb/src/include/duckdb/common/arrow/arrow_merge_event.hpp +62 -0
- package/src/duckdb/src/include/duckdb/common/arrow/arrow_query_result.hpp +52 -0
- package/src/duckdb/src/include/duckdb/common/arrow/arrow_types_extension.hpp +42 -0
- package/src/duckdb/src/include/duckdb/common/arrow/physical_arrow_batch_collector.hpp +30 -0
- package/src/duckdb/src/include/duckdb/common/arrow/physical_arrow_collector.hpp +65 -0
- package/src/duckdb/src/include/duckdb/common/arrow/schema_metadata.hpp +43 -0
- package/src/duckdb/src/include/duckdb/common/bswap.hpp +18 -16
- package/src/duckdb/src/include/duckdb/common/cgroups.hpp +30 -0
- package/src/duckdb/src/include/duckdb/common/compressed_file_system.hpp +3 -0
- package/src/duckdb/src/include/duckdb/common/dl.hpp +8 -1
- package/src/duckdb/src/include/duckdb/common/encryption_state.hpp +48 -0
- package/src/duckdb/src/include/duckdb/common/enum_util.hpp +88 -0
- package/src/duckdb/src/include/duckdb/common/enums/checkpoint_type.hpp +2 -2
- package/src/duckdb/src/include/duckdb/common/enums/copy_overwrite_mode.hpp +6 -1
- package/src/duckdb/src/include/duckdb/common/enums/destroy_buffer_upon.hpp +21 -0
- package/src/duckdb/src/include/duckdb/common/enums/explain_format.hpp +17 -0
- package/src/duckdb/src/include/duckdb/common/enums/file_compression_type.hpp +4 -0
- package/src/duckdb/src/include/duckdb/common/enums/join_type.hpp +2 -2
- package/src/duckdb/src/include/duckdb/common/enums/metric_type.hpp +88 -0
- package/src/duckdb/src/include/duckdb/common/enums/optimizer_type.hpp +6 -1
- package/src/duckdb/src/include/duckdb/common/enums/pending_execution_result.hpp +2 -1
- package/src/duckdb/src/include/duckdb/common/enums/physical_operator_type.hpp +1 -0
- package/src/duckdb/src/include/duckdb/common/enums/profiler_format.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/enums/relation_type.hpp +3 -1
- package/src/duckdb/src/include/duckdb/common/enums/set_scope.hpp +2 -1
- package/src/duckdb/src/include/duckdb/common/enums/statement_type.hpp +23 -2
- package/src/duckdb/src/include/duckdb/common/enums/stream_execution_result.hpp +25 -0
- package/src/duckdb/src/include/duckdb/common/enums/tableref_type.hpp +2 -1
- package/src/duckdb/src/include/duckdb/common/enums/wal_type.hpp +1 -0
- package/src/duckdb/src/include/duckdb/common/error_data.hpp +5 -2
- package/src/duckdb/src/include/duckdb/common/exception/binder_exception.hpp +1 -0
- package/src/duckdb/src/include/duckdb/common/exception.hpp +20 -2
- package/src/duckdb/src/include/duckdb/common/extra_operator_info.hpp +12 -0
- package/src/duckdb/src/include/duckdb/common/file_buffer.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/file_open_flags.hpp +16 -0
- package/src/duckdb/src/include/duckdb/common/file_opener.hpp +18 -0
- package/src/duckdb/src/include/duckdb/common/file_system.hpp +3 -0
- package/src/duckdb/src/include/duckdb/common/filename_pattern.hpp +4 -0
- package/src/duckdb/src/include/duckdb/common/fixed_size_map.hpp +160 -96
- package/src/duckdb/src/include/duckdb/common/fsst.hpp +9 -2
- package/src/duckdb/src/include/duckdb/common/helper.hpp +22 -8
- package/src/duckdb/src/include/duckdb/common/hive_partitioning.hpp +16 -7
- package/src/duckdb/src/include/duckdb/common/http_util.hpp +19 -0
- package/src/duckdb/src/include/duckdb/common/insertion_order_preserving_map.hpp +19 -6
- package/src/duckdb/src/include/duckdb/common/limits.hpp +9 -2
- package/src/duckdb/src/include/duckdb/common/multi_file_list.hpp +38 -6
- package/src/duckdb/src/include/duckdb/common/multi_file_reader.hpp +9 -2
- package/src/duckdb/src/include/duckdb/common/multi_file_reader_options.hpp +5 -1
- package/src/duckdb/src/include/duckdb/common/numeric_utils.hpp +82 -50
- package/src/duckdb/src/include/duckdb/common/operator/abs.hpp +11 -0
- package/src/duckdb/src/include/duckdb/common/operator/cast_operators.hpp +7 -3
- package/src/duckdb/src/include/duckdb/common/operator/decimal_cast_operators.hpp +23 -1
- package/src/duckdb/src/include/duckdb/common/operator/double_cast_operator.hpp +2 -1
- package/src/duckdb/src/include/duckdb/common/operator/integer_cast_operator.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/operator/numeric_cast.hpp +4 -0
- package/src/duckdb/src/include/duckdb/common/operator/string_cast.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/optional_ptr.hpp +10 -5
- package/src/duckdb/src/include/duckdb/common/optionally_owned_ptr.hpp +1 -0
- package/src/duckdb/src/include/duckdb/common/owning_string_map.hpp +155 -0
- package/src/duckdb/src/include/duckdb/common/perfect_map_set.hpp +2 -3
- package/src/duckdb/src/include/duckdb/common/platform.hpp +58 -0
- package/src/duckdb/src/include/duckdb/common/radix.hpp +172 -27
- package/src/duckdb/src/include/duckdb/common/radix_partitioning.hpp +5 -1
- package/src/duckdb/src/include/duckdb/common/random_engine.hpp +1 -0
- package/src/duckdb/src/include/duckdb/common/re2_regex.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/render_tree.hpp +77 -0
- package/src/duckdb/src/include/duckdb/common/row_operations/row_matcher.hpp +12 -0
- package/src/duckdb/src/include/duckdb/common/serializer/binary_serializer.hpp +6 -2
- package/src/duckdb/src/include/duckdb/common/serializer/buffered_file_writer.hpp +5 -3
- package/src/duckdb/src/include/duckdb/common/serializer/deserializer.hpp +15 -7
- package/src/duckdb/src/include/duckdb/common/serializer/memory_stream.hpp +3 -1
- package/src/duckdb/src/include/duckdb/common/serializer/serialization_data.hpp +245 -0
- package/src/duckdb/src/include/duckdb/common/serializer/serializer.hpp +10 -0
- package/src/duckdb/src/include/duckdb/common/sort/duckdb_pdqsort.hpp +10 -11
- package/src/duckdb/src/include/duckdb/common/sort/partition_state.hpp +12 -6
- package/src/duckdb/src/include/duckdb/common/string_util.hpp +37 -7
- package/src/duckdb/src/include/duckdb/common/tree_renderer/graphviz_tree_renderer.hpp +44 -0
- package/src/duckdb/src/include/duckdb/common/tree_renderer/html_tree_renderer.hpp +44 -0
- package/src/duckdb/src/include/duckdb/common/tree_renderer/json_tree_renderer.hpp +44 -0
- package/src/duckdb/src/include/duckdb/common/tree_renderer/text_tree_renderer.hpp +119 -0
- package/src/duckdb/src/include/duckdb/common/tree_renderer.hpp +9 -123
- package/src/duckdb/src/include/duckdb/common/type_visitor.hpp +96 -0
- package/src/duckdb/src/include/duckdb/common/typedefs.hpp +11 -1
- package/src/duckdb/src/include/duckdb/common/types/arrow_string_view_type.hpp +84 -0
- package/src/duckdb/src/include/duckdb/common/types/batched_data_collection.hpp +36 -1
- package/src/duckdb/src/include/duckdb/common/types/bit.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/types/cast_helpers.hpp +2 -2
- package/src/duckdb/src/include/duckdb/common/types/column/column_data_allocator.hpp +4 -2
- package/src/duckdb/src/include/duckdb/common/types/column/partitioned_column_data.hpp +52 -0
- package/src/duckdb/src/include/duckdb/common/types/data_chunk.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/types/date.hpp +0 -3
- package/src/duckdb/src/include/duckdb/common/types/date_lookup_cache.hpp +65 -0
- package/src/duckdb/src/include/duckdb/common/types/datetime.hpp +5 -2
- package/src/duckdb/src/include/duckdb/common/types/hyperloglog.hpp +49 -40
- package/src/duckdb/src/include/duckdb/common/types/interval.hpp +5 -1
- package/src/duckdb/src/include/duckdb/common/types/list_segment.hpp +2 -1
- package/src/duckdb/src/include/duckdb/common/types/row/partitioned_tuple_data.hpp +41 -9
- package/src/duckdb/src/include/duckdb/common/types/row/row_data_collection.hpp +4 -3
- package/src/duckdb/src/include/duckdb/common/types/row/row_data_collection_scanner.hpp +3 -1
- package/src/duckdb/src/include/duckdb/common/types/row/tuple_data_allocator.hpp +4 -0
- package/src/duckdb/src/include/duckdb/common/types/row/tuple_data_collection.hpp +4 -0
- package/src/duckdb/src/include/duckdb/common/types/row/tuple_data_states.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/types/selection_vector.hpp +4 -0
- package/src/duckdb/src/include/duckdb/common/types/string_type.hpp +4 -1
- package/src/duckdb/src/include/duckdb/common/types/time.hpp +11 -6
- package/src/duckdb/src/include/duckdb/common/types/timestamp.hpp +13 -3
- package/src/duckdb/src/include/duckdb/common/types/validity_mask.hpp +103 -12
- package/src/duckdb/src/include/duckdb/common/types/value.hpp +12 -3
- package/src/duckdb/src/include/duckdb/common/types/varint.hpp +107 -0
- package/src/duckdb/src/include/duckdb/common/types/vector.hpp +5 -1
- package/src/duckdb/src/include/duckdb/common/types/vector_buffer.hpp +7 -2
- package/src/duckdb/src/include/duckdb/common/types.hpp +6 -39
- package/src/duckdb/src/include/duckdb/common/union_by_name.hpp +42 -10
- package/src/duckdb/src/include/duckdb/common/vector_operations/generic_executor.hpp +29 -0
- package/src/duckdb/src/include/duckdb/common/vector_operations/unary_executor.hpp +0 -7
- package/src/duckdb/src/include/duckdb/common/vector_operations/vector_operations.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/winapi.hpp +8 -0
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/algebraic/covar.hpp +8 -4
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/algebraic/stddev.hpp +8 -4
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/distributive_functions.hpp +4 -2
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/histogram_helpers.hpp +99 -0
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/holistic_functions.hpp +16 -7
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/minmax_n_helpers.hpp +396 -0
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/nested_functions.hpp +10 -0
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/quantile_helpers.hpp +65 -0
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/quantile_sort_tree.hpp +349 -0
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/quantile_state.hpp +300 -0
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/regression/regr_slope.hpp +1 -1
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/sort_key_helpers.hpp +55 -0
- package/src/duckdb/src/include/duckdb/core_functions/array_kernels.hpp +107 -0
- package/src/duckdb/src/include/duckdb/core_functions/create_sort_key.hpp +55 -0
- package/src/duckdb/src/include/duckdb/core_functions/lambda_functions.hpp +1 -2
- package/src/duckdb/src/include/duckdb/core_functions/scalar/array_functions.hpp +24 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/date_functions.hpp +9 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/generic_functions.hpp +27 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/list_functions.hpp +80 -8
- package/src/duckdb/src/include/duckdb/core_functions/scalar/map_functions.hpp +9 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/math_functions.hpp +54 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/string_functions.hpp +30 -21
- package/src/duckdb/src/include/duckdb/execution/adaptive_filter.hpp +25 -14
- package/src/duckdb/src/include/duckdb/execution/aggregate_hashtable.hpp +2 -48
- package/src/duckdb/src/include/duckdb/execution/executor.hpp +25 -2
- package/src/duckdb/src/include/duckdb/execution/ht_entry.hpp +102 -0
- package/src/duckdb/src/include/duckdb/execution/index/art/art.hpp +94 -101
- package/src/duckdb/src/include/duckdb/execution/index/art/art_key.hpp +43 -25
- package/src/duckdb/src/include/duckdb/execution/index/art/base_leaf.hpp +109 -0
- package/src/duckdb/src/include/duckdb/execution/index/art/base_node.hpp +140 -0
- package/src/duckdb/src/include/duckdb/execution/index/art/iterator.hpp +43 -24
- package/src/duckdb/src/include/duckdb/execution/index/art/leaf.hpp +41 -52
- package/src/duckdb/src/include/duckdb/execution/index/art/node.hpp +133 -74
- package/src/duckdb/src/include/duckdb/execution/index/art/node256.hpp +46 -29
- package/src/duckdb/src/include/duckdb/execution/index/art/node256_leaf.hpp +53 -0
- package/src/duckdb/src/include/duckdb/execution/index/art/node48.hpp +52 -35
- package/src/duckdb/src/include/duckdb/execution/index/art/prefix.hpp +96 -57
- package/src/duckdb/src/include/duckdb/execution/index/bound_index.hpp +9 -4
- package/src/duckdb/src/include/duckdb/execution/index/fixed_size_allocator.hpp +48 -10
- package/src/duckdb/src/include/duckdb/execution/index/fixed_size_buffer.hpp +0 -2
- package/src/duckdb/src/include/duckdb/execution/index/index_pointer.hpp +4 -2
- package/src/duckdb/src/include/duckdb/execution/join_hashtable.hpp +114 -36
- package/src/duckdb/src/include/duckdb/execution/merge_sort_tree.hpp +158 -67
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/aggregate_object.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_hash_aggregate.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_perfecthash_aggregate.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_streaming_window.hpp +19 -2
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_ungrouped_aggregate.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_window.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/ungrouped_aggregate_state.hpp +75 -0
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/base_scanner.hpp +81 -23
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/column_count_scanner.hpp +27 -8
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_buffer_manager.hpp +2 -1
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_error.hpp +31 -22
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_file_handle.hpp +4 -2
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_file_scanner.hpp +48 -5
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_option.hpp +7 -3
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_reader_options.hpp +22 -12
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_schema.hpp +35 -0
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_sniffer.hpp +81 -39
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_state.hpp +2 -1
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_state_machine.hpp +18 -1
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_state_machine_cache.hpp +9 -7
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/global_csv_state.hpp +5 -4
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/header_value.hpp +26 -0
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/scanner_boundary.hpp +6 -9
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/skip_scanner.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/state_machine_options.hpp +5 -3
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/string_value_scanner.hpp +36 -19
- package/src/duckdb/src/include/duckdb/execution/operator/filter/physical_filter.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_batch_collector.hpp +21 -0
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_buffered_batch_collector.hpp +53 -0
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_buffered_collector.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_explain_analyze.hpp +6 -2
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_materialized_collector.hpp +18 -0
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_reservoir_sample.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_result_collector.hpp +6 -0
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_set.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_set_variable.hpp +43 -0
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_streaming_sample.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/join/join_filter_pushdown.hpp +59 -0
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_blockwise_nl_join.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_comparison_join.hpp +8 -1
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_delim_join.hpp +5 -2
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_hash_join.hpp +4 -2
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_iejoin.hpp +2 -0
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_join.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_left_delim_join.hpp +3 -1
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_range_join.hpp +4 -1
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_right_delim_join.hpp +3 -1
- package/src/duckdb/src/include/duckdb/execution/operator/order/physical_order.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/order/physical_top_n.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/batch_memory_manager.hpp +5 -37
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_batch_copy_to_file.hpp +5 -4
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_copy_to_file.hpp +8 -2
- package/src/duckdb/src/include/duckdb/execution/operator/projection/physical_projection.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/projection/physical_tableinout_function.hpp +2 -0
- package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_column_data_scan.hpp +9 -3
- package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_table_scan.hpp +8 -6
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_art_index.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/set/physical_cte.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/set/physical_recursive_cte.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/physical_operator.hpp +21 -6
- package/src/duckdb/src/include/duckdb/execution/physical_operator_states.hpp +3 -2
- package/src/duckdb/src/include/duckdb/execution/physical_plan_generator.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/window_executor.hpp +137 -110
- package/src/duckdb/src/include/duckdb/execution/window_segment_tree.hpp +57 -126
- package/src/duckdb/src/include/duckdb/function/aggregate_function.hpp +21 -4
- package/src/duckdb/src/include/duckdb/function/cast/default_casts.hpp +1 -1
- package/src/duckdb/src/include/duckdb/function/compression/compression.hpp +10 -10
- package/src/duckdb/src/include/duckdb/function/compression_function.hpp +37 -7
- package/src/duckdb/src/include/duckdb/function/copy_function.hpp +24 -11
- package/src/duckdb/src/include/duckdb/function/function_binder.hpp +4 -4
- package/src/duckdb/src/include/duckdb/function/function_serialization.hpp +41 -1
- package/src/duckdb/src/include/duckdb/function/macro_function.hpp +15 -5
- package/src/duckdb/src/include/duckdb/function/pragma/pragma_functions.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/replacement_scan.hpp +20 -4
- package/src/duckdb/src/include/duckdb/function/scalar/generic_functions.hpp +6 -0
- package/src/duckdb/src/include/duckdb/function/scalar/list/contains_or_position.hpp +77 -109
- package/src/duckdb/src/include/duckdb/function/scalar/nested_functions.hpp +1 -1
- package/src/duckdb/src/include/duckdb/function/scalar/regexp.hpp +6 -3
- package/src/duckdb/src/include/duckdb/function/scalar/strftime_format.hpp +25 -12
- package/src/duckdb/src/include/duckdb/function/scalar/string_functions.hpp +9 -8
- package/src/duckdb/src/include/duckdb/function/scalar_function.hpp +38 -4
- package/src/duckdb/src/include/duckdb/function/scalar_macro_function.hpp +1 -1
- package/src/duckdb/src/include/duckdb/function/table/arrow/arrow_duck_schema.hpp +11 -57
- package/src/duckdb/src/include/duckdb/function/table/arrow/arrow_type_info.hpp +142 -0
- package/src/duckdb/src/include/duckdb/function/table/arrow/enum/arrow_datetime_type.hpp +18 -0
- package/src/duckdb/src/include/duckdb/function/table/arrow/enum/arrow_type_info_type.hpp +7 -0
- package/src/duckdb/src/include/duckdb/function/table/arrow/enum/arrow_variable_size_type.hpp +10 -0
- package/src/duckdb/src/include/duckdb/function/table/arrow.hpp +2 -0
- package/src/duckdb/src/include/duckdb/function/table/range.hpp +4 -0
- package/src/duckdb/src/include/duckdb/function/table/read_csv.hpp +4 -1
- package/src/duckdb/src/include/duckdb/function/table/system_functions.hpp +4 -0
- package/src/duckdb/src/include/duckdb/function/table/table_scan.hpp +5 -5
- package/src/duckdb/src/include/duckdb/function/table_function.hpp +14 -2
- package/src/duckdb/src/include/duckdb/function/table_macro_function.hpp +1 -1
- package/src/duckdb/src/include/duckdb/main/appender.hpp +14 -4
- package/src/duckdb/src/include/duckdb/main/attached_database.hpp +25 -7
- package/src/duckdb/src/include/duckdb/main/buffered_data/batched_buffered_data.hpp +79 -0
- package/src/duckdb/src/include/duckdb/main/buffered_data/buffered_data.hpp +10 -20
- package/src/duckdb/src/include/duckdb/main/buffered_data/simple_buffered_data.hpp +11 -12
- package/src/duckdb/src/include/duckdb/main/capi/capi_internal.hpp +7 -2
- package/src/duckdb/src/include/duckdb/main/capi/cast/generic.hpp +1 -1
- package/src/duckdb/src/include/duckdb/main/capi/cast/utils.hpp +2 -2
- package/src/duckdb/src/include/duckdb/main/capi/extension_api.hpp +809 -0
- package/src/duckdb/src/include/duckdb/main/chunk_scan_state/batched_data_collection.hpp +35 -0
- package/src/duckdb/src/include/duckdb/main/client_config.hpp +68 -2
- package/src/duckdb/src/include/duckdb/main/client_context.hpp +30 -22
- package/src/duckdb/src/include/duckdb/main/client_context_state.hpp +79 -1
- package/src/duckdb/src/include/duckdb/main/client_properties.hpp +9 -3
- package/src/duckdb/src/include/duckdb/main/config.hpp +55 -7
- package/src/duckdb/src/include/duckdb/main/connection.hpp +5 -1
- package/src/duckdb/src/include/duckdb/main/database.hpp +16 -5
- package/src/duckdb/src/include/duckdb/main/database_manager.hpp +9 -8
- package/src/duckdb/src/include/duckdb/main/db_instance_cache.hpp +21 -6
- package/src/duckdb/src/include/duckdb/main/extension.hpp +20 -0
- package/src/duckdb/src/include/duckdb/main/extension_entries.hpp +25 -0
- package/src/duckdb/src/include/duckdb/main/extension_helper.hpp +29 -23
- package/src/duckdb/src/include/duckdb/main/extension_install_info.hpp +6 -0
- package/src/duckdb/src/include/duckdb/main/extension_util.hpp +3 -0
- package/src/duckdb/src/include/duckdb/main/pending_query_result.hpp +4 -2
- package/src/duckdb/src/include/duckdb/main/prepared_statement.hpp +5 -6
- package/src/duckdb/src/include/duckdb/main/prepared_statement_data.hpp +2 -5
- package/src/duckdb/src/include/duckdb/main/profiling_info.hpp +87 -0
- package/src/duckdb/src/include/duckdb/main/profiling_node.hpp +60 -0
- package/src/duckdb/src/include/duckdb/main/query_profiler.hpp +72 -34
- package/src/duckdb/src/include/duckdb/main/query_result.hpp +1 -1
- package/src/duckdb/src/include/duckdb/main/relation/create_table_relation.hpp +2 -1
- package/src/duckdb/src/include/duckdb/main/relation/delim_get_relation.hpp +30 -0
- package/src/duckdb/src/include/duckdb/main/relation/explain_relation.hpp +3 -1
- package/src/duckdb/src/include/duckdb/main/relation/join_relation.hpp +3 -0
- package/src/duckdb/src/include/duckdb/main/relation/materialized_relation.hpp +1 -4
- package/src/duckdb/src/include/duckdb/main/relation/query_relation.hpp +4 -1
- package/src/duckdb/src/include/duckdb/main/relation/read_json_relation.hpp +6 -0
- package/src/duckdb/src/include/duckdb/main/relation/table_function_relation.hpp +1 -0
- package/src/duckdb/src/include/duckdb/main/relation/view_relation.hpp +2 -0
- package/src/duckdb/src/include/duckdb/main/relation.hpp +7 -4
- package/src/duckdb/src/include/duckdb/main/secret/default_secrets.hpp +36 -0
- package/src/duckdb/src/include/duckdb/main/secret/secret.hpp +108 -0
- package/src/duckdb/src/include/duckdb/main/secret/secret_manager.hpp +14 -4
- package/src/duckdb/src/include/duckdb/main/settings.hpp +227 -3
- package/src/duckdb/src/include/duckdb/main/stream_query_result.hpp +8 -0
- package/src/duckdb/src/include/duckdb/optimizer/build_probe_side_optimizer.hpp +51 -0
- package/src/duckdb/src/include/duckdb/optimizer/compressed_materialization.hpp +7 -0
- package/src/duckdb/src/include/duckdb/optimizer/cte_filter_pusher.hpp +46 -0
- package/src/duckdb/src/include/duckdb/optimizer/filter_combiner.hpp +1 -1
- package/src/duckdb/src/include/duckdb/optimizer/filter_pushdown.hpp +7 -0
- package/src/duckdb/src/include/duckdb/optimizer/join_filter_pushdown_optimizer.hpp +31 -0
- package/src/duckdb/src/include/duckdb/optimizer/join_order/cardinality_estimator.hpp +51 -10
- package/src/duckdb/src/include/duckdb/optimizer/join_order/cost_model.hpp +1 -0
- package/src/duckdb/src/include/duckdb/optimizer/join_order/join_order_optimizer.hpp +17 -5
- package/src/duckdb/src/include/duckdb/optimizer/join_order/query_graph.hpp +1 -1
- package/src/duckdb/src/include/duckdb/optimizer/join_order/query_graph_manager.hpp +15 -13
- package/src/duckdb/src/include/duckdb/optimizer/join_order/relation_manager.hpp +9 -4
- package/src/duckdb/src/include/duckdb/optimizer/limit_pushdown.hpp +25 -0
- package/src/duckdb/src/include/duckdb/optimizer/optimizer.hpp +1 -0
- package/src/duckdb/src/include/duckdb/optimizer/rule/join_dependent_filter.hpp +37 -0
- package/src/duckdb/src/include/duckdb/parallel/executor_task.hpp +6 -1
- package/src/duckdb/src/include/duckdb/parallel/interrupt.hpp +54 -2
- package/src/duckdb/src/include/duckdb/parallel/meta_pipeline.hpp +27 -8
- package/src/duckdb/src/include/duckdb/parallel/pipeline.hpp +1 -0
- package/src/duckdb/src/include/duckdb/parallel/pipeline_prepare_finish_event.hpp +25 -0
- package/src/duckdb/src/include/duckdb/parallel/task_executor.hpp +63 -0
- package/src/duckdb/src/include/duckdb/parallel/task_scheduler.hpp +10 -1
- package/src/duckdb/src/include/duckdb/parser/expression/function_expression.hpp +4 -1
- package/src/duckdb/src/include/duckdb/parser/expression/star_expression.hpp +5 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_table_info.hpp +5 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/attach_info.hpp +5 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_index_info.hpp +2 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_macro_info.hpp +11 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/transaction_info.hpp +9 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_expression_iterator.hpp +13 -6
- package/src/duckdb/src/include/duckdb/parser/parser_extension.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/sql_statement.hpp +1 -3
- package/src/duckdb/src/include/duckdb/parser/statement/copy_statement.hpp +2 -0
- package/src/duckdb/src/include/duckdb/parser/statement/explain_statement.hpp +5 -1
- package/src/duckdb/src/include/duckdb/parser/statement/set_statement.hpp +2 -2
- package/src/duckdb/src/include/duckdb/parser/statement/transaction_statement.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/tableref/basetableref.hpp +0 -2
- package/src/duckdb/src/include/duckdb/parser/tableref/column_data_ref.hpp +9 -7
- package/src/duckdb/src/include/duckdb/parser/tableref/delimgetref.hpp +37 -0
- package/src/duckdb/src/include/duckdb/parser/tableref/joinref.hpp +4 -0
- package/src/duckdb/src/include/duckdb/parser/tableref/pivotref.hpp +0 -2
- package/src/duckdb/src/include/duckdb/parser/tableref/subqueryref.hpp +0 -2
- package/src/duckdb/src/include/duckdb/parser/tableref/table_function_ref.hpp +0 -1
- package/src/duckdb/src/include/duckdb/parser/tableref.hpp +3 -1
- package/src/duckdb/src/include/duckdb/parser/transformer.hpp +17 -9
- package/src/duckdb/src/include/duckdb/planner/binder.hpp +24 -14
- package/src/duckdb/src/include/duckdb/planner/collation_binding.hpp +44 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_aggregate_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression/bound_between_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression/bound_case_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression/bound_cast_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression/bound_columnref_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression/bound_comparison_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression/bound_conjunction_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression/bound_constant_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression/bound_default_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression/bound_expanded_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression/bound_function_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression/bound_lambda_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression/bound_lambdaref_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression/bound_operator_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression/bound_parameter_data.hpp +2 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_parameter_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression/bound_reference_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression/bound_subquery_expression.hpp +2 -2
- package/src/duckdb/src/include/duckdb/planner/expression/bound_unnest_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression/bound_window_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression.hpp +2 -2
- package/src/duckdb/src/include/duckdb/planner/expression_binder/column_alias_binder.hpp +2 -0
- package/src/duckdb/src/include/duckdb/planner/expression_binder/group_binder.hpp +1 -0
- package/src/duckdb/src/include/duckdb/planner/expression_binder/order_binder.hpp +6 -5
- package/src/duckdb/src/include/duckdb/planner/expression_binder/where_binder.hpp +1 -0
- package/src/duckdb/src/include/duckdb/planner/expression_binder.hpp +19 -11
- package/src/duckdb/src/include/duckdb/planner/filter/conjunction_filter.hpp +4 -0
- package/src/duckdb/src/include/duckdb/planner/filter/constant_filter.hpp +2 -0
- package/src/duckdb/src/include/duckdb/planner/filter/null_filter.hpp +4 -0
- package/src/duckdb/src/include/duckdb/planner/filter/struct_filter.hpp +2 -0
- package/src/duckdb/src/include/duckdb/planner/logical_operator.hpp +7 -2
- package/src/duckdb/src/include/duckdb/planner/logical_operator_visitor.hpp +2 -1
- package/src/duckdb/src/include/duckdb/planner/operator/logical_aggregate.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/operator/logical_any_join.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/operator/logical_comparison_join.hpp +6 -1
- package/src/duckdb/src/include/duckdb/planner/operator/logical_copy_to_file.hpp +10 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_cteref.hpp +1 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_delim_get.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/operator/logical_distinct.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/operator/logical_execute.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/operator/logical_explain.hpp +4 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_get.hpp +15 -5
- package/src/duckdb/src/include/duckdb/planner/operator/logical_materialized_cte.hpp +1 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_order.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/subquery/flatten_dependent_join.hpp +2 -1
- package/src/duckdb/src/include/duckdb/planner/table_filter.hpp +24 -2
- package/src/duckdb/src/include/duckdb/planner/tableref/bound_delimgetref.hpp +26 -0
- package/src/duckdb/src/include/duckdb/planner/tableref/bound_joinref.hpp +6 -0
- package/src/duckdb/src/include/duckdb/planner/tableref/bound_subqueryref.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/tableref/bound_table_function.hpp +2 -0
- package/src/duckdb/src/include/duckdb/planner/tableref/list.hpp +2 -0
- package/src/duckdb/src/include/duckdb/storage/arena_allocator.hpp +2 -1
- package/src/duckdb/src/include/duckdb/storage/block.hpp +4 -2
- package/src/duckdb/src/include/duckdb/storage/block_manager.hpp +48 -3
- package/src/duckdb/src/include/duckdb/storage/buffer/block_handle.hpp +21 -7
- package/src/duckdb/src/include/duckdb/storage/buffer/buffer_pool.hpp +65 -51
- package/src/duckdb/src/include/duckdb/storage/buffer_manager.hpp +14 -5
- package/src/duckdb/src/include/duckdb/storage/checkpoint/row_group_writer.hpp +0 -4
- package/src/duckdb/src/include/duckdb/storage/checkpoint/string_checkpoint_state.hpp +3 -2
- package/src/duckdb/src/include/duckdb/storage/checkpoint/table_data_writer.hpp +1 -0
- package/src/duckdb/src/include/duckdb/storage/checkpoint/write_overflow_strings_to_disk.hpp +3 -4
- package/src/duckdb/src/include/duckdb/storage/checkpoint_manager.hpp +2 -0
- package/src/duckdb/src/include/duckdb/storage/compression/alp/algorithm/alp.hpp +4 -4
- package/src/duckdb/src/include/duckdb/storage/compression/alp/alp_analyze.hpp +6 -4
- package/src/duckdb/src/include/duckdb/storage/compression/alp/alp_compress.hpp +19 -17
- package/src/duckdb/src/include/duckdb/storage/compression/alp/alp_constants.hpp +2 -2
- package/src/duckdb/src/include/duckdb/storage/compression/alp/alp_scan.hpp +3 -4
- package/src/duckdb/src/include/duckdb/storage/compression/alp/alp_utils.hpp +3 -2
- package/src/duckdb/src/include/duckdb/storage/compression/alprd/algorithm/alprd.hpp +3 -2
- package/src/duckdb/src/include/duckdb/storage/compression/alprd/alprd_analyze.hpp +13 -11
- package/src/duckdb/src/include/duckdb/storage/compression/alprd/alprd_compress.hpp +19 -19
- package/src/duckdb/src/include/duckdb/storage/compression/alprd/alprd_scan.hpp +3 -4
- package/src/duckdb/src/include/duckdb/storage/compression/chimp/chimp_scan.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/compression/patas/patas_scan.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/data_pointer.hpp +10 -2
- package/src/duckdb/src/include/duckdb/storage/data_table.hpp +3 -2
- package/src/duckdb/src/include/duckdb/storage/in_memory_block_manager.hpp +15 -0
- package/src/duckdb/src/include/duckdb/storage/index_storage_info.hpp +14 -10
- package/src/duckdb/src/include/duckdb/storage/metadata/metadata_manager.hpp +6 -8
- package/src/duckdb/src/include/duckdb/storage/partial_block_manager.hpp +7 -4
- package/src/duckdb/src/include/duckdb/storage/segment/uncompressed.hpp +4 -7
- package/src/duckdb/src/include/duckdb/storage/single_file_block_manager.hpp +29 -4
- package/src/duckdb/src/include/duckdb/storage/standard_buffer_manager.hpp +22 -7
- package/src/duckdb/src/include/duckdb/storage/statistics/base_statistics.hpp +15 -2
- package/src/duckdb/src/include/duckdb/storage/statistics/distinct_statistics.hpp +8 -2
- package/src/duckdb/src/include/duckdb/storage/statistics/numeric_stats.hpp +5 -16
- package/src/duckdb/src/include/duckdb/storage/statistics/numeric_stats_union.hpp +51 -13
- package/src/duckdb/src/include/duckdb/storage/statistics/string_stats.hpp +6 -3
- package/src/duckdb/src/include/duckdb/storage/storage_info.hpp +29 -19
- package/src/duckdb/src/include/duckdb/storage/storage_manager.hpp +23 -7
- package/src/duckdb/src/include/duckdb/storage/string_uncompressed.hpp +27 -18
- package/src/duckdb/src/include/duckdb/storage/table/append_state.hpp +6 -3
- package/src/duckdb/src/include/duckdb/storage/table/array_column_data.hpp +5 -2
- package/src/duckdb/src/include/duckdb/storage/table/chunk_info.hpp +3 -0
- package/src/duckdb/src/include/duckdb/storage/table/column_checkpoint_state.hpp +5 -1
- package/src/duckdb/src/include/duckdb/storage/table/column_data.hpp +77 -6
- package/src/duckdb/src/include/duckdb/storage/table/column_segment.hpp +23 -11
- package/src/duckdb/src/include/duckdb/storage/table/data_table_info.hpp +3 -0
- package/src/duckdb/src/include/duckdb/storage/table/list_column_data.hpp +5 -2
- package/src/duckdb/src/include/duckdb/storage/table/row_group.hpp +18 -4
- package/src/duckdb/src/include/duckdb/storage/table/row_group_collection.hpp +7 -1
- package/src/duckdb/src/include/duckdb/storage/table/row_version_manager.hpp +2 -1
- package/src/duckdb/src/include/duckdb/storage/table/scan_state.hpp +89 -14
- package/src/duckdb/src/include/duckdb/storage/table/standard_column_data.hpp +4 -2
- package/src/duckdb/src/include/duckdb/storage/table/struct_column_data.hpp +4 -2
- package/src/duckdb/src/include/duckdb/storage/table/table_index_list.hpp +2 -2
- package/src/duckdb/src/include/duckdb/storage/table/validity_column_data.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/temporary_memory_manager.hpp +33 -15
- package/src/duckdb/src/include/duckdb/storage/write_ahead_log.hpp +9 -9
- package/src/duckdb/src/include/duckdb/transaction/cleanup_state.hpp +3 -1
- package/src/duckdb/src/include/duckdb/transaction/commit_state.hpp +4 -16
- package/src/duckdb/src/include/duckdb/transaction/duck_transaction.hpp +27 -4
- package/src/duckdb/src/include/duckdb/transaction/duck_transaction_manager.hpp +11 -0
- package/src/duckdb/src/include/duckdb/transaction/local_storage.hpp +6 -2
- package/src/duckdb/src/include/duckdb/transaction/meta_transaction.hpp +5 -5
- package/src/duckdb/src/include/duckdb/transaction/transaction_context.hpp +6 -2
- package/src/duckdb/src/include/duckdb/transaction/undo_buffer.hpp +5 -3
- package/src/duckdb/src/include/duckdb/transaction/wal_write_state.hpp +48 -0
- package/src/duckdb/src/include/duckdb.h +1779 -739
- package/src/duckdb/src/include/duckdb_extension.h +921 -0
- package/src/duckdb/src/main/appender.cpp +53 -7
- package/src/duckdb/src/main/attached_database.cpp +87 -17
- package/src/duckdb/src/main/buffered_data/batched_buffered_data.cpp +226 -0
- package/src/duckdb/src/main/buffered_data/buffered_data.cpp +35 -0
- package/src/duckdb/src/main/buffered_data/simple_buffered_data.cpp +48 -23
- package/src/duckdb/src/main/capi/aggregate_function-c.cpp +327 -0
- package/src/duckdb/src/main/capi/appender-c.cpp +18 -0
- package/src/duckdb/src/main/capi/cast/utils-c.cpp +2 -2
- package/src/duckdb/src/main/capi/cast_function-c.cpp +210 -0
- package/src/duckdb/src/main/capi/config-c.cpp +3 -3
- package/src/duckdb/src/main/capi/data_chunk-c.cpp +18 -7
- package/src/duckdb/src/main/capi/duckdb_value-c.cpp +223 -24
- package/src/duckdb/src/main/capi/helper-c.cpp +51 -11
- package/src/duckdb/src/main/capi/logical_types-c.cpp +105 -46
- package/src/duckdb/src/main/capi/pending-c.cpp +7 -6
- package/src/duckdb/src/main/capi/prepared-c.cpp +18 -7
- package/src/duckdb/src/main/capi/profiling_info-c.cpp +84 -0
- package/src/duckdb/src/main/capi/result-c.cpp +139 -37
- package/src/duckdb/src/main/capi/scalar_function-c.cpp +269 -0
- package/src/duckdb/src/main/capi/table_description-c.cpp +82 -0
- package/src/duckdb/src/main/capi/table_function-c.cpp +161 -95
- package/src/duckdb/src/main/capi/value-c.cpp +2 -2
- package/src/duckdb/src/main/chunk_scan_state/batched_data_collection.cpp +57 -0
- package/src/duckdb/src/main/client_config.cpp +17 -0
- package/src/duckdb/src/main/client_context.cpp +67 -52
- package/src/duckdb/src/main/client_data.cpp +3 -3
- package/src/duckdb/src/main/config.cpp +120 -62
- package/src/duckdb/src/main/connection.cpp +14 -2
- package/src/duckdb/src/main/database.cpp +96 -35
- package/src/duckdb/src/main/database_manager.cpp +25 -23
- package/src/duckdb/src/main/database_path_and_type.cpp +2 -2
- package/src/duckdb/src/main/db_instance_cache.cpp +54 -19
- package/src/duckdb/src/main/extension/extension_helper.cpp +47 -42
- package/src/duckdb/src/main/extension/extension_install.cpp +155 -87
- package/src/duckdb/src/main/extension/extension_load.cpp +180 -26
- package/src/duckdb/src/main/extension/extension_util.cpp +8 -0
- package/src/duckdb/src/main/extension.cpp +72 -5
- package/src/duckdb/src/main/pending_query_result.cpp +20 -12
- package/src/duckdb/src/main/prepared_statement.cpp +6 -6
- package/src/duckdb/src/main/prepared_statement_data.cpp +28 -17
- package/src/duckdb/src/main/profiling_info.cpp +196 -0
- package/src/duckdb/src/main/query_profiler.cpp +413 -224
- package/src/duckdb/src/main/query_result.cpp +1 -1
- package/src/duckdb/src/main/relation/create_table_relation.cpp +4 -2
- package/src/duckdb/src/main/relation/create_view_relation.cpp +0 -6
- package/src/duckdb/src/main/relation/delim_get_relation.cpp +44 -0
- package/src/duckdb/src/main/relation/explain_relation.cpp +4 -3
- package/src/duckdb/src/main/relation/join_relation.cpp +5 -0
- package/src/duckdb/src/main/relation/limit_relation.cpp +1 -1
- package/src/duckdb/src/main/relation/materialized_relation.cpp +3 -3
- package/src/duckdb/src/main/relation/query_relation.cpp +42 -15
- package/src/duckdb/src/main/relation/read_csv_relation.cpp +7 -14
- package/src/duckdb/src/main/relation/read_json_relation.cpp +20 -0
- package/src/duckdb/src/main/relation/setop_relation.cpp +1 -1
- package/src/duckdb/src/main/relation/table_function_relation.cpp +6 -0
- package/src/duckdb/src/main/relation/view_relation.cpp +10 -0
- package/src/duckdb/src/main/relation.cpp +12 -8
- package/src/duckdb/src/main/secret/default_secrets.cpp +108 -0
- package/src/duckdb/src/main/secret/secret.cpp +145 -2
- package/src/duckdb/src/main/secret/secret_manager.cpp +85 -35
- package/src/duckdb/src/main/secret/secret_storage.cpp +29 -17
- package/src/duckdb/src/main/settings/settings.cpp +503 -11
- package/src/duckdb/src/main/stream_query_result.cpp +75 -2
- package/src/duckdb/src/optimizer/build_probe_side_optimizer.cpp +248 -0
- package/src/duckdb/src/optimizer/column_lifetime_analyzer.cpp +28 -6
- package/src/duckdb/src/optimizer/compressed_materialization/compress_comparison_join.cpp +152 -0
- package/src/duckdb/src/optimizer/compressed_materialization.cpp +11 -1
- package/src/duckdb/src/optimizer/cse_optimizer.cpp +3 -0
- package/src/duckdb/src/optimizer/cte_filter_pusher.cpp +117 -0
- package/src/duckdb/src/optimizer/filter_combiner.cpp +30 -9
- package/src/duckdb/src/optimizer/filter_pullup.cpp +54 -2
- package/src/duckdb/src/optimizer/filter_pushdown.cpp +71 -3
- package/src/duckdb/src/optimizer/join_filter_pushdown_optimizer.cpp +154 -0
- package/src/duckdb/src/optimizer/join_order/cardinality_estimator.cpp +245 -114
- package/src/duckdb/src/optimizer/join_order/join_order_optimizer.cpp +42 -20
- package/src/duckdb/src/optimizer/join_order/join_relation_set.cpp +6 -2
- package/src/duckdb/src/optimizer/join_order/plan_enumerator.cpp +32 -10
- package/src/duckdb/src/optimizer/join_order/query_graph_manager.cpp +97 -131
- package/src/duckdb/src/optimizer/join_order/relation_manager.cpp +265 -51
- package/src/duckdb/src/optimizer/join_order/relation_statistics_helper.cpp +21 -17
- package/src/duckdb/src/optimizer/limit_pushdown.cpp +42 -0
- package/src/duckdb/src/optimizer/optimizer.cpp +51 -8
- package/src/duckdb/src/optimizer/pushdown/pushdown_aggregate.cpp +17 -17
- package/src/duckdb/src/optimizer/pushdown/pushdown_cross_product.cpp +22 -4
- package/src/duckdb/src/optimizer/pushdown/pushdown_get.cpp +1 -18
- package/src/duckdb/src/optimizer/pushdown/pushdown_inner_join.cpp +6 -0
- package/src/duckdb/src/optimizer/pushdown/pushdown_mark_join.cpp +4 -2
- package/src/duckdb/src/optimizer/pushdown/pushdown_window.cpp +91 -0
- package/src/duckdb/src/optimizer/remove_unused_columns.cpp +21 -25
- package/src/duckdb/src/optimizer/rule/comparison_simplification.cpp +1 -0
- package/src/duckdb/src/optimizer/rule/empty_needle_removal.cpp +3 -0
- package/src/duckdb/src/optimizer/rule/equal_or_null_simplification.cpp +2 -2
- package/src/duckdb/src/optimizer/rule/in_clause_simplification_rule.cpp +8 -2
- package/src/duckdb/src/optimizer/rule/join_dependent_filter.cpp +135 -0
- package/src/duckdb/src/optimizer/rule/like_optimizations.cpp +1 -1
- package/src/duckdb/src/optimizer/rule/regex_optimizations.cpp +1 -1
- package/src/duckdb/src/optimizer/statistics/operator/propagate_filter.cpp +6 -1
- package/src/duckdb/src/optimizer/statistics/operator/propagate_get.cpp +7 -6
- package/src/duckdb/src/optimizer/statistics/operator/propagate_join.cpp +1 -1
- package/src/duckdb/src/optimizer/topn_optimizer.cpp +46 -7
- package/src/duckdb/src/parallel/executor.cpp +129 -51
- package/src/duckdb/src/parallel/executor_task.cpp +16 -3
- package/src/duckdb/src/parallel/meta_pipeline.cpp +98 -29
- package/src/duckdb/src/parallel/pipeline.cpp +17 -3
- package/src/duckdb/src/parallel/pipeline_executor.cpp +14 -2
- package/src/duckdb/src/parallel/pipeline_prepare_finish_event.cpp +34 -0
- package/src/duckdb/src/parallel/task_executor.cpp +84 -0
- package/src/duckdb/src/parallel/task_scheduler.cpp +94 -16
- package/src/duckdb/src/parallel/thread_context.cpp +1 -1
- package/src/duckdb/src/parser/expression/function_expression.cpp +14 -0
- package/src/duckdb/src/parser/expression/star_expression.cpp +35 -2
- package/src/duckdb/src/parser/parsed_data/alter_table_info.cpp +5 -1
- package/src/duckdb/src/parser/parsed_data/attach_info.cpp +17 -0
- package/src/duckdb/src/parser/parsed_data/create_index_info.cpp +37 -28
- package/src/duckdb/src/parser/parsed_data/create_macro_info.cpp +44 -2
- package/src/duckdb/src/parser/parsed_data/transaction_info.cpp +21 -1
- package/src/duckdb/src/parser/parsed_expression_iterator.cpp +29 -25
- package/src/duckdb/src/parser/parser.cpp +41 -1
- package/src/duckdb/src/parser/query_node/recursive_cte_node.cpp +1 -0
- package/src/duckdb/src/parser/statement/explain_statement.cpp +28 -13
- package/src/duckdb/src/parser/statement/relation_statement.cpp +5 -0
- package/src/duckdb/src/parser/statement/set_statement.cpp +4 -2
- package/src/duckdb/src/parser/statement/transaction_statement.cpp +3 -3
- package/src/duckdb/src/parser/tableref/column_data_ref.cpp +1 -27
- package/src/duckdb/src/parser/tableref/delimgetref.cpp +30 -0
- package/src/duckdb/src/parser/tableref/joinref.cpp +4 -0
- package/src/duckdb/src/parser/transform/constraint/transform_constraint.cpp +35 -29
- package/src/duckdb/src/parser/transform/expression/transform_array_access.cpp +32 -32
- package/src/duckdb/src/parser/transform/expression/transform_columnref.cpp +2 -1
- package/src/duckdb/src/parser/transform/expression/transform_constant.cpp +17 -0
- package/src/duckdb/src/parser/transform/expression/transform_function.cpp +5 -0
- package/src/duckdb/src/parser/transform/expression/transform_multi_assign_reference.cpp +36 -34
- package/src/duckdb/src/parser/transform/expression/transform_operator.cpp +30 -14
- package/src/duckdb/src/parser/transform/expression/transform_subquery.cpp +1 -1
- package/src/duckdb/src/parser/transform/helpers/transform_alias.cpp +2 -1
- package/src/duckdb/src/parser/transform/helpers/transform_cte.cpp +27 -19
- package/src/duckdb/src/parser/transform/helpers/transform_orderby.cpp +31 -28
- package/src/duckdb/src/parser/transform/statement/transform_alter_table.cpp +25 -27
- package/src/duckdb/src/parser/transform/statement/transform_copy.cpp +1 -1
- package/src/duckdb/src/parser/transform/statement/transform_create_function.cpp +53 -42
- package/src/duckdb/src/parser/transform/statement/transform_create_table.cpp +6 -6
- package/src/duckdb/src/parser/transform/statement/transform_create_table_as.cpp +1 -1
- package/src/duckdb/src/parser/transform/statement/transform_create_type.cpp +1 -1
- package/src/duckdb/src/parser/transform/statement/transform_create_view.cpp +1 -1
- package/src/duckdb/src/parser/transform/statement/transform_explain.cpp +38 -3
- package/src/duckdb/src/parser/transform/statement/transform_insert.cpp +1 -2
- package/src/duckdb/src/parser/transform/statement/transform_pivot_stmt.cpp +1 -1
- package/src/duckdb/src/parser/transform/statement/transform_prepare.cpp +1 -1
- package/src/duckdb/src/parser/transform/statement/transform_select.cpp +26 -21
- package/src/duckdb/src/parser/transform/statement/transform_set.cpp +8 -8
- package/src/duckdb/src/parser/transform/statement/transform_show.cpp +5 -2
- package/src/duckdb/src/parser/transform/statement/transform_show_select.cpp +6 -4
- package/src/duckdb/src/parser/transform/statement/transform_transaction.cpp +27 -6
- package/src/duckdb/src/parser/transform/statement/transform_update.cpp +8 -9
- package/src/duckdb/src/parser/transform/statement/transform_upsert.cpp +11 -12
- package/src/duckdb/src/parser/transform/statement/transform_vacuum.cpp +3 -3
- package/src/duckdb/src/parser/transform/tableref/transform_join.cpp +16 -10
- package/src/duckdb/src/parser/transform/tableref/transform_pivot.cpp +1 -1
- package/src/duckdb/src/parser/transform/tableref/transform_subquery.cpp +1 -1
- package/src/duckdb/src/parser/transformer.cpp +11 -7
- package/src/duckdb/src/planner/bind_context.cpp +3 -3
- package/src/duckdb/src/planner/binder/expression/bind_aggregate_expression.cpp +22 -7
- package/src/duckdb/src/planner/binder/expression/bind_between_expression.cpp +3 -3
- package/src/duckdb/src/planner/binder/expression/bind_collate_expression.cpp +3 -2
- package/src/duckdb/src/planner/binder/expression/bind_columnref_expression.cpp +11 -4
- package/src/duckdb/src/planner/binder/expression/bind_comparison_expression.cpp +9 -54
- package/src/duckdb/src/planner/binder/expression/bind_function_expression.cpp +3 -5
- package/src/duckdb/src/planner/binder/expression/bind_macro_expression.cpp +24 -27
- package/src/duckdb/src/planner/binder/expression/bind_operator_expression.cpp +7 -7
- package/src/duckdb/src/planner/binder/expression/bind_parameter_expression.cpp +9 -2
- package/src/duckdb/src/planner/binder/expression/bind_star_expression.cpp +26 -7
- package/src/duckdb/src/planner/binder/expression/bind_unnest_expression.cpp +5 -0
- package/src/duckdb/src/planner/binder/expression/bind_unpacked_star_expression.cpp +91 -0
- package/src/duckdb/src/planner/binder/expression/bind_window_expression.cpp +2 -2
- package/src/duckdb/src/planner/binder/query_node/bind_select_node.cpp +11 -8
- package/src/duckdb/src/planner/binder/query_node/bind_setop_node.cpp +1 -1
- package/src/duckdb/src/planner/binder/query_node/bind_table_macro_node.cpp +6 -10
- package/src/duckdb/src/planner/binder/query_node/plan_cte_node.cpp +14 -10
- package/src/duckdb/src/planner/binder/query_node/plan_setop.cpp +3 -3
- package/src/duckdb/src/planner/binder/query_node/plan_subquery.cpp +46 -7
- package/src/duckdb/src/planner/binder/statement/bind_call.cpp +13 -20
- package/src/duckdb/src/planner/binder/statement/bind_copy.cpp +105 -13
- package/src/duckdb/src/planner/binder/statement/bind_copy_database.cpp +7 -3
- package/src/duckdb/src/planner/binder/statement/bind_create.cpp +75 -55
- package/src/duckdb/src/planner/binder/statement/bind_create_table.cpp +1 -1
- package/src/duckdb/src/planner/binder/statement/bind_delete.cpp +5 -4
- package/src/duckdb/src/planner/binder/statement/bind_drop.cpp +2 -2
- package/src/duckdb/src/planner/binder/statement/bind_execute.cpp +24 -8
- package/src/duckdb/src/planner/binder/statement/bind_explain.cpp +2 -2
- package/src/duckdb/src/planner/binder/statement/bind_export.cpp +5 -105
- package/src/duckdb/src/planner/binder/statement/bind_extension.cpp +2 -2
- package/src/duckdb/src/planner/binder/statement/bind_insert.cpp +109 -41
- package/src/duckdb/src/planner/binder/statement/bind_set.cpp +23 -7
- package/src/duckdb/src/planner/binder/statement/bind_simple.cpp +4 -1
- package/src/duckdb/src/planner/binder/statement/bind_summarize.cpp +17 -3
- package/src/duckdb/src/planner/binder/statement/bind_update.cpp +5 -4
- package/src/duckdb/src/planner/binder/statement/bind_vacuum.cpp +8 -6
- package/src/duckdb/src/planner/binder/tableref/bind_basetableref.cpp +55 -42
- package/src/duckdb/src/planner/binder/tableref/bind_column_data_ref.cpp +3 -2
- package/src/duckdb/src/planner/binder/tableref/bind_delimgetref.cpp +16 -0
- package/src/duckdb/src/planner/binder/tableref/bind_joinref.cpp +31 -1
- package/src/duckdb/src/planner/binder/tableref/bind_pivot.cpp +6 -0
- package/src/duckdb/src/planner/binder/tableref/bind_showref.cpp +2 -0
- package/src/duckdb/src/planner/binder/tableref/bind_table_function.cpp +106 -46
- package/src/duckdb/src/planner/binder/tableref/plan_delimgetref.cpp +11 -0
- package/src/duckdb/src/planner/binder/tableref/plan_joinref.cpp +15 -2
- package/src/duckdb/src/planner/binder/tableref/plan_table_function.cpp +4 -0
- package/src/duckdb/src/planner/binder.cpp +172 -15
- package/src/duckdb/src/planner/collation_binding.cpp +99 -0
- package/src/duckdb/src/planner/expression/bound_aggregate_expression.cpp +10 -4
- package/src/duckdb/src/planner/expression/bound_between_expression.cpp +1 -1
- package/src/duckdb/src/planner/expression/bound_case_expression.cpp +1 -1
- package/src/duckdb/src/planner/expression/bound_cast_expression.cpp +14 -12
- package/src/duckdb/src/planner/expression/bound_columnref_expression.cpp +1 -1
- package/src/duckdb/src/planner/expression/bound_comparison_expression.cpp +1 -1
- package/src/duckdb/src/planner/expression/bound_conjunction_expression.cpp +1 -1
- package/src/duckdb/src/planner/expression/bound_constant_expression.cpp +1 -1
- package/src/duckdb/src/planner/expression/bound_expanded_expression.cpp +1 -1
- package/src/duckdb/src/planner/expression/bound_function_expression.cpp +8 -2
- package/src/duckdb/src/planner/expression/bound_lambda_expression.cpp +1 -1
- package/src/duckdb/src/planner/expression/bound_lambdaref_expression.cpp +1 -1
- package/src/duckdb/src/planner/expression/bound_operator_expression.cpp +1 -1
- package/src/duckdb/src/planner/expression/bound_parameter_expression.cpp +1 -1
- package/src/duckdb/src/planner/expression/bound_reference_expression.cpp +1 -1
- package/src/duckdb/src/planner/expression/bound_subquery_expression.cpp +1 -1
- package/src/duckdb/src/planner/expression/bound_unnest_expression.cpp +1 -1
- package/src/duckdb/src/planner/expression/bound_window_expression.cpp +6 -6
- package/src/duckdb/src/planner/expression_binder/aggregate_binder.cpp +1 -1
- package/src/duckdb/src/planner/expression_binder/alter_binder.cpp +2 -2
- package/src/duckdb/src/planner/expression_binder/base_select_binder.cpp +1 -1
- package/src/duckdb/src/planner/expression_binder/column_alias_binder.cpp +7 -0
- package/src/duckdb/src/planner/expression_binder/constant_binder.cpp +3 -3
- package/src/duckdb/src/planner/expression_binder/group_binder.cpp +26 -22
- package/src/duckdb/src/planner/expression_binder/having_binder.cpp +7 -1
- package/src/duckdb/src/planner/expression_binder/index_binder.cpp +2 -2
- package/src/duckdb/src/planner/expression_binder/insert_binder.cpp +2 -2
- package/src/duckdb/src/planner/expression_binder/lateral_binder.cpp +2 -2
- package/src/duckdb/src/planner/expression_binder/order_binder.cpp +61 -43
- package/src/duckdb/src/planner/expression_binder/qualify_binder.cpp +2 -2
- package/src/duckdb/src/planner/expression_binder/relation_binder.cpp +4 -4
- package/src/duckdb/src/planner/expression_binder/returning_binder.cpp +3 -2
- package/src/duckdb/src/planner/expression_binder/table_function_binder.cpp +10 -3
- package/src/duckdb/src/planner/expression_binder/update_binder.cpp +1 -1
- package/src/duckdb/src/planner/expression_binder/where_binder.cpp +9 -2
- package/src/duckdb/src/planner/expression_binder.cpp +121 -21
- package/src/duckdb/src/planner/expression_iterator.cpp +26 -1
- package/src/duckdb/src/planner/filter/conjunction_filter.cpp +33 -0
- package/src/duckdb/src/planner/filter/constant_filter.cpp +15 -0
- package/src/duckdb/src/planner/filter/null_filter.cpp +22 -0
- package/src/duckdb/src/planner/filter/struct_filter.cpp +16 -0
- package/src/duckdb/src/planner/logical_operator.cpp +24 -7
- package/src/duckdb/src/planner/operator/logical_aggregate.cpp +13 -7
- package/src/duckdb/src/planner/operator/logical_any_join.cpp +5 -2
- package/src/duckdb/src/planner/operator/logical_comparison_join.cpp +13 -5
- package/src/duckdb/src/planner/operator/logical_copy_to_file.cpp +64 -8
- package/src/duckdb/src/planner/operator/logical_cteref.cpp +7 -0
- package/src/duckdb/src/planner/operator/logical_distinct.cpp +6 -5
- package/src/duckdb/src/planner/operator/logical_get.cpp +60 -18
- package/src/duckdb/src/planner/operator/logical_materialized_cte.cpp +7 -0
- package/src/duckdb/src/planner/operator/logical_order.cpp +7 -4
- package/src/duckdb/src/planner/operator/logical_top_n.cpp +2 -2
- package/src/duckdb/src/planner/operator/logical_vacuum.cpp +1 -1
- package/src/duckdb/src/planner/planner.cpp +2 -3
- package/src/duckdb/src/planner/subquery/flatten_dependent_join.cpp +27 -10
- package/src/duckdb/src/planner/table_filter.cpp +51 -0
- package/src/duckdb/src/storage/arena_allocator.cpp +28 -10
- package/src/duckdb/src/storage/block.cpp +3 -2
- package/src/duckdb/src/storage/buffer/block_handle.cpp +29 -14
- package/src/duckdb/src/storage/buffer/block_manager.cpp +6 -5
- package/src/duckdb/src/storage/buffer/buffer_handle.cpp +1 -1
- package/src/duckdb/src/storage/buffer/buffer_pool.cpp +264 -125
- package/src/duckdb/src/storage/buffer_manager.cpp +5 -1
- package/src/duckdb/src/storage/checkpoint/row_group_writer.cpp +0 -6
- package/src/duckdb/src/storage/checkpoint/table_data_writer.cpp +26 -3
- package/src/duckdb/src/storage/checkpoint/write_overflow_strings_to_disk.cpp +21 -9
- package/src/duckdb/src/storage/checkpoint_manager.cpp +49 -24
- package/src/duckdb/src/storage/compression/alp/alp.cpp +6 -11
- package/src/duckdb/src/storage/compression/alprd.cpp +5 -9
- package/src/duckdb/src/storage/compression/bitpacking.cpp +35 -31
- package/src/duckdb/src/storage/compression/chimp/chimp.cpp +6 -8
- package/src/duckdb/src/storage/compression/dictionary_compression.cpp +71 -58
- package/src/duckdb/src/storage/compression/fixed_size_uncompressed.cpp +15 -13
- package/src/duckdb/src/storage/compression/fsst.cpp +66 -53
- package/src/duckdb/src/storage/compression/numeric_constant.cpp +4 -5
- package/src/duckdb/src/storage/compression/patas.cpp +6 -17
- package/src/duckdb/src/storage/compression/rle.cpp +20 -18
- package/src/duckdb/src/storage/compression/string_uncompressed.cpp +71 -52
- package/src/duckdb/src/storage/compression/uncompressed.cpp +2 -2
- package/src/duckdb/src/storage/compression/validity_uncompressed.cpp +8 -7
- package/src/duckdb/src/storage/data_pointer.cpp +22 -0
- package/src/duckdb/src/storage/data_table.cpp +41 -12
- package/src/duckdb/src/storage/local_storage.cpp +22 -8
- package/src/duckdb/src/storage/metadata/metadata_manager.cpp +33 -17
- package/src/duckdb/src/storage/metadata/metadata_reader.cpp +4 -4
- package/src/duckdb/src/storage/metadata/metadata_writer.cpp +3 -3
- package/src/duckdb/src/storage/partial_block_manager.cpp +19 -8
- package/src/duckdb/src/storage/serialization/serialize_create_info.cpp +11 -8
- package/src/duckdb/src/storage/serialization/serialize_expression.cpp +1 -1
- package/src/duckdb/src/storage/serialization/serialize_extension_install_info.cpp +2 -0
- package/src/duckdb/src/storage/serialization/serialize_logical_operator.cpp +3 -3
- package/src/duckdb/src/storage/serialization/serialize_nodes.cpp +19 -5
- package/src/duckdb/src/storage/serialization/serialize_parse_info.cpp +21 -1
- package/src/duckdb/src/storage/serialization/serialize_parsed_expression.cpp +4 -2
- package/src/duckdb/src/storage/serialization/serialize_query_node.cpp +2 -2
- package/src/duckdb/src/storage/serialization/serialize_storage.cpp +2 -0
- package/src/duckdb/src/storage/serialization/serialize_tableref.cpp +8 -4
- package/src/duckdb/src/storage/serialization/serialize_types.cpp +4 -4
- package/src/duckdb/src/storage/single_file_block_manager.cpp +170 -34
- package/src/duckdb/src/storage/standard_buffer_manager.cpp +221 -64
- package/src/duckdb/src/storage/statistics/column_statistics.cpp +4 -3
- package/src/duckdb/src/storage/statistics/distinct_statistics.cpp +36 -26
- package/src/duckdb/src/storage/statistics/numeric_stats.cpp +4 -15
- package/src/duckdb/src/storage/statistics/string_stats.cpp +14 -8
- package/src/duckdb/src/storage/statistics/struct_stats.cpp +2 -1
- package/src/duckdb/src/storage/storage_info.cpp +34 -9
- package/src/duckdb/src/storage/storage_manager.cpp +147 -74
- package/src/duckdb/src/storage/table/array_column_data.cpp +37 -17
- package/src/duckdb/src/storage/table/chunk_info.cpp +38 -0
- package/src/duckdb/src/storage/table/column_checkpoint_state.cpp +10 -6
- package/src/duckdb/src/storage/table/column_data.cpp +252 -31
- package/src/duckdb/src/storage/table/column_data_checkpointer.cpp +2 -12
- package/src/duckdb/src/storage/table/column_segment.cpp +63 -34
- package/src/duckdb/src/storage/table/list_column_data.cpp +34 -15
- package/src/duckdb/src/storage/table/row_group.cpp +228 -120
- package/src/duckdb/src/storage/table/row_group_collection.cpp +122 -120
- package/src/duckdb/src/storage/table/row_version_manager.cpp +27 -1
- package/src/duckdb/src/storage/table/scan_state.cpp +101 -18
- package/src/duckdb/src/storage/table/standard_column_data.cpp +20 -34
- package/src/duckdb/src/storage/table/struct_column_data.cpp +39 -42
- package/src/duckdb/src/storage/table/table_statistics.cpp +2 -1
- package/src/duckdb/src/storage/table/update_segment.cpp +9 -8
- package/src/duckdb/src/storage/table/validity_column_data.cpp +2 -2
- package/src/duckdb/src/storage/table_index_list.cpp +8 -7
- package/src/duckdb/src/storage/temporary_file_manager.cpp +11 -9
- package/src/duckdb/src/storage/temporary_memory_manager.cpp +227 -39
- package/src/duckdb/src/storage/wal_replay.cpp +68 -28
- package/src/duckdb/src/storage/write_ahead_log.cpp +56 -47
- package/src/duckdb/src/transaction/cleanup_state.cpp +9 -1
- package/src/duckdb/src/transaction/commit_state.cpp +7 -170
- package/src/duckdb/src/transaction/duck_transaction.cpp +87 -19
- package/src/duckdb/src/transaction/duck_transaction_manager.cpp +65 -10
- package/src/duckdb/src/transaction/meta_transaction.cpp +18 -3
- package/src/duckdb/src/transaction/transaction_context.cpp +21 -17
- package/src/duckdb/src/transaction/undo_buffer.cpp +20 -14
- package/src/duckdb/src/transaction/wal_write_state.cpp +292 -0
- package/src/duckdb/src/verification/prepared_statement_verifier.cpp +0 -1
- package/src/duckdb/third_party/brotli/common/brotli_constants.h +204 -0
- package/src/duckdb/third_party/brotli/common/brotli_platform.h +543 -0
- package/src/duckdb/third_party/brotli/common/constants.cpp +17 -0
- package/src/duckdb/third_party/brotli/common/context.cpp +156 -0
- package/src/duckdb/third_party/brotli/common/context.h +110 -0
- package/src/duckdb/third_party/brotli/common/dictionary.cpp +5912 -0
- package/src/duckdb/third_party/brotli/common/dictionary.h +60 -0
- package/src/duckdb/third_party/brotli/common/platform.cpp +24 -0
- package/src/duckdb/third_party/brotli/common/shared_dictionary.cpp +517 -0
- package/src/duckdb/third_party/brotli/common/shared_dictionary_internal.h +71 -0
- package/src/duckdb/third_party/brotli/common/transform.cpp +287 -0
- package/src/duckdb/third_party/brotli/common/transform.h +77 -0
- package/src/duckdb/third_party/brotli/common/version.h +51 -0
- package/src/duckdb/third_party/brotli/dec/bit_reader.cpp +74 -0
- package/src/duckdb/third_party/brotli/dec/bit_reader.h +419 -0
- package/src/duckdb/third_party/brotli/dec/decode.cpp +2758 -0
- package/src/duckdb/third_party/brotli/dec/huffman.cpp +338 -0
- package/src/duckdb/third_party/brotli/dec/huffman.h +118 -0
- package/src/duckdb/third_party/brotli/dec/prefix.h +733 -0
- package/src/duckdb/third_party/brotli/dec/state.cpp +178 -0
- package/src/duckdb/third_party/brotli/dec/state.h +386 -0
- package/src/duckdb/third_party/brotli/enc/backward_references.cpp +3775 -0
- package/src/duckdb/third_party/brotli/enc/backward_references.h +36 -0
- package/src/duckdb/third_party/brotli/enc/backward_references_hq.cpp +935 -0
- package/src/duckdb/third_party/brotli/enc/backward_references_hq.h +92 -0
- package/src/duckdb/third_party/brotli/enc/bit_cost.cpp +410 -0
- package/src/duckdb/third_party/brotli/enc/bit_cost.h +60 -0
- package/src/duckdb/third_party/brotli/enc/block_splitter.cpp +1653 -0
- package/src/duckdb/third_party/brotli/enc/block_splitter.h +48 -0
- package/src/duckdb/third_party/brotli/enc/brotli_bit_stream.cpp +1431 -0
- package/src/duckdb/third_party/brotli/enc/brotli_bit_stream.h +85 -0
- package/src/duckdb/third_party/brotli/enc/brotli_hash.h +4352 -0
- package/src/duckdb/third_party/brotli/enc/brotli_params.h +47 -0
- package/src/duckdb/third_party/brotli/enc/cluster.cpp +1025 -0
- package/src/duckdb/third_party/brotli/enc/cluster.h +1017 -0
- package/src/duckdb/third_party/brotli/enc/command.cpp +24 -0
- package/src/duckdb/third_party/brotli/enc/command.h +187 -0
- package/src/duckdb/third_party/brotli/enc/compound_dictionary.cpp +209 -0
- package/src/duckdb/third_party/brotli/enc/compound_dictionary.h +75 -0
- package/src/duckdb/third_party/brotli/enc/compress_fragment.cpp +796 -0
- package/src/duckdb/third_party/brotli/enc/compress_fragment.h +82 -0
- package/src/duckdb/third_party/brotli/enc/compress_fragment_two_pass.cpp +653 -0
- package/src/duckdb/third_party/brotli/enc/compress_fragment_two_pass.h +68 -0
- package/src/duckdb/third_party/brotli/enc/dictionary_hash.cpp +1844 -0
- package/src/duckdb/third_party/brotli/enc/dictionary_hash.h +21 -0
- package/src/duckdb/third_party/brotli/enc/encode.cpp +1990 -0
- package/src/duckdb/third_party/brotli/enc/encoder_dict.cpp +636 -0
- package/src/duckdb/third_party/brotli/enc/encoder_dict.h +153 -0
- package/src/duckdb/third_party/brotli/enc/entropy_encode.cpp +500 -0
- package/src/duckdb/third_party/brotli/enc/entropy_encode.h +119 -0
- package/src/duckdb/third_party/brotli/enc/entropy_encode_static.h +538 -0
- package/src/duckdb/third_party/brotli/enc/fast_log.cpp +101 -0
- package/src/duckdb/third_party/brotli/enc/fast_log.h +63 -0
- package/src/duckdb/third_party/brotli/enc/find_match_length.h +68 -0
- package/src/duckdb/third_party/brotli/enc/histogram.cpp +96 -0
- package/src/duckdb/third_party/brotli/enc/histogram.h +210 -0
- package/src/duckdb/third_party/brotli/enc/literal_cost.cpp +176 -0
- package/src/duckdb/third_party/brotli/enc/literal_cost.h +28 -0
- package/src/duckdb/third_party/brotli/enc/memory.cpp +190 -0
- package/src/duckdb/third_party/brotli/enc/memory.h +127 -0
- package/src/duckdb/third_party/brotli/enc/metablock.cpp +1225 -0
- package/src/duckdb/third_party/brotli/enc/metablock.h +102 -0
- package/src/duckdb/third_party/brotli/enc/prefix.h +50 -0
- package/src/duckdb/third_party/brotli/enc/quality.h +202 -0
- package/src/duckdb/third_party/brotli/enc/ringbuffer.h +164 -0
- package/src/duckdb/third_party/brotli/enc/state.h +106 -0
- package/src/duckdb/third_party/brotli/enc/static_dict.cpp +538 -0
- package/src/duckdb/third_party/brotli/enc/static_dict.h +37 -0
- package/src/duckdb/third_party/brotli/enc/static_dict_lut.h +5862 -0
- package/src/duckdb/third_party/brotli/enc/utf8_util.cpp +81 -0
- package/src/duckdb/third_party/brotli/enc/utf8_util.h +29 -0
- package/src/duckdb/third_party/brotli/enc/write_bits.h +84 -0
- package/src/duckdb/third_party/brotli/include/brotli/decode.h +405 -0
- package/src/duckdb/third_party/brotli/include/brotli/encode.h +489 -0
- package/src/duckdb/third_party/brotli/include/brotli/port.h +238 -0
- package/src/duckdb/third_party/brotli/include/brotli/shared_dictionary.h +96 -0
- package/src/duckdb/third_party/brotli/include/brotli/types.h +83 -0
- package/src/duckdb/third_party/fast_float/fast_float/fast_float.h +20 -4
- package/src/duckdb/third_party/fmt/include/fmt/format.h +54 -10
- package/src/duckdb/third_party/fsst/fsst.h +2 -2
- package/src/duckdb/third_party/fsst/libfsst.hpp +2 -2
- package/src/duckdb/third_party/httplib/httplib.hpp +6763 -5580
- package/src/duckdb/third_party/hyperloglog/hyperloglog.cpp +13 -30
- package/src/duckdb/third_party/hyperloglog/hyperloglog.hpp +8 -2
- package/src/duckdb/third_party/libpg_query/include/nodes/nodes.hpp +1 -0
- package/src/duckdb/third_party/libpg_query/include/nodes/parsenodes.hpp +22 -9
- package/src/duckdb/third_party/libpg_query/include/parser/gram.hpp +1041 -554
- package/src/duckdb/third_party/libpg_query/include/parser/kwlist.hpp +1 -0
- package/src/duckdb/third_party/libpg_query/postgres_parser.cpp +2 -1
- package/src/duckdb/third_party/libpg_query/src_backend_parser_gram.cpp +21605 -21752
- package/src/duckdb/third_party/libpg_query/src_backend_parser_scan.cpp +538 -299
- package/src/duckdb/third_party/mbedtls/include/mbedtls/mbedtls_config.h +1 -0
- package/src/duckdb/third_party/mbedtls/include/mbedtls_wrapper.hpp +36 -12
- package/src/duckdb/third_party/mbedtls/library/md.cpp +6 -6
- package/src/duckdb/third_party/mbedtls/library/sha1.cpp +2 -0
- package/src/duckdb/third_party/mbedtls/library/sha256.cpp +3 -0
- package/src/duckdb/third_party/mbedtls/mbedtls_wrapper.cpp +99 -47
- package/src/duckdb/third_party/pcg/pcg_extras.hpp +1 -1
- package/src/duckdb/third_party/re2/re2/prog.cc +2 -2
- package/src/duckdb/third_party/snappy/snappy-internal.h +398 -0
- package/src/duckdb/third_party/snappy/snappy-sinksource.cc +111 -9
- package/src/duckdb/third_party/snappy/snappy-sinksource.h +158 -0
- package/src/duckdb/third_party/snappy/snappy-stubs-internal.h +523 -3
- package/src/duckdb/third_party/snappy/snappy-stubs-public.h +34 -1
- package/src/duckdb/third_party/snappy/snappy.cc +2626 -0
- package/src/duckdb/third_party/snappy/snappy.h +223 -0
- package/src/duckdb/third_party/snappy/snappy_version.hpp +11 -0
- package/src/duckdb/third_party/utf8proc/include/utf8proc.hpp +69 -101
- package/src/duckdb/third_party/utf8proc/include/utf8proc_wrapper.hpp +53 -0
- package/src/duckdb/third_party/utf8proc/utf8proc.cpp +627 -678
- package/src/duckdb/third_party/utf8proc/utf8proc_data.cpp +15008 -12868
- package/src/duckdb/third_party/utf8proc/utf8proc_wrapper.cpp +185 -29
- package/src/duckdb/ub_extension_json_json_functions.cpp +6 -0
- package/src/duckdb/ub_src_catalog_default.cpp +4 -0
- package/src/duckdb/ub_src_common.cpp +7 -1
- package/src/duckdb/ub_src_common_arrow.cpp +10 -0
- package/src/duckdb/ub_src_common_enums.cpp +2 -0
- package/src/duckdb/ub_src_common_tree_renderer.cpp +10 -0
- package/src/duckdb/ub_src_common_types.cpp +2 -0
- package/src/duckdb/ub_src_core_functions_aggregate_holistic.cpp +4 -0
- package/src/duckdb/ub_src_core_functions_aggregate_nested.cpp +2 -0
- package/src/duckdb/ub_src_core_functions_scalar_generic.cpp +2 -0
- package/src/duckdb/ub_src_core_functions_scalar_list.cpp +2 -4
- package/src/duckdb/ub_src_core_functions_scalar_map.cpp +2 -0
- package/src/duckdb/ub_src_core_functions_scalar_string.cpp +4 -0
- package/src/duckdb/ub_src_execution_index_art.cpp +5 -3
- package/src/duckdb/ub_src_execution_operator_csv_scanner_scanner.cpp +2 -0
- package/src/duckdb/ub_src_execution_operator_helper.cpp +4 -0
- package/src/duckdb/ub_src_function.cpp +4 -0
- package/src/duckdb/ub_src_function_cast.cpp +2 -0
- package/src/duckdb/ub_src_function_scalar_generic.cpp +4 -0
- package/src/duckdb/ub_src_function_scalar_list.cpp +0 -2
- package/src/duckdb/ub_src_function_scalar_string.cpp +2 -0
- package/src/duckdb/ub_src_function_table.cpp +2 -0
- package/src/duckdb/ub_src_function_table_arrow.cpp +2 -0
- package/src/duckdb/ub_src_function_table_system.cpp +2 -0
- package/src/duckdb/ub_src_main.cpp +4 -0
- package/src/duckdb/ub_src_main_buffered_data.cpp +4 -0
- package/src/duckdb/ub_src_main_capi.cpp +10 -0
- package/src/duckdb/ub_src_main_chunk_scan_state.cpp +2 -0
- package/src/duckdb/ub_src_main_relation.cpp +2 -0
- package/src/duckdb/ub_src_main_secret.cpp +2 -0
- package/src/duckdb/ub_src_optimizer.cpp +8 -0
- package/src/duckdb/ub_src_optimizer_compressed_materialization.cpp +2 -0
- package/src/duckdb/ub_src_optimizer_pushdown.cpp +2 -0
- package/src/duckdb/ub_src_optimizer_rule.cpp +2 -0
- package/src/duckdb/ub_src_parallel.cpp +4 -0
- package/src/duckdb/ub_src_parser_tableref.cpp +2 -0
- package/src/duckdb/ub_src_planner.cpp +2 -0
- package/src/duckdb/ub_src_planner_binder_expression.cpp +2 -0
- package/src/duckdb/ub_src_planner_binder_tableref.cpp +4 -0
- package/src/duckdb/ub_src_storage_statistics.cpp +0 -2
- package/src/duckdb/ub_src_transaction.cpp +2 -0
- package/test/columns.test.ts +1 -1
- package/test/prepare.test.ts +1 -1
- package/test/test_all_types.test.ts +1 -1
@@ -6,17 +6,25 @@
|
|
6
6
|
//
|
7
7
|
//
|
8
8
|
//===----------------------------------------------------------------------===//
|
9
|
+
//
|
10
|
+
// !!!!!!!
|
11
|
+
// WARNING: this file is autogenerated by scripts/generate_c_api.py, manual changes will be overwritten
|
12
|
+
// !!!!!!!
|
9
13
|
|
10
14
|
#pragma once
|
11
15
|
|
12
16
|
//! duplicate of duckdb/main/winapi.hpp
|
13
17
|
#ifndef DUCKDB_API
|
14
18
|
#ifdef _WIN32
|
19
|
+
#ifdef DUCKDB_STATIC_BUILD
|
20
|
+
#define DUCKDB_API
|
21
|
+
#else
|
15
22
|
#if defined(DUCKDB_BUILD_LIBRARY) && !defined(DUCKDB_BUILD_LOADABLE_EXTENSION)
|
16
23
|
#define DUCKDB_API __declspec(dllexport)
|
17
24
|
#else
|
18
25
|
#define DUCKDB_API __declspec(dllimport)
|
19
26
|
#endif
|
27
|
+
#endif
|
20
28
|
#else
|
21
29
|
#define DUCKDB_API
|
22
30
|
#endif
|
@@ -25,41 +33,20 @@
|
|
25
33
|
//! duplicate of duckdb/main/winapi.hpp
|
26
34
|
#ifndef DUCKDB_EXTENSION_API
|
27
35
|
#ifdef _WIN32
|
36
|
+
#ifdef DUCKDB_STATIC_BUILD
|
37
|
+
#define DUCKDB_EXTENSION_API
|
38
|
+
#else
|
28
39
|
#ifdef DUCKDB_BUILD_LOADABLE_EXTENSION
|
29
40
|
#define DUCKDB_EXTENSION_API __declspec(dllexport)
|
30
41
|
#else
|
31
42
|
#define DUCKDB_EXTENSION_API
|
32
43
|
#endif
|
44
|
+
#endif
|
33
45
|
#else
|
34
46
|
#define DUCKDB_EXTENSION_API __attribute__((visibility("default")))
|
35
47
|
#endif
|
36
48
|
#endif
|
37
49
|
|
38
|
-
//! In the future, we are planning to move extension functions to a separate header. For now you can set the define
|
39
|
-
//! below to remove the functions that are planned to be moved out of this header.
|
40
|
-
// #define DUCKDB_NO_EXTENSION_FUNCTIONS
|
41
|
-
|
42
|
-
//! Set the define below to remove all functions that are deprecated or planned to be deprecated
|
43
|
-
// #define DUCKDB_API_NO_DEPRECATED
|
44
|
-
|
45
|
-
//! API versions
|
46
|
-
//! If no explicit API version is defined, the latest API version is used.
|
47
|
-
//! Note that using older API versions (i.e. not using DUCKDB_API_LATEST) is deprecated.
|
48
|
-
//! These will not be supported long-term, and will be removed in future versions.
|
49
|
-
#ifndef DUCKDB_API_0_3_1
|
50
|
-
#define DUCKDB_API_0_3_1 1
|
51
|
-
#endif
|
52
|
-
#ifndef DUCKDB_API_0_3_2
|
53
|
-
#define DUCKDB_API_0_3_2 2
|
54
|
-
#endif
|
55
|
-
#ifndef DUCKDB_API_LATEST
|
56
|
-
#define DUCKDB_API_LATEST DUCKDB_API_0_3_2
|
57
|
-
#endif
|
58
|
-
|
59
|
-
#ifndef DUCKDB_API_VERSION
|
60
|
-
#define DUCKDB_API_VERSION DUCKDB_API_LATEST
|
61
|
-
#endif
|
62
|
-
|
63
50
|
#include <stdbool.h>
|
64
51
|
#include <stdint.h>
|
65
52
|
#include <stddef.h>
|
@@ -142,25 +129,29 @@ typedef enum DUCKDB_TYPE {
|
|
142
129
|
DUCKDB_TYPE_TIME_TZ = 30,
|
143
130
|
// duckdb_timestamp
|
144
131
|
DUCKDB_TYPE_TIMESTAMP_TZ = 31,
|
132
|
+
// ANY type
|
133
|
+
DUCKDB_TYPE_ANY = 34,
|
134
|
+
// duckdb_varint
|
135
|
+
DUCKDB_TYPE_VARINT = 35,
|
145
136
|
} duckdb_type;
|
146
137
|
//! An enum over the returned state of different functions.
|
147
|
-
typedef enum { DuckDBSuccess = 0, DuckDBError = 1 } duckdb_state;
|
138
|
+
typedef enum duckdb_state { DuckDBSuccess = 0, DuckDBError = 1 } duckdb_state;
|
148
139
|
//! An enum over the pending state of a pending query result.
|
149
|
-
typedef enum {
|
140
|
+
typedef enum duckdb_pending_state {
|
150
141
|
DUCKDB_PENDING_RESULT_READY = 0,
|
151
142
|
DUCKDB_PENDING_RESULT_NOT_READY = 1,
|
152
143
|
DUCKDB_PENDING_ERROR = 2,
|
153
144
|
DUCKDB_PENDING_NO_TASKS_AVAILABLE = 3
|
154
145
|
} duckdb_pending_state;
|
155
146
|
//! An enum over DuckDB's different result types.
|
156
|
-
typedef enum {
|
147
|
+
typedef enum duckdb_result_type {
|
157
148
|
DUCKDB_RESULT_TYPE_INVALID = 0,
|
158
149
|
DUCKDB_RESULT_TYPE_CHANGED_ROWS = 1,
|
159
150
|
DUCKDB_RESULT_TYPE_NOTHING = 2,
|
160
151
|
DUCKDB_RESULT_TYPE_QUERY_RESULT = 3,
|
161
152
|
} duckdb_result_type;
|
162
153
|
//! An enum over DuckDB's different statement types.
|
163
|
-
typedef enum {
|
154
|
+
typedef enum duckdb_statement_type {
|
164
155
|
DUCKDB_STATEMENT_TYPE_INVALID = 0,
|
165
156
|
DUCKDB_STATEMENT_TYPE_SELECT = 1,
|
166
157
|
DUCKDB_STATEMENT_TYPE_INSERT = 2,
|
@@ -190,6 +181,54 @@ typedef enum {
|
|
190
181
|
DUCKDB_STATEMENT_TYPE_DETACH = 26,
|
191
182
|
DUCKDB_STATEMENT_TYPE_MULTI = 27,
|
192
183
|
} duckdb_statement_type;
|
184
|
+
//! An enum over DuckDB's different result types.
|
185
|
+
typedef enum duckdb_error_type {
|
186
|
+
DUCKDB_ERROR_INVALID = 0,
|
187
|
+
DUCKDB_ERROR_OUT_OF_RANGE = 1,
|
188
|
+
DUCKDB_ERROR_CONVERSION = 2,
|
189
|
+
DUCKDB_ERROR_UNKNOWN_TYPE = 3,
|
190
|
+
DUCKDB_ERROR_DECIMAL = 4,
|
191
|
+
DUCKDB_ERROR_MISMATCH_TYPE = 5,
|
192
|
+
DUCKDB_ERROR_DIVIDE_BY_ZERO = 6,
|
193
|
+
DUCKDB_ERROR_OBJECT_SIZE = 7,
|
194
|
+
DUCKDB_ERROR_INVALID_TYPE = 8,
|
195
|
+
DUCKDB_ERROR_SERIALIZATION = 9,
|
196
|
+
DUCKDB_ERROR_TRANSACTION = 10,
|
197
|
+
DUCKDB_ERROR_NOT_IMPLEMENTED = 11,
|
198
|
+
DUCKDB_ERROR_EXPRESSION = 12,
|
199
|
+
DUCKDB_ERROR_CATALOG = 13,
|
200
|
+
DUCKDB_ERROR_PARSER = 14,
|
201
|
+
DUCKDB_ERROR_PLANNER = 15,
|
202
|
+
DUCKDB_ERROR_SCHEDULER = 16,
|
203
|
+
DUCKDB_ERROR_EXECUTOR = 17,
|
204
|
+
DUCKDB_ERROR_CONSTRAINT = 18,
|
205
|
+
DUCKDB_ERROR_INDEX = 19,
|
206
|
+
DUCKDB_ERROR_STAT = 20,
|
207
|
+
DUCKDB_ERROR_CONNECTION = 21,
|
208
|
+
DUCKDB_ERROR_SYNTAX = 22,
|
209
|
+
DUCKDB_ERROR_SETTINGS = 23,
|
210
|
+
DUCKDB_ERROR_BINDER = 24,
|
211
|
+
DUCKDB_ERROR_NETWORK = 25,
|
212
|
+
DUCKDB_ERROR_OPTIMIZER = 26,
|
213
|
+
DUCKDB_ERROR_NULL_POINTER = 27,
|
214
|
+
DUCKDB_ERROR_IO = 28,
|
215
|
+
DUCKDB_ERROR_INTERRUPT = 29,
|
216
|
+
DUCKDB_ERROR_FATAL = 30,
|
217
|
+
DUCKDB_ERROR_INTERNAL = 31,
|
218
|
+
DUCKDB_ERROR_INVALID_INPUT = 32,
|
219
|
+
DUCKDB_ERROR_OUT_OF_MEMORY = 33,
|
220
|
+
DUCKDB_ERROR_PERMISSION = 34,
|
221
|
+
DUCKDB_ERROR_PARAMETER_NOT_RESOLVED = 35,
|
222
|
+
DUCKDB_ERROR_PARAMETER_NOT_ALLOWED = 36,
|
223
|
+
DUCKDB_ERROR_DEPENDENCY = 37,
|
224
|
+
DUCKDB_ERROR_HTTP = 38,
|
225
|
+
DUCKDB_ERROR_MISSING_EXTENSION = 39,
|
226
|
+
DUCKDB_ERROR_AUTOLOAD = 40,
|
227
|
+
DUCKDB_ERROR_SEQUENCE = 41,
|
228
|
+
DUCKDB_INVALID_CONFIGURATION = 42
|
229
|
+
} duckdb_error_type;
|
230
|
+
//! An enum over DuckDB's different cast modes.
|
231
|
+
typedef enum duckdb_cast_mode { DUCKDB_CAST_NORMAL = 0, DUCKDB_CAST_TRY = 1 } duckdb_cast_mode;
|
193
232
|
|
194
233
|
//===--------------------------------------------------------------------===//
|
195
234
|
// General type definitions
|
@@ -313,28 +352,21 @@ typedef struct {
|
|
313
352
|
//! duckdb_column_type, and duckdb_column_name, which take the result and the column index
|
314
353
|
//! as their parameters
|
315
354
|
typedef struct {
|
316
|
-
#if DUCKDB_API_VERSION < DUCKDB_API_0_3_2
|
317
|
-
void *data;
|
318
|
-
bool *nullmask;
|
319
|
-
duckdb_type type;
|
320
|
-
char *name;
|
321
|
-
#else
|
322
355
|
// deprecated, use duckdb_column_data
|
323
|
-
void *
|
356
|
+
void *deprecated_data;
|
324
357
|
// deprecated, use duckdb_nullmask_data
|
325
|
-
bool *
|
358
|
+
bool *deprecated_nullmask;
|
326
359
|
// deprecated, use duckdb_column_type
|
327
|
-
duckdb_type
|
360
|
+
duckdb_type deprecated_type;
|
328
361
|
// deprecated, use duckdb_column_name
|
329
|
-
char *
|
330
|
-
#endif
|
362
|
+
char *deprecated_name;
|
331
363
|
void *internal_data;
|
332
364
|
} duckdb_column;
|
333
365
|
|
334
366
|
//! A vector to a specified column in a data chunk. Lives as long as the
|
335
367
|
//! data chunk lives, i.e., must not be destroyed.
|
336
368
|
typedef struct _duckdb_vector {
|
337
|
-
void *
|
369
|
+
void *internal_ptr;
|
338
370
|
} * duckdb_vector;
|
339
371
|
|
340
372
|
//===--------------------------------------------------------------------===//
|
@@ -358,100 +390,177 @@ typedef struct {
|
|
358
390
|
//! A query result consists of a pointer to its internal data.
|
359
391
|
//! Must be freed with 'duckdb_destroy_result'.
|
360
392
|
typedef struct {
|
361
|
-
#if DUCKDB_API_VERSION < DUCKDB_API_0_3_2
|
362
|
-
idx_t column_count;
|
363
|
-
idx_t row_count;
|
364
|
-
idx_t rows_changed;
|
365
|
-
duckdb_column *columns;
|
366
|
-
char *error_message;
|
367
|
-
#else
|
368
393
|
// deprecated, use duckdb_column_count
|
369
|
-
idx_t
|
394
|
+
idx_t deprecated_column_count;
|
370
395
|
// deprecated, use duckdb_row_count
|
371
|
-
idx_t
|
396
|
+
idx_t deprecated_row_count;
|
372
397
|
// deprecated, use duckdb_rows_changed
|
373
|
-
idx_t
|
398
|
+
idx_t deprecated_rows_changed;
|
374
399
|
// deprecated, use duckdb_column_*-family of functions
|
375
|
-
duckdb_column *
|
400
|
+
duckdb_column *deprecated_columns;
|
376
401
|
// deprecated, use duckdb_result_error
|
377
|
-
char *
|
378
|
-
#endif
|
402
|
+
char *deprecated_error_message;
|
379
403
|
void *internal_data;
|
380
404
|
} duckdb_result;
|
381
405
|
|
382
406
|
//! A database object. Should be closed with `duckdb_close`.
|
383
407
|
typedef struct _duckdb_database {
|
384
|
-
void *
|
408
|
+
void *internal_ptr;
|
385
409
|
} * duckdb_database;
|
386
410
|
|
387
411
|
//! A connection to a duckdb database. Must be closed with `duckdb_disconnect`.
|
388
412
|
typedef struct _duckdb_connection {
|
389
|
-
void *
|
413
|
+
void *internal_ptr;
|
390
414
|
} * duckdb_connection;
|
391
415
|
|
392
416
|
//! A prepared statement is a parameterized query that allows you to bind parameters to it.
|
393
417
|
//! Must be destroyed with `duckdb_destroy_prepare`.
|
394
418
|
typedef struct _duckdb_prepared_statement {
|
395
|
-
void *
|
419
|
+
void *internal_ptr;
|
396
420
|
} * duckdb_prepared_statement;
|
397
421
|
|
398
422
|
//! Extracted statements. Must be destroyed with `duckdb_destroy_extracted`.
|
399
423
|
typedef struct _duckdb_extracted_statements {
|
400
|
-
void *
|
424
|
+
void *internal_ptr;
|
401
425
|
} * duckdb_extracted_statements;
|
402
426
|
|
403
427
|
//! The pending result represents an intermediate structure for a query that is not yet fully executed.
|
404
428
|
//! Must be destroyed with `duckdb_destroy_pending`.
|
405
429
|
typedef struct _duckdb_pending_result {
|
406
|
-
void *
|
430
|
+
void *internal_ptr;
|
407
431
|
} * duckdb_pending_result;
|
408
432
|
|
409
433
|
//! The appender enables fast data loading into DuckDB.
|
410
434
|
//! Must be destroyed with `duckdb_appender_destroy`.
|
411
435
|
typedef struct _duckdb_appender {
|
412
|
-
void *
|
436
|
+
void *internal_ptr;
|
413
437
|
} * duckdb_appender;
|
414
438
|
|
439
|
+
//! The table description allows querying info about the table.
|
440
|
+
//! Must be destroyed with `duckdb_table_description_destroy`.
|
441
|
+
typedef struct _duckdb_table_description {
|
442
|
+
void *internal_ptr;
|
443
|
+
} * duckdb_table_description;
|
444
|
+
|
415
445
|
//! Can be used to provide start-up options for the DuckDB instance.
|
416
446
|
//! Must be destroyed with `duckdb_destroy_config`.
|
417
447
|
typedef struct _duckdb_config {
|
418
|
-
void *
|
448
|
+
void *internal_ptr;
|
419
449
|
} * duckdb_config;
|
420
450
|
|
421
451
|
//! Holds an internal logical type.
|
422
452
|
//! Must be destroyed with `duckdb_destroy_logical_type`.
|
423
453
|
typedef struct _duckdb_logical_type {
|
424
|
-
void *
|
454
|
+
void *internal_ptr;
|
425
455
|
} * duckdb_logical_type;
|
426
456
|
|
457
|
+
//! Holds extra information used when registering a custom logical type.
|
458
|
+
//! Reserved for future use.
|
459
|
+
typedef struct _duckdb_create_type_info {
|
460
|
+
void *internal_ptr;
|
461
|
+
} * duckdb_create_type_info;
|
462
|
+
|
427
463
|
//! Contains a data chunk from a duckdb_result.
|
428
464
|
//! Must be destroyed with `duckdb_destroy_data_chunk`.
|
429
465
|
typedef struct _duckdb_data_chunk {
|
430
|
-
void *
|
466
|
+
void *internal_ptr;
|
431
467
|
} * duckdb_data_chunk;
|
432
468
|
|
433
469
|
//! Holds a DuckDB value, which wraps a type.
|
434
470
|
//! Must be destroyed with `duckdb_destroy_value`.
|
435
471
|
typedef struct _duckdb_value {
|
436
|
-
void *
|
472
|
+
void *internal_ptr;
|
437
473
|
} * duckdb_value;
|
438
474
|
|
475
|
+
//! Holds a recursive tree that matches the query plan.
|
476
|
+
typedef struct _duckdb_profiling_info {
|
477
|
+
void *internal_ptr;
|
478
|
+
} * duckdb_profiling_info;
|
479
|
+
|
480
|
+
//===--------------------------------------------------------------------===//
|
481
|
+
// C API Extension info
|
482
|
+
//===--------------------------------------------------------------------===//
|
483
|
+
//! Holds state during the C API extension intialization process
|
484
|
+
typedef struct _duckdb_extension_info {
|
485
|
+
void *internal_ptr;
|
486
|
+
} * duckdb_extension_info;
|
487
|
+
|
488
|
+
//===--------------------------------------------------------------------===//
|
489
|
+
// Function types
|
490
|
+
//===--------------------------------------------------------------------===//
|
491
|
+
//! Additional function info. When setting this info, it is necessary to pass a destroy-callback function.
|
492
|
+
typedef struct _duckdb_function_info {
|
493
|
+
void *internal_ptr;
|
494
|
+
} * duckdb_function_info;
|
495
|
+
|
496
|
+
//===--------------------------------------------------------------------===//
|
497
|
+
// Scalar function types
|
498
|
+
//===--------------------------------------------------------------------===//
|
499
|
+
//! A scalar function. Must be destroyed with `duckdb_destroy_scalar_function`.
|
500
|
+
typedef struct _duckdb_scalar_function {
|
501
|
+
void *internal_ptr;
|
502
|
+
} * duckdb_scalar_function;
|
503
|
+
|
504
|
+
//! A scalar function set. Must be destroyed with `duckdb_destroy_scalar_function_set`.
|
505
|
+
typedef struct _duckdb_scalar_function_set {
|
506
|
+
void *internal_ptr;
|
507
|
+
} * duckdb_scalar_function_set;
|
508
|
+
|
509
|
+
//! The main function of the scalar function.
|
510
|
+
typedef void (*duckdb_scalar_function_t)(duckdb_function_info info, duckdb_data_chunk input, duckdb_vector output);
|
511
|
+
|
512
|
+
//===--------------------------------------------------------------------===//
|
513
|
+
// Aggregate function types
|
514
|
+
//===--------------------------------------------------------------------===//
|
515
|
+
//! An aggregate function. Must be destroyed with `duckdb_destroy_aggregate_function`.
|
516
|
+
typedef struct _duckdb_aggregate_function {
|
517
|
+
void *internal_ptr;
|
518
|
+
} * duckdb_aggregate_function;
|
519
|
+
|
520
|
+
//! A aggregate function set. Must be destroyed with `duckdb_destroy_aggregate_function_set`.
|
521
|
+
typedef struct _duckdb_aggregate_function_set {
|
522
|
+
void *internal_ptr;
|
523
|
+
} * duckdb_aggregate_function_set;
|
524
|
+
|
525
|
+
//! Aggregate state
|
526
|
+
typedef struct _duckdb_aggregate_state {
|
527
|
+
void *internal_ptr;
|
528
|
+
} * duckdb_aggregate_state;
|
529
|
+
|
530
|
+
//! Returns the aggregate state size
|
531
|
+
typedef idx_t (*duckdb_aggregate_state_size)(duckdb_function_info info);
|
532
|
+
//! Initialize the aggregate state
|
533
|
+
typedef void (*duckdb_aggregate_init_t)(duckdb_function_info info, duckdb_aggregate_state state);
|
534
|
+
//! Destroy aggregate state (optional)
|
535
|
+
typedef void (*duckdb_aggregate_destroy_t)(duckdb_aggregate_state *states, idx_t count);
|
536
|
+
//! Update a set of aggregate states with new values
|
537
|
+
typedef void (*duckdb_aggregate_update_t)(duckdb_function_info info, duckdb_data_chunk input,
|
538
|
+
duckdb_aggregate_state *states);
|
539
|
+
//! Combine aggregate states
|
540
|
+
typedef void (*duckdb_aggregate_combine_t)(duckdb_function_info info, duckdb_aggregate_state *source,
|
541
|
+
duckdb_aggregate_state *target, idx_t count);
|
542
|
+
//! Finalize aggregate states into a result vector
|
543
|
+
typedef void (*duckdb_aggregate_finalize_t)(duckdb_function_info info, duckdb_aggregate_state *source,
|
544
|
+
duckdb_vector result, idx_t count, idx_t offset);
|
545
|
+
|
439
546
|
//===--------------------------------------------------------------------===//
|
440
547
|
// Table function types
|
441
548
|
//===--------------------------------------------------------------------===//
|
442
549
|
|
443
|
-
#ifndef DUCKDB_NO_EXTENSION_FUNCTIONS
|
444
550
|
//! A table function. Must be destroyed with `duckdb_destroy_table_function`.
|
445
|
-
typedef
|
551
|
+
typedef struct _duckdb_table_function {
|
552
|
+
void *internal_ptr;
|
553
|
+
} * duckdb_table_function;
|
446
554
|
|
447
555
|
//! The bind info of the function. When setting this info, it is necessary to pass a destroy-callback function.
|
448
|
-
typedef
|
556
|
+
typedef struct _duckdb_bind_info {
|
557
|
+
void *internal_ptr;
|
558
|
+
} * duckdb_bind_info;
|
449
559
|
|
450
560
|
//! Additional function init info. When setting this info, it is necessary to pass a destroy-callback function.
|
451
|
-
typedef
|
452
|
-
|
453
|
-
|
454
|
-
typedef void *duckdb_function_info;
|
561
|
+
typedef struct _duckdb_init_info {
|
562
|
+
void *internal_ptr;
|
563
|
+
} * duckdb_init_info;
|
455
564
|
|
456
565
|
//! The bind function of the table function.
|
457
566
|
typedef void (*duckdb_table_function_bind_t)(duckdb_bind_info info);
|
@@ -462,16 +571,29 @@ typedef void (*duckdb_table_function_init_t)(duckdb_init_info info);
|
|
462
571
|
//! The main function of the table function.
|
463
572
|
typedef void (*duckdb_table_function_t)(duckdb_function_info info, duckdb_data_chunk output);
|
464
573
|
|
574
|
+
//===--------------------------------------------------------------------===//
|
575
|
+
// Cast types
|
576
|
+
//===--------------------------------------------------------------------===//
|
577
|
+
|
578
|
+
//! A cast function. Must be destroyed with `duckdb_destroy_cast_function`.
|
579
|
+
typedef struct _duckdb_cast_function {
|
580
|
+
void *internal_ptr;
|
581
|
+
} * duckdb_cast_function;
|
582
|
+
|
583
|
+
typedef bool (*duckdb_cast_function_t)(duckdb_function_info info, idx_t count, duckdb_vector input,
|
584
|
+
duckdb_vector output);
|
585
|
+
|
465
586
|
//===--------------------------------------------------------------------===//
|
466
587
|
// Replacement scan types
|
467
588
|
//===--------------------------------------------------------------------===//
|
468
589
|
|
469
590
|
//! Additional replacement scan info. When setting this info, it is necessary to pass a destroy-callback function.
|
470
|
-
typedef
|
591
|
+
typedef struct _duckdb_replacement_scan_info {
|
592
|
+
void *internal_ptr;
|
593
|
+
} * duckdb_replacement_scan_info;
|
471
594
|
|
472
595
|
//! A replacement scan function that can be added to a database.
|
473
596
|
typedef void (*duckdb_replacement_callback_t)(duckdb_replacement_scan_info info, const char *table_name, void *data);
|
474
|
-
#endif
|
475
597
|
|
476
598
|
//===--------------------------------------------------------------------===//
|
477
599
|
// Arrow-related types
|
@@ -479,30 +601,43 @@ typedef void (*duckdb_replacement_callback_t)(duckdb_replacement_scan_info info,
|
|
479
601
|
|
480
602
|
//! Holds an arrow query result. Must be destroyed with `duckdb_destroy_arrow`.
|
481
603
|
typedef struct _duckdb_arrow {
|
482
|
-
void *
|
604
|
+
void *internal_ptr;
|
483
605
|
} * duckdb_arrow;
|
484
606
|
|
485
607
|
//! Holds an arrow array stream. Must be destroyed with `duckdb_destroy_arrow_stream`.
|
486
608
|
typedef struct _duckdb_arrow_stream {
|
487
|
-
void *
|
609
|
+
void *internal_ptr;
|
488
610
|
} * duckdb_arrow_stream;
|
489
611
|
|
490
612
|
//! Holds an arrow schema. Remember to release the respective ArrowSchema object.
|
491
613
|
typedef struct _duckdb_arrow_schema {
|
492
|
-
void *
|
614
|
+
void *internal_ptr;
|
493
615
|
} * duckdb_arrow_schema;
|
494
616
|
|
495
617
|
//! Holds an arrow array. Remember to release the respective ArrowArray object.
|
496
618
|
typedef struct _duckdb_arrow_array {
|
497
|
-
void *
|
619
|
+
void *internal_ptr;
|
498
620
|
} * duckdb_arrow_array;
|
499
621
|
|
622
|
+
//===--------------------------------------------------------------------===//
|
623
|
+
// DuckDB extension access
|
624
|
+
//===--------------------------------------------------------------------===//
|
625
|
+
//! Passed to C API extension as parameter to the entrypoint
|
626
|
+
struct duckdb_extension_access {
|
627
|
+
//! Indicate that an error has occured
|
628
|
+
void (*set_error)(duckdb_extension_info info, const char *error);
|
629
|
+
//! Fetch the database from duckdb to register extensions to
|
630
|
+
duckdb_database *(*get_database)(duckdb_extension_info info);
|
631
|
+
//! Fetch the API
|
632
|
+
void *(*get_api)(duckdb_extension_info info, const char *version);
|
633
|
+
};
|
634
|
+
|
500
635
|
//===--------------------------------------------------------------------===//
|
501
636
|
// Functions
|
502
637
|
//===--------------------------------------------------------------------===//
|
503
638
|
|
504
639
|
//===--------------------------------------------------------------------===//
|
505
|
-
// Open
|
640
|
+
// Open Connect
|
506
641
|
//===--------------------------------------------------------------------===//
|
507
642
|
|
508
643
|
/*!
|
@@ -510,9 +645,9 @@ Creates a new database or opens an existing database file stored at the given pa
|
|
510
645
|
If no path is given a new in-memory database is created instead.
|
511
646
|
The instantiated database should be closed with 'duckdb_close'.
|
512
647
|
|
513
|
-
* path
|
514
|
-
* out_database
|
515
|
-
*
|
648
|
+
* @param path Path to the database file on disk, or `nullptr` or `:memory:` to open an in-memory database.
|
649
|
+
* @param out_database The result database object.
|
650
|
+
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
516
651
|
*/
|
517
652
|
DUCKDB_API duckdb_state duckdb_open(const char *path, duckdb_database *out_database);
|
518
653
|
|
@@ -520,12 +655,12 @@ DUCKDB_API duckdb_state duckdb_open(const char *path, duckdb_database *out_datab
|
|
520
655
|
Extended version of duckdb_open. Creates a new database or opens an existing database file stored at the given path.
|
521
656
|
The instantiated database should be closed with 'duckdb_close'.
|
522
657
|
|
523
|
-
* path
|
524
|
-
* out_database
|
525
|
-
* config
|
526
|
-
* out_error
|
658
|
+
* @param path Path to the database file on disk, or `nullptr` or `:memory:` to open an in-memory database.
|
659
|
+
* @param out_database The result database object.
|
660
|
+
* @param config (Optional) configuration used to start up the database system.
|
661
|
+
* @param out_error If set and the function returns DuckDBError, this will contain the reason why the start-up failed.
|
527
662
|
Note that the error must be freed using `duckdb_free`.
|
528
|
-
*
|
663
|
+
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
529
664
|
*/
|
530
665
|
DUCKDB_API duckdb_state duckdb_open_ext(const char *path, duckdb_database *out_database, duckdb_config config,
|
531
666
|
char **out_error);
|
@@ -536,7 +671,7 @@ This should be called after you are done with any database allocated through `du
|
|
536
671
|
Note that failing to call `duckdb_close` (in case of e.g. a program crash) will not cause data corruption.
|
537
672
|
Still, it is recommended to always correctly close a database object after you are done with it.
|
538
673
|
|
539
|
-
* database
|
674
|
+
* @param database The database object to shut down.
|
540
675
|
*/
|
541
676
|
DUCKDB_API void duckdb_close(duckdb_database *database);
|
542
677
|
|
@@ -545,31 +680,31 @@ Opens a connection to a database. Connections are required to query the database
|
|
545
680
|
associated with the connection.
|
546
681
|
The instantiated connection should be closed using 'duckdb_disconnect'.
|
547
682
|
|
548
|
-
* database
|
549
|
-
* out_connection
|
550
|
-
*
|
683
|
+
* @param database The database file to connect to.
|
684
|
+
* @param out_connection The result connection object.
|
685
|
+
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
551
686
|
*/
|
552
687
|
DUCKDB_API duckdb_state duckdb_connect(duckdb_database database, duckdb_connection *out_connection);
|
553
688
|
|
554
689
|
/*!
|
555
690
|
Interrupt running query
|
556
691
|
|
557
|
-
* connection
|
692
|
+
* @param connection The connection to interrupt
|
558
693
|
*/
|
559
694
|
DUCKDB_API void duckdb_interrupt(duckdb_connection connection);
|
560
695
|
|
561
696
|
/*!
|
562
697
|
Get progress of the running query
|
563
698
|
|
564
|
-
* connection
|
565
|
-
*
|
699
|
+
* @param connection The working connection
|
700
|
+
* @return -1 if no progress or a percentage of the progress
|
566
701
|
*/
|
567
702
|
DUCKDB_API duckdb_query_progress_type duckdb_query_progress(duckdb_connection connection);
|
568
703
|
|
569
704
|
/*!
|
570
705
|
Closes the specified connection and de-allocates all memory allocated for that connection.
|
571
706
|
|
572
|
-
* connection
|
707
|
+
* @param connection The connection to close.
|
573
708
|
*/
|
574
709
|
DUCKDB_API void duckdb_disconnect(duckdb_connection *connection);
|
575
710
|
|
@@ -591,8 +726,11 @@ The duckdb_config must be destroyed using 'duckdb_destroy_config'
|
|
591
726
|
|
592
727
|
This will always succeed unless there is a malloc failure.
|
593
728
|
|
594
|
-
|
595
|
-
|
729
|
+
Note that `duckdb_destroy_config` should always be called on the resulting config, even if the function returns
|
730
|
+
`DuckDBError`.
|
731
|
+
|
732
|
+
* @param out_config The result configuration object.
|
733
|
+
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
596
734
|
*/
|
597
735
|
DUCKDB_API duckdb_state duckdb_create_config(duckdb_config *out_config);
|
598
736
|
|
@@ -601,7 +739,7 @@ This returns the total amount of configuration options available for usage with
|
|
601
739
|
|
602
740
|
This should not be called in a loop as it internally loops over all the options.
|
603
741
|
|
604
|
-
*
|
742
|
+
* @return The amount of config options available.
|
605
743
|
*/
|
606
744
|
DUCKDB_API size_t duckdb_config_count();
|
607
745
|
|
@@ -611,10 +749,10 @@ display configuration options. This will succeed unless `index` is out of range
|
|
611
749
|
|
612
750
|
The result name or description MUST NOT be freed.
|
613
751
|
|
614
|
-
* index
|
615
|
-
* out_name
|
616
|
-
* out_description
|
617
|
-
*
|
752
|
+
* @param index The index of the configuration option (between 0 and `duckdb_config_count`)
|
753
|
+
* @param out_name A name of the configuration flag.
|
754
|
+
* @param out_description A description of the configuration flag.
|
755
|
+
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
618
756
|
*/
|
619
757
|
DUCKDB_API duckdb_state duckdb_get_config_flag(size_t index, const char **out_name, const char **out_description);
|
620
758
|
|
@@ -626,17 +764,17 @@ In the source code, configuration options are defined in `config.cpp`.
|
|
626
764
|
|
627
765
|
This can fail if either the name is invalid, or if the value provided for the option is invalid.
|
628
766
|
|
629
|
-
*
|
630
|
-
* name
|
631
|
-
* option
|
632
|
-
*
|
767
|
+
* @param config The configuration object to set the option on.
|
768
|
+
* @param name The name of the configuration flag to set.
|
769
|
+
* @param option The value to set the configuration flag to.
|
770
|
+
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
633
771
|
*/
|
634
772
|
DUCKDB_API duckdb_state duckdb_set_config(duckdb_config config, const char *name, const char *option);
|
635
773
|
|
636
774
|
/*!
|
637
775
|
Destroys the specified configuration object and de-allocates all memory allocated for the object.
|
638
776
|
|
639
|
-
* config
|
777
|
+
* @param config The configuration object to destroy.
|
640
778
|
*/
|
641
779
|
DUCKDB_API void duckdb_destroy_config(duckdb_config *config);
|
642
780
|
|
@@ -652,17 +790,17 @@ If the query fails to execute, DuckDBError is returned and the error message can
|
|
652
790
|
Note that after running `duckdb_query`, `duckdb_destroy_result` must be called on the result object even if the
|
653
791
|
query fails, otherwise the error stored within the result will not be freed correctly.
|
654
792
|
|
655
|
-
* connection
|
656
|
-
* query
|
657
|
-
* out_result
|
658
|
-
*
|
793
|
+
* @param connection The connection to perform the query in.
|
794
|
+
* @param query The SQL query to run.
|
795
|
+
* @param out_result The query result.
|
796
|
+
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
659
797
|
*/
|
660
798
|
DUCKDB_API duckdb_state duckdb_query(duckdb_connection connection, const char *query, duckdb_result *out_result);
|
661
799
|
|
662
800
|
/*!
|
663
801
|
Closes the result and de-allocates all memory allocated for that connection.
|
664
802
|
|
665
|
-
* result
|
803
|
+
* @param result The result to destroy.
|
666
804
|
*/
|
667
805
|
DUCKDB_API void duckdb_destroy_result(duckdb_result *result);
|
668
806
|
|
@@ -672,9 +810,9 @@ automatically be destroyed when the result is destroyed.
|
|
672
810
|
|
673
811
|
Returns `NULL` if the column is out of range.
|
674
812
|
|
675
|
-
* result
|
676
|
-
* col
|
677
|
-
*
|
813
|
+
* @param result The result object to fetch the column name from.
|
814
|
+
* @param col The column index.
|
815
|
+
* @return The column name of the specified column.
|
678
816
|
*/
|
679
817
|
DUCKDB_API const char *duckdb_column_name(duckdb_result *result, idx_t col);
|
680
818
|
|
@@ -683,18 +821,18 @@ Returns the column type of the specified column.
|
|
683
821
|
|
684
822
|
Returns `DUCKDB_TYPE_INVALID` if the column is out of range.
|
685
823
|
|
686
|
-
* result
|
687
|
-
* col
|
688
|
-
*
|
824
|
+
* @param result The result object to fetch the column type from.
|
825
|
+
* @param col The column index.
|
826
|
+
* @return The column type of the specified column.
|
689
827
|
*/
|
690
828
|
DUCKDB_API duckdb_type duckdb_column_type(duckdb_result *result, idx_t col);
|
691
829
|
|
692
830
|
/*!
|
693
831
|
Returns the statement type of the statement that was executed
|
694
832
|
|
695
|
-
* result
|
696
|
-
|
697
|
-
|
833
|
+
* @param result The result object to fetch the statement type from.
|
834
|
+
* @return duckdb_statement_type value or DUCKDB_STATEMENT_TYPE_INVALID
|
835
|
+
*/
|
698
836
|
DUCKDB_API duckdb_statement_type duckdb_result_statement_type(duckdb_result result);
|
699
837
|
|
700
838
|
/*!
|
@@ -704,17 +842,17 @@ The return type of this call should be destroyed with `duckdb_destroy_logical_ty
|
|
704
842
|
|
705
843
|
Returns `NULL` if the column is out of range.
|
706
844
|
|
707
|
-
* result
|
708
|
-
* col
|
709
|
-
*
|
845
|
+
* @param result The result object to fetch the column type from.
|
846
|
+
* @param col The column index.
|
847
|
+
* @return The logical column type of the specified column.
|
710
848
|
*/
|
711
849
|
DUCKDB_API duckdb_logical_type duckdb_column_logical_type(duckdb_result *result, idx_t col);
|
712
850
|
|
713
851
|
/*!
|
714
852
|
Returns the number of columns present in a the result object.
|
715
853
|
|
716
|
-
* result
|
717
|
-
*
|
854
|
+
* @param result The result object.
|
855
|
+
* @return The number of columns present in the result object.
|
718
856
|
*/
|
719
857
|
DUCKDB_API idx_t duckdb_column_count(duckdb_result *result);
|
720
858
|
|
@@ -724,8 +862,8 @@ DUCKDB_API idx_t duckdb_column_count(duckdb_result *result);
|
|
724
862
|
|
725
863
|
Returns the number of rows present in the result object.
|
726
864
|
|
727
|
-
* result
|
728
|
-
*
|
865
|
+
* @param result The result object.
|
866
|
+
* @return The number of rows present in the result object.
|
729
867
|
*/
|
730
868
|
DUCKDB_API idx_t duckdb_row_count(duckdb_result *result);
|
731
869
|
#endif
|
@@ -734,8 +872,8 @@ DUCKDB_API idx_t duckdb_row_count(duckdb_result *result);
|
|
734
872
|
Returns the number of rows changed by the query stored in the result. This is relevant only for INSERT/UPDATE/DELETE
|
735
873
|
queries. For other queries the rows_changed will be 0.
|
736
874
|
|
737
|
-
* result
|
738
|
-
*
|
875
|
+
* @param result The result object.
|
876
|
+
* @return The number of rows changed.
|
739
877
|
*/
|
740
878
|
DUCKDB_API idx_t duckdb_rows_changed(duckdb_result *result);
|
741
879
|
|
@@ -755,12 +893,14 @@ int32_t *data = (int32_t *) duckdb_column_data(&result, 0);
|
|
755
893
|
printf("Data for row %d: %d\n", row, data[row]);
|
756
894
|
```
|
757
895
|
|
758
|
-
* result
|
759
|
-
* col
|
760
|
-
*
|
896
|
+
* @param result The result object to fetch the column data from.
|
897
|
+
* @param col The column index.
|
898
|
+
* @return The column data of the specified column.
|
761
899
|
*/
|
762
900
|
DUCKDB_API void *duckdb_column_data(duckdb_result *result, idx_t col);
|
901
|
+
#endif
|
763
902
|
|
903
|
+
#ifndef DUCKDB_API_NO_DEPRECATED
|
764
904
|
/*!
|
765
905
|
**DEPRECATED**: Prefer using `duckdb_result_get_chunk` instead.
|
766
906
|
|
@@ -778,9 +918,9 @@ if (nullmask[row]) {
|
|
778
918
|
}
|
779
919
|
```
|
780
920
|
|
781
|
-
* result
|
782
|
-
* col
|
783
|
-
*
|
921
|
+
* @param result The result object to fetch the nullmask from.
|
922
|
+
* @param col The column index.
|
923
|
+
* @return The nullmask of the specified column.
|
784
924
|
*/
|
785
925
|
DUCKDB_API bool *duckdb_nullmask_data(duckdb_result *result, idx_t col);
|
786
926
|
#endif
|
@@ -790,14 +930,24 @@ Returns the error message contained within the result. The error is only set if
|
|
790
930
|
|
791
931
|
The result of this function must not be freed. It will be cleaned up when `duckdb_destroy_result` is called.
|
792
932
|
|
793
|
-
* result
|
794
|
-
*
|
933
|
+
* @param result The result object to fetch the error from.
|
934
|
+
* @return The error of the result.
|
795
935
|
*/
|
796
936
|
DUCKDB_API const char *duckdb_result_error(duckdb_result *result);
|
797
937
|
|
938
|
+
/*!
|
939
|
+
Returns the result error type contained within the result. The error is only set if `duckdb_query` returns
|
940
|
+
`DuckDBError`.
|
941
|
+
|
942
|
+
* @param result The result object to fetch the error from.
|
943
|
+
* @return The error type of the result.
|
944
|
+
*/
|
945
|
+
DUCKDB_API duckdb_error_type duckdb_result_error_type(duckdb_result *result);
|
946
|
+
|
798
947
|
//===--------------------------------------------------------------------===//
|
799
948
|
// Result Functions
|
800
949
|
//===--------------------------------------------------------------------===//
|
950
|
+
|
801
951
|
#ifndef DUCKDB_API_NO_DEPRECATED
|
802
952
|
/*!
|
803
953
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
@@ -814,9 +964,9 @@ mixed with the legacy result functions).
|
|
814
964
|
|
815
965
|
Use `duckdb_result_chunk_count` to figure out how many chunks there are in the result.
|
816
966
|
|
817
|
-
* result
|
818
|
-
* chunk_index
|
819
|
-
*
|
967
|
+
* @param result The result object to fetch the data chunk from.
|
968
|
+
* @param chunk_index The chunk index to fetch from.
|
969
|
+
* @return The resulting data chunk. Returns `NULL` if the chunk index is out of bounds.
|
820
970
|
*/
|
821
971
|
DUCKDB_API duckdb_data_chunk duckdb_result_get_chunk(duckdb_result result, idx_t chunk_index);
|
822
972
|
|
@@ -825,8 +975,8 @@ DUCKDB_API duckdb_data_chunk duckdb_result_get_chunk(duckdb_result result, idx_t
|
|
825
975
|
|
826
976
|
Checks if the type of the internal result is StreamQueryResult.
|
827
977
|
|
828
|
-
* result
|
829
|
-
*
|
978
|
+
* @param result The result object to check.
|
979
|
+
* @return Whether or not the result object is of the type StreamQueryResult
|
830
980
|
*/
|
831
981
|
DUCKDB_API bool duckdb_result_is_streaming(duckdb_result result);
|
832
982
|
|
@@ -835,159 +985,160 @@ DUCKDB_API bool duckdb_result_is_streaming(duckdb_result result);
|
|
835
985
|
|
836
986
|
Returns the number of data chunks present in the result.
|
837
987
|
|
838
|
-
* result
|
839
|
-
*
|
988
|
+
* @param result The result object
|
989
|
+
* @return Number of data chunks present in the result.
|
840
990
|
*/
|
841
991
|
DUCKDB_API idx_t duckdb_result_chunk_count(duckdb_result result);
|
842
|
-
#endif
|
843
992
|
|
844
993
|
/*!
|
845
994
|
Returns the return_type of the given result, or DUCKDB_RETURN_TYPE_INVALID on error
|
846
995
|
|
847
|
-
* result
|
848
|
-
*
|
849
|
-
|
996
|
+
* @param result The result object
|
997
|
+
* @return The return_type
|
998
|
+
*/
|
850
999
|
DUCKDB_API duckdb_result_type duckdb_result_return_type(duckdb_result result);
|
851
1000
|
|
852
|
-
#
|
1001
|
+
#endif
|
853
1002
|
//===--------------------------------------------------------------------===//
|
854
|
-
// Safe
|
1003
|
+
// Safe Fetch Functions
|
855
1004
|
//===--------------------------------------------------------------------===//
|
856
1005
|
|
857
1006
|
// These functions will perform conversions if necessary.
|
858
1007
|
// On failure (e.g. if conversion cannot be performed or if the value is NULL) a default value is returned.
|
859
1008
|
// Note that these functions are slow since they perform bounds checking and conversion
|
860
1009
|
// For fast access of values prefer using `duckdb_result_get_chunk`
|
861
|
-
|
1010
|
+
#ifndef DUCKDB_API_NO_DEPRECATED
|
862
1011
|
/*!
|
863
1012
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
864
1013
|
|
865
|
-
|
866
|
-
|
1014
|
+
* @return The boolean value at the specified location, or false if the value cannot be converted.
|
1015
|
+
*/
|
867
1016
|
DUCKDB_API bool duckdb_value_boolean(duckdb_result *result, idx_t col, idx_t row);
|
868
1017
|
|
869
1018
|
/*!
|
870
1019
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
871
1020
|
|
872
|
-
|
873
|
-
|
1021
|
+
* @return The int8_t value at the specified location, or 0 if the value cannot be converted.
|
1022
|
+
*/
|
874
1023
|
DUCKDB_API int8_t duckdb_value_int8(duckdb_result *result, idx_t col, idx_t row);
|
875
1024
|
|
876
1025
|
/*!
|
877
1026
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
878
1027
|
|
879
|
-
|
880
|
-
|
1028
|
+
* @return The int16_t value at the specified location, or 0 if the value cannot be converted.
|
1029
|
+
*/
|
881
1030
|
DUCKDB_API int16_t duckdb_value_int16(duckdb_result *result, idx_t col, idx_t row);
|
882
1031
|
|
883
1032
|
/*!
|
884
1033
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
885
1034
|
|
886
|
-
|
887
|
-
|
1035
|
+
* @return The int32_t value at the specified location, or 0 if the value cannot be converted.
|
1036
|
+
*/
|
888
1037
|
DUCKDB_API int32_t duckdb_value_int32(duckdb_result *result, idx_t col, idx_t row);
|
889
1038
|
|
890
1039
|
/*!
|
891
1040
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
892
1041
|
|
893
|
-
|
894
|
-
|
1042
|
+
* @return The int64_t value at the specified location, or 0 if the value cannot be converted.
|
1043
|
+
*/
|
895
1044
|
DUCKDB_API int64_t duckdb_value_int64(duckdb_result *result, idx_t col, idx_t row);
|
896
1045
|
|
897
1046
|
/*!
|
898
1047
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
899
1048
|
|
900
|
-
|
901
|
-
|
1049
|
+
* @return The duckdb_hugeint value at the specified location, or 0 if the value cannot be converted.
|
1050
|
+
*/
|
902
1051
|
DUCKDB_API duckdb_hugeint duckdb_value_hugeint(duckdb_result *result, idx_t col, idx_t row);
|
903
1052
|
|
904
1053
|
/*!
|
905
1054
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
906
1055
|
|
907
|
-
|
908
|
-
|
1056
|
+
* @return The duckdb_uhugeint value at the specified location, or 0 if the value cannot be converted.
|
1057
|
+
*/
|
909
1058
|
DUCKDB_API duckdb_uhugeint duckdb_value_uhugeint(duckdb_result *result, idx_t col, idx_t row);
|
910
1059
|
|
911
1060
|
/*!
|
912
1061
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
913
1062
|
|
914
|
-
|
915
|
-
|
1063
|
+
* @return The duckdb_decimal value at the specified location, or 0 if the value cannot be converted.
|
1064
|
+
*/
|
916
1065
|
DUCKDB_API duckdb_decimal duckdb_value_decimal(duckdb_result *result, idx_t col, idx_t row);
|
917
1066
|
|
918
1067
|
/*!
|
919
1068
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
920
1069
|
|
921
|
-
|
922
|
-
|
1070
|
+
* @return The uint8_t value at the specified location, or 0 if the value cannot be converted.
|
1071
|
+
*/
|
923
1072
|
DUCKDB_API uint8_t duckdb_value_uint8(duckdb_result *result, idx_t col, idx_t row);
|
924
1073
|
|
925
1074
|
/*!
|
926
1075
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
927
1076
|
|
928
|
-
|
929
|
-
|
1077
|
+
* @return The uint16_t value at the specified location, or 0 if the value cannot be converted.
|
1078
|
+
*/
|
930
1079
|
DUCKDB_API uint16_t duckdb_value_uint16(duckdb_result *result, idx_t col, idx_t row);
|
931
1080
|
|
932
1081
|
/*!
|
933
1082
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
934
1083
|
|
935
|
-
|
936
|
-
|
1084
|
+
* @return The uint32_t value at the specified location, or 0 if the value cannot be converted.
|
1085
|
+
*/
|
937
1086
|
DUCKDB_API uint32_t duckdb_value_uint32(duckdb_result *result, idx_t col, idx_t row);
|
938
1087
|
|
939
1088
|
/*!
|
940
1089
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
941
1090
|
|
942
|
-
|
943
|
-
|
1091
|
+
* @return The uint64_t value at the specified location, or 0 if the value cannot be converted.
|
1092
|
+
*/
|
944
1093
|
DUCKDB_API uint64_t duckdb_value_uint64(duckdb_result *result, idx_t col, idx_t row);
|
945
1094
|
|
946
1095
|
/*!
|
947
1096
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
948
1097
|
|
949
|
-
|
950
|
-
|
1098
|
+
* @return The float value at the specified location, or 0 if the value cannot be converted.
|
1099
|
+
*/
|
951
1100
|
DUCKDB_API float duckdb_value_float(duckdb_result *result, idx_t col, idx_t row);
|
952
1101
|
|
953
1102
|
/*!
|
954
1103
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
955
1104
|
|
956
|
-
|
957
|
-
|
1105
|
+
* @return The double value at the specified location, or 0 if the value cannot be converted.
|
1106
|
+
*/
|
958
1107
|
DUCKDB_API double duckdb_value_double(duckdb_result *result, idx_t col, idx_t row);
|
959
1108
|
|
960
1109
|
/*!
|
961
1110
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
962
1111
|
|
963
|
-
|
964
|
-
|
1112
|
+
* @return The duckdb_date value at the specified location, or 0 if the value cannot be converted.
|
1113
|
+
*/
|
965
1114
|
DUCKDB_API duckdb_date duckdb_value_date(duckdb_result *result, idx_t col, idx_t row);
|
966
1115
|
|
967
1116
|
/*!
|
968
1117
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
969
1118
|
|
970
|
-
|
971
|
-
|
1119
|
+
* @return The duckdb_time value at the specified location, or 0 if the value cannot be converted.
|
1120
|
+
*/
|
972
1121
|
DUCKDB_API duckdb_time duckdb_value_time(duckdb_result *result, idx_t col, idx_t row);
|
973
1122
|
|
974
1123
|
/*!
|
975
1124
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
976
1125
|
|
977
|
-
|
978
|
-
|
1126
|
+
* @return The duckdb_timestamp value at the specified location, or 0 if the value cannot be converted.
|
1127
|
+
*/
|
979
1128
|
DUCKDB_API duckdb_timestamp duckdb_value_timestamp(duckdb_result *result, idx_t col, idx_t row);
|
980
1129
|
|
981
1130
|
/*!
|
982
1131
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
983
1132
|
|
984
|
-
|
985
|
-
|
1133
|
+
* @return The duckdb_interval value at the specified location, or 0 if the value cannot be converted.
|
1134
|
+
*/
|
986
1135
|
DUCKDB_API duckdb_interval duckdb_value_interval(duckdb_result *result, idx_t col, idx_t row);
|
987
1136
|
|
988
1137
|
/*!
|
989
|
-
|
990
|
-
|
1138
|
+
**DEPRECATED**: Use duckdb_value_string instead. This function does not work correctly if the string contains null
|
1139
|
+
bytes.
|
1140
|
+
|
1141
|
+
* @return The text value at the specified location as a null-terminated string, or nullptr if the value cannot be
|
991
1142
|
converted. The result must be freed with `duckdb_free`.
|
992
1143
|
*/
|
993
1144
|
DUCKDB_API char *duckdb_value_varchar(duckdb_result *result, idx_t col, idx_t row);
|
@@ -995,16 +1146,18 @@ DUCKDB_API char *duckdb_value_varchar(duckdb_result *result, idx_t col, idx_t ro
|
|
995
1146
|
/*!
|
996
1147
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
997
1148
|
|
998
|
-
|
999
|
-
|
1000
|
-
|
1001
|
-
|
1149
|
+
No support for nested types, and for other complex types.
|
1150
|
+
The resulting field "string.data" must be freed with `duckdb_free.`
|
1151
|
+
|
1152
|
+
* @return The string value at the specified location. Attempts to cast the result value to string.
|
1153
|
+
*/
|
1002
1154
|
DUCKDB_API duckdb_string duckdb_value_string(duckdb_result *result, idx_t col, idx_t row);
|
1003
1155
|
|
1004
1156
|
/*!
|
1005
|
-
|
1157
|
+
**DEPRECATED**: Use duckdb_value_string_internal instead. This function does not work correctly if the string contains
|
1006
1158
|
null bytes.
|
1007
|
-
|
1159
|
+
|
1160
|
+
* @return The char* value at the specified location. ONLY works on VARCHAR columns and does not auto-cast.
|
1008
1161
|
If the column is NOT a VARCHAR column this function will return NULL.
|
1009
1162
|
|
1010
1163
|
The result must NOT be freed.
|
@@ -1012,9 +1165,9 @@ The result must NOT be freed.
|
|
1012
1165
|
DUCKDB_API char *duckdb_value_varchar_internal(duckdb_result *result, idx_t col, idx_t row);
|
1013
1166
|
|
1014
1167
|
/*!
|
1015
|
-
|
1168
|
+
**DEPRECATED**: Use duckdb_value_string_internal instead. This function does not work correctly if the string contains
|
1016
1169
|
null bytes.
|
1017
|
-
*
|
1170
|
+
* @return The char* value at the specified location. ONLY works on VARCHAR columns and does not auto-cast.
|
1018
1171
|
If the column is NOT a VARCHAR column this function will return NULL.
|
1019
1172
|
|
1020
1173
|
The result must NOT be freed.
|
@@ -1024,7 +1177,7 @@ DUCKDB_API duckdb_string duckdb_value_string_internal(duckdb_result *result, idx
|
|
1024
1177
|
/*!
|
1025
1178
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
1026
1179
|
|
1027
|
-
*
|
1180
|
+
* @return The duckdb_blob value at the specified location. Returns a blob with blob.data set to nullptr if the
|
1028
1181
|
value cannot be converted. The resulting field "blob.data" must be freed with `duckdb_free.`
|
1029
1182
|
*/
|
1030
1183
|
DUCKDB_API duckdb_blob duckdb_value_blob(duckdb_result *result, idx_t col, idx_t row);
|
@@ -1032,11 +1185,11 @@ DUCKDB_API duckdb_blob duckdb_value_blob(duckdb_result *result, idx_t col, idx_t
|
|
1032
1185
|
/*!
|
1033
1186
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
1034
1187
|
|
1035
|
-
|
1036
|
-
|
1188
|
+
* @return Returns true if the value at the specified index is NULL, and false otherwise.
|
1189
|
+
*/
|
1037
1190
|
DUCKDB_API bool duckdb_value_is_null(duckdb_result *result, idx_t col, idx_t row);
|
1038
|
-
#endif
|
1039
1191
|
|
1192
|
+
#endif
|
1040
1193
|
//===--------------------------------------------------------------------===//
|
1041
1194
|
// Helpers
|
1042
1195
|
//===--------------------------------------------------------------------===//
|
@@ -1045,8 +1198,8 @@ DUCKDB_API bool duckdb_value_is_null(duckdb_result *result, idx_t col, idx_t row
|
|
1045
1198
|
Allocate `size` bytes of memory using the duckdb internal malloc function. Any memory allocated in this manner
|
1046
1199
|
should be freed using `duckdb_free`.
|
1047
1200
|
|
1048
|
-
* size
|
1049
|
-
*
|
1201
|
+
* @param size The number of bytes to allocate.
|
1202
|
+
* @return A pointer to the allocated memory region.
|
1050
1203
|
*/
|
1051
1204
|
DUCKDB_API void *duckdb_malloc(size_t size);
|
1052
1205
|
|
@@ -1054,7 +1207,7 @@ DUCKDB_API void *duckdb_malloc(size_t size);
|
|
1054
1207
|
Free a value returned from `duckdb_malloc`, `duckdb_value_varchar`, `duckdb_value_blob`, or
|
1055
1208
|
`duckdb_value_string`.
|
1056
1209
|
|
1057
|
-
* ptr
|
1210
|
+
* @param ptr The memory region to de-allocate.
|
1058
1211
|
*/
|
1059
1212
|
DUCKDB_API void duckdb_free(void *ptr);
|
1060
1213
|
|
@@ -1062,7 +1215,7 @@ DUCKDB_API void duckdb_free(void *ptr);
|
|
1062
1215
|
The internal vector size used by DuckDB.
|
1063
1216
|
This is the amount of tuples that will fit into a data chunk created by `duckdb_create_data_chunk`.
|
1064
1217
|
|
1065
|
-
*
|
1218
|
+
* @return The vector size.
|
1066
1219
|
*/
|
1067
1220
|
DUCKDB_API idx_t duckdb_vector_size();
|
1068
1221
|
|
@@ -1073,48 +1226,64 @@ This means that the data of the string does not have a separate allocation.
|
|
1073
1226
|
*/
|
1074
1227
|
DUCKDB_API bool duckdb_string_is_inlined(duckdb_string_t string);
|
1075
1228
|
|
1229
|
+
/*!
|
1230
|
+
Get the string length of a string_t
|
1231
|
+
|
1232
|
+
* @param string The string to get the length of.
|
1233
|
+
* @return The length.
|
1234
|
+
*/
|
1235
|
+
DUCKDB_API uint32_t duckdb_string_t_length(duckdb_string_t string);
|
1236
|
+
|
1237
|
+
/*!
|
1238
|
+
Get a pointer to the string data of a string_t
|
1239
|
+
|
1240
|
+
* @param string The string to get the pointer to.
|
1241
|
+
* @return The pointer.
|
1242
|
+
*/
|
1243
|
+
DUCKDB_API const char *duckdb_string_t_data(duckdb_string_t *string);
|
1244
|
+
|
1076
1245
|
//===--------------------------------------------------------------------===//
|
1077
|
-
// Date
|
1246
|
+
// Date Time Timestamp Helpers
|
1078
1247
|
//===--------------------------------------------------------------------===//
|
1079
1248
|
|
1080
1249
|
/*!
|
1081
1250
|
Decompose a `duckdb_date` object into year, month and date (stored as `duckdb_date_struct`).
|
1082
1251
|
|
1083
|
-
* date
|
1084
|
-
*
|
1252
|
+
* @param date The date object, as obtained from a `DUCKDB_TYPE_DATE` column.
|
1253
|
+
* @return The `duckdb_date_struct` with the decomposed elements.
|
1085
1254
|
*/
|
1086
1255
|
DUCKDB_API duckdb_date_struct duckdb_from_date(duckdb_date date);
|
1087
1256
|
|
1088
1257
|
/*!
|
1089
1258
|
Re-compose a `duckdb_date` from year, month and date (`duckdb_date_struct`).
|
1090
1259
|
|
1091
|
-
* date
|
1092
|
-
*
|
1260
|
+
* @param date The year, month and date stored in a `duckdb_date_struct`.
|
1261
|
+
* @return The `duckdb_date` element.
|
1093
1262
|
*/
|
1094
1263
|
DUCKDB_API duckdb_date duckdb_to_date(duckdb_date_struct date);
|
1095
1264
|
|
1096
1265
|
/*!
|
1097
1266
|
Test a `duckdb_date` to see if it is a finite value.
|
1098
1267
|
|
1099
|
-
* date
|
1100
|
-
*
|
1268
|
+
* @param date The date object, as obtained from a `DUCKDB_TYPE_DATE` column.
|
1269
|
+
* @return True if the date is finite, false if it is ±infinity.
|
1101
1270
|
*/
|
1102
1271
|
DUCKDB_API bool duckdb_is_finite_date(duckdb_date date);
|
1103
1272
|
|
1104
1273
|
/*!
|
1105
1274
|
Decompose a `duckdb_time` object into hour, minute, second and microsecond (stored as `duckdb_time_struct`).
|
1106
1275
|
|
1107
|
-
* time
|
1108
|
-
*
|
1276
|
+
* @param time The time object, as obtained from a `DUCKDB_TYPE_TIME` column.
|
1277
|
+
* @return The `duckdb_time_struct` with the decomposed elements.
|
1109
1278
|
*/
|
1110
1279
|
DUCKDB_API duckdb_time_struct duckdb_from_time(duckdb_time time);
|
1111
1280
|
|
1112
1281
|
/*!
|
1113
1282
|
Create a `duckdb_time_tz` object from micros and a timezone offset.
|
1114
1283
|
|
1115
|
-
* micros
|
1116
|
-
* offset
|
1117
|
-
*
|
1284
|
+
* @param micros The microsecond component of the time.
|
1285
|
+
* @param offset The timezone offset component of the time.
|
1286
|
+
* @return The `duckdb_time_tz` element.
|
1118
1287
|
*/
|
1119
1288
|
DUCKDB_API duckdb_time_tz duckdb_create_time_tz(int64_t micros, int32_t offset);
|
1120
1289
|
|
@@ -1123,41 +1292,39 @@ Decompose a TIME_TZ objects into micros and a timezone offset.
|
|
1123
1292
|
|
1124
1293
|
Use `duckdb_from_time` to further decompose the micros into hour, minute, second and microsecond.
|
1125
1294
|
|
1126
|
-
* micros
|
1127
|
-
* out_micros: The microsecond component of the time.
|
1128
|
-
* out_offset: The timezone offset component of the time.
|
1295
|
+
* @param micros The time object, as obtained from a `DUCKDB_TYPE_TIME_TZ` column.
|
1129
1296
|
*/
|
1130
1297
|
DUCKDB_API duckdb_time_tz_struct duckdb_from_time_tz(duckdb_time_tz micros);
|
1131
1298
|
|
1132
1299
|
/*!
|
1133
1300
|
Re-compose a `duckdb_time` from hour, minute, second and microsecond (`duckdb_time_struct`).
|
1134
1301
|
|
1135
|
-
* time
|
1136
|
-
*
|
1302
|
+
* @param time The hour, minute, second and microsecond in a `duckdb_time_struct`.
|
1303
|
+
* @return The `duckdb_time` element.
|
1137
1304
|
*/
|
1138
1305
|
DUCKDB_API duckdb_time duckdb_to_time(duckdb_time_struct time);
|
1139
1306
|
|
1140
1307
|
/*!
|
1141
1308
|
Decompose a `duckdb_timestamp` object into a `duckdb_timestamp_struct`.
|
1142
1309
|
|
1143
|
-
* ts
|
1144
|
-
*
|
1310
|
+
* @param ts The ts object, as obtained from a `DUCKDB_TYPE_TIMESTAMP` column.
|
1311
|
+
* @return The `duckdb_timestamp_struct` with the decomposed elements.
|
1145
1312
|
*/
|
1146
1313
|
DUCKDB_API duckdb_timestamp_struct duckdb_from_timestamp(duckdb_timestamp ts);
|
1147
1314
|
|
1148
1315
|
/*!
|
1149
1316
|
Re-compose a `duckdb_timestamp` from a duckdb_timestamp_struct.
|
1150
1317
|
|
1151
|
-
* ts
|
1152
|
-
*
|
1318
|
+
* @param ts The de-composed elements in a `duckdb_timestamp_struct`.
|
1319
|
+
* @return The `duckdb_timestamp` element.
|
1153
1320
|
*/
|
1154
1321
|
DUCKDB_API duckdb_timestamp duckdb_to_timestamp(duckdb_timestamp_struct ts);
|
1155
1322
|
|
1156
1323
|
/*!
|
1157
1324
|
Test a `duckdb_timestamp` to see if it is a finite value.
|
1158
1325
|
|
1159
|
-
* ts
|
1160
|
-
*
|
1326
|
+
* @param ts The timestamp object, as obtained from a `DUCKDB_TYPE_TIMESTAMP` column.
|
1327
|
+
* @return True if the timestamp is finite, false if it is ±infinity.
|
1161
1328
|
*/
|
1162
1329
|
DUCKDB_API bool duckdb_is_finite_timestamp(duckdb_timestamp ts);
|
1163
1330
|
|
@@ -1168,8 +1335,8 @@ DUCKDB_API bool duckdb_is_finite_timestamp(duckdb_timestamp ts);
|
|
1168
1335
|
/*!
|
1169
1336
|
Converts a duckdb_hugeint object (as obtained from a `DUCKDB_TYPE_HUGEINT` column) into a double.
|
1170
1337
|
|
1171
|
-
* val
|
1172
|
-
*
|
1338
|
+
* @param val The hugeint value.
|
1339
|
+
* @return The converted `double` element.
|
1173
1340
|
*/
|
1174
1341
|
DUCKDB_API double duckdb_hugeint_to_double(duckdb_hugeint val);
|
1175
1342
|
|
@@ -1178,8 +1345,8 @@ Converts a double value to a duckdb_hugeint object.
|
|
1178
1345
|
|
1179
1346
|
If the conversion fails because the double value is too big the result will be 0.
|
1180
1347
|
|
1181
|
-
* val
|
1182
|
-
*
|
1348
|
+
* @param val The double value.
|
1349
|
+
* @return The converted `duckdb_hugeint` element.
|
1183
1350
|
*/
|
1184
1351
|
DUCKDB_API duckdb_hugeint duckdb_double_to_hugeint(double val);
|
1185
1352
|
|
@@ -1190,8 +1357,8 @@ DUCKDB_API duckdb_hugeint duckdb_double_to_hugeint(double val);
|
|
1190
1357
|
/*!
|
1191
1358
|
Converts a duckdb_uhugeint object (as obtained from a `DUCKDB_TYPE_UHUGEINT` column) into a double.
|
1192
1359
|
|
1193
|
-
* val
|
1194
|
-
*
|
1360
|
+
* @param val The uhugeint value.
|
1361
|
+
* @return The converted `double` element.
|
1195
1362
|
*/
|
1196
1363
|
DUCKDB_API double duckdb_uhugeint_to_double(duckdb_uhugeint val);
|
1197
1364
|
|
@@ -1200,8 +1367,8 @@ Converts a double value to a duckdb_uhugeint object.
|
|
1200
1367
|
|
1201
1368
|
If the conversion fails because the double value is too big the result will be 0.
|
1202
1369
|
|
1203
|
-
* val
|
1204
|
-
*
|
1370
|
+
* @param val The double value.
|
1371
|
+
* @return The converted `duckdb_uhugeint` element.
|
1205
1372
|
*/
|
1206
1373
|
DUCKDB_API duckdb_uhugeint duckdb_double_to_uhugeint(double val);
|
1207
1374
|
|
@@ -1214,16 +1381,16 @@ Converts a double value to a duckdb_decimal object.
|
|
1214
1381
|
|
1215
1382
|
If the conversion fails because the double value is too big, or the width/scale are invalid the result will be 0.
|
1216
1383
|
|
1217
|
-
* val
|
1218
|
-
*
|
1384
|
+
* @param val The double value.
|
1385
|
+
* @return The converted `duckdb_decimal` element.
|
1219
1386
|
*/
|
1220
1387
|
DUCKDB_API duckdb_decimal duckdb_double_to_decimal(double val, uint8_t width, uint8_t scale);
|
1221
1388
|
|
1222
1389
|
/*!
|
1223
1390
|
Converts a duckdb_decimal object (as obtained from a `DUCKDB_TYPE_DECIMAL` column) into a double.
|
1224
1391
|
|
1225
|
-
* val
|
1226
|
-
*
|
1392
|
+
* @param val The decimal value.
|
1393
|
+
* @return The converted `double` element.
|
1227
1394
|
*/
|
1228
1395
|
DUCKDB_API double duckdb_decimal_to_double(duckdb_decimal val);
|
1229
1396
|
|
@@ -1240,7 +1407,6 @@ DUCKDB_API double duckdb_decimal_to_double(duckdb_decimal val);
|
|
1240
1407
|
// SELECT * FROM tbl WHERE id=?
|
1241
1408
|
// Or a query with multiple parameters:
|
1242
1409
|
// SELECT * FROM tbl WHERE id=$1 OR name=$2
|
1243
|
-
|
1244
1410
|
/*!
|
1245
1411
|
Create a prepared statement object from a query.
|
1246
1412
|
|
@@ -1249,10 +1415,10 @@ Note that after calling `duckdb_prepare`, the prepared statement should always b
|
|
1249
1415
|
|
1250
1416
|
If the prepare fails, `duckdb_prepare_error` can be called to obtain the reason why the prepare failed.
|
1251
1417
|
|
1252
|
-
* connection
|
1253
|
-
* query
|
1254
|
-
* out_prepared_statement
|
1255
|
-
*
|
1418
|
+
* @param connection The connection object
|
1419
|
+
* @param query The SQL query to prepare
|
1420
|
+
* @param out_prepared_statement The resulting prepared statement object
|
1421
|
+
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
1256
1422
|
*/
|
1257
1423
|
DUCKDB_API duckdb_state duckdb_prepare(duckdb_connection connection, const char *query,
|
1258
1424
|
duckdb_prepared_statement *out_prepared_statement);
|
@@ -1260,7 +1426,7 @@ DUCKDB_API duckdb_state duckdb_prepare(duckdb_connection connection, const char
|
|
1260
1426
|
/*!
|
1261
1427
|
Closes the prepared statement and de-allocates all memory allocated for the statement.
|
1262
1428
|
|
1263
|
-
* prepared_statement
|
1429
|
+
* @param prepared_statement The prepared statement to destroy.
|
1264
1430
|
*/
|
1265
1431
|
DUCKDB_API void duckdb_destroy_prepare(duckdb_prepared_statement *prepared_statement);
|
1266
1432
|
|
@@ -1270,8 +1436,8 @@ If the prepared statement has no error message, this returns `nullptr` instead.
|
|
1270
1436
|
|
1271
1437
|
The error message should not be freed. It will be de-allocated when `duckdb_destroy_prepare` is called.
|
1272
1438
|
|
1273
|
-
* prepared_statement
|
1274
|
-
*
|
1439
|
+
* @param prepared_statement The prepared statement to obtain the error from.
|
1440
|
+
* @return The error message, or `nullptr` if there is none.
|
1275
1441
|
*/
|
1276
1442
|
DUCKDB_API const char *duckdb_prepare_error(duckdb_prepared_statement prepared_statement);
|
1277
1443
|
|
@@ -1280,7 +1446,7 @@ Returns the number of parameters that can be provided to the given prepared stat
|
|
1280
1446
|
|
1281
1447
|
Returns 0 if the query was not successfully prepared.
|
1282
1448
|
|
1283
|
-
* prepared_statement
|
1449
|
+
* @param prepared_statement The prepared statement to obtain the number of parameters for.
|
1284
1450
|
*/
|
1285
1451
|
DUCKDB_API idx_t duckdb_nparams(duckdb_prepared_statement prepared_statement);
|
1286
1452
|
|
@@ -1290,7 +1456,7 @@ The returned string should be freed using `duckdb_free`.
|
|
1290
1456
|
|
1291
1457
|
Returns NULL if the index is out of range for the provided prepared statement.
|
1292
1458
|
|
1293
|
-
* prepared_statement
|
1459
|
+
* @param prepared_statement The prepared statement for which to get the parameter name from.
|
1294
1460
|
*/
|
1295
1461
|
DUCKDB_API const char *duckdb_parameter_name(duckdb_prepared_statement prepared_statement, idx_t index);
|
1296
1462
|
|
@@ -1299,9 +1465,9 @@ Returns the parameter type for the parameter at the given index.
|
|
1299
1465
|
|
1300
1466
|
Returns `DUCKDB_TYPE_INVALID` if the parameter index is out of range or the statement was not successfully prepared.
|
1301
1467
|
|
1302
|
-
* prepared_statement
|
1303
|
-
* param_idx
|
1304
|
-
*
|
1468
|
+
* @param prepared_statement The prepared statement.
|
1469
|
+
* @param param_idx The parameter index.
|
1470
|
+
* @return The parameter type
|
1305
1471
|
*/
|
1306
1472
|
DUCKDB_API duckdb_type duckdb_param_type(duckdb_prepared_statement prepared_statement, idx_t param_idx);
|
1307
1473
|
|
@@ -1313,13 +1479,13 @@ DUCKDB_API duckdb_state duckdb_clear_bindings(duckdb_prepared_statement prepared
|
|
1313
1479
|
/*!
|
1314
1480
|
Returns the statement type of the statement to be executed
|
1315
1481
|
|
1316
|
-
|
1317
|
-
|
1318
|
-
|
1482
|
+
* @param statement The prepared statement.
|
1483
|
+
* @return duckdb_statement_type value or DUCKDB_STATEMENT_TYPE_INVALID
|
1484
|
+
*/
|
1319
1485
|
DUCKDB_API duckdb_statement_type duckdb_prepared_statement_type(duckdb_prepared_statement statement);
|
1320
1486
|
|
1321
1487
|
//===--------------------------------------------------------------------===//
|
1322
|
-
// Bind Values
|
1488
|
+
// Bind Values To Prepared Statements
|
1323
1489
|
//===--------------------------------------------------------------------===//
|
1324
1490
|
|
1325
1491
|
/*!
|
@@ -1364,11 +1530,13 @@ Binds a duckdb_hugeint value to the prepared statement at the specified index.
|
|
1364
1530
|
*/
|
1365
1531
|
DUCKDB_API duckdb_state duckdb_bind_hugeint(duckdb_prepared_statement prepared_statement, idx_t param_idx,
|
1366
1532
|
duckdb_hugeint val);
|
1533
|
+
|
1367
1534
|
/*!
|
1368
1535
|
Binds an duckdb_uhugeint value to the prepared statement at the specified index.
|
1369
1536
|
*/
|
1370
1537
|
DUCKDB_API duckdb_state duckdb_bind_uhugeint(duckdb_prepared_statement prepared_statement, idx_t param_idx,
|
1371
1538
|
duckdb_uhugeint val);
|
1539
|
+
|
1372
1540
|
/*!
|
1373
1541
|
Binds a duckdb_decimal value to the prepared statement at the specified index.
|
1374
1542
|
*/
|
@@ -1423,6 +1591,12 @@ Binds a duckdb_timestamp value to the prepared statement at the specified index.
|
|
1423
1591
|
DUCKDB_API duckdb_state duckdb_bind_timestamp(duckdb_prepared_statement prepared_statement, idx_t param_idx,
|
1424
1592
|
duckdb_timestamp val);
|
1425
1593
|
|
1594
|
+
/*!
|
1595
|
+
Binds a duckdb_timestamp value to the prepared statement at the specified index.
|
1596
|
+
*/
|
1597
|
+
DUCKDB_API duckdb_state duckdb_bind_timestamp_tz(duckdb_prepared_statement prepared_statement, idx_t param_idx,
|
1598
|
+
duckdb_timestamp val);
|
1599
|
+
|
1426
1600
|
/*!
|
1427
1601
|
Binds a duckdb_interval value to the prepared statement at the specified index.
|
1428
1602
|
*/
|
@@ -1464,9 +1638,9 @@ between calls to this function.
|
|
1464
1638
|
|
1465
1639
|
Note that the result must be freed with `duckdb_destroy_result`.
|
1466
1640
|
|
1467
|
-
* prepared_statement
|
1468
|
-
* out_result
|
1469
|
-
*
|
1641
|
+
* @param prepared_statement The prepared statement to execute.
|
1642
|
+
* @param out_result The query result.
|
1643
|
+
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
1470
1644
|
*/
|
1471
1645
|
DUCKDB_API duckdb_state duckdb_execute_prepared(duckdb_prepared_statement prepared_statement,
|
1472
1646
|
duckdb_result *out_result);
|
@@ -1483,9 +1657,9 @@ between calls to this function.
|
|
1483
1657
|
|
1484
1658
|
Note that the result must be freed with `duckdb_destroy_result`.
|
1485
1659
|
|
1486
|
-
* prepared_statement
|
1487
|
-
* out_result
|
1488
|
-
*
|
1660
|
+
* @param prepared_statement The prepared statement to execute.
|
1661
|
+
* @param out_result The query result.
|
1662
|
+
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
1489
1663
|
*/
|
1490
1664
|
DUCKDB_API duckdb_state duckdb_execute_prepared_streaming(duckdb_prepared_statement prepared_statement,
|
1491
1665
|
duckdb_result *out_result);
|
@@ -1496,7 +1670,6 @@ DUCKDB_API duckdb_state duckdb_execute_prepared_streaming(duckdb_prepared_statem
|
|
1496
1670
|
//===--------------------------------------------------------------------===//
|
1497
1671
|
|
1498
1672
|
// A query string can be extracted into multiple SQL statements. Each statement can be prepared and executed separately.
|
1499
|
-
|
1500
1673
|
/*!
|
1501
1674
|
Extract all statements from a query.
|
1502
1675
|
Note that after calling `duckdb_extract_statements`, the extracted statements should always be destroyed using
|
@@ -1504,10 +1677,10 @@ Note that after calling `duckdb_extract_statements`, the extracted statements sh
|
|
1504
1677
|
|
1505
1678
|
If the extract fails, `duckdb_extract_statements_error` can be called to obtain the reason why the extract failed.
|
1506
1679
|
|
1507
|
-
* connection
|
1508
|
-
* query
|
1509
|
-
* out_extracted_statements
|
1510
|
-
*
|
1680
|
+
* @param connection The connection object
|
1681
|
+
* @param query The SQL query to extract
|
1682
|
+
* @param out_extracted_statements The resulting extracted statements object
|
1683
|
+
* @return The number of extracted statements or 0 on failure.
|
1511
1684
|
*/
|
1512
1685
|
DUCKDB_API idx_t duckdb_extract_statements(duckdb_connection connection, const char *query,
|
1513
1686
|
duckdb_extracted_statements *out_extracted_statements);
|
@@ -1519,28 +1692,29 @@ Note that after calling `duckdb_prepare_extracted_statement`, the prepared state
|
|
1519
1692
|
|
1520
1693
|
If the prepare fails, `duckdb_prepare_error` can be called to obtain the reason why the prepare failed.
|
1521
1694
|
|
1522
|
-
* connection
|
1523
|
-
* extracted_statements
|
1524
|
-
* index
|
1525
|
-
* out_prepared_statement
|
1526
|
-
*
|
1695
|
+
* @param connection The connection object
|
1696
|
+
* @param extracted_statements The extracted statements object
|
1697
|
+
* @param index The index of the extracted statement to prepare
|
1698
|
+
* @param out_prepared_statement The resulting prepared statement object
|
1699
|
+
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
1527
1700
|
*/
|
1528
1701
|
DUCKDB_API duckdb_state duckdb_prepare_extracted_statement(duckdb_connection connection,
|
1529
1702
|
duckdb_extracted_statements extracted_statements,
|
1530
1703
|
idx_t index,
|
1531
1704
|
duckdb_prepared_statement *out_prepared_statement);
|
1705
|
+
|
1532
1706
|
/*!
|
1533
1707
|
Returns the error message contained within the extracted statements.
|
1534
1708
|
The result of this function must not be freed. It will be cleaned up when `duckdb_destroy_extracted` is called.
|
1535
1709
|
|
1536
|
-
*
|
1537
|
-
*
|
1710
|
+
* @param extracted_statements The extracted statements to fetch the error from.
|
1711
|
+
* @return The error of the extracted statements.
|
1538
1712
|
*/
|
1539
1713
|
DUCKDB_API const char *duckdb_extract_statements_error(duckdb_extracted_statements extracted_statements);
|
1540
1714
|
|
1541
1715
|
/*!
|
1542
1716
|
De-allocates all memory allocated for the extracted statements.
|
1543
|
-
* extracted_statements
|
1717
|
+
* @param extracted_statements The extracted statements to destroy.
|
1544
1718
|
*/
|
1545
1719
|
DUCKDB_API void duckdb_destroy_extracted(duckdb_extracted_statements *extracted_statements);
|
1546
1720
|
|
@@ -1556,12 +1730,13 @@ The pending result can be used to incrementally execute a query, returning contr
|
|
1556
1730
|
Note that after calling `duckdb_pending_prepared`, the pending result should always be destroyed using
|
1557
1731
|
`duckdb_destroy_pending`, even if this function returns DuckDBError.
|
1558
1732
|
|
1559
|
-
* prepared_statement
|
1560
|
-
* out_result
|
1561
|
-
*
|
1733
|
+
* @param prepared_statement The prepared statement to execute.
|
1734
|
+
* @param out_result The pending query result.
|
1735
|
+
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
1562
1736
|
*/
|
1563
1737
|
DUCKDB_API duckdb_state duckdb_pending_prepared(duckdb_prepared_statement prepared_statement,
|
1564
1738
|
duckdb_pending_result *out_result);
|
1739
|
+
|
1565
1740
|
#ifndef DUCKDB_API_NO_DEPRECATED
|
1566
1741
|
/*!
|
1567
1742
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
@@ -1573,9 +1748,9 @@ The pending result represents an intermediate structure for a query that is not
|
|
1573
1748
|
Note that after calling `duckdb_pending_prepared_streaming`, the pending result should always be destroyed using
|
1574
1749
|
`duckdb_destroy_pending`, even if this function returns DuckDBError.
|
1575
1750
|
|
1576
|
-
* prepared_statement
|
1577
|
-
* out_result
|
1578
|
-
*
|
1751
|
+
* @param prepared_statement The prepared statement to execute.
|
1752
|
+
* @param out_result The pending query result.
|
1753
|
+
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
1579
1754
|
*/
|
1580
1755
|
DUCKDB_API duckdb_state duckdb_pending_prepared_streaming(duckdb_prepared_statement prepared_statement,
|
1581
1756
|
duckdb_pending_result *out_result);
|
@@ -1584,7 +1759,7 @@ DUCKDB_API duckdb_state duckdb_pending_prepared_streaming(duckdb_prepared_statem
|
|
1584
1759
|
/*!
|
1585
1760
|
Closes the pending result and de-allocates all memory allocated for the result.
|
1586
1761
|
|
1587
|
-
* pending_result
|
1762
|
+
* @param pending_result The pending result to destroy.
|
1588
1763
|
*/
|
1589
1764
|
DUCKDB_API void duckdb_destroy_pending(duckdb_pending_result *pending_result);
|
1590
1765
|
|
@@ -1593,8 +1768,8 @@ Returns the error message contained within the pending result.
|
|
1593
1768
|
|
1594
1769
|
The result of this function must not be freed. It will be cleaned up when `duckdb_destroy_pending` is called.
|
1595
1770
|
|
1596
|
-
*
|
1597
|
-
*
|
1771
|
+
* @param pending_result The pending result to fetch the error from.
|
1772
|
+
* @return The error of the pending result.
|
1598
1773
|
*/
|
1599
1774
|
DUCKDB_API const char *duckdb_pending_error(duckdb_pending_result pending_result);
|
1600
1775
|
|
@@ -1607,8 +1782,8 @@ If this returns DUCKDB_PENDING_ERROR, an error occurred during execution.
|
|
1607
1782
|
|
1608
1783
|
The error message can be obtained by calling duckdb_pending_error on the pending_result.
|
1609
1784
|
|
1610
|
-
* pending_result
|
1611
|
-
*
|
1785
|
+
* @param pending_result The pending result to execute a task within.
|
1786
|
+
* @return The state of the pending result after the execution.
|
1612
1787
|
*/
|
1613
1788
|
DUCKDB_API duckdb_pending_state duckdb_pending_execute_task(duckdb_pending_result pending_result);
|
1614
1789
|
|
@@ -1619,8 +1794,8 @@ If this returns DUCKDB_PENDING_ERROR, an error occurred during execution.
|
|
1619
1794
|
|
1620
1795
|
The error message can be obtained by calling duckdb_pending_error on the pending_result.
|
1621
1796
|
|
1622
|
-
* pending_result
|
1623
|
-
*
|
1797
|
+
* @param pending_result The pending result.
|
1798
|
+
* @return The state of the pending result.
|
1624
1799
|
*/
|
1625
1800
|
DUCKDB_API duckdb_pending_state duckdb_pending_execute_check_state(duckdb_pending_result pending_result);
|
1626
1801
|
|
@@ -1632,9 +1807,9 @@ Otherwise, all remaining tasks must be executed first.
|
|
1632
1807
|
|
1633
1808
|
Note that the result must be freed with `duckdb_destroy_result`.
|
1634
1809
|
|
1635
|
-
* pending_result
|
1636
|
-
* out_result
|
1637
|
-
*
|
1810
|
+
* @param pending_result The pending result to execute.
|
1811
|
+
* @param out_result The result object.
|
1812
|
+
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
1638
1813
|
*/
|
1639
1814
|
DUCKDB_API duckdb_state duckdb_execute_pending(duckdb_pending_result pending_result, duckdb_result *out_result);
|
1640
1815
|
|
@@ -1642,8 +1817,8 @@ DUCKDB_API duckdb_state duckdb_execute_pending(duckdb_pending_result pending_res
|
|
1642
1817
|
Returns whether a duckdb_pending_state is finished executing. For example if `pending_state` is
|
1643
1818
|
DUCKDB_PENDING_RESULT_READY, this function will return true.
|
1644
1819
|
|
1645
|
-
* pending_state
|
1646
|
-
*
|
1820
|
+
* @param pending_state The pending state on which to decide whether to finish execution.
|
1821
|
+
* @return Boolean indicating pending execution should be considered finished.
|
1647
1822
|
*/
|
1648
1823
|
DUCKDB_API bool duckdb_pending_execution_is_finished(duckdb_pending_state pending_state);
|
1649
1824
|
|
@@ -1654,447 +1829,794 @@ DUCKDB_API bool duckdb_pending_execution_is_finished(duckdb_pending_state pendin
|
|
1654
1829
|
/*!
|
1655
1830
|
Destroys the value and de-allocates all memory allocated for that type.
|
1656
1831
|
|
1657
|
-
* value
|
1832
|
+
* @param value The value to destroy.
|
1658
1833
|
*/
|
1659
1834
|
DUCKDB_API void duckdb_destroy_value(duckdb_value *value);
|
1660
1835
|
|
1661
1836
|
/*!
|
1662
1837
|
Creates a value from a null-terminated string
|
1663
1838
|
|
1664
|
-
*
|
1665
|
-
*
|
1839
|
+
* @param text The null-terminated string
|
1840
|
+
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
1666
1841
|
*/
|
1667
1842
|
DUCKDB_API duckdb_value duckdb_create_varchar(const char *text);
|
1668
1843
|
|
1669
1844
|
/*!
|
1670
1845
|
Creates a value from a string
|
1671
1846
|
|
1672
|
-
*
|
1673
|
-
* length
|
1674
|
-
*
|
1847
|
+
* @param text The text
|
1848
|
+
* @param length The length of the text
|
1849
|
+
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
1675
1850
|
*/
|
1676
1851
|
DUCKDB_API duckdb_value duckdb_create_varchar_length(const char *text, idx_t length);
|
1677
1852
|
|
1678
1853
|
/*!
|
1679
|
-
Creates a value from
|
1854
|
+
Creates a value from a boolean
|
1680
1855
|
|
1681
|
-
*
|
1682
|
-
*
|
1856
|
+
* @param input The boolean value
|
1857
|
+
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
1683
1858
|
*/
|
1684
|
-
DUCKDB_API duckdb_value
|
1859
|
+
DUCKDB_API duckdb_value duckdb_create_bool(bool input);
|
1685
1860
|
|
1686
1861
|
/*!
|
1687
|
-
Creates a
|
1862
|
+
Creates a value from a int8_t (a tinyint)
|
1688
1863
|
|
1689
|
-
*
|
1690
|
-
*
|
1691
|
-
* returns: The value. This must be destroyed with `duckdb_destroy_value`.
|
1864
|
+
* @param input The tinyint value
|
1865
|
+
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
1692
1866
|
*/
|
1693
|
-
DUCKDB_API duckdb_value
|
1867
|
+
DUCKDB_API duckdb_value duckdb_create_int8(int8_t input);
|
1694
1868
|
|
1695
1869
|
/*!
|
1696
|
-
Creates a
|
1870
|
+
Creates a value from a uint8_t (a utinyint)
|
1697
1871
|
|
1698
|
-
*
|
1699
|
-
*
|
1700
|
-
* value_count: The number of values in the list
|
1701
|
-
* returns: The value. This must be destroyed with `duckdb_destroy_value`.
|
1872
|
+
* @param input The utinyint value
|
1873
|
+
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
1702
1874
|
*/
|
1703
|
-
DUCKDB_API duckdb_value
|
1875
|
+
DUCKDB_API duckdb_value duckdb_create_uint8(uint8_t input);
|
1704
1876
|
|
1705
1877
|
/*!
|
1706
|
-
Creates a
|
1878
|
+
Creates a value from a int16_t (a smallint)
|
1707
1879
|
|
1708
|
-
*
|
1709
|
-
*
|
1710
|
-
* value_count: The number of values in the array
|
1711
|
-
* returns: The value. This must be destroyed with `duckdb_destroy_value`.
|
1880
|
+
* @param input The smallint value
|
1881
|
+
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
1712
1882
|
*/
|
1713
|
-
DUCKDB_API duckdb_value
|
1883
|
+
DUCKDB_API duckdb_value duckdb_create_int16(int16_t input);
|
1714
1884
|
|
1715
1885
|
/*!
|
1716
|
-
|
1717
|
-
The result must be destroyed with `duckdb_free`.
|
1886
|
+
Creates a value from a uint16_t (a usmallint)
|
1718
1887
|
|
1719
|
-
*
|
1720
|
-
*
|
1888
|
+
* @param input The usmallint value
|
1889
|
+
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
1721
1890
|
*/
|
1722
|
-
DUCKDB_API
|
1891
|
+
DUCKDB_API duckdb_value duckdb_create_uint16(uint16_t input);
|
1723
1892
|
|
1724
1893
|
/*!
|
1725
|
-
|
1894
|
+
Creates a value from a int32_t (an integer)
|
1726
1895
|
|
1727
|
-
*
|
1728
|
-
*
|
1896
|
+
* @param input The integer value
|
1897
|
+
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
1729
1898
|
*/
|
1730
|
-
DUCKDB_API
|
1731
|
-
|
1732
|
-
//===--------------------------------------------------------------------===//
|
1733
|
-
// Logical Type Interface
|
1734
|
-
//===--------------------------------------------------------------------===//
|
1899
|
+
DUCKDB_API duckdb_value duckdb_create_int32(int32_t input);
|
1735
1900
|
|
1736
1901
|
/*!
|
1737
|
-
Creates a
|
1738
|
-
The resulting type should be destroyed with `duckdb_destroy_logical_type`.
|
1902
|
+
Creates a value from a uint32_t (a uinteger)
|
1739
1903
|
|
1740
|
-
|
1741
|
-
|
1742
|
-
* type: The primitive type to create.
|
1743
|
-
* returns: The logical type.
|
1904
|
+
* @param input The uinteger value
|
1905
|
+
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
1744
1906
|
*/
|
1745
|
-
DUCKDB_API
|
1907
|
+
DUCKDB_API duckdb_value duckdb_create_uint32(uint32_t input);
|
1746
1908
|
|
1747
1909
|
/*!
|
1748
|
-
|
1749
|
-
The result must be destroyed with `duckdb_free`.
|
1910
|
+
Creates a value from a uint64_t (a ubigint)
|
1750
1911
|
|
1751
|
-
*
|
1752
|
-
*
|
1753
|
-
|
1754
|
-
DUCKDB_API
|
1912
|
+
* @param input The ubigint value
|
1913
|
+
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
1914
|
+
*/
|
1915
|
+
DUCKDB_API duckdb_value duckdb_create_uint64(uint64_t input);
|
1755
1916
|
|
1756
1917
|
/*!
|
1757
|
-
Creates a
|
1758
|
-
The resulting type should be destroyed with `duckdb_destroy_logical_type`.
|
1918
|
+
Creates a value from an int64
|
1759
1919
|
|
1760
|
-
*
|
1761
|
-
* returns: The logical type.
|
1920
|
+
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
1762
1921
|
*/
|
1763
|
-
DUCKDB_API
|
1922
|
+
DUCKDB_API duckdb_value duckdb_create_int64(int64_t val);
|
1764
1923
|
|
1765
1924
|
/*!
|
1766
|
-
Creates a
|
1767
|
-
The resulting type should be destroyed with `duckdb_destroy_logical_type`.
|
1925
|
+
Creates a value from a hugeint
|
1768
1926
|
|
1769
|
-
*
|
1770
|
-
*
|
1771
|
-
* returns: The logical type.
|
1927
|
+
* @param input The hugeint value
|
1928
|
+
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
1772
1929
|
*/
|
1773
|
-
DUCKDB_API
|
1930
|
+
DUCKDB_API duckdb_value duckdb_create_hugeint(duckdb_hugeint input);
|
1774
1931
|
|
1775
1932
|
/*!
|
1776
|
-
Creates a
|
1777
|
-
The resulting type should be destroyed with `duckdb_destroy_logical_type`.
|
1933
|
+
Creates a value from a uhugeint
|
1778
1934
|
|
1779
|
-
*
|
1780
|
-
*
|
1935
|
+
* @param input The uhugeint value
|
1936
|
+
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
1781
1937
|
*/
|
1782
|
-
DUCKDB_API
|
1938
|
+
DUCKDB_API duckdb_value duckdb_create_uhugeint(duckdb_uhugeint input);
|
1783
1939
|
|
1784
1940
|
/*!
|
1785
|
-
Creates a
|
1786
|
-
The resulting type should be destroyed with `duckdb_destroy_logical_type`.
|
1941
|
+
Creates a value from a float
|
1787
1942
|
|
1788
|
-
*
|
1789
|
-
*
|
1790
|
-
* returns: The logical type.
|
1943
|
+
* @param input The float value
|
1944
|
+
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
1791
1945
|
*/
|
1792
|
-
DUCKDB_API
|
1793
|
-
idx_t member_count);
|
1946
|
+
DUCKDB_API duckdb_value duckdb_create_float(float input);
|
1794
1947
|
|
1795
1948
|
/*!
|
1796
|
-
Creates a
|
1797
|
-
The resulting type should be destroyed with `duckdb_destroy_logical_type`.
|
1949
|
+
Creates a value from a double
|
1798
1950
|
|
1799
|
-
*
|
1800
|
-
*
|
1801
|
-
* member_count: The number of members that were specified for both arrays.
|
1802
|
-
* returns: The logical type.
|
1951
|
+
* @param input The double value
|
1952
|
+
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
1803
1953
|
*/
|
1804
|
-
DUCKDB_API
|
1805
|
-
idx_t member_count);
|
1954
|
+
DUCKDB_API duckdb_value duckdb_create_double(double input);
|
1806
1955
|
|
1807
1956
|
/*!
|
1808
|
-
Creates
|
1809
|
-
The resulting type should be destroyed with `duckdb_destroy_logical_type`.
|
1957
|
+
Creates a value from a date
|
1810
1958
|
|
1811
|
-
*
|
1812
|
-
*
|
1813
|
-
* member_count: The number of elements that were specified in the array.
|
1814
|
-
* returns: The logical type.
|
1959
|
+
* @param input The date value
|
1960
|
+
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
1815
1961
|
*/
|
1816
|
-
DUCKDB_API
|
1962
|
+
DUCKDB_API duckdb_value duckdb_create_date(duckdb_date input);
|
1817
1963
|
|
1818
1964
|
/*!
|
1819
|
-
Creates a
|
1820
|
-
The resulting type should be destroyed with `duckdb_destroy_logical_type`.
|
1965
|
+
Creates a value from a time
|
1821
1966
|
|
1822
|
-
*
|
1823
|
-
*
|
1824
|
-
* returns: The logical type.
|
1967
|
+
* @param input The time value
|
1968
|
+
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
1825
1969
|
*/
|
1826
|
-
DUCKDB_API
|
1970
|
+
DUCKDB_API duckdb_value duckdb_create_time(duckdb_time input);
|
1827
1971
|
|
1828
1972
|
/*!
|
1829
|
-
|
1973
|
+
Creates a value from a time_tz.
|
1974
|
+
Not to be confused with `duckdb_create_time_tz`, which creates a duckdb_time_tz_t.
|
1830
1975
|
|
1831
|
-
*
|
1832
|
-
*
|
1976
|
+
* @param value The time_tz value
|
1977
|
+
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
1833
1978
|
*/
|
1834
|
-
DUCKDB_API
|
1979
|
+
DUCKDB_API duckdb_value duckdb_create_time_tz_value(duckdb_time_tz value);
|
1835
1980
|
|
1836
1981
|
/*!
|
1837
|
-
|
1982
|
+
Creates a value from a timestamp
|
1838
1983
|
|
1839
|
-
*
|
1840
|
-
*
|
1984
|
+
* @param input The timestamp value
|
1985
|
+
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
1841
1986
|
*/
|
1842
|
-
DUCKDB_API
|
1987
|
+
DUCKDB_API duckdb_value duckdb_create_timestamp(duckdb_timestamp input);
|
1843
1988
|
|
1844
1989
|
/*!
|
1845
|
-
|
1990
|
+
Creates a value from an interval
|
1846
1991
|
|
1847
|
-
*
|
1848
|
-
*
|
1992
|
+
* @param input The interval value
|
1993
|
+
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
1849
1994
|
*/
|
1850
|
-
DUCKDB_API
|
1995
|
+
DUCKDB_API duckdb_value duckdb_create_interval(duckdb_interval input);
|
1851
1996
|
|
1852
1997
|
/*!
|
1853
|
-
|
1998
|
+
Creates a value from a blob
|
1854
1999
|
|
1855
|
-
*
|
1856
|
-
*
|
2000
|
+
* @param data The blob data
|
2001
|
+
* @param length The length of the blob data
|
2002
|
+
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
1857
2003
|
*/
|
1858
|
-
DUCKDB_API
|
2004
|
+
DUCKDB_API duckdb_value duckdb_create_blob(const uint8_t *data, idx_t length);
|
1859
2005
|
|
1860
2006
|
/*!
|
1861
|
-
|
2007
|
+
Returns the boolean value of the given value.
|
1862
2008
|
|
1863
|
-
*
|
1864
|
-
*
|
2009
|
+
* @param val A duckdb_value containing a boolean
|
2010
|
+
* @return A boolean, or false if the value cannot be converted
|
1865
2011
|
*/
|
1866
|
-
DUCKDB_API
|
2012
|
+
DUCKDB_API bool duckdb_get_bool(duckdb_value val);
|
1867
2013
|
|
1868
2014
|
/*!
|
1869
|
-
|
2015
|
+
Returns the int8_t value of the given value.
|
1870
2016
|
|
1871
|
-
*
|
1872
|
-
*
|
2017
|
+
* @param val A duckdb_value containing a tinyint
|
2018
|
+
* @return A int8_t, or MinValue<int8> if the value cannot be converted
|
1873
2019
|
*/
|
1874
|
-
DUCKDB_API
|
2020
|
+
DUCKDB_API int8_t duckdb_get_int8(duckdb_value val);
|
1875
2021
|
|
1876
2022
|
/*!
|
1877
|
-
|
2023
|
+
Returns the uint8_t value of the given value.
|
1878
2024
|
|
1879
|
-
|
1880
|
-
|
1881
|
-
* type: The logical type object
|
1882
|
-
* index: The index in the dictionary
|
1883
|
-
* returns: The string value of the enum type. Must be freed with `duckdb_free`.
|
2025
|
+
* @param val A duckdb_value containing a utinyint
|
2026
|
+
* @return A uint8_t, or MinValue<uint8> if the value cannot be converted
|
1884
2027
|
*/
|
1885
|
-
DUCKDB_API
|
2028
|
+
DUCKDB_API uint8_t duckdb_get_uint8(duckdb_value val);
|
1886
2029
|
|
1887
2030
|
/*!
|
1888
|
-
|
1889
|
-
|
1890
|
-
The result must be freed with `duckdb_destroy_logical_type`.
|
2031
|
+
Returns the int16_t value of the given value.
|
1891
2032
|
|
1892
|
-
*
|
1893
|
-
*
|
2033
|
+
* @param val A duckdb_value containing a smallint
|
2034
|
+
* @return A int16_t, or MinValue<int16> if the value cannot be converted
|
1894
2035
|
*/
|
1895
|
-
DUCKDB_API
|
2036
|
+
DUCKDB_API int16_t duckdb_get_int16(duckdb_value val);
|
1896
2037
|
|
1897
2038
|
/*!
|
1898
|
-
|
1899
|
-
|
1900
|
-
The result must be freed with `duckdb_destroy_logical_type`.
|
2039
|
+
Returns the uint16_t value of the given value.
|
1901
2040
|
|
1902
|
-
*
|
1903
|
-
*
|
2041
|
+
* @param val A duckdb_value containing a usmallint
|
2042
|
+
* @return A uint16_t, or MinValue<uint16> if the value cannot be converted
|
1904
2043
|
*/
|
1905
|
-
DUCKDB_API
|
2044
|
+
DUCKDB_API uint16_t duckdb_get_uint16(duckdb_value val);
|
1906
2045
|
|
1907
2046
|
/*!
|
1908
|
-
|
2047
|
+
Returns the int32_t value of the given value.
|
1909
2048
|
|
1910
|
-
*
|
1911
|
-
*
|
2049
|
+
* @param val A duckdb_value containing a integer
|
2050
|
+
* @return A int32_t, or MinValue<int32> if the value cannot be converted
|
1912
2051
|
*/
|
1913
|
-
DUCKDB_API
|
2052
|
+
DUCKDB_API int32_t duckdb_get_int32(duckdb_value val);
|
1914
2053
|
|
1915
2054
|
/*!
|
1916
|
-
|
2055
|
+
Returns the uint32_t value of the given value.
|
1917
2056
|
|
1918
|
-
|
1919
|
-
|
1920
|
-
* type: The logical type object
|
1921
|
-
* returns: The key type of the map type. Must be destroyed with `duckdb_destroy_logical_type`.
|
2057
|
+
* @param val A duckdb_value containing a uinteger
|
2058
|
+
* @return A uint32_t, or MinValue<uint32> if the value cannot be converted
|
1922
2059
|
*/
|
1923
|
-
DUCKDB_API
|
2060
|
+
DUCKDB_API uint32_t duckdb_get_uint32(duckdb_value val);
|
1924
2061
|
|
1925
2062
|
/*!
|
1926
|
-
|
2063
|
+
Returns the int64_t value of the given value.
|
1927
2064
|
|
1928
|
-
|
1929
|
-
|
1930
|
-
* type: The logical type object
|
1931
|
-
* returns: The value type of the map type. Must be destroyed with `duckdb_destroy_logical_type`.
|
2065
|
+
* @param val A duckdb_value containing a bigint
|
2066
|
+
* @return A int64_t, or MinValue<int64> if the value cannot be converted
|
1932
2067
|
*/
|
1933
|
-
DUCKDB_API
|
2068
|
+
DUCKDB_API int64_t duckdb_get_int64(duckdb_value val);
|
1934
2069
|
|
1935
2070
|
/*!
|
1936
|
-
Returns the
|
2071
|
+
Returns the uint64_t value of the given value.
|
1937
2072
|
|
1938
|
-
*
|
1939
|
-
*
|
2073
|
+
* @param val A duckdb_value containing a ubigint
|
2074
|
+
* @return A uint64_t, or MinValue<uint64> if the value cannot be converted
|
1940
2075
|
*/
|
1941
|
-
DUCKDB_API
|
2076
|
+
DUCKDB_API uint64_t duckdb_get_uint64(duckdb_value val);
|
1942
2077
|
|
1943
2078
|
/*!
|
1944
|
-
|
1945
|
-
|
1946
|
-
The result must be freed with `duckdb_free`.
|
2079
|
+
Returns the hugeint value of the given value.
|
1947
2080
|
|
1948
|
-
*
|
1949
|
-
*
|
1950
|
-
* returns: The name of the struct type. Must be freed with `duckdb_free`.
|
2081
|
+
* @param val A duckdb_value containing a hugeint
|
2082
|
+
* @return A duckdb_hugeint, or MinValue<hugeint> if the value cannot be converted
|
1951
2083
|
*/
|
1952
|
-
DUCKDB_API
|
2084
|
+
DUCKDB_API duckdb_hugeint duckdb_get_hugeint(duckdb_value val);
|
1953
2085
|
|
1954
2086
|
/*!
|
1955
|
-
|
1956
|
-
|
1957
|
-
The result must be freed with `duckdb_destroy_logical_type`.
|
2087
|
+
Returns the uhugeint value of the given value.
|
1958
2088
|
|
1959
|
-
*
|
1960
|
-
*
|
1961
|
-
* returns: The child type of the struct type. Must be destroyed with `duckdb_destroy_logical_type`.
|
2089
|
+
* @param val A duckdb_value containing a uhugeint
|
2090
|
+
* @return A duckdb_uhugeint, or MinValue<uhugeint> if the value cannot be converted
|
1962
2091
|
*/
|
1963
|
-
DUCKDB_API
|
2092
|
+
DUCKDB_API duckdb_uhugeint duckdb_get_uhugeint(duckdb_value val);
|
1964
2093
|
|
1965
2094
|
/*!
|
1966
|
-
Returns the
|
2095
|
+
Returns the float value of the given value.
|
1967
2096
|
|
1968
|
-
*
|
1969
|
-
*
|
2097
|
+
* @param val A duckdb_value containing a float
|
2098
|
+
* @return A float, or NAN if the value cannot be converted
|
1970
2099
|
*/
|
1971
|
-
DUCKDB_API
|
2100
|
+
DUCKDB_API float duckdb_get_float(duckdb_value val);
|
1972
2101
|
|
1973
2102
|
/*!
|
1974
|
-
|
2103
|
+
Returns the double value of the given value.
|
1975
2104
|
|
1976
|
-
|
2105
|
+
* @param val A duckdb_value containing a double
|
2106
|
+
* @return A double, or NAN if the value cannot be converted
|
2107
|
+
*/
|
2108
|
+
DUCKDB_API double duckdb_get_double(duckdb_value val);
|
2109
|
+
|
2110
|
+
/*!
|
2111
|
+
Returns the date value of the given value.
|
1977
2112
|
|
1978
|
-
*
|
1979
|
-
*
|
1980
|
-
* returns: The name of the union member. Must be freed with `duckdb_free`.
|
2113
|
+
* @param val A duckdb_value containing a date
|
2114
|
+
* @return A duckdb_date, or MinValue<date> if the value cannot be converted
|
1981
2115
|
*/
|
1982
|
-
DUCKDB_API
|
2116
|
+
DUCKDB_API duckdb_date duckdb_get_date(duckdb_value val);
|
1983
2117
|
|
1984
2118
|
/*!
|
1985
|
-
|
2119
|
+
Returns the time value of the given value.
|
1986
2120
|
|
1987
|
-
|
2121
|
+
* @param val A duckdb_value containing a time
|
2122
|
+
* @return A duckdb_time, or MinValue<time> if the value cannot be converted
|
2123
|
+
*/
|
2124
|
+
DUCKDB_API duckdb_time duckdb_get_time(duckdb_value val);
|
1988
2125
|
|
1989
|
-
|
1990
|
-
|
1991
|
-
|
2126
|
+
/*!
|
2127
|
+
Returns the time_tz value of the given value.
|
2128
|
+
|
2129
|
+
* @param val A duckdb_value containing a time_tz
|
2130
|
+
* @return A duckdb_time_tz, or MinValue<time_tz> if the value cannot be converted
|
1992
2131
|
*/
|
1993
|
-
DUCKDB_API
|
2132
|
+
DUCKDB_API duckdb_time_tz duckdb_get_time_tz(duckdb_value val);
|
1994
2133
|
|
1995
2134
|
/*!
|
1996
|
-
|
2135
|
+
Returns the timestamp value of the given value.
|
1997
2136
|
|
1998
|
-
*
|
2137
|
+
* @param val A duckdb_value containing a timestamp
|
2138
|
+
* @return A duckdb_timestamp, or MinValue<timestamp> if the value cannot be converted
|
1999
2139
|
*/
|
2000
|
-
DUCKDB_API
|
2140
|
+
DUCKDB_API duckdb_timestamp duckdb_get_timestamp(duckdb_value val);
|
2001
2141
|
|
2002
|
-
|
2003
|
-
|
2004
|
-
|
2142
|
+
/*!
|
2143
|
+
Returns the interval value of the given value.
|
2144
|
+
|
2145
|
+
* @param val A duckdb_value containing a interval
|
2146
|
+
* @return A duckdb_interval, or MinValue<interval> if the value cannot be converted
|
2147
|
+
*/
|
2148
|
+
DUCKDB_API duckdb_interval duckdb_get_interval(duckdb_value val);
|
2005
2149
|
|
2006
2150
|
/*!
|
2007
|
-
|
2151
|
+
Returns the type of the given value. The type is valid as long as the value is not destroyed.
|
2152
|
+
The type itself must not be destroyed.
|
2153
|
+
|
2154
|
+
* @param val A duckdb_value
|
2155
|
+
* @return A duckdb_logical_type.
|
2156
|
+
*/
|
2157
|
+
DUCKDB_API duckdb_logical_type duckdb_get_value_type(duckdb_value val);
|
2008
2158
|
|
2009
|
-
|
2159
|
+
/*!
|
2160
|
+
Returns the blob value of the given value.
|
2010
2161
|
|
2011
|
-
*
|
2012
|
-
*
|
2013
|
-
* returns: The data chunk.
|
2162
|
+
* @param val A duckdb_value containing a blob
|
2163
|
+
* @return A duckdb_blob
|
2014
2164
|
*/
|
2015
|
-
DUCKDB_API
|
2165
|
+
DUCKDB_API duckdb_blob duckdb_get_blob(duckdb_value val);
|
2016
2166
|
|
2017
2167
|
/*!
|
2018
|
-
|
2168
|
+
Obtains a string representation of the given value.
|
2169
|
+
The result must be destroyed with `duckdb_free`.
|
2019
2170
|
|
2020
|
-
*
|
2171
|
+
* @param value The value
|
2172
|
+
* @return The string value. This must be destroyed with `duckdb_free`.
|
2021
2173
|
*/
|
2022
|
-
DUCKDB_API
|
2174
|
+
DUCKDB_API char *duckdb_get_varchar(duckdb_value value);
|
2023
2175
|
|
2024
2176
|
/*!
|
2025
|
-
|
2177
|
+
Creates a struct value from a type and an array of values. Must be destroyed with `duckdb_destroy_value`.
|
2026
2178
|
|
2027
|
-
*
|
2179
|
+
* @param type The type of the struct
|
2180
|
+
* @param values The values for the struct fields
|
2181
|
+
* @return The struct value, or nullptr, if any child type is `DUCKDB_TYPE_ANY` or `DUCKDB_TYPE_INVALID`.
|
2028
2182
|
*/
|
2029
|
-
DUCKDB_API
|
2183
|
+
DUCKDB_API duckdb_value duckdb_create_struct_value(duckdb_logical_type type, duckdb_value *values);
|
2030
2184
|
|
2031
2185
|
/*!
|
2032
|
-
|
2186
|
+
Creates a list value from a child (element) type and an array of values of length `value_count`.
|
2187
|
+
Must be destroyed with `duckdb_destroy_value`.
|
2033
2188
|
|
2034
|
-
*
|
2035
|
-
*
|
2189
|
+
* @param type The type of the list
|
2190
|
+
* @param values The values for the list
|
2191
|
+
* @param value_count The number of values in the list
|
2192
|
+
* @return The list value, or nullptr, if the child type is `DUCKDB_TYPE_ANY` or `DUCKDB_TYPE_INVALID`.
|
2036
2193
|
*/
|
2037
|
-
DUCKDB_API
|
2194
|
+
DUCKDB_API duckdb_value duckdb_create_list_value(duckdb_logical_type type, duckdb_value *values, idx_t value_count);
|
2038
2195
|
|
2039
2196
|
/*!
|
2040
|
-
|
2197
|
+
Creates an array value from a child (element) type and an array of values of length `value_count`.
|
2198
|
+
Must be destroyed with `duckdb_destroy_value`.
|
2041
2199
|
|
2042
|
-
|
2043
|
-
|
2200
|
+
* @param type The type of the array
|
2201
|
+
* @param values The values for the array
|
2202
|
+
* @param value_count The number of values in the array
|
2203
|
+
* @return The array value, or nullptr, if the child type is `DUCKDB_TYPE_ANY` or `DUCKDB_TYPE_INVALID`.
|
2204
|
+
*/
|
2205
|
+
DUCKDB_API duckdb_value duckdb_create_array_value(duckdb_logical_type type, duckdb_value *values, idx_t value_count);
|
2206
|
+
|
2207
|
+
/*!
|
2208
|
+
Returns the number of elements in a MAP value.
|
2044
2209
|
|
2045
|
-
*
|
2046
|
-
*
|
2210
|
+
* @param value The MAP value.
|
2211
|
+
* @return The number of elements in the map.
|
2047
2212
|
*/
|
2048
|
-
DUCKDB_API
|
2213
|
+
DUCKDB_API idx_t duckdb_get_map_size(duckdb_value value);
|
2049
2214
|
|
2050
2215
|
/*!
|
2051
|
-
|
2216
|
+
Returns the MAP key at index as a duckdb_value.
|
2052
2217
|
|
2053
|
-
*
|
2054
|
-
*
|
2218
|
+
* @param value The MAP value.
|
2219
|
+
* @param index The index of the key.
|
2220
|
+
* @return The key as a duckdb_value.
|
2055
2221
|
*/
|
2056
|
-
DUCKDB_API
|
2222
|
+
DUCKDB_API duckdb_value duckdb_get_map_key(duckdb_value value, idx_t index);
|
2057
2223
|
|
2058
2224
|
/*!
|
2059
|
-
|
2225
|
+
Returns the MAP value at index as a duckdb_value.
|
2060
2226
|
|
2061
|
-
*
|
2062
|
-
*
|
2227
|
+
* @param value The MAP value.
|
2228
|
+
* @param index The index of the value.
|
2229
|
+
* @return The value as a duckdb_value.
|
2063
2230
|
*/
|
2064
|
-
DUCKDB_API
|
2231
|
+
DUCKDB_API duckdb_value duckdb_get_map_value(duckdb_value value, idx_t index);
|
2065
2232
|
|
2066
2233
|
//===--------------------------------------------------------------------===//
|
2067
|
-
//
|
2234
|
+
// Logical Type Interface
|
2068
2235
|
//===--------------------------------------------------------------------===//
|
2069
2236
|
|
2070
2237
|
/*!
|
2071
|
-
|
2238
|
+
Creates a `duckdb_logical_type` from a primitive type.
|
2239
|
+
The resulting logical type must be destroyed with `duckdb_destroy_logical_type`.
|
2072
2240
|
|
2073
|
-
|
2241
|
+
Returns an invalid logical type, if type is: `DUCKDB_TYPE_INVALID`, `DUCKDB_TYPE_DECIMAL`, `DUCKDB_TYPE_ENUM`,
|
2242
|
+
`DUCKDB_TYPE_LIST`, `DUCKDB_TYPE_STRUCT`, `DUCKDB_TYPE_MAP`, `DUCKDB_TYPE_ARRAY`, or `DUCKDB_TYPE_UNION`.
|
2074
2243
|
|
2075
|
-
*
|
2076
|
-
*
|
2244
|
+
* @param type The primitive type to create.
|
2245
|
+
* @return The logical type.
|
2077
2246
|
*/
|
2078
|
-
DUCKDB_API duckdb_logical_type
|
2247
|
+
DUCKDB_API duckdb_logical_type duckdb_create_logical_type(duckdb_type type);
|
2079
2248
|
|
2080
2249
|
/*!
|
2081
|
-
|
2082
|
-
|
2083
|
-
The data pointer can be used to read or write values from the vector.
|
2084
|
-
How to read or write values depends on the type of the vector.
|
2250
|
+
Returns the alias of a duckdb_logical_type, if set, else `nullptr`.
|
2251
|
+
The result must be destroyed with `duckdb_free`.
|
2085
2252
|
|
2086
|
-
*
|
2087
|
-
*
|
2253
|
+
* @param type The logical type
|
2254
|
+
* @return The alias or `nullptr`
|
2088
2255
|
*/
|
2089
|
-
DUCKDB_API
|
2256
|
+
DUCKDB_API char *duckdb_logical_type_get_alias(duckdb_logical_type type);
|
2090
2257
|
|
2091
2258
|
/*!
|
2092
|
-
|
2259
|
+
Sets the alias of a duckdb_logical_type.
|
2093
2260
|
|
2094
|
-
|
2261
|
+
* @param type The logical type
|
2262
|
+
* @param alias The alias to set
|
2263
|
+
*/
|
2264
|
+
DUCKDB_API void duckdb_logical_type_set_alias(duckdb_logical_type type, const char *alias);
|
2095
2265
|
|
2096
|
-
|
2097
|
-
|
2266
|
+
/*!
|
2267
|
+
Creates a LIST type from its child type.
|
2268
|
+
The return type must be destroyed with `duckdb_destroy_logical_type`.
|
2269
|
+
|
2270
|
+
* @param type The child type of the list
|
2271
|
+
* @return The logical type.
|
2272
|
+
*/
|
2273
|
+
DUCKDB_API duckdb_logical_type duckdb_create_list_type(duckdb_logical_type type);
|
2274
|
+
|
2275
|
+
/*!
|
2276
|
+
Creates an ARRAY type from its child type.
|
2277
|
+
The return type must be destroyed with `duckdb_destroy_logical_type`.
|
2278
|
+
|
2279
|
+
* @param type The child type of the array.
|
2280
|
+
* @param array_size The number of elements in the array.
|
2281
|
+
* @return The logical type.
|
2282
|
+
*/
|
2283
|
+
DUCKDB_API duckdb_logical_type duckdb_create_array_type(duckdb_logical_type type, idx_t array_size);
|
2284
|
+
|
2285
|
+
/*!
|
2286
|
+
Creates a MAP type from its key type and value type.
|
2287
|
+
The return type must be destroyed with `duckdb_destroy_logical_type`.
|
2288
|
+
|
2289
|
+
* @param key_type The map's key type.
|
2290
|
+
* @param value_type The map's value type.
|
2291
|
+
* @return The logical type.
|
2292
|
+
*/
|
2293
|
+
DUCKDB_API duckdb_logical_type duckdb_create_map_type(duckdb_logical_type key_type, duckdb_logical_type value_type);
|
2294
|
+
|
2295
|
+
/*!
|
2296
|
+
Creates a UNION type from the passed arrays.
|
2297
|
+
The return type must be destroyed with `duckdb_destroy_logical_type`.
|
2298
|
+
|
2299
|
+
* @param member_types The array of union member types.
|
2300
|
+
* @param member_names The union member names.
|
2301
|
+
* @param member_count The number of union members.
|
2302
|
+
* @return The logical type.
|
2303
|
+
*/
|
2304
|
+
DUCKDB_API duckdb_logical_type duckdb_create_union_type(duckdb_logical_type *member_types, const char **member_names,
|
2305
|
+
idx_t member_count);
|
2306
|
+
|
2307
|
+
/*!
|
2308
|
+
Creates a STRUCT type based on the member types and names.
|
2309
|
+
The resulting type must be destroyed with `duckdb_destroy_logical_type`.
|
2310
|
+
|
2311
|
+
* @param member_types The array of types of the struct members.
|
2312
|
+
* @param member_names The array of names of the struct members.
|
2313
|
+
* @param member_count The number of members of the struct.
|
2314
|
+
* @return The logical type.
|
2315
|
+
*/
|
2316
|
+
DUCKDB_API duckdb_logical_type duckdb_create_struct_type(duckdb_logical_type *member_types, const char **member_names,
|
2317
|
+
idx_t member_count);
|
2318
|
+
|
2319
|
+
/*!
|
2320
|
+
Creates an ENUM type from the passed member name array.
|
2321
|
+
The resulting type should be destroyed with `duckdb_destroy_logical_type`.
|
2322
|
+
|
2323
|
+
* @param member_names The array of names that the enum should consist of.
|
2324
|
+
* @param member_count The number of elements that were specified in the array.
|
2325
|
+
* @return The logical type.
|
2326
|
+
*/
|
2327
|
+
DUCKDB_API duckdb_logical_type duckdb_create_enum_type(const char **member_names, idx_t member_count);
|
2328
|
+
|
2329
|
+
/*!
|
2330
|
+
Creates a DECIMAL type with the specified width and scale.
|
2331
|
+
The resulting type should be destroyed with `duckdb_destroy_logical_type`.
|
2332
|
+
|
2333
|
+
* @param width The width of the decimal type
|
2334
|
+
* @param scale The scale of the decimal type
|
2335
|
+
* @return The logical type.
|
2336
|
+
*/
|
2337
|
+
DUCKDB_API duckdb_logical_type duckdb_create_decimal_type(uint8_t width, uint8_t scale);
|
2338
|
+
|
2339
|
+
/*!
|
2340
|
+
Retrieves the enum `duckdb_type` of a `duckdb_logical_type`.
|
2341
|
+
|
2342
|
+
* @param type The logical type.
|
2343
|
+
* @return The `duckdb_type` id.
|
2344
|
+
*/
|
2345
|
+
DUCKDB_API duckdb_type duckdb_get_type_id(duckdb_logical_type type);
|
2346
|
+
|
2347
|
+
/*!
|
2348
|
+
Retrieves the width of a decimal type.
|
2349
|
+
|
2350
|
+
* @param type The logical type object
|
2351
|
+
* @return The width of the decimal type
|
2352
|
+
*/
|
2353
|
+
DUCKDB_API uint8_t duckdb_decimal_width(duckdb_logical_type type);
|
2354
|
+
|
2355
|
+
/*!
|
2356
|
+
Retrieves the scale of a decimal type.
|
2357
|
+
|
2358
|
+
* @param type The logical type object
|
2359
|
+
* @return The scale of the decimal type
|
2360
|
+
*/
|
2361
|
+
DUCKDB_API uint8_t duckdb_decimal_scale(duckdb_logical_type type);
|
2362
|
+
|
2363
|
+
/*!
|
2364
|
+
Retrieves the internal storage type of a decimal type.
|
2365
|
+
|
2366
|
+
* @param type The logical type object
|
2367
|
+
* @return The internal type of the decimal type
|
2368
|
+
*/
|
2369
|
+
DUCKDB_API duckdb_type duckdb_decimal_internal_type(duckdb_logical_type type);
|
2370
|
+
|
2371
|
+
/*!
|
2372
|
+
Retrieves the internal storage type of an enum type.
|
2373
|
+
|
2374
|
+
* @param type The logical type object
|
2375
|
+
* @return The internal type of the enum type
|
2376
|
+
*/
|
2377
|
+
DUCKDB_API duckdb_type duckdb_enum_internal_type(duckdb_logical_type type);
|
2378
|
+
|
2379
|
+
/*!
|
2380
|
+
Retrieves the dictionary size of the enum type.
|
2381
|
+
|
2382
|
+
* @param type The logical type object
|
2383
|
+
* @return The dictionary size of the enum type
|
2384
|
+
*/
|
2385
|
+
DUCKDB_API uint32_t duckdb_enum_dictionary_size(duckdb_logical_type type);
|
2386
|
+
|
2387
|
+
/*!
|
2388
|
+
Retrieves the dictionary value at the specified position from the enum.
|
2389
|
+
|
2390
|
+
The result must be freed with `duckdb_free`.
|
2391
|
+
|
2392
|
+
* @param type The logical type object
|
2393
|
+
* @param index The index in the dictionary
|
2394
|
+
* @return The string value of the enum type. Must be freed with `duckdb_free`.
|
2395
|
+
*/
|
2396
|
+
DUCKDB_API char *duckdb_enum_dictionary_value(duckdb_logical_type type, idx_t index);
|
2397
|
+
|
2398
|
+
/*!
|
2399
|
+
Retrieves the child type of the given LIST type. Also accepts MAP types.
|
2400
|
+
The result must be freed with `duckdb_destroy_logical_type`.
|
2401
|
+
|
2402
|
+
* @param type The logical type, either LIST or MAP.
|
2403
|
+
* @return The child type of the LIST or MAP type.
|
2404
|
+
*/
|
2405
|
+
DUCKDB_API duckdb_logical_type duckdb_list_type_child_type(duckdb_logical_type type);
|
2406
|
+
|
2407
|
+
/*!
|
2408
|
+
Retrieves the child type of the given ARRAY type.
|
2409
|
+
|
2410
|
+
The result must be freed with `duckdb_destroy_logical_type`.
|
2411
|
+
|
2412
|
+
* @param type The logical type. Must be ARRAY.
|
2413
|
+
* @return The child type of the ARRAY type.
|
2414
|
+
*/
|
2415
|
+
DUCKDB_API duckdb_logical_type duckdb_array_type_child_type(duckdb_logical_type type);
|
2416
|
+
|
2417
|
+
/*!
|
2418
|
+
Retrieves the array size of the given array type.
|
2419
|
+
|
2420
|
+
* @param type The logical type object
|
2421
|
+
* @return The fixed number of elements the values of this array type can store.
|
2422
|
+
*/
|
2423
|
+
DUCKDB_API idx_t duckdb_array_type_array_size(duckdb_logical_type type);
|
2424
|
+
|
2425
|
+
/*!
|
2426
|
+
Retrieves the key type of the given map type.
|
2427
|
+
|
2428
|
+
The result must be freed with `duckdb_destroy_logical_type`.
|
2429
|
+
|
2430
|
+
* @param type The logical type object
|
2431
|
+
* @return The key type of the map type. Must be destroyed with `duckdb_destroy_logical_type`.
|
2432
|
+
*/
|
2433
|
+
DUCKDB_API duckdb_logical_type duckdb_map_type_key_type(duckdb_logical_type type);
|
2434
|
+
|
2435
|
+
/*!
|
2436
|
+
Retrieves the value type of the given map type.
|
2437
|
+
|
2438
|
+
The result must be freed with `duckdb_destroy_logical_type`.
|
2439
|
+
|
2440
|
+
* @param type The logical type object
|
2441
|
+
* @return The value type of the map type. Must be destroyed with `duckdb_destroy_logical_type`.
|
2442
|
+
*/
|
2443
|
+
DUCKDB_API duckdb_logical_type duckdb_map_type_value_type(duckdb_logical_type type);
|
2444
|
+
|
2445
|
+
/*!
|
2446
|
+
Returns the number of children of a struct type.
|
2447
|
+
|
2448
|
+
* @param type The logical type object
|
2449
|
+
* @return The number of children of a struct type.
|
2450
|
+
*/
|
2451
|
+
DUCKDB_API idx_t duckdb_struct_type_child_count(duckdb_logical_type type);
|
2452
|
+
|
2453
|
+
/*!
|
2454
|
+
Retrieves the name of the struct child.
|
2455
|
+
|
2456
|
+
The result must be freed with `duckdb_free`.
|
2457
|
+
|
2458
|
+
* @param type The logical type object
|
2459
|
+
* @param index The child index
|
2460
|
+
* @return The name of the struct type. Must be freed with `duckdb_free`.
|
2461
|
+
*/
|
2462
|
+
DUCKDB_API char *duckdb_struct_type_child_name(duckdb_logical_type type, idx_t index);
|
2463
|
+
|
2464
|
+
/*!
|
2465
|
+
Retrieves the child type of the given struct type at the specified index.
|
2466
|
+
|
2467
|
+
The result must be freed with `duckdb_destroy_logical_type`.
|
2468
|
+
|
2469
|
+
* @param type The logical type object
|
2470
|
+
* @param index The child index
|
2471
|
+
* @return The child type of the struct type. Must be destroyed with `duckdb_destroy_logical_type`.
|
2472
|
+
*/
|
2473
|
+
DUCKDB_API duckdb_logical_type duckdb_struct_type_child_type(duckdb_logical_type type, idx_t index);
|
2474
|
+
|
2475
|
+
/*!
|
2476
|
+
Returns the number of members that the union type has.
|
2477
|
+
|
2478
|
+
* @param type The logical type (union) object
|
2479
|
+
* @return The number of members of a union type.
|
2480
|
+
*/
|
2481
|
+
DUCKDB_API idx_t duckdb_union_type_member_count(duckdb_logical_type type);
|
2482
|
+
|
2483
|
+
/*!
|
2484
|
+
Retrieves the name of the union member.
|
2485
|
+
|
2486
|
+
The result must be freed with `duckdb_free`.
|
2487
|
+
|
2488
|
+
* @param type The logical type object
|
2489
|
+
* @param index The child index
|
2490
|
+
* @return The name of the union member. Must be freed with `duckdb_free`.
|
2491
|
+
*/
|
2492
|
+
DUCKDB_API char *duckdb_union_type_member_name(duckdb_logical_type type, idx_t index);
|
2493
|
+
|
2494
|
+
/*!
|
2495
|
+
Retrieves the child type of the given union member at the specified index.
|
2496
|
+
|
2497
|
+
The result must be freed with `duckdb_destroy_logical_type`.
|
2498
|
+
|
2499
|
+
* @param type The logical type object
|
2500
|
+
* @param index The child index
|
2501
|
+
* @return The child type of the union member. Must be destroyed with `duckdb_destroy_logical_type`.
|
2502
|
+
*/
|
2503
|
+
DUCKDB_API duckdb_logical_type duckdb_union_type_member_type(duckdb_logical_type type, idx_t index);
|
2504
|
+
|
2505
|
+
/*!
|
2506
|
+
Destroys the logical type and de-allocates all memory allocated for that type.
|
2507
|
+
|
2508
|
+
* @param type The logical type to destroy.
|
2509
|
+
*/
|
2510
|
+
DUCKDB_API void duckdb_destroy_logical_type(duckdb_logical_type *type);
|
2511
|
+
|
2512
|
+
/*!
|
2513
|
+
Registers a custom type within the given connection.
|
2514
|
+
The type must have an alias
|
2515
|
+
|
2516
|
+
* @param con The connection to use
|
2517
|
+
* @param type The custom type to register
|
2518
|
+
* @return Whether or not the registration was successful.
|
2519
|
+
*/
|
2520
|
+
DUCKDB_API duckdb_state duckdb_register_logical_type(duckdb_connection con, duckdb_logical_type type,
|
2521
|
+
duckdb_create_type_info info);
|
2522
|
+
|
2523
|
+
//===--------------------------------------------------------------------===//
|
2524
|
+
// Data Chunk Interface
|
2525
|
+
//===--------------------------------------------------------------------===//
|
2526
|
+
|
2527
|
+
/*!
|
2528
|
+
Creates an empty data chunk with the specified column types.
|
2529
|
+
The result must be destroyed with `duckdb_destroy_data_chunk`.
|
2530
|
+
|
2531
|
+
* @param types An array of column types. Column types can not contain ANY and INVALID types.
|
2532
|
+
* @param column_count The number of columns.
|
2533
|
+
* @return The data chunk.
|
2534
|
+
*/
|
2535
|
+
DUCKDB_API duckdb_data_chunk duckdb_create_data_chunk(duckdb_logical_type *types, idx_t column_count);
|
2536
|
+
|
2537
|
+
/*!
|
2538
|
+
Destroys the data chunk and de-allocates all memory allocated for that chunk.
|
2539
|
+
|
2540
|
+
* @param chunk The data chunk to destroy.
|
2541
|
+
*/
|
2542
|
+
DUCKDB_API void duckdb_destroy_data_chunk(duckdb_data_chunk *chunk);
|
2543
|
+
|
2544
|
+
/*!
|
2545
|
+
Resets a data chunk, clearing the validity masks and setting the cardinality of the data chunk to 0.
|
2546
|
+
After calling this method, you must call `duckdb_vector_get_validity` and `duckdb_vector_get_data` to obtain current
|
2547
|
+
data and validity pointers
|
2548
|
+
|
2549
|
+
* @param chunk The data chunk to reset.
|
2550
|
+
*/
|
2551
|
+
DUCKDB_API void duckdb_data_chunk_reset(duckdb_data_chunk chunk);
|
2552
|
+
|
2553
|
+
/*!
|
2554
|
+
Retrieves the number of columns in a data chunk.
|
2555
|
+
|
2556
|
+
* @param chunk The data chunk to get the data from
|
2557
|
+
* @return The number of columns in the data chunk
|
2558
|
+
*/
|
2559
|
+
DUCKDB_API idx_t duckdb_data_chunk_get_column_count(duckdb_data_chunk chunk);
|
2560
|
+
|
2561
|
+
/*!
|
2562
|
+
Retrieves the vector at the specified column index in the data chunk.
|
2563
|
+
|
2564
|
+
The pointer to the vector is valid for as long as the chunk is alive.
|
2565
|
+
It does NOT need to be destroyed.
|
2566
|
+
|
2567
|
+
* @param chunk The data chunk to get the data from
|
2568
|
+
* @return The vector
|
2569
|
+
*/
|
2570
|
+
DUCKDB_API duckdb_vector duckdb_data_chunk_get_vector(duckdb_data_chunk chunk, idx_t col_idx);
|
2571
|
+
|
2572
|
+
/*!
|
2573
|
+
Retrieves the current number of tuples in a data chunk.
|
2574
|
+
|
2575
|
+
* @param chunk The data chunk to get the data from
|
2576
|
+
* @return The number of tuples in the data chunk
|
2577
|
+
*/
|
2578
|
+
DUCKDB_API idx_t duckdb_data_chunk_get_size(duckdb_data_chunk chunk);
|
2579
|
+
|
2580
|
+
/*!
|
2581
|
+
Sets the current number of tuples in a data chunk.
|
2582
|
+
|
2583
|
+
* @param chunk The data chunk to set the size in
|
2584
|
+
* @param size The number of tuples in the data chunk
|
2585
|
+
*/
|
2586
|
+
DUCKDB_API void duckdb_data_chunk_set_size(duckdb_data_chunk chunk, idx_t size);
|
2587
|
+
|
2588
|
+
//===--------------------------------------------------------------------===//
|
2589
|
+
// Vector Interface
|
2590
|
+
//===--------------------------------------------------------------------===//
|
2591
|
+
|
2592
|
+
/*!
|
2593
|
+
Retrieves the column type of the specified vector.
|
2594
|
+
|
2595
|
+
The result must be destroyed with `duckdb_destroy_logical_type`.
|
2596
|
+
|
2597
|
+
* @param vector The vector get the data from
|
2598
|
+
* @return The type of the vector
|
2599
|
+
*/
|
2600
|
+
DUCKDB_API duckdb_logical_type duckdb_vector_get_column_type(duckdb_vector vector);
|
2601
|
+
|
2602
|
+
/*!
|
2603
|
+
Retrieves the data pointer of the vector.
|
2604
|
+
|
2605
|
+
The data pointer can be used to read or write values from the vector.
|
2606
|
+
How to read or write values depends on the type of the vector.
|
2607
|
+
|
2608
|
+
* @param vector The vector to get the data from
|
2609
|
+
* @return The data pointer
|
2610
|
+
*/
|
2611
|
+
DUCKDB_API void *duckdb_vector_get_data(duckdb_vector vector);
|
2612
|
+
|
2613
|
+
/*!
|
2614
|
+
Retrieves the validity mask pointer of the specified vector.
|
2615
|
+
|
2616
|
+
If all values are valid, this function MIGHT return NULL!
|
2617
|
+
|
2618
|
+
The validity mask is a bitset that signifies null-ness within the data chunk.
|
2619
|
+
It is a series of uint64_t values, where each uint64_t value contains validity for 64 tuples.
|
2098
2620
|
The bit is set to 1 if the value is valid (i.e. not NULL) or 0 if the value is invalid (i.e. NULL).
|
2099
2621
|
|
2100
2622
|
Validity of a specific value can be obtained like this:
|
@@ -2105,8 +2627,8 @@ bool is_valid = validity_mask[entry_idx] & (1 << idx_in_entry);
|
|
2105
2627
|
|
2106
2628
|
Alternatively, the (slower) duckdb_validity_row_is_valid function can be used.
|
2107
2629
|
|
2108
|
-
* vector
|
2109
|
-
*
|
2630
|
+
* @param vector The vector to get the data from
|
2631
|
+
* @return The pointer to the validity mask, or NULL if no validity mask is present
|
2110
2632
|
*/
|
2111
2633
|
DUCKDB_API uint64_t *duckdb_vector_get_validity(duckdb_vector vector);
|
2112
2634
|
|
@@ -2116,26 +2638,26 @@ Ensures the validity mask is writable by allocating it.
|
|
2116
2638
|
After this function is called, `duckdb_vector_get_validity` will ALWAYS return non-NULL.
|
2117
2639
|
This allows null values to be written to the vector, regardless of whether a validity mask was present before.
|
2118
2640
|
|
2119
|
-
* vector
|
2641
|
+
* @param vector The vector to alter
|
2120
2642
|
*/
|
2121
2643
|
DUCKDB_API void duckdb_vector_ensure_validity_writable(duckdb_vector vector);
|
2122
2644
|
|
2123
2645
|
/*!
|
2124
2646
|
Assigns a string element in the vector at the specified location.
|
2125
2647
|
|
2126
|
-
* vector
|
2127
|
-
* index
|
2128
|
-
* str
|
2648
|
+
* @param vector The vector to alter
|
2649
|
+
* @param index The row position in the vector to assign the string to
|
2650
|
+
* @param str The null-terminated string
|
2129
2651
|
*/
|
2130
2652
|
DUCKDB_API void duckdb_vector_assign_string_element(duckdb_vector vector, idx_t index, const char *str);
|
2131
2653
|
|
2132
2654
|
/*!
|
2133
2655
|
Assigns a string element in the vector at the specified location. You may also use this function to assign BLOBs.
|
2134
2656
|
|
2135
|
-
* vector
|
2136
|
-
* index
|
2137
|
-
* str
|
2138
|
-
* str_len
|
2657
|
+
* @param vector The vector to alter
|
2658
|
+
* @param index The row position in the vector to assign the string to
|
2659
|
+
* @param str The string
|
2660
|
+
* @param str_len The length of the string (in bytes)
|
2139
2661
|
*/
|
2140
2662
|
DUCKDB_API void duckdb_vector_assign_string_element_len(duckdb_vector vector, idx_t index, const char *str,
|
2141
2663
|
idx_t str_len);
|
@@ -2145,34 +2667,37 @@ Retrieves the child vector of a list vector.
|
|
2145
2667
|
|
2146
2668
|
The resulting vector is valid as long as the parent vector is valid.
|
2147
2669
|
|
2148
|
-
* vector
|
2149
|
-
*
|
2670
|
+
* @param vector The vector
|
2671
|
+
* @return The child vector
|
2150
2672
|
*/
|
2151
2673
|
DUCKDB_API duckdb_vector duckdb_list_vector_get_child(duckdb_vector vector);
|
2152
2674
|
|
2153
2675
|
/*!
|
2154
2676
|
Returns the size of the child vector of the list.
|
2155
2677
|
|
2156
|
-
* vector
|
2157
|
-
*
|
2678
|
+
* @param vector The vector
|
2679
|
+
* @return The size of the child list
|
2158
2680
|
*/
|
2159
2681
|
DUCKDB_API idx_t duckdb_list_vector_get_size(duckdb_vector vector);
|
2160
2682
|
|
2161
2683
|
/*!
|
2162
2684
|
Sets the total size of the underlying child-vector of a list vector.
|
2163
2685
|
|
2164
|
-
* vector
|
2165
|
-
* size
|
2166
|
-
*
|
2686
|
+
* @param vector The list vector.
|
2687
|
+
* @param size The size of the child list.
|
2688
|
+
* @return The duckdb state. Returns DuckDBError if the vector is nullptr.
|
2167
2689
|
*/
|
2168
2690
|
DUCKDB_API duckdb_state duckdb_list_vector_set_size(duckdb_vector vector, idx_t size);
|
2169
2691
|
|
2170
2692
|
/*!
|
2171
2693
|
Sets the total capacity of the underlying child-vector of a list.
|
2172
2694
|
|
2173
|
-
|
2174
|
-
|
2175
|
-
|
2695
|
+
After calling this method, you must call `duckdb_vector_get_validity` and `duckdb_vector_get_data` to obtain current
|
2696
|
+
data and validity pointers
|
2697
|
+
|
2698
|
+
* @param vector The list vector.
|
2699
|
+
* @param required_capacity the total capacity to reserve.
|
2700
|
+
* @return The duckdb state. Returns DuckDBError if the vector is nullptr.
|
2176
2701
|
*/
|
2177
2702
|
DUCKDB_API duckdb_state duckdb_list_vector_reserve(duckdb_vector vector, idx_t required_capacity);
|
2178
2703
|
|
@@ -2181,9 +2706,9 @@ Retrieves the child vector of a struct vector.
|
|
2181
2706
|
|
2182
2707
|
The resulting vector is valid as long as the parent vector is valid.
|
2183
2708
|
|
2184
|
-
* vector
|
2185
|
-
* index
|
2186
|
-
*
|
2709
|
+
* @param vector The vector
|
2710
|
+
* @param index The child index
|
2711
|
+
* @return The child vector
|
2187
2712
|
*/
|
2188
2713
|
DUCKDB_API duckdb_vector duckdb_struct_vector_get_child(duckdb_vector vector, idx_t index);
|
2189
2714
|
|
@@ -2193,8 +2718,8 @@ Retrieves the child vector of a array vector.
|
|
2193
2718
|
The resulting vector is valid as long as the parent vector is valid.
|
2194
2719
|
The resulting vector has the size of the parent vector multiplied by the array size.
|
2195
2720
|
|
2196
|
-
* vector
|
2197
|
-
*
|
2721
|
+
* @param vector The vector
|
2722
|
+
* @return The child vector
|
2198
2723
|
*/
|
2199
2724
|
DUCKDB_API duckdb_vector duckdb_array_vector_get_child(duckdb_vector vector);
|
2200
2725
|
|
@@ -2205,9 +2730,9 @@ DUCKDB_API duckdb_vector duckdb_array_vector_get_child(duckdb_vector vector);
|
|
2205
2730
|
/*!
|
2206
2731
|
Returns whether or not a row is valid (i.e. not NULL) in the given validity mask.
|
2207
2732
|
|
2208
|
-
* validity
|
2209
|
-
* row
|
2210
|
-
*
|
2733
|
+
* @param validity The validity mask, as obtained through `duckdb_vector_get_validity`
|
2734
|
+
* @param row The row index
|
2735
|
+
* @return true if the row is valid, false otherwise
|
2211
2736
|
*/
|
2212
2737
|
DUCKDB_API bool duckdb_validity_row_is_valid(uint64_t *validity, idx_t row);
|
2213
2738
|
|
@@ -2217,9 +2742,9 @@ In a validity mask, sets a specific row to either valid or invalid.
|
|
2217
2742
|
Note that `duckdb_vector_ensure_validity_writable` should be called before calling `duckdb_vector_get_validity`,
|
2218
2743
|
to ensure that there is a validity mask to write to.
|
2219
2744
|
|
2220
|
-
* validity
|
2221
|
-
* row
|
2222
|
-
* valid
|
2745
|
+
* @param validity The validity mask, as obtained through `duckdb_vector_get_validity`.
|
2746
|
+
* @param row The row index
|
2747
|
+
* @param valid Whether or not to set the row to valid, or invalid
|
2223
2748
|
*/
|
2224
2749
|
DUCKDB_API void duckdb_validity_set_row_validity(uint64_t *validity, idx_t row, bool valid);
|
2225
2750
|
|
@@ -2228,8 +2753,8 @@ In a validity mask, sets a specific row to invalid.
|
|
2228
2753
|
|
2229
2754
|
Equivalent to `duckdb_validity_set_row_validity` with valid set to false.
|
2230
2755
|
|
2231
|
-
* validity
|
2232
|
-
* row
|
2756
|
+
* @param validity The validity mask
|
2757
|
+
* @param row The row index
|
2233
2758
|
*/
|
2234
2759
|
DUCKDB_API void duckdb_validity_set_row_invalid(uint64_t *validity, idx_t row);
|
2235
2760
|
|
@@ -2238,12 +2763,326 @@ In a validity mask, sets a specific row to valid.
|
|
2238
2763
|
|
2239
2764
|
Equivalent to `duckdb_validity_set_row_validity` with valid set to true.
|
2240
2765
|
|
2241
|
-
* validity
|
2242
|
-
* row
|
2766
|
+
* @param validity The validity mask
|
2767
|
+
* @param row The row index
|
2243
2768
|
*/
|
2244
2769
|
DUCKDB_API void duckdb_validity_set_row_valid(uint64_t *validity, idx_t row);
|
2245
2770
|
|
2246
|
-
|
2771
|
+
//===--------------------------------------------------------------------===//
|
2772
|
+
// Scalar Functions
|
2773
|
+
//===--------------------------------------------------------------------===//
|
2774
|
+
|
2775
|
+
/*!
|
2776
|
+
Creates a new empty scalar function.
|
2777
|
+
|
2778
|
+
The return value should be destroyed with `duckdb_destroy_scalar_function`.
|
2779
|
+
|
2780
|
+
* @return The scalar function object.
|
2781
|
+
*/
|
2782
|
+
DUCKDB_API duckdb_scalar_function duckdb_create_scalar_function();
|
2783
|
+
|
2784
|
+
/*!
|
2785
|
+
Destroys the given scalar function object.
|
2786
|
+
|
2787
|
+
* @param scalar_function The scalar function to destroy
|
2788
|
+
*/
|
2789
|
+
DUCKDB_API void duckdb_destroy_scalar_function(duckdb_scalar_function *scalar_function);
|
2790
|
+
|
2791
|
+
/*!
|
2792
|
+
Sets the name of the given scalar function.
|
2793
|
+
|
2794
|
+
* @param scalar_function The scalar function
|
2795
|
+
* @param name The name of the scalar function
|
2796
|
+
*/
|
2797
|
+
DUCKDB_API void duckdb_scalar_function_set_name(duckdb_scalar_function scalar_function, const char *name);
|
2798
|
+
|
2799
|
+
/*!
|
2800
|
+
Sets the parameters of the given scalar function to varargs. Does not require adding parameters with
|
2801
|
+
duckdb_scalar_function_add_parameter.
|
2802
|
+
|
2803
|
+
* @param scalar_function The scalar function.
|
2804
|
+
* @param type The type of the arguments.
|
2805
|
+
* @return The parameter type. Cannot contain INVALID.
|
2806
|
+
*/
|
2807
|
+
DUCKDB_API void duckdb_scalar_function_set_varargs(duckdb_scalar_function scalar_function, duckdb_logical_type type);
|
2808
|
+
|
2809
|
+
/*!
|
2810
|
+
Sets the parameters of the given scalar function to varargs. Does not require adding parameters with
|
2811
|
+
duckdb_scalar_function_add_parameter.
|
2812
|
+
|
2813
|
+
* @param scalar_function The scalar function.
|
2814
|
+
*/
|
2815
|
+
DUCKDB_API void duckdb_scalar_function_set_special_handling(duckdb_scalar_function scalar_function);
|
2816
|
+
|
2817
|
+
/*!
|
2818
|
+
Sets the Function Stability of the scalar function to VOLATILE, indicating the function should be re-run for every row.
|
2819
|
+
This limits optimization that can be performed for the function.
|
2820
|
+
|
2821
|
+
* @param scalar_function The scalar function.
|
2822
|
+
*/
|
2823
|
+
DUCKDB_API void duckdb_scalar_function_set_volatile(duckdb_scalar_function scalar_function);
|
2824
|
+
|
2825
|
+
/*!
|
2826
|
+
Adds a parameter to the scalar function.
|
2827
|
+
|
2828
|
+
* @param scalar_function The scalar function.
|
2829
|
+
* @param type The parameter type. Cannot contain INVALID.
|
2830
|
+
*/
|
2831
|
+
DUCKDB_API void duckdb_scalar_function_add_parameter(duckdb_scalar_function scalar_function, duckdb_logical_type type);
|
2832
|
+
|
2833
|
+
/*!
|
2834
|
+
Sets the return type of the scalar function.
|
2835
|
+
|
2836
|
+
* @param scalar_function The scalar function
|
2837
|
+
* @param type Cannot contain INVALID or ANY.
|
2838
|
+
*/
|
2839
|
+
DUCKDB_API void duckdb_scalar_function_set_return_type(duckdb_scalar_function scalar_function,
|
2840
|
+
duckdb_logical_type type);
|
2841
|
+
|
2842
|
+
/*!
|
2843
|
+
Assigns extra information to the scalar function that can be fetched during binding, etc.
|
2844
|
+
|
2845
|
+
* @param scalar_function The scalar function
|
2846
|
+
* @param extra_info The extra information
|
2847
|
+
* @param destroy The callback that will be called to destroy the bind data (if any)
|
2848
|
+
*/
|
2849
|
+
DUCKDB_API void duckdb_scalar_function_set_extra_info(duckdb_scalar_function scalar_function, void *extra_info,
|
2850
|
+
duckdb_delete_callback_t destroy);
|
2851
|
+
|
2852
|
+
/*!
|
2853
|
+
Sets the main function of the scalar function.
|
2854
|
+
|
2855
|
+
* @param scalar_function The scalar function
|
2856
|
+
* @param function The function
|
2857
|
+
*/
|
2858
|
+
DUCKDB_API void duckdb_scalar_function_set_function(duckdb_scalar_function scalar_function,
|
2859
|
+
duckdb_scalar_function_t function);
|
2860
|
+
|
2861
|
+
/*!
|
2862
|
+
Register the scalar function object within the given connection.
|
2863
|
+
|
2864
|
+
The function requires at least a name, a function and a return type.
|
2865
|
+
|
2866
|
+
If the function is incomplete or a function with this name already exists DuckDBError is returned.
|
2867
|
+
|
2868
|
+
* @param con The connection to register it in.
|
2869
|
+
* @param scalar_function The function pointer
|
2870
|
+
* @return Whether or not the registration was successful.
|
2871
|
+
*/
|
2872
|
+
DUCKDB_API duckdb_state duckdb_register_scalar_function(duckdb_connection con, duckdb_scalar_function scalar_function);
|
2873
|
+
|
2874
|
+
/*!
|
2875
|
+
Retrieves the extra info of the function as set in `duckdb_scalar_function_set_extra_info`.
|
2876
|
+
|
2877
|
+
* @param info The info object.
|
2878
|
+
* @return The extra info.
|
2879
|
+
*/
|
2880
|
+
DUCKDB_API void *duckdb_scalar_function_get_extra_info(duckdb_function_info info);
|
2881
|
+
|
2882
|
+
/*!
|
2883
|
+
Report that an error has occurred while executing the scalar function.
|
2884
|
+
|
2885
|
+
* @param info The info object.
|
2886
|
+
* @param error The error message
|
2887
|
+
*/
|
2888
|
+
DUCKDB_API void duckdb_scalar_function_set_error(duckdb_function_info info, const char *error);
|
2889
|
+
|
2890
|
+
/*!
|
2891
|
+
Creates a new empty scalar function set.
|
2892
|
+
|
2893
|
+
The return value should be destroyed with `duckdb_destroy_scalar_function_set`.
|
2894
|
+
|
2895
|
+
* @return The scalar function set object.
|
2896
|
+
*/
|
2897
|
+
DUCKDB_API duckdb_scalar_function_set duckdb_create_scalar_function_set(const char *name);
|
2898
|
+
|
2899
|
+
/*!
|
2900
|
+
Destroys the given scalar function set object.
|
2901
|
+
|
2902
|
+
*/
|
2903
|
+
DUCKDB_API void duckdb_destroy_scalar_function_set(duckdb_scalar_function_set *scalar_function_set);
|
2904
|
+
|
2905
|
+
/*!
|
2906
|
+
Adds the scalar function as a new overload to the scalar function set.
|
2907
|
+
|
2908
|
+
Returns DuckDBError if the function could not be added, for example if the overload already exists.
|
2909
|
+
|
2910
|
+
* @param set The scalar function set
|
2911
|
+
* @param function The function to add
|
2912
|
+
*/
|
2913
|
+
DUCKDB_API duckdb_state duckdb_add_scalar_function_to_set(duckdb_scalar_function_set set,
|
2914
|
+
duckdb_scalar_function function);
|
2915
|
+
|
2916
|
+
/*!
|
2917
|
+
Register the scalar function set within the given connection.
|
2918
|
+
|
2919
|
+
The set requires at least a single valid overload.
|
2920
|
+
|
2921
|
+
If the set is incomplete or a function with this name already exists DuckDBError is returned.
|
2922
|
+
|
2923
|
+
* @param con The connection to register it in.
|
2924
|
+
* @param set The function set to register
|
2925
|
+
* @return Whether or not the registration was successful.
|
2926
|
+
*/
|
2927
|
+
DUCKDB_API duckdb_state duckdb_register_scalar_function_set(duckdb_connection con, duckdb_scalar_function_set set);
|
2928
|
+
|
2929
|
+
//===--------------------------------------------------------------------===//
|
2930
|
+
// Aggregate Functions
|
2931
|
+
//===--------------------------------------------------------------------===//
|
2932
|
+
|
2933
|
+
/*!
|
2934
|
+
Creates a new empty aggregate function.
|
2935
|
+
|
2936
|
+
The return value should be destroyed with `duckdb_destroy_aggregate_function`.
|
2937
|
+
|
2938
|
+
* @return The aggregate function object.
|
2939
|
+
*/
|
2940
|
+
DUCKDB_API duckdb_aggregate_function duckdb_create_aggregate_function();
|
2941
|
+
|
2942
|
+
/*!
|
2943
|
+
Destroys the given aggregate function object.
|
2944
|
+
|
2945
|
+
*/
|
2946
|
+
DUCKDB_API void duckdb_destroy_aggregate_function(duckdb_aggregate_function *aggregate_function);
|
2947
|
+
|
2948
|
+
/*!
|
2949
|
+
Sets the name of the given aggregate function.
|
2950
|
+
|
2951
|
+
* @param aggregate_function The aggregate function
|
2952
|
+
* @param name The name of the aggregate function
|
2953
|
+
*/
|
2954
|
+
DUCKDB_API void duckdb_aggregate_function_set_name(duckdb_aggregate_function aggregate_function, const char *name);
|
2955
|
+
|
2956
|
+
/*!
|
2957
|
+
Adds a parameter to the aggregate function.
|
2958
|
+
|
2959
|
+
* @param aggregate_function The aggregate function.
|
2960
|
+
* @param type The parameter type. Cannot contain INVALID.
|
2961
|
+
*/
|
2962
|
+
DUCKDB_API void duckdb_aggregate_function_add_parameter(duckdb_aggregate_function aggregate_function,
|
2963
|
+
duckdb_logical_type type);
|
2964
|
+
|
2965
|
+
/*!
|
2966
|
+
Sets the return type of the aggregate function.
|
2967
|
+
|
2968
|
+
* @param aggregate_function The aggregate function.
|
2969
|
+
* @param type The return type. Cannot contain INVALID or ANY.
|
2970
|
+
*/
|
2971
|
+
DUCKDB_API void duckdb_aggregate_function_set_return_type(duckdb_aggregate_function aggregate_function,
|
2972
|
+
duckdb_logical_type type);
|
2973
|
+
|
2974
|
+
/*!
|
2975
|
+
Sets the main functions of the aggregate function.
|
2976
|
+
|
2977
|
+
* @param aggregate_function The aggregate function
|
2978
|
+
* @param state_size state size
|
2979
|
+
* @param state_init state init function
|
2980
|
+
* @param update update states
|
2981
|
+
* @param combine combine states
|
2982
|
+
* @param finalize finalize states
|
2983
|
+
*/
|
2984
|
+
DUCKDB_API void duckdb_aggregate_function_set_functions(duckdb_aggregate_function aggregate_function,
|
2985
|
+
duckdb_aggregate_state_size state_size,
|
2986
|
+
duckdb_aggregate_init_t state_init,
|
2987
|
+
duckdb_aggregate_update_t update,
|
2988
|
+
duckdb_aggregate_combine_t combine,
|
2989
|
+
duckdb_aggregate_finalize_t finalize);
|
2990
|
+
|
2991
|
+
/*!
|
2992
|
+
Sets the state destructor callback of the aggregate function (optional)
|
2993
|
+
|
2994
|
+
* @param aggregate_function The aggregate function
|
2995
|
+
* @param destroy state destroy callback
|
2996
|
+
*/
|
2997
|
+
DUCKDB_API void duckdb_aggregate_function_set_destructor(duckdb_aggregate_function aggregate_function,
|
2998
|
+
duckdb_aggregate_destroy_t destroy);
|
2999
|
+
|
3000
|
+
/*!
|
3001
|
+
Register the aggregate function object within the given connection.
|
3002
|
+
|
3003
|
+
The function requires at least a name, functions and a return type.
|
3004
|
+
|
3005
|
+
If the function is incomplete or a function with this name already exists DuckDBError is returned.
|
3006
|
+
|
3007
|
+
* @param con The connection to register it in.
|
3008
|
+
* @return Whether or not the registration was successful.
|
3009
|
+
*/
|
3010
|
+
DUCKDB_API duckdb_state duckdb_register_aggregate_function(duckdb_connection con,
|
3011
|
+
duckdb_aggregate_function aggregate_function);
|
3012
|
+
|
3013
|
+
/*!
|
3014
|
+
Sets the NULL handling of the aggregate function to SPECIAL_HANDLING.
|
3015
|
+
|
3016
|
+
* @param aggregate_function The aggregate function
|
3017
|
+
*/
|
3018
|
+
DUCKDB_API void duckdb_aggregate_function_set_special_handling(duckdb_aggregate_function aggregate_function);
|
3019
|
+
|
3020
|
+
/*!
|
3021
|
+
Assigns extra information to the scalar function that can be fetched during binding, etc.
|
3022
|
+
|
3023
|
+
* @param aggregate_function The aggregate function
|
3024
|
+
* @param extra_info The extra information
|
3025
|
+
* @param destroy The callback that will be called to destroy the bind data (if any)
|
3026
|
+
*/
|
3027
|
+
DUCKDB_API void duckdb_aggregate_function_set_extra_info(duckdb_aggregate_function aggregate_function, void *extra_info,
|
3028
|
+
duckdb_delete_callback_t destroy);
|
3029
|
+
|
3030
|
+
/*!
|
3031
|
+
Retrieves the extra info of the function as set in `duckdb_aggregate_function_set_extra_info`.
|
3032
|
+
|
3033
|
+
* @param info The info object
|
3034
|
+
* @return The extra info
|
3035
|
+
*/
|
3036
|
+
DUCKDB_API void *duckdb_aggregate_function_get_extra_info(duckdb_function_info info);
|
3037
|
+
|
3038
|
+
/*!
|
3039
|
+
Report that an error has occurred while executing the aggregate function.
|
3040
|
+
|
3041
|
+
* @param info The info object
|
3042
|
+
* @param error The error message
|
3043
|
+
*/
|
3044
|
+
DUCKDB_API void duckdb_aggregate_function_set_error(duckdb_function_info info, const char *error);
|
3045
|
+
|
3046
|
+
/*!
|
3047
|
+
Creates a new empty aggregate function set.
|
3048
|
+
|
3049
|
+
The return value should be destroyed with `duckdb_destroy_aggregate_function_set`.
|
3050
|
+
|
3051
|
+
* @return The aggregate function set object.
|
3052
|
+
*/
|
3053
|
+
DUCKDB_API duckdb_aggregate_function_set duckdb_create_aggregate_function_set(const char *name);
|
3054
|
+
|
3055
|
+
/*!
|
3056
|
+
Destroys the given aggregate function set object.
|
3057
|
+
|
3058
|
+
*/
|
3059
|
+
DUCKDB_API void duckdb_destroy_aggregate_function_set(duckdb_aggregate_function_set *aggregate_function_set);
|
3060
|
+
|
3061
|
+
/*!
|
3062
|
+
Adds the aggregate function as a new overload to the aggregate function set.
|
3063
|
+
|
3064
|
+
Returns DuckDBError if the function could not be added, for example if the overload already exists.
|
3065
|
+
|
3066
|
+
* @param set The aggregate function set
|
3067
|
+
* @param function The function to add
|
3068
|
+
*/
|
3069
|
+
DUCKDB_API duckdb_state duckdb_add_aggregate_function_to_set(duckdb_aggregate_function_set set,
|
3070
|
+
duckdb_aggregate_function function);
|
3071
|
+
|
3072
|
+
/*!
|
3073
|
+
Register the aggregate function set within the given connection.
|
3074
|
+
|
3075
|
+
The set requires at least a single valid overload.
|
3076
|
+
|
3077
|
+
If the set is incomplete or a function with this name already exists DuckDBError is returned.
|
3078
|
+
|
3079
|
+
* @param con The connection to register it in.
|
3080
|
+
* @param set The function set to register
|
3081
|
+
* @return Whether or not the registration was successful.
|
3082
|
+
*/
|
3083
|
+
DUCKDB_API duckdb_state duckdb_register_aggregate_function_set(duckdb_connection con,
|
3084
|
+
duckdb_aggregate_function_set set);
|
3085
|
+
|
2247
3086
|
//===--------------------------------------------------------------------===//
|
2248
3087
|
// Table Functions
|
2249
3088
|
//===--------------------------------------------------------------------===//
|
@@ -2253,39 +3092,39 @@ Creates a new empty table function.
|
|
2253
3092
|
|
2254
3093
|
The return value should be destroyed with `duckdb_destroy_table_function`.
|
2255
3094
|
|
2256
|
-
*
|
3095
|
+
* @return The table function object.
|
2257
3096
|
*/
|
2258
3097
|
DUCKDB_API duckdb_table_function duckdb_create_table_function();
|
2259
3098
|
|
2260
3099
|
/*!
|
2261
3100
|
Destroys the given table function object.
|
2262
3101
|
|
2263
|
-
* table_function
|
3102
|
+
* @param table_function The table function to destroy
|
2264
3103
|
*/
|
2265
3104
|
DUCKDB_API void duckdb_destroy_table_function(duckdb_table_function *table_function);
|
2266
3105
|
|
2267
3106
|
/*!
|
2268
3107
|
Sets the name of the given table function.
|
2269
3108
|
|
2270
|
-
* table_function
|
2271
|
-
* name
|
3109
|
+
* @param table_function The table function
|
3110
|
+
* @param name The name of the table function
|
2272
3111
|
*/
|
2273
3112
|
DUCKDB_API void duckdb_table_function_set_name(duckdb_table_function table_function, const char *name);
|
2274
3113
|
|
2275
3114
|
/*!
|
2276
3115
|
Adds a parameter to the table function.
|
2277
3116
|
|
2278
|
-
* table_function
|
2279
|
-
* type
|
3117
|
+
* @param table_function The table function.
|
3118
|
+
* @param type The parameter type. Cannot contain INVALID.
|
2280
3119
|
*/
|
2281
3120
|
DUCKDB_API void duckdb_table_function_add_parameter(duckdb_table_function table_function, duckdb_logical_type type);
|
2282
3121
|
|
2283
3122
|
/*!
|
2284
3123
|
Adds a named parameter to the table function.
|
2285
3124
|
|
2286
|
-
* table_function
|
2287
|
-
* name
|
2288
|
-
* type
|
3125
|
+
* @param table_function The table function.
|
3126
|
+
* @param name The parameter name.
|
3127
|
+
* @param type The parameter type. Cannot contain INVALID.
|
2289
3128
|
*/
|
2290
3129
|
DUCKDB_API void duckdb_table_function_add_named_parameter(duckdb_table_function table_function, const char *name,
|
2291
3130
|
duckdb_logical_type type);
|
@@ -2293,9 +3132,9 @@ DUCKDB_API void duckdb_table_function_add_named_parameter(duckdb_table_function
|
|
2293
3132
|
/*!
|
2294
3133
|
Assigns extra information to the table function that can be fetched during binding, etc.
|
2295
3134
|
|
2296
|
-
* table_function
|
2297
|
-
* extra_info
|
2298
|
-
* destroy
|
3135
|
+
* @param table_function The table function
|
3136
|
+
* @param extra_info The extra information
|
3137
|
+
* @param destroy The callback that will be called to destroy the bind data (if any)
|
2299
3138
|
*/
|
2300
3139
|
DUCKDB_API void duckdb_table_function_set_extra_info(duckdb_table_function table_function, void *extra_info,
|
2301
3140
|
duckdb_delete_callback_t destroy);
|
@@ -2303,24 +3142,24 @@ DUCKDB_API void duckdb_table_function_set_extra_info(duckdb_table_function table
|
|
2303
3142
|
/*!
|
2304
3143
|
Sets the bind function of the table function.
|
2305
3144
|
|
2306
|
-
* table_function
|
2307
|
-
* bind
|
3145
|
+
* @param table_function The table function
|
3146
|
+
* @param bind The bind function
|
2308
3147
|
*/
|
2309
3148
|
DUCKDB_API void duckdb_table_function_set_bind(duckdb_table_function table_function, duckdb_table_function_bind_t bind);
|
2310
3149
|
|
2311
3150
|
/*!
|
2312
3151
|
Sets the init function of the table function.
|
2313
3152
|
|
2314
|
-
* table_function
|
2315
|
-
* init
|
3153
|
+
* @param table_function The table function
|
3154
|
+
* @param init The init function
|
2316
3155
|
*/
|
2317
3156
|
DUCKDB_API void duckdb_table_function_set_init(duckdb_table_function table_function, duckdb_table_function_init_t init);
|
2318
3157
|
|
2319
3158
|
/*!
|
2320
3159
|
Sets the thread-local init function of the table function.
|
2321
3160
|
|
2322
|
-
* table_function
|
2323
|
-
* init
|
3161
|
+
* @param table_function The table function
|
3162
|
+
* @param init The init function
|
2324
3163
|
*/
|
2325
3164
|
DUCKDB_API void duckdb_table_function_set_local_init(duckdb_table_function table_function,
|
2326
3165
|
duckdb_table_function_init_t init);
|
@@ -2328,8 +3167,8 @@ DUCKDB_API void duckdb_table_function_set_local_init(duckdb_table_function table
|
|
2328
3167
|
/*!
|
2329
3168
|
Sets the main function of the table function.
|
2330
3169
|
|
2331
|
-
* table_function
|
2332
|
-
* function
|
3170
|
+
* @param table_function The table function
|
3171
|
+
* @param function The function
|
2333
3172
|
*/
|
2334
3173
|
DUCKDB_API void duckdb_table_function_set_function(duckdb_table_function table_function,
|
2335
3174
|
duckdb_table_function_t function);
|
@@ -2341,8 +3180,8 @@ If this is set to true, the system will provide a list of all required columns i
|
|
2341
3180
|
the `duckdb_init_get_column_count` and `duckdb_init_get_column_index` functions.
|
2342
3181
|
If this is set to false (the default), the system will expect all columns to be projected.
|
2343
3182
|
|
2344
|
-
* table_function
|
2345
|
-
* pushdown
|
3183
|
+
* @param table_function The table function
|
3184
|
+
* @param pushdown True if the table function supports projection pushdown, false otherwise.
|
2346
3185
|
*/
|
2347
3186
|
DUCKDB_API void duckdb_table_function_supports_projection_pushdown(duckdb_table_function table_function, bool pushdown);
|
2348
3187
|
|
@@ -2353,9 +3192,9 @@ The function requires at least a name, a bind function, an init function and a m
|
|
2353
3192
|
|
2354
3193
|
If the function is incomplete or a function with this name already exists DuckDBError is returned.
|
2355
3194
|
|
2356
|
-
* con
|
2357
|
-
* function
|
2358
|
-
*
|
3195
|
+
* @param con The connection to register it in.
|
3196
|
+
* @param function The function pointer
|
3197
|
+
* @return Whether or not the registration was successful.
|
2359
3198
|
*/
|
2360
3199
|
DUCKDB_API duckdb_state duckdb_register_table_function(duckdb_connection con, duckdb_table_function function);
|
2361
3200
|
|
@@ -2366,25 +3205,25 @@ DUCKDB_API duckdb_state duckdb_register_table_function(duckdb_connection con, du
|
|
2366
3205
|
/*!
|
2367
3206
|
Retrieves the extra info of the function as set in `duckdb_table_function_set_extra_info`.
|
2368
3207
|
|
2369
|
-
* info
|
2370
|
-
*
|
3208
|
+
* @param info The info object
|
3209
|
+
* @return The extra info
|
2371
3210
|
*/
|
2372
3211
|
DUCKDB_API void *duckdb_bind_get_extra_info(duckdb_bind_info info);
|
2373
3212
|
|
2374
3213
|
/*!
|
2375
3214
|
Adds a result column to the output of the table function.
|
2376
3215
|
|
2377
|
-
* info
|
2378
|
-
* name
|
2379
|
-
* type
|
3216
|
+
* @param info The table function's bind info.
|
3217
|
+
* @param name The column name.
|
3218
|
+
* @param type The logical column type.
|
2380
3219
|
*/
|
2381
3220
|
DUCKDB_API void duckdb_bind_add_result_column(duckdb_bind_info info, const char *name, duckdb_logical_type type);
|
2382
3221
|
|
2383
3222
|
/*!
|
2384
3223
|
Retrieves the number of regular (non-named) parameters to the function.
|
2385
3224
|
|
2386
|
-
* info
|
2387
|
-
*
|
3225
|
+
* @param info The info object
|
3226
|
+
* @return The number of parameters
|
2388
3227
|
*/
|
2389
3228
|
DUCKDB_API idx_t duckdb_bind_get_parameter_count(duckdb_bind_info info);
|
2390
3229
|
|
@@ -2393,9 +3232,9 @@ Retrieves the parameter at the given index.
|
|
2393
3232
|
|
2394
3233
|
The result must be destroyed with `duckdb_destroy_value`.
|
2395
3234
|
|
2396
|
-
* info
|
2397
|
-
* index
|
2398
|
-
*
|
3235
|
+
* @param info The info object
|
3236
|
+
* @param index The index of the parameter to get
|
3237
|
+
* @return The value of the parameter. Must be destroyed with `duckdb_destroy_value`.
|
2399
3238
|
*/
|
2400
3239
|
DUCKDB_API duckdb_value duckdb_bind_get_parameter(duckdb_bind_info info, idx_t index);
|
2401
3240
|
|
@@ -2404,34 +3243,34 @@ Retrieves a named parameter with the given name.
|
|
2404
3243
|
|
2405
3244
|
The result must be destroyed with `duckdb_destroy_value`.
|
2406
3245
|
|
2407
|
-
* info
|
2408
|
-
* name
|
2409
|
-
*
|
3246
|
+
* @param info The info object
|
3247
|
+
* @param name The name of the parameter
|
3248
|
+
* @return The value of the parameter. Must be destroyed with `duckdb_destroy_value`.
|
2410
3249
|
*/
|
2411
3250
|
DUCKDB_API duckdb_value duckdb_bind_get_named_parameter(duckdb_bind_info info, const char *name);
|
2412
3251
|
|
2413
3252
|
/*!
|
2414
3253
|
Sets the user-provided bind data in the bind object. This object can be retrieved again during execution.
|
2415
3254
|
|
2416
|
-
* info
|
2417
|
-
*
|
2418
|
-
* destroy
|
3255
|
+
* @param info The info object
|
3256
|
+
* @param bind_data The bind data object.
|
3257
|
+
* @param destroy The callback that will be called to destroy the bind data (if any)
|
2419
3258
|
*/
|
2420
3259
|
DUCKDB_API void duckdb_bind_set_bind_data(duckdb_bind_info info, void *bind_data, duckdb_delete_callback_t destroy);
|
2421
3260
|
|
2422
3261
|
/*!
|
2423
3262
|
Sets the cardinality estimate for the table function, used for optimization.
|
2424
3263
|
|
2425
|
-
* info
|
2426
|
-
* is_exact
|
3264
|
+
* @param info The bind data object.
|
3265
|
+
* @param is_exact Whether or not the cardinality estimate is exact, or an approximation
|
2427
3266
|
*/
|
2428
3267
|
DUCKDB_API void duckdb_bind_set_cardinality(duckdb_bind_info info, idx_t cardinality, bool is_exact);
|
2429
3268
|
|
2430
3269
|
/*!
|
2431
3270
|
Report that an error has occurred while calling bind.
|
2432
3271
|
|
2433
|
-
* info
|
2434
|
-
* error
|
3272
|
+
* @param info The info object
|
3273
|
+
* @param error The error message
|
2435
3274
|
*/
|
2436
3275
|
DUCKDB_API void duckdb_bind_set_error(duckdb_bind_info info, const char *error);
|
2437
3276
|
|
@@ -2442,8 +3281,8 @@ DUCKDB_API void duckdb_bind_set_error(duckdb_bind_info info, const char *error);
|
|
2442
3281
|
/*!
|
2443
3282
|
Retrieves the extra info of the function as set in `duckdb_table_function_set_extra_info`.
|
2444
3283
|
|
2445
|
-
* info
|
2446
|
-
*
|
3284
|
+
* @param info The info object
|
3285
|
+
* @return The extra info
|
2447
3286
|
*/
|
2448
3287
|
DUCKDB_API void *duckdb_init_get_extra_info(duckdb_init_info info);
|
2449
3288
|
|
@@ -2453,17 +3292,17 @@ Gets the bind data set by `duckdb_bind_set_bind_data` during the bind.
|
|
2453
3292
|
Note that the bind data should be considered as read-only.
|
2454
3293
|
For tracking state, use the init data instead.
|
2455
3294
|
|
2456
|
-
* info
|
2457
|
-
*
|
3295
|
+
* @param info The info object
|
3296
|
+
* @return The bind data object
|
2458
3297
|
*/
|
2459
3298
|
DUCKDB_API void *duckdb_init_get_bind_data(duckdb_init_info info);
|
2460
3299
|
|
2461
3300
|
/*!
|
2462
3301
|
Sets the user-provided init data in the init object. This object can be retrieved again during execution.
|
2463
3302
|
|
2464
|
-
* info
|
2465
|
-
*
|
2466
|
-
* destroy
|
3303
|
+
* @param info The info object
|
3304
|
+
* @param init_data The init data object.
|
3305
|
+
* @param destroy The callback that will be called to destroy the init data (if any)
|
2467
3306
|
*/
|
2468
3307
|
DUCKDB_API void duckdb_init_set_init_data(duckdb_init_info info, void *init_data, duckdb_delete_callback_t destroy);
|
2469
3308
|
|
@@ -2472,8 +3311,8 @@ Returns the number of projected columns.
|
|
2472
3311
|
|
2473
3312
|
This function must be used if projection pushdown is enabled to figure out which columns to emit.
|
2474
3313
|
|
2475
|
-
* info
|
2476
|
-
*
|
3314
|
+
* @param info The info object
|
3315
|
+
* @return The number of projected columns.
|
2477
3316
|
*/
|
2478
3317
|
DUCKDB_API idx_t duckdb_init_get_column_count(duckdb_init_info info);
|
2479
3318
|
|
@@ -2482,25 +3321,25 @@ Returns the column index of the projected column at the specified position.
|
|
2482
3321
|
|
2483
3322
|
This function must be used if projection pushdown is enabled to figure out which columns to emit.
|
2484
3323
|
|
2485
|
-
* info
|
2486
|
-
* column_index
|
2487
|
-
*
|
3324
|
+
* @param info The info object
|
3325
|
+
* @param column_index The index at which to get the projected column index, from 0..duckdb_init_get_column_count(info)
|
3326
|
+
* @return The column index of the projected column.
|
2488
3327
|
*/
|
2489
3328
|
DUCKDB_API idx_t duckdb_init_get_column_index(duckdb_init_info info, idx_t column_index);
|
2490
3329
|
|
2491
3330
|
/*!
|
2492
3331
|
Sets how many threads can process this table function in parallel (default: 1)
|
2493
3332
|
|
2494
|
-
* info
|
2495
|
-
* max_threads
|
3333
|
+
* @param info The info object
|
3334
|
+
* @param max_threads The maximum amount of threads that can process this table function
|
2496
3335
|
*/
|
2497
3336
|
DUCKDB_API void duckdb_init_set_max_threads(duckdb_init_info info, idx_t max_threads);
|
2498
3337
|
|
2499
3338
|
/*!
|
2500
3339
|
Report that an error has occurred while calling init.
|
2501
3340
|
|
2502
|
-
* info
|
2503
|
-
* error
|
3341
|
+
* @param info The info object
|
3342
|
+
* @param error The error message
|
2504
3343
|
*/
|
2505
3344
|
DUCKDB_API void duckdb_init_set_error(duckdb_init_info info, const char *error);
|
2506
3345
|
|
@@ -2511,8 +3350,8 @@ DUCKDB_API void duckdb_init_set_error(duckdb_init_info info, const char *error);
|
|
2511
3350
|
/*!
|
2512
3351
|
Retrieves the extra info of the function as set in `duckdb_table_function_set_extra_info`.
|
2513
3352
|
|
2514
|
-
* info
|
2515
|
-
*
|
3353
|
+
* @param info The info object
|
3354
|
+
* @return The extra info
|
2516
3355
|
*/
|
2517
3356
|
DUCKDB_API void *duckdb_function_get_extra_info(duckdb_function_info info);
|
2518
3357
|
|
@@ -2522,32 +3361,32 @@ Gets the bind data set by `duckdb_bind_set_bind_data` during the bind.
|
|
2522
3361
|
Note that the bind data should be considered as read-only.
|
2523
3362
|
For tracking state, use the init data instead.
|
2524
3363
|
|
2525
|
-
* info
|
2526
|
-
*
|
3364
|
+
* @param info The info object
|
3365
|
+
* @return The bind data object
|
2527
3366
|
*/
|
2528
3367
|
DUCKDB_API void *duckdb_function_get_bind_data(duckdb_function_info info);
|
2529
3368
|
|
2530
3369
|
/*!
|
2531
3370
|
Gets the init data set by `duckdb_init_set_init_data` during the init.
|
2532
3371
|
|
2533
|
-
* info
|
2534
|
-
*
|
3372
|
+
* @param info The info object
|
3373
|
+
* @return The init data object
|
2535
3374
|
*/
|
2536
3375
|
DUCKDB_API void *duckdb_function_get_init_data(duckdb_function_info info);
|
2537
3376
|
|
2538
3377
|
/*!
|
2539
3378
|
Gets the thread-local init data set by `duckdb_init_set_init_data` during the local_init.
|
2540
3379
|
|
2541
|
-
* info
|
2542
|
-
*
|
3380
|
+
* @param info The info object
|
3381
|
+
* @return The init data object
|
2543
3382
|
*/
|
2544
3383
|
DUCKDB_API void *duckdb_function_get_local_init_data(duckdb_function_info info);
|
2545
3384
|
|
2546
3385
|
/*!
|
2547
3386
|
Report that an error has occurred while executing the function.
|
2548
3387
|
|
2549
|
-
* info
|
2550
|
-
* error
|
3388
|
+
* @param info The info object
|
3389
|
+
* @param error The error message
|
2551
3390
|
*/
|
2552
3391
|
DUCKDB_API void duckdb_function_set_error(duckdb_function_info info, const char *error);
|
2553
3392
|
|
@@ -2558,10 +3397,10 @@ DUCKDB_API void duckdb_function_set_error(duckdb_function_info info, const char
|
|
2558
3397
|
/*!
|
2559
3398
|
Add a replacement scan definition to the specified database.
|
2560
3399
|
|
2561
|
-
* db
|
2562
|
-
* replacement
|
2563
|
-
* extra_data
|
2564
|
-
* delete_callback
|
3400
|
+
* @param db The database object to add the replacement scan to
|
3401
|
+
* @param replacement The replacement scan callback
|
3402
|
+
* @param extra_data Extra data that is passed back into the specified callback
|
3403
|
+
* @param delete_callback The delete callback to call on the extra data, if any
|
2565
3404
|
*/
|
2566
3405
|
DUCKDB_API void duckdb_add_replacement_scan(duckdb_database db, duckdb_replacement_callback_t replacement,
|
2567
3406
|
void *extra_data, duckdb_delete_callback_t delete_callback);
|
@@ -2570,27 +3409,75 @@ DUCKDB_API void duckdb_add_replacement_scan(duckdb_database db, duckdb_replaceme
|
|
2570
3409
|
Sets the replacement function name. If this function is called in the replacement callback,
|
2571
3410
|
the replacement scan is performed. If it is not called, the replacement callback is not performed.
|
2572
3411
|
|
2573
|
-
* info
|
2574
|
-
* function_name
|
3412
|
+
* @param info The info object
|
3413
|
+
* @param function_name The function name to substitute.
|
2575
3414
|
*/
|
2576
3415
|
DUCKDB_API void duckdb_replacement_scan_set_function_name(duckdb_replacement_scan_info info, const char *function_name);
|
2577
3416
|
|
2578
3417
|
/*!
|
2579
3418
|
Adds a parameter to the replacement scan function.
|
2580
3419
|
|
2581
|
-
* info
|
2582
|
-
* parameter
|
3420
|
+
* @param info The info object
|
3421
|
+
* @param parameter The parameter to add.
|
2583
3422
|
*/
|
2584
3423
|
DUCKDB_API void duckdb_replacement_scan_add_parameter(duckdb_replacement_scan_info info, duckdb_value parameter);
|
2585
3424
|
|
2586
3425
|
/*!
|
2587
3426
|
Report that an error has occurred while executing the replacement scan.
|
2588
3427
|
|
2589
|
-
* info
|
2590
|
-
* error
|
3428
|
+
* @param info The info object
|
3429
|
+
* @param error The error message
|
2591
3430
|
*/
|
2592
3431
|
DUCKDB_API void duckdb_replacement_scan_set_error(duckdb_replacement_scan_info info, const char *error);
|
2593
|
-
|
3432
|
+
|
3433
|
+
//===--------------------------------------------------------------------===//
|
3434
|
+
// Profiling Info
|
3435
|
+
//===--------------------------------------------------------------------===//
|
3436
|
+
|
3437
|
+
/*!
|
3438
|
+
Returns the root node of the profiling information. Returns nullptr, if profiling is not enabled.
|
3439
|
+
|
3440
|
+
* @param connection A connection object.
|
3441
|
+
* @return A profiling information object.
|
3442
|
+
*/
|
3443
|
+
DUCKDB_API duckdb_profiling_info duckdb_get_profiling_info(duckdb_connection connection);
|
3444
|
+
|
3445
|
+
/*!
|
3446
|
+
Returns the value of the metric of the current profiling info node. Returns nullptr, if the metric does
|
3447
|
+
not exist or is not enabled. Currently, the value holds a string, and you can retrieve the string
|
3448
|
+
by calling the corresponding function: char *duckdb_get_varchar(duckdb_value value).
|
3449
|
+
|
3450
|
+
* @param info A profiling information object.
|
3451
|
+
* @param key The name of the requested metric.
|
3452
|
+
* @return The value of the metric. Must be freed with `duckdb_destroy_value`
|
3453
|
+
*/
|
3454
|
+
DUCKDB_API duckdb_value duckdb_profiling_info_get_value(duckdb_profiling_info info, const char *key);
|
3455
|
+
|
3456
|
+
/*!
|
3457
|
+
Returns the key-value metric map of this profiling node as a MAP duckdb_value.
|
3458
|
+
The individual elements are accessible via the duckdb_value MAP functions.
|
3459
|
+
|
3460
|
+
* @param info A profiling information object.
|
3461
|
+
* @return The key-value metric map as a MAP duckdb_value.
|
3462
|
+
*/
|
3463
|
+
DUCKDB_API duckdb_value duckdb_profiling_info_get_metrics(duckdb_profiling_info info);
|
3464
|
+
|
3465
|
+
/*!
|
3466
|
+
Returns the number of children in the current profiling info node.
|
3467
|
+
|
3468
|
+
* @param info A profiling information object.
|
3469
|
+
* @return The number of children in the current node.
|
3470
|
+
*/
|
3471
|
+
DUCKDB_API idx_t duckdb_profiling_info_get_child_count(duckdb_profiling_info info);
|
3472
|
+
|
3473
|
+
/*!
|
3474
|
+
Returns the child node at the specified index.
|
3475
|
+
|
3476
|
+
* @param info A profiling information object.
|
3477
|
+
* @param index The index of the child node.
|
3478
|
+
* @return The child node at the specified index.
|
3479
|
+
*/
|
3480
|
+
DUCKDB_API duckdb_profiling_info duckdb_profiling_info_get_child(duckdb_profiling_info info, idx_t index);
|
2594
3481
|
|
2595
3482
|
//===--------------------------------------------------------------------===//
|
2596
3483
|
// Appender
|
@@ -2608,17 +3495,16 @@ DUCKDB_API void duckdb_replacement_scan_set_error(duckdb_replacement_scan_info i
|
|
2608
3495
|
|
2609
3496
|
// Note that `duckdb_appender_destroy` should always be called on the resulting appender, even if the function returns
|
2610
3497
|
// `DuckDBError`.
|
2611
|
-
|
2612
3498
|
/*!
|
2613
3499
|
Creates an appender object.
|
2614
3500
|
|
2615
3501
|
Note that the object must be destroyed with `duckdb_appender_destroy`.
|
2616
3502
|
|
2617
|
-
* connection
|
2618
|
-
* schema
|
2619
|
-
* table
|
2620
|
-
* out_appender
|
2621
|
-
*
|
3503
|
+
* @param connection The connection context to create the appender in.
|
3504
|
+
* @param schema The schema of the table to append to, or `nullptr` for the default schema.
|
3505
|
+
* @param table The table name to append to.
|
3506
|
+
* @param out_appender The resulting appender object.
|
3507
|
+
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
2622
3508
|
*/
|
2623
3509
|
DUCKDB_API duckdb_state duckdb_appender_create(duckdb_connection connection, const char *schema, const char *table,
|
2624
3510
|
duckdb_appender *out_appender);
|
@@ -2626,8 +3512,8 @@ DUCKDB_API duckdb_state duckdb_appender_create(duckdb_connection connection, con
|
|
2626
3512
|
/*!
|
2627
3513
|
Returns the number of columns in the table that belongs to the appender.
|
2628
3514
|
|
2629
|
-
* appender The appender to get the column count from.
|
2630
|
-
*
|
3515
|
+
* @param appender The appender to get the column count from.
|
3516
|
+
* @return The number of columns in the table.
|
2631
3517
|
*/
|
2632
3518
|
DUCKDB_API idx_t duckdb_appender_column_count(duckdb_appender appender);
|
2633
3519
|
|
@@ -2636,9 +3522,9 @@ Returns the type of the column at the specified index.
|
|
2636
3522
|
|
2637
3523
|
Note: The resulting type should be destroyed with `duckdb_destroy_logical_type`.
|
2638
3524
|
|
2639
|
-
* appender The appender to get the column type from.
|
2640
|
-
* col_idx The index of the column to get the type of.
|
2641
|
-
*
|
3525
|
+
* @param appender The appender to get the column type from.
|
3526
|
+
* @param col_idx The index of the column to get the type of.
|
3527
|
+
* @return The duckdb_logical_type of the column.
|
2642
3528
|
*/
|
2643
3529
|
DUCKDB_API duckdb_logical_type duckdb_appender_column_type(duckdb_appender appender, idx_t col_idx);
|
2644
3530
|
|
@@ -2648,8 +3534,8 @@ If the appender has no error message, this returns `nullptr` instead.
|
|
2648
3534
|
|
2649
3535
|
The error message should not be freed. It will be de-allocated when `duckdb_appender_destroy` is called.
|
2650
3536
|
|
2651
|
-
* appender
|
2652
|
-
*
|
3537
|
+
* @param appender The appender to get the error from.
|
3538
|
+
* @return The error message, or `nullptr` if there is none.
|
2653
3539
|
*/
|
2654
3540
|
DUCKDB_API const char *duckdb_appender_error(duckdb_appender appender);
|
2655
3541
|
|
@@ -2659,8 +3545,8 @@ constraint violation or any other error, then all data is invalidated, and this
|
|
2659
3545
|
It is not possible to append more values. Call duckdb_appender_error to obtain the error message followed by
|
2660
3546
|
duckdb_appender_destroy to destroy the invalidated appender.
|
2661
3547
|
|
2662
|
-
* appender
|
2663
|
-
*
|
3548
|
+
* @param appender The appender to flush.
|
3549
|
+
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
2664
3550
|
*/
|
2665
3551
|
DUCKDB_API duckdb_state duckdb_appender_flush(duckdb_appender appender);
|
2666
3552
|
|
@@ -2670,8 +3556,8 @@ triggers a constraint violation or any other error, then all data is invalidated
|
|
2670
3556
|
Call duckdb_appender_error to obtain the error message followed by duckdb_appender_destroy to destroy the invalidated
|
2671
3557
|
appender.
|
2672
3558
|
|
2673
|
-
* appender
|
2674
|
-
*
|
3559
|
+
* @param appender The appender to flush and close.
|
3560
|
+
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
2675
3561
|
*/
|
2676
3562
|
DUCKDB_API duckdb_state duckdb_appender_close(duckdb_appender appender);
|
2677
3563
|
|
@@ -2682,8 +3568,8 @@ then all data is invalidated, and this function returns DuckDBError. Due to the
|
|
2682
3568
|
longer possible to obtain the specific error message with duckdb_appender_error. Therefore, call duckdb_appender_close
|
2683
3569
|
before destroying the appender, if you need insights into the specific error.
|
2684
3570
|
|
2685
|
-
* appender
|
2686
|
-
*
|
3571
|
+
* @param appender The appender to flush, close and destroy.
|
3572
|
+
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
2687
3573
|
*/
|
2688
3574
|
DUCKDB_API duckdb_state duckdb_appender_destroy(duckdb_appender *appender);
|
2689
3575
|
|
@@ -2695,11 +3581,16 @@ DUCKDB_API duckdb_state duckdb_appender_begin_row(duckdb_appender appender);
|
|
2695
3581
|
/*!
|
2696
3582
|
Finish the current row of appends. After end_row is called, the next row can be appended.
|
2697
3583
|
|
2698
|
-
* appender
|
2699
|
-
*
|
3584
|
+
* @param appender The appender.
|
3585
|
+
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
2700
3586
|
*/
|
2701
3587
|
DUCKDB_API duckdb_state duckdb_appender_end_row(duckdb_appender appender);
|
2702
3588
|
|
3589
|
+
/*!
|
3590
|
+
Append a DEFAULT value (NULL if DEFAULT not available for column) to the appender.
|
3591
|
+
*/
|
3592
|
+
DUCKDB_API duckdb_state duckdb_append_default(duckdb_appender appender);
|
3593
|
+
|
2703
3594
|
/*!
|
2704
3595
|
Append a bool value to the appender.
|
2705
3596
|
*/
|
@@ -2812,17 +3703,61 @@ The types of the data chunk must exactly match the types of the table, no castin
|
|
2812
3703
|
If the types do not match or the appender is in an invalid state, DuckDBError is returned.
|
2813
3704
|
If the append is successful, DuckDBSuccess is returned.
|
2814
3705
|
|
2815
|
-
* appender
|
2816
|
-
* chunk
|
2817
|
-
*
|
3706
|
+
* @param appender The appender to append to.
|
3707
|
+
* @param chunk The data chunk to append.
|
3708
|
+
* @return The return state.
|
2818
3709
|
*/
|
2819
3710
|
DUCKDB_API duckdb_state duckdb_append_data_chunk(duckdb_appender appender, duckdb_data_chunk chunk);
|
2820
3711
|
|
2821
|
-
|
3712
|
+
//===--------------------------------------------------------------------===//
|
3713
|
+
// Table Description
|
3714
|
+
//===--------------------------------------------------------------------===//
|
3715
|
+
|
3716
|
+
/*!
|
3717
|
+
Creates a table description object. Note that `duckdb_table_description_destroy` should always be called on the
|
3718
|
+
resulting table_description, even if the function returns `DuckDBError`.
|
3719
|
+
|
3720
|
+
* @param connection The connection context.
|
3721
|
+
* @param schema The schema of the table, or `nullptr` for the default schema.
|
3722
|
+
* @param table The table name.
|
3723
|
+
* @param out The resulting table description object.
|
3724
|
+
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
3725
|
+
*/
|
3726
|
+
DUCKDB_API duckdb_state duckdb_table_description_create(duckdb_connection connection, const char *schema,
|
3727
|
+
const char *table, duckdb_table_description *out);
|
3728
|
+
|
3729
|
+
/*!
|
3730
|
+
Destroy the TableDescription object.
|
3731
|
+
|
3732
|
+
* @param table_description The table_description to destroy.
|
3733
|
+
*/
|
3734
|
+
DUCKDB_API void duckdb_table_description_destroy(duckdb_table_description *table_description);
|
3735
|
+
|
3736
|
+
/*!
|
3737
|
+
Returns the error message associated with the given table_description.
|
3738
|
+
If the table_description has no error message, this returns `nullptr` instead.
|
3739
|
+
The error message should not be freed. It will be de-allocated when `duckdb_table_description_destroy` is called.
|
3740
|
+
|
3741
|
+
* @param table_description The table_description to get the error from.
|
3742
|
+
* @return The error message, or `nullptr` if there is none.
|
3743
|
+
*/
|
3744
|
+
DUCKDB_API const char *duckdb_table_description_error(duckdb_table_description table_description);
|
3745
|
+
|
3746
|
+
/*!
|
3747
|
+
Check if the column at 'index' index of the table has a DEFAULT expression.
|
3748
|
+
|
3749
|
+
* @param table_description The table_description to query.
|
3750
|
+
* @param index The index of the column to query.
|
3751
|
+
* @param out The out-parameter used to store the result.
|
3752
|
+
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
3753
|
+
*/
|
3754
|
+
DUCKDB_API duckdb_state duckdb_column_has_default(duckdb_table_description table_description, idx_t index, bool *out);
|
3755
|
+
|
2822
3756
|
//===--------------------------------------------------------------------===//
|
2823
3757
|
// Arrow Interface
|
2824
3758
|
//===--------------------------------------------------------------------===//
|
2825
3759
|
|
3760
|
+
#ifndef DUCKDB_API_NO_DEPRECATED
|
2826
3761
|
/*!
|
2827
3762
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
2828
3763
|
|
@@ -2833,10 +3768,10 @@ If the query fails to execute, DuckDBError is returned and the error message can
|
|
2833
3768
|
Note that after running `duckdb_query_arrow`, `duckdb_destroy_arrow` must be called on the result object even if the
|
2834
3769
|
query fails, otherwise the error stored within the result will not be freed correctly.
|
2835
3770
|
|
2836
|
-
* connection
|
2837
|
-
* query
|
2838
|
-
* out_result
|
2839
|
-
*
|
3771
|
+
* @param connection The connection to perform the query in.
|
3772
|
+
* @param query The SQL query to run.
|
3773
|
+
* @param out_result The query result.
|
3774
|
+
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
2840
3775
|
*/
|
2841
3776
|
DUCKDB_API duckdb_state duckdb_query_arrow(duckdb_connection connection, const char *query, duckdb_arrow *out_result);
|
2842
3777
|
|
@@ -2846,9 +3781,9 @@ DUCKDB_API duckdb_state duckdb_query_arrow(duckdb_connection connection, const c
|
|
2846
3781
|
Fetch the internal arrow schema from the arrow result. Remember to call release on the respective
|
2847
3782
|
ArrowSchema object.
|
2848
3783
|
|
2849
|
-
* result
|
2850
|
-
* out_schema
|
2851
|
-
*
|
3784
|
+
* @param result The result to fetch the schema from.
|
3785
|
+
* @param out_schema The output schema.
|
3786
|
+
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
2852
3787
|
*/
|
2853
3788
|
DUCKDB_API duckdb_state duckdb_query_arrow_schema(duckdb_arrow result, duckdb_arrow_schema *out_schema);
|
2854
3789
|
|
@@ -2858,21 +3793,22 @@ DUCKDB_API duckdb_state duckdb_query_arrow_schema(duckdb_arrow result, duckdb_ar
|
|
2858
3793
|
Fetch the internal arrow schema from the prepared statement. Remember to call release on the respective
|
2859
3794
|
ArrowSchema object.
|
2860
3795
|
|
2861
|
-
*
|
2862
|
-
* out_schema
|
2863
|
-
*
|
3796
|
+
* @param prepared The prepared statement to fetch the schema from.
|
3797
|
+
* @param out_schema The output schema.
|
3798
|
+
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
2864
3799
|
*/
|
2865
3800
|
DUCKDB_API duckdb_state duckdb_prepared_arrow_schema(duckdb_prepared_statement prepared,
|
2866
3801
|
duckdb_arrow_schema *out_schema);
|
3802
|
+
|
2867
3803
|
/*!
|
2868
3804
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
2869
3805
|
|
2870
3806
|
Convert a data chunk into an arrow struct array. Remember to call release on the respective
|
2871
3807
|
ArrowArray object.
|
2872
3808
|
|
2873
|
-
* result
|
2874
|
-
* chunk
|
2875
|
-
* out_array
|
3809
|
+
* @param result The result object the data chunk have been fetched from.
|
3810
|
+
* @param chunk The data chunk to convert.
|
3811
|
+
* @param out_array The output array.
|
2876
3812
|
*/
|
2877
3813
|
DUCKDB_API void duckdb_result_arrow_array(duckdb_result result, duckdb_data_chunk chunk, duckdb_arrow_array *out_array);
|
2878
3814
|
|
@@ -2885,9 +3821,9 @@ ArrowArray object.
|
|
2885
3821
|
This function can be called multiple time to get next chunks, which will free the previous out_array.
|
2886
3822
|
So consume the out_array before calling this function again.
|
2887
3823
|
|
2888
|
-
* result
|
2889
|
-
* out_array
|
2890
|
-
*
|
3824
|
+
* @param result The result to fetch the array from.
|
3825
|
+
* @param out_array The output array.
|
3826
|
+
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
2891
3827
|
*/
|
2892
3828
|
DUCKDB_API duckdb_state duckdb_query_arrow_array(duckdb_arrow result, duckdb_arrow_array *out_array);
|
2893
3829
|
|
@@ -2896,8 +3832,8 @@ DUCKDB_API duckdb_state duckdb_query_arrow_array(duckdb_arrow result, duckdb_arr
|
|
2896
3832
|
|
2897
3833
|
Returns the number of columns present in the arrow result object.
|
2898
3834
|
|
2899
|
-
* result
|
2900
|
-
*
|
3835
|
+
* @param result The result object.
|
3836
|
+
* @return The number of columns present in the result object.
|
2901
3837
|
*/
|
2902
3838
|
DUCKDB_API idx_t duckdb_arrow_column_count(duckdb_arrow result);
|
2903
3839
|
|
@@ -2906,8 +3842,8 @@ DUCKDB_API idx_t duckdb_arrow_column_count(duckdb_arrow result);
|
|
2906
3842
|
|
2907
3843
|
Returns the number of rows present in the arrow result object.
|
2908
3844
|
|
2909
|
-
* result
|
2910
|
-
*
|
3845
|
+
* @param result The result object.
|
3846
|
+
* @return The number of rows present in the result object.
|
2911
3847
|
*/
|
2912
3848
|
DUCKDB_API idx_t duckdb_arrow_row_count(duckdb_arrow result);
|
2913
3849
|
|
@@ -2917,8 +3853,8 @@ DUCKDB_API idx_t duckdb_arrow_row_count(duckdb_arrow result);
|
|
2917
3853
|
Returns the number of rows changed by the query stored in the arrow result. This is relevant only for
|
2918
3854
|
INSERT/UPDATE/DELETE queries. For other queries the rows_changed will be 0.
|
2919
3855
|
|
2920
|
-
* result
|
2921
|
-
*
|
3856
|
+
* @param result The result object.
|
3857
|
+
* @return The number of rows changed.
|
2922
3858
|
*/
|
2923
3859
|
DUCKDB_API idx_t duckdb_arrow_rows_changed(duckdb_arrow result);
|
2924
3860
|
|
@@ -2930,8 +3866,8 @@ DUCKDB_API idx_t duckdb_arrow_rows_changed(duckdb_arrow result);
|
|
2930
3866
|
|
2931
3867
|
The error message should not be freed. It will be de-allocated when `duckdb_destroy_arrow` is called.
|
2932
3868
|
|
2933
|
-
* result
|
2934
|
-
*
|
3869
|
+
* @param result The result object to fetch the error from.
|
3870
|
+
* @return The error of the result.
|
2935
3871
|
*/
|
2936
3872
|
DUCKDB_API const char *duckdb_query_arrow_error(duckdb_arrow result);
|
2937
3873
|
|
@@ -2940,7 +3876,7 @@ DUCKDB_API const char *duckdb_query_arrow_error(duckdb_arrow result);
|
|
2940
3876
|
|
2941
3877
|
Closes the result and de-allocates all memory allocated for the arrow result.
|
2942
3878
|
|
2943
|
-
* result
|
3879
|
+
* @param result The result to destroy.
|
2944
3880
|
*/
|
2945
3881
|
DUCKDB_API void duckdb_destroy_arrow(duckdb_arrow *result);
|
2946
3882
|
|
@@ -2949,7 +3885,7 @@ DUCKDB_API void duckdb_destroy_arrow(duckdb_arrow *result);
|
|
2949
3885
|
|
2950
3886
|
Releases the arrow array stream and de-allocates its memory.
|
2951
3887
|
|
2952
|
-
*
|
3888
|
+
* @param stream_p The arrow array stream to destroy.
|
2953
3889
|
*/
|
2954
3890
|
DUCKDB_API void duckdb_destroy_arrow_stream(duckdb_arrow_stream *stream_p);
|
2955
3891
|
|
@@ -2959,9 +3895,9 @@ DUCKDB_API void duckdb_destroy_arrow_stream(duckdb_arrow_stream *stream_p);
|
|
2959
3895
|
Executes the prepared statement with the given bound parameters, and returns an arrow query result.
|
2960
3896
|
Note that after running `duckdb_execute_prepared_arrow`, `duckdb_destroy_arrow` must be called on the result object.
|
2961
3897
|
|
2962
|
-
* prepared_statement
|
2963
|
-
* out_result
|
2964
|
-
*
|
3898
|
+
* @param prepared_statement The prepared statement to execute.
|
3899
|
+
* @param out_result The query result.
|
3900
|
+
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
2965
3901
|
*/
|
2966
3902
|
DUCKDB_API duckdb_state duckdb_execute_prepared_arrow(duckdb_prepared_statement prepared_statement,
|
2967
3903
|
duckdb_arrow *out_result);
|
@@ -2971,10 +3907,10 @@ DUCKDB_API duckdb_state duckdb_execute_prepared_arrow(duckdb_prepared_statement
|
|
2971
3907
|
|
2972
3908
|
Scans the Arrow stream and creates a view with the given name.
|
2973
3909
|
|
2974
|
-
* connection
|
2975
|
-
* table_name
|
2976
|
-
* arrow
|
2977
|
-
*
|
3910
|
+
* @param connection The connection on which to execute the scan.
|
3911
|
+
* @param table_name Name of the temporary view to create.
|
3912
|
+
* @param arrow Arrow stream wrapper.
|
3913
|
+
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
2978
3914
|
*/
|
2979
3915
|
DUCKDB_API duckdb_state duckdb_arrow_scan(duckdb_connection connection, const char *table_name,
|
2980
3916
|
duckdb_arrow_stream arrow);
|
@@ -2985,19 +3921,18 @@ DUCKDB_API duckdb_state duckdb_arrow_scan(duckdb_connection connection, const ch
|
|
2985
3921
|
Scans the Arrow array and creates a view with the given name.
|
2986
3922
|
Note that after running `duckdb_arrow_array_scan`, `duckdb_destroy_arrow_stream` must be called on the out stream.
|
2987
3923
|
|
2988
|
-
* connection
|
2989
|
-
* table_name
|
2990
|
-
* arrow_schema
|
2991
|
-
* arrow_array
|
2992
|
-
* out_stream
|
2993
|
-
*
|
3924
|
+
* @param connection The connection on which to execute the scan.
|
3925
|
+
* @param table_name Name of the temporary view to create.
|
3926
|
+
* @param arrow_schema Arrow schema wrapper.
|
3927
|
+
* @param arrow_array Arrow array wrapper.
|
3928
|
+
* @param out_stream Output array stream that wraps around the passed schema, for releasing/deleting once done.
|
3929
|
+
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
2994
3930
|
*/
|
2995
3931
|
DUCKDB_API duckdb_state duckdb_arrow_array_scan(duckdb_connection connection, const char *table_name,
|
2996
3932
|
duckdb_arrow_schema arrow_schema, duckdb_arrow_array arrow_array,
|
2997
3933
|
duckdb_arrow_stream *out_stream);
|
2998
|
-
#endif
|
2999
3934
|
|
3000
|
-
#
|
3935
|
+
#endif
|
3001
3936
|
//===--------------------------------------------------------------------===//
|
3002
3937
|
// Threading Information
|
3003
3938
|
//===--------------------------------------------------------------------===//
|
@@ -3007,8 +3942,8 @@ Execute DuckDB tasks on this thread.
|
|
3007
3942
|
|
3008
3943
|
Will return after `max_tasks` have been executed, or if there are no more tasks present.
|
3009
3944
|
|
3010
|
-
* database
|
3011
|
-
* max_tasks
|
3945
|
+
* @param database The database object to execute tasks for
|
3946
|
+
* @param max_tasks The maximum amount of tasks to execute
|
3012
3947
|
*/
|
3013
3948
|
DUCKDB_API void duckdb_execute_tasks(duckdb_database database, idx_t max_tasks);
|
3014
3949
|
|
@@ -3018,8 +3953,8 @@ Creates a task state that can be used with duckdb_execute_tasks_state to execute
|
|
3018
3953
|
|
3019
3954
|
`duckdb_destroy_state` must be called on the result.
|
3020
3955
|
|
3021
|
-
* database
|
3022
|
-
*
|
3956
|
+
* @param database The database object to create the task state for
|
3957
|
+
* @return The task state that can be used with duckdb_execute_tasks_state.
|
3023
3958
|
*/
|
3024
3959
|
DUCKDB_API duckdb_task_state duckdb_create_task_state(duckdb_database database);
|
3025
3960
|
|
@@ -3029,7 +3964,7 @@ Execute DuckDB tasks on this thread.
|
|
3029
3964
|
The thread will keep on executing tasks forever, until duckdb_finish_execution is called on the state.
|
3030
3965
|
Multiple threads can share the same duckdb_task_state.
|
3031
3966
|
|
3032
|
-
* state
|
3967
|
+
* @param state The task state of the executor
|
3033
3968
|
*/
|
3034
3969
|
DUCKDB_API void duckdb_execute_tasks_state(duckdb_task_state state);
|
3035
3970
|
|
@@ -3041,24 +3976,24 @@ max_tasks tasks have been executed or there are no more tasks to be executed.
|
|
3041
3976
|
|
3042
3977
|
Multiple threads can share the same duckdb_task_state.
|
3043
3978
|
|
3044
|
-
* state
|
3045
|
-
* max_tasks
|
3046
|
-
*
|
3979
|
+
* @param state The task state of the executor
|
3980
|
+
* @param max_tasks The maximum amount of tasks to execute
|
3981
|
+
* @return The amount of tasks that have actually been executed
|
3047
3982
|
*/
|
3048
3983
|
DUCKDB_API idx_t duckdb_execute_n_tasks_state(duckdb_task_state state, idx_t max_tasks);
|
3049
3984
|
|
3050
3985
|
/*!
|
3051
3986
|
Finish execution on a specific task.
|
3052
3987
|
|
3053
|
-
* state
|
3988
|
+
* @param state The task state to finish execution
|
3054
3989
|
*/
|
3055
3990
|
DUCKDB_API void duckdb_finish_execution(duckdb_task_state state);
|
3056
3991
|
|
3057
3992
|
/*!
|
3058
3993
|
Check if the provided duckdb_task_state has finished execution
|
3059
3994
|
|
3060
|
-
* state
|
3061
|
-
*
|
3995
|
+
* @param state The task state to inspect
|
3996
|
+
* @return Whether or not duckdb_finish_execution has been called on the task state
|
3062
3997
|
*/
|
3063
3998
|
DUCKDB_API bool duckdb_task_state_is_finished(duckdb_task_state state);
|
3064
3999
|
|
@@ -3068,21 +4003,21 @@ Destroys the task state returned from duckdb_create_task_state.
|
|
3068
4003
|
Note that this should not be called while there is an active duckdb_execute_tasks_state running
|
3069
4004
|
on the task state.
|
3070
4005
|
|
3071
|
-
* state
|
4006
|
+
* @param state The task state to clean up
|
3072
4007
|
*/
|
3073
4008
|
DUCKDB_API void duckdb_destroy_task_state(duckdb_task_state state);
|
3074
4009
|
|
3075
4010
|
/*!
|
3076
4011
|
Returns true if the execution of the current query is finished.
|
3077
4012
|
|
3078
|
-
* con
|
4013
|
+
* @param con The connection on which to check
|
3079
4014
|
*/
|
3080
4015
|
DUCKDB_API bool duckdb_execution_is_finished(duckdb_connection con);
|
3081
|
-
#endif
|
3082
4016
|
|
3083
4017
|
//===--------------------------------------------------------------------===//
|
3084
4018
|
// Streaming Result Interface
|
3085
4019
|
//===--------------------------------------------------------------------===//
|
4020
|
+
|
3086
4021
|
#ifndef DUCKDB_API_NO_DEPRECATED
|
3087
4022
|
/*!
|
3088
4023
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
@@ -3099,8 +4034,8 @@ mixed with the legacy result functions or the materialized result functions).
|
|
3099
4034
|
|
3100
4035
|
It is not known beforehand how many chunks will be returned by this result.
|
3101
4036
|
|
3102
|
-
* result
|
3103
|
-
*
|
4037
|
+
* @param result The result object to fetch the data chunk from.
|
4038
|
+
* @return The resulting data chunk. Returns `NULL` if the result has an error.
|
3104
4039
|
*/
|
3105
4040
|
DUCKDB_API duckdb_data_chunk duckdb_stream_fetch_chunk(duckdb_result result);
|
3106
4041
|
#endif
|
@@ -3112,11 +4047,116 @@ The result must be destroyed with `duckdb_destroy_data_chunk`.
|
|
3112
4047
|
|
3113
4048
|
It is not known beforehand how many chunks will be returned by this result.
|
3114
4049
|
|
3115
|
-
* result
|
3116
|
-
*
|
4050
|
+
* @param result The result object to fetch the data chunk from.
|
4051
|
+
* @return The resulting data chunk. Returns `NULL` if the result has an error.
|
3117
4052
|
*/
|
3118
4053
|
DUCKDB_API duckdb_data_chunk duckdb_fetch_chunk(duckdb_result result);
|
3119
4054
|
|
4055
|
+
//===--------------------------------------------------------------------===//
|
4056
|
+
// Cast Functions
|
4057
|
+
//===--------------------------------------------------------------------===//
|
4058
|
+
|
4059
|
+
/*!
|
4060
|
+
Creates a new cast function object.
|
4061
|
+
|
4062
|
+
* @return The cast function object.
|
4063
|
+
*/
|
4064
|
+
DUCKDB_API duckdb_cast_function duckdb_create_cast_function();
|
4065
|
+
|
4066
|
+
/*!
|
4067
|
+
Sets the source type of the cast function.
|
4068
|
+
|
4069
|
+
* @param cast_function The cast function object.
|
4070
|
+
* @param source_type The source type to set.
|
4071
|
+
*/
|
4072
|
+
DUCKDB_API void duckdb_cast_function_set_source_type(duckdb_cast_function cast_function,
|
4073
|
+
duckdb_logical_type source_type);
|
4074
|
+
|
4075
|
+
/*!
|
4076
|
+
Sets the target type of the cast function.
|
4077
|
+
|
4078
|
+
* @param cast_function The cast function object.
|
4079
|
+
* @param target_type The target type to set.
|
4080
|
+
*/
|
4081
|
+
DUCKDB_API void duckdb_cast_function_set_target_type(duckdb_cast_function cast_function,
|
4082
|
+
duckdb_logical_type target_type);
|
4083
|
+
|
4084
|
+
/*!
|
4085
|
+
Sets the "cost" of implicitly casting the source type to the target type using this function.
|
4086
|
+
|
4087
|
+
* @param cast_function The cast function object.
|
4088
|
+
* @param cost The cost to set.
|
4089
|
+
*/
|
4090
|
+
DUCKDB_API void duckdb_cast_function_set_implicit_cast_cost(duckdb_cast_function cast_function, int64_t cost);
|
4091
|
+
|
4092
|
+
/*!
|
4093
|
+
Sets the actual cast function to use.
|
4094
|
+
|
4095
|
+
* @param cast_function The cast function object.
|
4096
|
+
* @param function The function to set.
|
4097
|
+
*/
|
4098
|
+
DUCKDB_API void duckdb_cast_function_set_function(duckdb_cast_function cast_function, duckdb_cast_function_t function);
|
4099
|
+
|
4100
|
+
/*!
|
4101
|
+
Assigns extra information to the cast function that can be fetched during execution, etc.
|
4102
|
+
|
4103
|
+
* @param extra_info The extra information
|
4104
|
+
* @param destroy The callback that will be called to destroy the extra information (if any)
|
4105
|
+
*/
|
4106
|
+
DUCKDB_API void duckdb_cast_function_set_extra_info(duckdb_cast_function cast_function, void *extra_info,
|
4107
|
+
duckdb_delete_callback_t destroy);
|
4108
|
+
|
4109
|
+
/*!
|
4110
|
+
Retrieves the extra info of the function as set in `duckdb_cast_function_set_extra_info`.
|
4111
|
+
|
4112
|
+
* @param info The info object.
|
4113
|
+
* @return The extra info.
|
4114
|
+
*/
|
4115
|
+
DUCKDB_API void *duckdb_cast_function_get_extra_info(duckdb_function_info info);
|
4116
|
+
|
4117
|
+
/*!
|
4118
|
+
Get the cast execution mode from the given function info.
|
4119
|
+
|
4120
|
+
* @param info The info object.
|
4121
|
+
* @return The cast mode.
|
4122
|
+
*/
|
4123
|
+
DUCKDB_API duckdb_cast_mode duckdb_cast_function_get_cast_mode(duckdb_function_info info);
|
4124
|
+
|
4125
|
+
/*!
|
4126
|
+
Report that an error has occurred while executing the cast function.
|
4127
|
+
|
4128
|
+
* @param info The info object.
|
4129
|
+
* @param error The error message.
|
4130
|
+
*/
|
4131
|
+
DUCKDB_API void duckdb_cast_function_set_error(duckdb_function_info info, const char *error);
|
4132
|
+
|
4133
|
+
/*!
|
4134
|
+
Report that an error has occurred while executing the cast function, setting the corresponding output row to NULL.
|
4135
|
+
|
4136
|
+
* @param info The info object.
|
4137
|
+
* @param error The error message.
|
4138
|
+
* @param row The index of the row within the output vector to set to NULL.
|
4139
|
+
* @param output The output vector.
|
4140
|
+
*/
|
4141
|
+
DUCKDB_API void duckdb_cast_function_set_row_error(duckdb_function_info info, const char *error, idx_t row,
|
4142
|
+
duckdb_vector output);
|
4143
|
+
|
4144
|
+
/*!
|
4145
|
+
Registers a cast function within the given connection.
|
4146
|
+
|
4147
|
+
* @param con The connection to use.
|
4148
|
+
* @param cast_function The cast function to register.
|
4149
|
+
* @return Whether or not the registration was successful.
|
4150
|
+
*/
|
4151
|
+
DUCKDB_API duckdb_state duckdb_register_cast_function(duckdb_connection con, duckdb_cast_function cast_function);
|
4152
|
+
|
4153
|
+
/*!
|
4154
|
+
Destroys the cast function object.
|
4155
|
+
|
4156
|
+
* @param cast_function The cast function object.
|
4157
|
+
*/
|
4158
|
+
DUCKDB_API void duckdb_destroy_cast_function(duckdb_cast_function *cast_function);
|
4159
|
+
|
3120
4160
|
#ifdef __cplusplus
|
3121
4161
|
}
|
3122
4162
|
#endif
|