duckdb 1.2.1-dev4.0 → 1.2.1-dev8.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/package.json +1 -1
- package/src/connection.cpp +57 -35
- package/src/duckdb/extension/core_functions/aggregate/distributive/string_agg.cpp +14 -22
- package/src/duckdb/extension/core_functions/aggregate/nested/list.cpp +0 -1
- package/src/duckdb/extension/core_functions/lambda_functions.cpp +0 -11
- package/src/duckdb/extension/core_functions/scalar/list/list_aggregates.cpp +18 -6
- package/src/duckdb/extension/icu/icu-datefunc.cpp +9 -2
- package/src/duckdb/extension/icu/icu-strptime.cpp +7 -11
- package/src/duckdb/extension/icu/include/icu-datefunc.hpp +3 -1
- package/src/duckdb/extension/json/buffered_json_reader.cpp +18 -31
- package/src/duckdb/extension/json/json_extension.cpp +8 -3
- package/src/duckdb/extension/parquet/column_reader.cpp +4 -6
- package/src/duckdb/extension/parquet/column_writer.cpp +33 -12
- package/src/duckdb/extension/parquet/include/column_reader.hpp +0 -2
- package/src/duckdb/extension/parquet/include/parquet_bss_encoder.hpp +0 -1
- package/src/duckdb/extension/parquet/include/parquet_dlba_encoder.hpp +1 -2
- package/src/duckdb/src/catalog/catalog.cpp +12 -0
- package/src/duckdb/src/catalog/catalog_entry/duck_table_entry.cpp +1 -1
- package/src/duckdb/src/catalog/catalog_entry_retriever.cpp +1 -1
- package/src/duckdb/src/catalog/catalog_search_path.cpp +8 -8
- package/src/duckdb/src/common/bind_helpers.cpp +3 -0
- package/src/duckdb/src/common/compressed_file_system.cpp +2 -0
- package/src/duckdb/src/common/hive_partitioning.cpp +1 -1
- package/src/duckdb/src/common/multi_file_reader.cpp +3 -3
- package/src/duckdb/src/execution/aggregate_hashtable.cpp +1 -1
- package/src/duckdb/src/execution/index/art/art.cpp +19 -6
- package/src/duckdb/src/execution/index/art/iterator.cpp +7 -3
- package/src/duckdb/src/execution/operator/aggregate/physical_window.cpp +11 -4
- package/src/duckdb/src/execution/operator/csv_scanner/buffer_manager/csv_buffer.cpp +2 -2
- package/src/duckdb/src/execution/operator/csv_scanner/encode/csv_encoder.cpp +5 -1
- package/src/duckdb/src/execution/operator/csv_scanner/scanner/base_scanner.cpp +3 -2
- package/src/duckdb/src/execution/operator/csv_scanner/scanner/csv_schema.cpp +2 -2
- package/src/duckdb/src/execution/operator/csv_scanner/scanner/scanner_boundary.cpp +1 -1
- package/src/duckdb/src/execution/operator/csv_scanner/scanner/string_value_scanner.cpp +20 -12
- package/src/duckdb/src/execution/operator/csv_scanner/sniffer/dialect_detection.cpp +19 -22
- package/src/duckdb/src/execution/operator/csv_scanner/sniffer/type_refinement.cpp +1 -1
- package/src/duckdb/src/execution/operator/csv_scanner/util/csv_error.cpp +1 -0
- package/src/duckdb/src/execution/operator/csv_scanner/util/csv_reader_options.cpp +16 -0
- package/src/duckdb/src/execution/operator/helper/physical_reservoir_sample.cpp +1 -0
- package/src/duckdb/src/execution/operator/helper/physical_streaming_sample.cpp +16 -7
- package/src/duckdb/src/execution/operator/persistent/physical_batch_insert.cpp +3 -1
- package/src/duckdb/src/execution/operator/scan/physical_table_scan.cpp +11 -1
- package/src/duckdb/src/execution/operator/schema/physical_create_art_index.cpp +5 -7
- package/src/duckdb/src/execution/physical_plan/plan_create_index.cpp +11 -0
- package/src/duckdb/src/execution/physical_plan/plan_sample.cpp +1 -3
- package/src/duckdb/src/execution/radix_partitioned_hashtable.cpp +14 -5
- package/src/duckdb/src/execution/sample/reservoir_sample.cpp +24 -12
- package/src/duckdb/src/function/scalar/generic/getvariable.cpp +3 -3
- package/src/duckdb/src/function/table/version/pragma_version.cpp +3 -3
- package/src/duckdb/src/function/window/window_aggregate_states.cpp +3 -0
- package/src/duckdb/src/function/window/window_boundaries_state.cpp +108 -48
- package/src/duckdb/src/function/window/window_constant_aggregator.cpp +5 -5
- package/src/duckdb/src/function/window/window_distinct_aggregator.cpp +6 -0
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry_retriever.hpp +1 -1
- package/src/duckdb/src/include/duckdb/catalog/catalog_search_path.hpp +10 -9
- package/src/duckdb/src/include/duckdb/common/adbc/adbc-init.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/multi_file_reader.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/index/art/iterator.hpp +2 -0
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/base_scanner.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_buffer.hpp +5 -4
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_option.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_schema.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/encode/csv_encoder.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/sniffer/csv_sniffer.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/string_value_scanner.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_streaming_sample.hpp +3 -7
- package/src/duckdb/src/include/duckdb/execution/reservoir_sample.hpp +2 -1
- package/src/duckdb/src/include/duckdb/function/lambda_functions.hpp +11 -3
- package/src/duckdb/src/include/duckdb/function/window/window_boundaries_state.hpp +4 -0
- package/src/duckdb/src/include/duckdb/main/client_context_state.hpp +4 -0
- package/src/duckdb/src/include/duckdb/main/extension_entries.hpp +25 -7
- package/src/duckdb/src/include/duckdb/main/pending_query_result.hpp +2 -0
- package/src/duckdb/src/include/duckdb/main/query_profiler.hpp +7 -0
- package/src/duckdb/src/include/duckdb/optimizer/filter_combiner.hpp +2 -2
- package/src/duckdb/src/include/duckdb/optimizer/late_materialization.hpp +2 -1
- package/src/duckdb/src/include/duckdb/optimizer/optimizer_extension.hpp +11 -5
- package/src/duckdb/src/include/duckdb/parallel/executor_task.hpp +4 -1
- package/src/duckdb/src/include/duckdb/parallel/pipeline.hpp +0 -1
- package/src/duckdb/src/include/duckdb/parallel/task_executor.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parallel/task_notifier.hpp +27 -0
- package/src/duckdb/src/include/duckdb/parallel/task_scheduler.hpp +4 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_subquery_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/tableref/bound_cteref.hpp +1 -0
- package/src/duckdb/src/include/duckdb/storage/checkpoint/table_data_writer.hpp +3 -1
- package/src/duckdb/src/include/duckdb/storage/checkpoint_manager.hpp +7 -1
- package/src/duckdb/src/include/duckdb/storage/storage_manager.hpp +3 -2
- package/src/duckdb/src/include/duckdb.h +495 -480
- package/src/duckdb/src/main/attached_database.cpp +1 -1
- package/src/duckdb/src/main/capi/duckdb-c.cpp +5 -1
- package/src/duckdb/src/main/capi/helper-c.cpp +8 -0
- package/src/duckdb/src/main/config.cpp +7 -1
- package/src/duckdb/src/main/database.cpp +8 -8
- package/src/duckdb/src/main/extension/extension_helper.cpp +3 -1
- package/src/duckdb/src/main/extension/extension_load.cpp +12 -12
- package/src/duckdb/src/optimizer/column_lifetime_analyzer.cpp +1 -0
- package/src/duckdb/src/optimizer/join_order/query_graph_manager.cpp +2 -2
- package/src/duckdb/src/optimizer/late_materialization.cpp +26 -5
- package/src/duckdb/src/optimizer/optimizer.cpp +12 -1
- package/src/duckdb/src/parallel/executor_task.cpp +10 -6
- package/src/duckdb/src/parallel/task_executor.cpp +4 -1
- package/src/duckdb/src/parallel/task_notifier.cpp +23 -0
- package/src/duckdb/src/parallel/task_scheduler.cpp +33 -0
- package/src/duckdb/src/parser/transform/expression/transform_subquery.cpp +4 -1
- package/src/duckdb/src/planner/binder/expression/bind_subquery_expression.cpp +1 -1
- package/src/duckdb/src/planner/binder/query_node/plan_subquery.cpp +4 -2
- package/src/duckdb/src/planner/binder/statement/bind_create.cpp +7 -2
- package/src/duckdb/src/planner/binder/statement/bind_create_table.cpp +6 -5
- package/src/duckdb/src/storage/checkpoint/table_data_writer.cpp +4 -2
- package/src/duckdb/src/storage/checkpoint_manager.cpp +4 -3
- package/src/duckdb/src/storage/compression/string_uncompressed.cpp +21 -10
- package/src/duckdb/src/storage/storage_info.cpp +2 -0
- package/src/duckdb/src/storage/storage_manager.cpp +2 -2
- package/src/duckdb/src/storage/table/row_group.cpp +5 -6
- package/src/duckdb/src/storage/table/scan_state.cpp +6 -0
- package/src/duckdb/src/transaction/duck_transaction.cpp +11 -3
- package/src/duckdb/src/transaction/duck_transaction_manager.cpp +2 -2
- package/src/duckdb/third_party/concurrentqueue/concurrentqueue.h +17 -0
- package/src/duckdb/ub_src_parallel.cpp +2 -0
@@ -13,20 +13,19 @@
|
|
13
13
|
|
14
14
|
#pragma once
|
15
15
|
|
16
|
-
|
17
|
-
#ifndef DUCKDB_API
|
16
|
+
#ifndef DUCKDB_C_API
|
18
17
|
#ifdef _WIN32
|
19
18
|
#ifdef DUCKDB_STATIC_BUILD
|
20
|
-
#define
|
19
|
+
#define DUCKDB_C_API
|
21
20
|
#else
|
22
21
|
#if defined(DUCKDB_BUILD_LIBRARY) && !defined(DUCKDB_BUILD_LOADABLE_EXTENSION)
|
23
|
-
#define
|
22
|
+
#define DUCKDB_C_API __declspec(dllexport)
|
24
23
|
#else
|
25
|
-
#define
|
24
|
+
#define DUCKDB_C_API __declspec(dllimport)
|
26
25
|
#endif
|
27
26
|
#endif
|
28
27
|
#else
|
29
|
-
#define
|
28
|
+
#define DUCKDB_C_API
|
30
29
|
#endif
|
31
30
|
#endif
|
32
31
|
|
@@ -135,6 +134,10 @@ typedef enum DUCKDB_TYPE {
|
|
135
134
|
DUCKDB_TYPE_VARINT = 35,
|
136
135
|
// SQLNULL type
|
137
136
|
DUCKDB_TYPE_SQLNULL = 36,
|
137
|
+
// STRING_LITERAL type
|
138
|
+
DUCKDB_TYPE_STRING_LITERAL = 37,
|
139
|
+
// INTEGER_LITERAL type
|
140
|
+
DUCKDB_TYPE_INTEGER_LITERAL = 38,
|
138
141
|
} duckdb_type;
|
139
142
|
//! An enum over the returned state of different functions.
|
140
143
|
typedef enum duckdb_state { DuckDBSuccess = 0, DuckDBError = 1 } duckdb_state;
|
@@ -692,7 +695,7 @@ process. Must be destroyed with 'duckdb_destroy_instance_cache'.
|
|
692
695
|
|
693
696
|
* @return The database instance cache.
|
694
697
|
*/
|
695
|
-
|
698
|
+
DUCKDB_C_API duckdb_instance_cache duckdb_create_instance_cache();
|
696
699
|
|
697
700
|
/*!
|
698
701
|
Creates a new database instance in the instance cache, or retrieves an existing database instance.
|
@@ -706,16 +709,16 @@ Must be closed with 'duckdb_close'.
|
|
706
709
|
Note that the error message must be freed using `duckdb_free`.
|
707
710
|
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
708
711
|
*/
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
+
DUCKDB_C_API duckdb_state duckdb_get_or_create_from_cache(duckdb_instance_cache instance_cache, const char *path,
|
713
|
+
duckdb_database *out_database, duckdb_config config,
|
714
|
+
char **out_error);
|
712
715
|
|
713
716
|
/*!
|
714
717
|
Destroys an existing database instance cache and de-allocates its memory.
|
715
718
|
|
716
719
|
* @param instance_cache The instance cache to destroy.
|
717
720
|
*/
|
718
|
-
|
721
|
+
DUCKDB_C_API void duckdb_destroy_instance_cache(duckdb_instance_cache *instance_cache);
|
719
722
|
|
720
723
|
/*!
|
721
724
|
Creates a new database or opens an existing database file stored at the given path.
|
@@ -726,7 +729,7 @@ The database must be closed with 'duckdb_close'.
|
|
726
729
|
* @param out_database The result database object.
|
727
730
|
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
728
731
|
*/
|
729
|
-
|
732
|
+
DUCKDB_C_API duckdb_state duckdb_open(const char *path, duckdb_database *out_database);
|
730
733
|
|
731
734
|
/*!
|
732
735
|
Extended version of duckdb_open. Creates a new database or opens an existing database file stored at the given path.
|
@@ -739,8 +742,8 @@ The database must be closed with 'duckdb_close'.
|
|
739
742
|
Note that the error message must be freed using `duckdb_free`.
|
740
743
|
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
741
744
|
*/
|
742
|
-
|
743
|
-
|
745
|
+
DUCKDB_C_API duckdb_state duckdb_open_ext(const char *path, duckdb_database *out_database, duckdb_config config,
|
746
|
+
char **out_error);
|
744
747
|
|
745
748
|
/*!
|
746
749
|
Closes the specified database and de-allocates all memory allocated for that database.
|
@@ -750,7 +753,7 @@ Still, it is recommended to always correctly close a database object after you a
|
|
750
753
|
|
751
754
|
* @param database The database object to shut down.
|
752
755
|
*/
|
753
|
-
|
756
|
+
DUCKDB_C_API void duckdb_close(duckdb_database *database);
|
754
757
|
|
755
758
|
/*!
|
756
759
|
Opens a connection to a database. Connections are required to query the database, and store transactional state
|
@@ -761,14 +764,14 @@ The instantiated connection should be closed using 'duckdb_disconnect'.
|
|
761
764
|
* @param out_connection The result connection object.
|
762
765
|
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
763
766
|
*/
|
764
|
-
|
767
|
+
DUCKDB_C_API duckdb_state duckdb_connect(duckdb_database database, duckdb_connection *out_connection);
|
765
768
|
|
766
769
|
/*!
|
767
770
|
Interrupt running query
|
768
771
|
|
769
772
|
* @param connection The connection to interrupt
|
770
773
|
*/
|
771
|
-
|
774
|
+
DUCKDB_C_API void duckdb_interrupt(duckdb_connection connection);
|
772
775
|
|
773
776
|
/*!
|
774
777
|
Get progress of the running query
|
@@ -776,21 +779,21 @@ Get progress of the running query
|
|
776
779
|
* @param connection The working connection
|
777
780
|
* @return -1 if no progress or a percentage of the progress
|
778
781
|
*/
|
779
|
-
|
782
|
+
DUCKDB_C_API duckdb_query_progress_type duckdb_query_progress(duckdb_connection connection);
|
780
783
|
|
781
784
|
/*!
|
782
785
|
Closes the specified connection and de-allocates all memory allocated for that connection.
|
783
786
|
|
784
787
|
* @param connection The connection to close.
|
785
788
|
*/
|
786
|
-
|
789
|
+
DUCKDB_C_API void duckdb_disconnect(duckdb_connection *connection);
|
787
790
|
|
788
791
|
/*!
|
789
792
|
Returns the version of the linked DuckDB, with a version postfix for dev versions
|
790
793
|
|
791
794
|
Usually used for developing C extensions that must return this for a compatibility check.
|
792
795
|
*/
|
793
|
-
|
796
|
+
DUCKDB_C_API const char *duckdb_library_version();
|
794
797
|
|
795
798
|
//===--------------------------------------------------------------------===//
|
796
799
|
// Configuration
|
@@ -809,7 +812,7 @@ Note that `duckdb_destroy_config` should always be called on the resulting confi
|
|
809
812
|
* @param out_config The result configuration object.
|
810
813
|
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
811
814
|
*/
|
812
|
-
|
815
|
+
DUCKDB_C_API duckdb_state duckdb_create_config(duckdb_config *out_config);
|
813
816
|
|
814
817
|
/*!
|
815
818
|
This returns the total amount of configuration options available for usage with `duckdb_get_config_flag`.
|
@@ -818,7 +821,7 @@ This should not be called in a loop as it internally loops over all the options.
|
|
818
821
|
|
819
822
|
* @return The amount of config options available.
|
820
823
|
*/
|
821
|
-
|
824
|
+
DUCKDB_C_API size_t duckdb_config_count();
|
822
825
|
|
823
826
|
/*!
|
824
827
|
Obtains a human-readable name and description of a specific configuration option. This can be used to e.g.
|
@@ -831,7 +834,7 @@ The result name or description MUST NOT be freed.
|
|
831
834
|
* @param out_description A description of the configuration flag.
|
832
835
|
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
833
836
|
*/
|
834
|
-
|
837
|
+
DUCKDB_C_API duckdb_state duckdb_get_config_flag(size_t index, const char **out_name, const char **out_description);
|
835
838
|
|
836
839
|
/*!
|
837
840
|
Sets the specified option for the specified configuration. The configuration option is indicated by name.
|
@@ -846,14 +849,14 @@ This can fail if either the name is invalid, or if the value provided for the op
|
|
846
849
|
* @param option The value to set the configuration flag to.
|
847
850
|
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
848
851
|
*/
|
849
|
-
|
852
|
+
DUCKDB_C_API duckdb_state duckdb_set_config(duckdb_config config, const char *name, const char *option);
|
850
853
|
|
851
854
|
/*!
|
852
855
|
Destroys the specified configuration object and de-allocates all memory allocated for the object.
|
853
856
|
|
854
857
|
* @param config The configuration object to destroy.
|
855
858
|
*/
|
856
|
-
|
859
|
+
DUCKDB_C_API void duckdb_destroy_config(duckdb_config *config);
|
857
860
|
|
858
861
|
//===--------------------------------------------------------------------===//
|
859
862
|
// Query Execution
|
@@ -872,14 +875,14 @@ query fails, otherwise the error stored within the result will not be freed corr
|
|
872
875
|
* @param out_result The query result.
|
873
876
|
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
874
877
|
*/
|
875
|
-
|
878
|
+
DUCKDB_C_API duckdb_state duckdb_query(duckdb_connection connection, const char *query, duckdb_result *out_result);
|
876
879
|
|
877
880
|
/*!
|
878
881
|
Closes the result and de-allocates all memory allocated for that connection.
|
879
882
|
|
880
883
|
* @param result The result to destroy.
|
881
884
|
*/
|
882
|
-
|
885
|
+
DUCKDB_C_API void duckdb_destroy_result(duckdb_result *result);
|
883
886
|
|
884
887
|
/*!
|
885
888
|
Returns the column name of the specified column. The result should not need to be freed; the column names will
|
@@ -891,7 +894,7 @@ Returns `NULL` if the column is out of range.
|
|
891
894
|
* @param col The column index.
|
892
895
|
* @return The column name of the specified column.
|
893
896
|
*/
|
894
|
-
|
897
|
+
DUCKDB_C_API const char *duckdb_column_name(duckdb_result *result, idx_t col);
|
895
898
|
|
896
899
|
/*!
|
897
900
|
Returns the column type of the specified column.
|
@@ -902,7 +905,7 @@ Returns `DUCKDB_TYPE_INVALID` if the column is out of range.
|
|
902
905
|
* @param col The column index.
|
903
906
|
* @return The column type of the specified column.
|
904
907
|
*/
|
905
|
-
|
908
|
+
DUCKDB_C_API duckdb_type duckdb_column_type(duckdb_result *result, idx_t col);
|
906
909
|
|
907
910
|
/*!
|
908
911
|
Returns the statement type of the statement that was executed
|
@@ -910,7 +913,7 @@ Returns the statement type of the statement that was executed
|
|
910
913
|
* @param result The result object to fetch the statement type from.
|
911
914
|
* @return duckdb_statement_type value or DUCKDB_STATEMENT_TYPE_INVALID
|
912
915
|
*/
|
913
|
-
|
916
|
+
DUCKDB_C_API duckdb_statement_type duckdb_result_statement_type(duckdb_result result);
|
914
917
|
|
915
918
|
/*!
|
916
919
|
Returns the logical column type of the specified column.
|
@@ -923,7 +926,7 @@ Returns `NULL` if the column is out of range.
|
|
923
926
|
* @param col The column index.
|
924
927
|
* @return The logical column type of the specified column.
|
925
928
|
*/
|
926
|
-
|
929
|
+
DUCKDB_C_API duckdb_logical_type duckdb_column_logical_type(duckdb_result *result, idx_t col);
|
927
930
|
|
928
931
|
/*!
|
929
932
|
Returns the number of columns present in a the result object.
|
@@ -931,7 +934,7 @@ Returns the number of columns present in a the result object.
|
|
931
934
|
* @param result The result object.
|
932
935
|
* @return The number of columns present in the result object.
|
933
936
|
*/
|
934
|
-
|
937
|
+
DUCKDB_C_API idx_t duckdb_column_count(duckdb_result *result);
|
935
938
|
|
936
939
|
#ifndef DUCKDB_API_NO_DEPRECATED
|
937
940
|
/*!
|
@@ -942,7 +945,7 @@ Returns the number of rows present in the result object.
|
|
942
945
|
* @param result The result object.
|
943
946
|
* @return The number of rows present in the result object.
|
944
947
|
*/
|
945
|
-
|
948
|
+
DUCKDB_C_API idx_t duckdb_row_count(duckdb_result *result);
|
946
949
|
|
947
950
|
#endif
|
948
951
|
/*!
|
@@ -952,7 +955,7 @@ queries. For other queries the rows_changed will be 0.
|
|
952
955
|
* @param result The result object.
|
953
956
|
* @return The number of rows changed.
|
954
957
|
*/
|
955
|
-
|
958
|
+
DUCKDB_C_API idx_t duckdb_rows_changed(duckdb_result *result);
|
956
959
|
|
957
960
|
#ifndef DUCKDB_API_NO_DEPRECATED
|
958
961
|
/*!
|
@@ -974,7 +977,7 @@ printf("Data for row %d: %d\n", row, data[row]);
|
|
974
977
|
* @param col The column index.
|
975
978
|
* @return The column data of the specified column.
|
976
979
|
*/
|
977
|
-
|
980
|
+
DUCKDB_C_API void *duckdb_column_data(duckdb_result *result, idx_t col);
|
978
981
|
|
979
982
|
/*!
|
980
983
|
**DEPRECATED**: Prefer using `duckdb_result_get_chunk` instead.
|
@@ -997,7 +1000,7 @@ if (nullmask[row]) {
|
|
997
1000
|
* @param col The column index.
|
998
1001
|
* @return The nullmask of the specified column.
|
999
1002
|
*/
|
1000
|
-
|
1003
|
+
DUCKDB_C_API bool *duckdb_nullmask_data(duckdb_result *result, idx_t col);
|
1001
1004
|
|
1002
1005
|
#endif
|
1003
1006
|
/*!
|
@@ -1008,7 +1011,7 @@ The result of this function must not be freed. It will be cleaned up when `duckd
|
|
1008
1011
|
* @param result The result object to fetch the error from.
|
1009
1012
|
* @return The error of the result.
|
1010
1013
|
*/
|
1011
|
-
|
1014
|
+
DUCKDB_C_API const char *duckdb_result_error(duckdb_result *result);
|
1012
1015
|
|
1013
1016
|
/*!
|
1014
1017
|
Returns the result error type contained within the result. The error is only set if `duckdb_query` returns
|
@@ -1017,7 +1020,7 @@ Returns the result error type contained within the result. The error is only set
|
|
1017
1020
|
* @param result The result object to fetch the error from.
|
1018
1021
|
* @return The error type of the result.
|
1019
1022
|
*/
|
1020
|
-
|
1023
|
+
DUCKDB_C_API duckdb_error_type duckdb_result_error_type(duckdb_result *result);
|
1021
1024
|
|
1022
1025
|
//===--------------------------------------------------------------------===//
|
1023
1026
|
// Result Functions
|
@@ -1043,7 +1046,7 @@ Use `duckdb_result_chunk_count` to figure out how many chunks there are in the r
|
|
1043
1046
|
* @param chunk_index The chunk index to fetch from.
|
1044
1047
|
* @return The resulting data chunk. Returns `NULL` if the chunk index is out of bounds.
|
1045
1048
|
*/
|
1046
|
-
|
1049
|
+
DUCKDB_C_API duckdb_data_chunk duckdb_result_get_chunk(duckdb_result result, idx_t chunk_index);
|
1047
1050
|
|
1048
1051
|
/*!
|
1049
1052
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
@@ -1053,7 +1056,7 @@ Checks if the type of the internal result is StreamQueryResult.
|
|
1053
1056
|
* @param result The result object to check.
|
1054
1057
|
* @return Whether or not the result object is of the type StreamQueryResult
|
1055
1058
|
*/
|
1056
|
-
|
1059
|
+
DUCKDB_C_API bool duckdb_result_is_streaming(duckdb_result result);
|
1057
1060
|
|
1058
1061
|
/*!
|
1059
1062
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
@@ -1063,7 +1066,7 @@ Returns the number of data chunks present in the result.
|
|
1063
1066
|
* @param result The result object
|
1064
1067
|
* @return Number of data chunks present in the result.
|
1065
1068
|
*/
|
1066
|
-
|
1069
|
+
DUCKDB_C_API idx_t duckdb_result_chunk_count(duckdb_result result);
|
1067
1070
|
|
1068
1071
|
#endif
|
1069
1072
|
/*!
|
@@ -1072,7 +1075,7 @@ Returns the return_type of the given result, or DUCKDB_RETURN_TYPE_INVALID on er
|
|
1072
1075
|
* @param result The result object
|
1073
1076
|
* @return The return_type
|
1074
1077
|
*/
|
1075
|
-
|
1078
|
+
DUCKDB_C_API duckdb_result_type duckdb_result_return_type(duckdb_result result);
|
1076
1079
|
|
1077
1080
|
//===--------------------------------------------------------------------===//
|
1078
1081
|
// Safe Fetch Functions
|
@@ -1088,126 +1091,126 @@ DUCKDB_API duckdb_result_type duckdb_result_return_type(duckdb_result result);
|
|
1088
1091
|
|
1089
1092
|
* @return The boolean value at the specified location, or false if the value cannot be converted.
|
1090
1093
|
*/
|
1091
|
-
|
1094
|
+
DUCKDB_C_API bool duckdb_value_boolean(duckdb_result *result, idx_t col, idx_t row);
|
1092
1095
|
|
1093
1096
|
/*!
|
1094
1097
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
1095
1098
|
|
1096
1099
|
* @return The int8_t value at the specified location, or 0 if the value cannot be converted.
|
1097
1100
|
*/
|
1098
|
-
|
1101
|
+
DUCKDB_C_API int8_t duckdb_value_int8(duckdb_result *result, idx_t col, idx_t row);
|
1099
1102
|
|
1100
1103
|
/*!
|
1101
1104
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
1102
1105
|
|
1103
1106
|
* @return The int16_t value at the specified location, or 0 if the value cannot be converted.
|
1104
1107
|
*/
|
1105
|
-
|
1108
|
+
DUCKDB_C_API int16_t duckdb_value_int16(duckdb_result *result, idx_t col, idx_t row);
|
1106
1109
|
|
1107
1110
|
/*!
|
1108
1111
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
1109
1112
|
|
1110
1113
|
* @return The int32_t value at the specified location, or 0 if the value cannot be converted.
|
1111
1114
|
*/
|
1112
|
-
|
1115
|
+
DUCKDB_C_API int32_t duckdb_value_int32(duckdb_result *result, idx_t col, idx_t row);
|
1113
1116
|
|
1114
1117
|
/*!
|
1115
1118
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
1116
1119
|
|
1117
1120
|
* @return The int64_t value at the specified location, or 0 if the value cannot be converted.
|
1118
1121
|
*/
|
1119
|
-
|
1122
|
+
DUCKDB_C_API int64_t duckdb_value_int64(duckdb_result *result, idx_t col, idx_t row);
|
1120
1123
|
|
1121
1124
|
/*!
|
1122
1125
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
1123
1126
|
|
1124
1127
|
* @return The duckdb_hugeint value at the specified location, or 0 if the value cannot be converted.
|
1125
1128
|
*/
|
1126
|
-
|
1129
|
+
DUCKDB_C_API duckdb_hugeint duckdb_value_hugeint(duckdb_result *result, idx_t col, idx_t row);
|
1127
1130
|
|
1128
1131
|
/*!
|
1129
1132
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
1130
1133
|
|
1131
1134
|
* @return The duckdb_uhugeint value at the specified location, or 0 if the value cannot be converted.
|
1132
1135
|
*/
|
1133
|
-
|
1136
|
+
DUCKDB_C_API duckdb_uhugeint duckdb_value_uhugeint(duckdb_result *result, idx_t col, idx_t row);
|
1134
1137
|
|
1135
1138
|
/*!
|
1136
1139
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
1137
1140
|
|
1138
1141
|
* @return The duckdb_decimal value at the specified location, or 0 if the value cannot be converted.
|
1139
1142
|
*/
|
1140
|
-
|
1143
|
+
DUCKDB_C_API duckdb_decimal duckdb_value_decimal(duckdb_result *result, idx_t col, idx_t row);
|
1141
1144
|
|
1142
1145
|
/*!
|
1143
1146
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
1144
1147
|
|
1145
1148
|
* @return The uint8_t value at the specified location, or 0 if the value cannot be converted.
|
1146
1149
|
*/
|
1147
|
-
|
1150
|
+
DUCKDB_C_API uint8_t duckdb_value_uint8(duckdb_result *result, idx_t col, idx_t row);
|
1148
1151
|
|
1149
1152
|
/*!
|
1150
1153
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
1151
1154
|
|
1152
1155
|
* @return The uint16_t value at the specified location, or 0 if the value cannot be converted.
|
1153
1156
|
*/
|
1154
|
-
|
1157
|
+
DUCKDB_C_API uint16_t duckdb_value_uint16(duckdb_result *result, idx_t col, idx_t row);
|
1155
1158
|
|
1156
1159
|
/*!
|
1157
1160
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
1158
1161
|
|
1159
1162
|
* @return The uint32_t value at the specified location, or 0 if the value cannot be converted.
|
1160
1163
|
*/
|
1161
|
-
|
1164
|
+
DUCKDB_C_API uint32_t duckdb_value_uint32(duckdb_result *result, idx_t col, idx_t row);
|
1162
1165
|
|
1163
1166
|
/*!
|
1164
1167
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
1165
1168
|
|
1166
1169
|
* @return The uint64_t value at the specified location, or 0 if the value cannot be converted.
|
1167
1170
|
*/
|
1168
|
-
|
1171
|
+
DUCKDB_C_API uint64_t duckdb_value_uint64(duckdb_result *result, idx_t col, idx_t row);
|
1169
1172
|
|
1170
1173
|
/*!
|
1171
1174
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
1172
1175
|
|
1173
1176
|
* @return The float value at the specified location, or 0 if the value cannot be converted.
|
1174
1177
|
*/
|
1175
|
-
|
1178
|
+
DUCKDB_C_API float duckdb_value_float(duckdb_result *result, idx_t col, idx_t row);
|
1176
1179
|
|
1177
1180
|
/*!
|
1178
1181
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
1179
1182
|
|
1180
1183
|
* @return The double value at the specified location, or 0 if the value cannot be converted.
|
1181
1184
|
*/
|
1182
|
-
|
1185
|
+
DUCKDB_C_API double duckdb_value_double(duckdb_result *result, idx_t col, idx_t row);
|
1183
1186
|
|
1184
1187
|
/*!
|
1185
1188
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
1186
1189
|
|
1187
1190
|
* @return The duckdb_date value at the specified location, or 0 if the value cannot be converted.
|
1188
1191
|
*/
|
1189
|
-
|
1192
|
+
DUCKDB_C_API duckdb_date duckdb_value_date(duckdb_result *result, idx_t col, idx_t row);
|
1190
1193
|
|
1191
1194
|
/*!
|
1192
1195
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
1193
1196
|
|
1194
1197
|
* @return The duckdb_time value at the specified location, or 0 if the value cannot be converted.
|
1195
1198
|
*/
|
1196
|
-
|
1199
|
+
DUCKDB_C_API duckdb_time duckdb_value_time(duckdb_result *result, idx_t col, idx_t row);
|
1197
1200
|
|
1198
1201
|
/*!
|
1199
1202
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
1200
1203
|
|
1201
1204
|
* @return The duckdb_timestamp value at the specified location, or 0 if the value cannot be converted.
|
1202
1205
|
*/
|
1203
|
-
|
1206
|
+
DUCKDB_C_API duckdb_timestamp duckdb_value_timestamp(duckdb_result *result, idx_t col, idx_t row);
|
1204
1207
|
|
1205
1208
|
/*!
|
1206
1209
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
1207
1210
|
|
1208
1211
|
* @return The duckdb_interval value at the specified location, or 0 if the value cannot be converted.
|
1209
1212
|
*/
|
1210
|
-
|
1213
|
+
DUCKDB_C_API duckdb_interval duckdb_value_interval(duckdb_result *result, idx_t col, idx_t row);
|
1211
1214
|
|
1212
1215
|
/*!
|
1213
1216
|
**DEPRECATED**: Use duckdb_value_string instead. This function does not work correctly if the string contains null
|
@@ -1216,7 +1219,7 @@ bytes.
|
|
1216
1219
|
* @return The text value at the specified location as a null-terminated string, or nullptr if the value cannot be
|
1217
1220
|
converted. The result must be freed with `duckdb_free`.
|
1218
1221
|
*/
|
1219
|
-
|
1222
|
+
DUCKDB_C_API char *duckdb_value_varchar(duckdb_result *result, idx_t col, idx_t row);
|
1220
1223
|
|
1221
1224
|
/*!
|
1222
1225
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
@@ -1226,7 +1229,7 @@ The resulting field "string.data" must be freed with `duckdb_free.`
|
|
1226
1229
|
|
1227
1230
|
* @return The string value at the specified location. Attempts to cast the result value to string.
|
1228
1231
|
*/
|
1229
|
-
|
1232
|
+
DUCKDB_C_API duckdb_string duckdb_value_string(duckdb_result *result, idx_t col, idx_t row);
|
1230
1233
|
|
1231
1234
|
/*!
|
1232
1235
|
**DEPRECATED**: Use duckdb_value_string_internal instead. This function does not work correctly if the string contains
|
@@ -1237,7 +1240,7 @@ If the column is NOT a VARCHAR column this function will return NULL.
|
|
1237
1240
|
|
1238
1241
|
The result must NOT be freed.
|
1239
1242
|
*/
|
1240
|
-
|
1243
|
+
DUCKDB_C_API char *duckdb_value_varchar_internal(duckdb_result *result, idx_t col, idx_t row);
|
1241
1244
|
|
1242
1245
|
/*!
|
1243
1246
|
**DEPRECATED**: Use duckdb_value_string_internal instead. This function does not work correctly if the string contains
|
@@ -1247,7 +1250,7 @@ If the column is NOT a VARCHAR column this function will return NULL.
|
|
1247
1250
|
|
1248
1251
|
The result must NOT be freed.
|
1249
1252
|
*/
|
1250
|
-
|
1253
|
+
DUCKDB_C_API duckdb_string duckdb_value_string_internal(duckdb_result *result, idx_t col, idx_t row);
|
1251
1254
|
|
1252
1255
|
/*!
|
1253
1256
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
@@ -1255,14 +1258,14 @@ DUCKDB_API duckdb_string duckdb_value_string_internal(duckdb_result *result, idx
|
|
1255
1258
|
* @return The duckdb_blob value at the specified location. Returns a blob with blob.data set to nullptr if the
|
1256
1259
|
value cannot be converted. The resulting field "blob.data" must be freed with `duckdb_free.`
|
1257
1260
|
*/
|
1258
|
-
|
1261
|
+
DUCKDB_C_API duckdb_blob duckdb_value_blob(duckdb_result *result, idx_t col, idx_t row);
|
1259
1262
|
|
1260
1263
|
/*!
|
1261
1264
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
1262
1265
|
|
1263
1266
|
* @return Returns true if the value at the specified index is NULL, and false otherwise.
|
1264
1267
|
*/
|
1265
|
-
|
1268
|
+
DUCKDB_C_API bool duckdb_value_is_null(duckdb_result *result, idx_t col, idx_t row);
|
1266
1269
|
|
1267
1270
|
#endif
|
1268
1271
|
//===--------------------------------------------------------------------===//
|
@@ -1276,7 +1279,7 @@ should be freed using `duckdb_free`.
|
|
1276
1279
|
* @param size The number of bytes to allocate.
|
1277
1280
|
* @return A pointer to the allocated memory region.
|
1278
1281
|
*/
|
1279
|
-
|
1282
|
+
DUCKDB_C_API void *duckdb_malloc(size_t size);
|
1280
1283
|
|
1281
1284
|
/*!
|
1282
1285
|
Free a value returned from `duckdb_malloc`, `duckdb_value_varchar`, `duckdb_value_blob`, or
|
@@ -1284,7 +1287,7 @@ Free a value returned from `duckdb_malloc`, `duckdb_value_varchar`, `duckdb_valu
|
|
1284
1287
|
|
1285
1288
|
* @param ptr The memory region to de-allocate.
|
1286
1289
|
*/
|
1287
|
-
|
1290
|
+
DUCKDB_C_API void duckdb_free(void *ptr);
|
1288
1291
|
|
1289
1292
|
/*!
|
1290
1293
|
The internal vector size used by DuckDB.
|
@@ -1292,14 +1295,14 @@ This is the amount of tuples that will fit into a data chunk created by `duckdb_
|
|
1292
1295
|
|
1293
1296
|
* @return The vector size.
|
1294
1297
|
*/
|
1295
|
-
|
1298
|
+
DUCKDB_C_API idx_t duckdb_vector_size();
|
1296
1299
|
|
1297
1300
|
/*!
|
1298
1301
|
Whether or not the duckdb_string_t value is inlined.
|
1299
1302
|
This means that the data of the string does not have a separate allocation.
|
1300
1303
|
|
1301
1304
|
*/
|
1302
|
-
|
1305
|
+
DUCKDB_C_API bool duckdb_string_is_inlined(duckdb_string_t string);
|
1303
1306
|
|
1304
1307
|
/*!
|
1305
1308
|
Get the string length of a string_t
|
@@ -1307,7 +1310,7 @@ Get the string length of a string_t
|
|
1307
1310
|
* @param string The string to get the length of.
|
1308
1311
|
* @return The length.
|
1309
1312
|
*/
|
1310
|
-
|
1313
|
+
DUCKDB_C_API uint32_t duckdb_string_t_length(duckdb_string_t string);
|
1311
1314
|
|
1312
1315
|
/*!
|
1313
1316
|
Get a pointer to the string data of a string_t
|
@@ -1315,7 +1318,7 @@ Get a pointer to the string data of a string_t
|
|
1315
1318
|
* @param string The string to get the pointer to.
|
1316
1319
|
* @return The pointer.
|
1317
1320
|
*/
|
1318
|
-
|
1321
|
+
DUCKDB_C_API const char *duckdb_string_t_data(duckdb_string_t *string);
|
1319
1322
|
|
1320
1323
|
//===--------------------------------------------------------------------===//
|
1321
1324
|
// Date Time Timestamp Helpers
|
@@ -1327,7 +1330,7 @@ Decompose a `duckdb_date` object into year, month and date (stored as `duckdb_da
|
|
1327
1330
|
* @param date The date object, as obtained from a `DUCKDB_TYPE_DATE` column.
|
1328
1331
|
* @return The `duckdb_date_struct` with the decomposed elements.
|
1329
1332
|
*/
|
1330
|
-
|
1333
|
+
DUCKDB_C_API duckdb_date_struct duckdb_from_date(duckdb_date date);
|
1331
1334
|
|
1332
1335
|
/*!
|
1333
1336
|
Re-compose a `duckdb_date` from year, month and date (`duckdb_date_struct`).
|
@@ -1335,7 +1338,7 @@ Re-compose a `duckdb_date` from year, month and date (`duckdb_date_struct`).
|
|
1335
1338
|
* @param date The year, month and date stored in a `duckdb_date_struct`.
|
1336
1339
|
* @return The `duckdb_date` element.
|
1337
1340
|
*/
|
1338
|
-
|
1341
|
+
DUCKDB_C_API duckdb_date duckdb_to_date(duckdb_date_struct date);
|
1339
1342
|
|
1340
1343
|
/*!
|
1341
1344
|
Test a `duckdb_date` to see if it is a finite value.
|
@@ -1343,7 +1346,7 @@ Test a `duckdb_date` to see if it is a finite value.
|
|
1343
1346
|
* @param date The date object, as obtained from a `DUCKDB_TYPE_DATE` column.
|
1344
1347
|
* @return True if the date is finite, false if it is ±infinity.
|
1345
1348
|
*/
|
1346
|
-
|
1349
|
+
DUCKDB_C_API bool duckdb_is_finite_date(duckdb_date date);
|
1347
1350
|
|
1348
1351
|
/*!
|
1349
1352
|
Decompose a `duckdb_time` object into hour, minute, second and microsecond (stored as `duckdb_time_struct`).
|
@@ -1351,7 +1354,7 @@ Decompose a `duckdb_time` object into hour, minute, second and microsecond (stor
|
|
1351
1354
|
* @param time The time object, as obtained from a `DUCKDB_TYPE_TIME` column.
|
1352
1355
|
* @return The `duckdb_time_struct` with the decomposed elements.
|
1353
1356
|
*/
|
1354
|
-
|
1357
|
+
DUCKDB_C_API duckdb_time_struct duckdb_from_time(duckdb_time time);
|
1355
1358
|
|
1356
1359
|
/*!
|
1357
1360
|
Create a `duckdb_time_tz` object from micros and a timezone offset.
|
@@ -1360,7 +1363,7 @@ Create a `duckdb_time_tz` object from micros and a timezone offset.
|
|
1360
1363
|
* @param offset The timezone offset component of the time.
|
1361
1364
|
* @return The `duckdb_time_tz` element.
|
1362
1365
|
*/
|
1363
|
-
|
1366
|
+
DUCKDB_C_API duckdb_time_tz duckdb_create_time_tz(int64_t micros, int32_t offset);
|
1364
1367
|
|
1365
1368
|
/*!
|
1366
1369
|
Decompose a TIME_TZ objects into micros and a timezone offset.
|
@@ -1369,7 +1372,7 @@ Use `duckdb_from_time` to further decompose the micros into hour, minute, second
|
|
1369
1372
|
|
1370
1373
|
* @param micros The time object, as obtained from a `DUCKDB_TYPE_TIME_TZ` column.
|
1371
1374
|
*/
|
1372
|
-
|
1375
|
+
DUCKDB_C_API duckdb_time_tz_struct duckdb_from_time_tz(duckdb_time_tz micros);
|
1373
1376
|
|
1374
1377
|
/*!
|
1375
1378
|
Re-compose a `duckdb_time` from hour, minute, second and microsecond (`duckdb_time_struct`).
|
@@ -1377,7 +1380,7 @@ Re-compose a `duckdb_time` from hour, minute, second and microsecond (`duckdb_ti
|
|
1377
1380
|
* @param time The hour, minute, second and microsecond in a `duckdb_time_struct`.
|
1378
1381
|
* @return The `duckdb_time` element.
|
1379
1382
|
*/
|
1380
|
-
|
1383
|
+
DUCKDB_C_API duckdb_time duckdb_to_time(duckdb_time_struct time);
|
1381
1384
|
|
1382
1385
|
/*!
|
1383
1386
|
Decompose a `duckdb_timestamp` object into a `duckdb_timestamp_struct`.
|
@@ -1385,7 +1388,7 @@ Decompose a `duckdb_timestamp` object into a `duckdb_timestamp_struct`.
|
|
1385
1388
|
* @param ts The ts object, as obtained from a `DUCKDB_TYPE_TIMESTAMP` column.
|
1386
1389
|
* @return The `duckdb_timestamp_struct` with the decomposed elements.
|
1387
1390
|
*/
|
1388
|
-
|
1391
|
+
DUCKDB_C_API duckdb_timestamp_struct duckdb_from_timestamp(duckdb_timestamp ts);
|
1389
1392
|
|
1390
1393
|
/*!
|
1391
1394
|
Re-compose a `duckdb_timestamp` from a duckdb_timestamp_struct.
|
@@ -1393,7 +1396,7 @@ Re-compose a `duckdb_timestamp` from a duckdb_timestamp_struct.
|
|
1393
1396
|
* @param ts The de-composed elements in a `duckdb_timestamp_struct`.
|
1394
1397
|
* @return The `duckdb_timestamp` element.
|
1395
1398
|
*/
|
1396
|
-
|
1399
|
+
DUCKDB_C_API duckdb_timestamp duckdb_to_timestamp(duckdb_timestamp_struct ts);
|
1397
1400
|
|
1398
1401
|
/*!
|
1399
1402
|
Test a `duckdb_timestamp` to see if it is a finite value.
|
@@ -1401,7 +1404,7 @@ Test a `duckdb_timestamp` to see if it is a finite value.
|
|
1401
1404
|
* @param ts The duckdb_timestamp object, as obtained from a `DUCKDB_TYPE_TIMESTAMP` column.
|
1402
1405
|
* @return True if the timestamp is finite, false if it is ±infinity.
|
1403
1406
|
*/
|
1404
|
-
|
1407
|
+
DUCKDB_C_API bool duckdb_is_finite_timestamp(duckdb_timestamp ts);
|
1405
1408
|
|
1406
1409
|
/*!
|
1407
1410
|
Test a `duckdb_timestamp_s` to see if it is a finite value.
|
@@ -1409,7 +1412,7 @@ Test a `duckdb_timestamp_s` to see if it is a finite value.
|
|
1409
1412
|
* @param ts The duckdb_timestamp_s object, as obtained from a `DUCKDB_TYPE_TIMESTAMP_S` column.
|
1410
1413
|
* @return True if the timestamp is finite, false if it is ±infinity.
|
1411
1414
|
*/
|
1412
|
-
|
1415
|
+
DUCKDB_C_API bool duckdb_is_finite_timestamp_s(duckdb_timestamp_s ts);
|
1413
1416
|
|
1414
1417
|
/*!
|
1415
1418
|
Test a `duckdb_timestamp_ms` to see if it is a finite value.
|
@@ -1417,7 +1420,7 @@ Test a `duckdb_timestamp_ms` to see if it is a finite value.
|
|
1417
1420
|
* @param ts The duckdb_timestamp_ms object, as obtained from a `DUCKDB_TYPE_TIMESTAMP_MS` column.
|
1418
1421
|
* @return True if the timestamp is finite, false if it is ±infinity.
|
1419
1422
|
*/
|
1420
|
-
|
1423
|
+
DUCKDB_C_API bool duckdb_is_finite_timestamp_ms(duckdb_timestamp_ms ts);
|
1421
1424
|
|
1422
1425
|
/*!
|
1423
1426
|
Test a `duckdb_timestamp_ns` to see if it is a finite value.
|
@@ -1425,7 +1428,7 @@ Test a `duckdb_timestamp_ns` to see if it is a finite value.
|
|
1425
1428
|
* @param ts The duckdb_timestamp_ns object, as obtained from a `DUCKDB_TYPE_TIMESTAMP_NS` column.
|
1426
1429
|
* @return True if the timestamp is finite, false if it is ±infinity.
|
1427
1430
|
*/
|
1428
|
-
|
1431
|
+
DUCKDB_C_API bool duckdb_is_finite_timestamp_ns(duckdb_timestamp_ns ts);
|
1429
1432
|
|
1430
1433
|
//===--------------------------------------------------------------------===//
|
1431
1434
|
// Hugeint Helpers
|
@@ -1437,7 +1440,7 @@ Converts a duckdb_hugeint object (as obtained from a `DUCKDB_TYPE_HUGEINT` colum
|
|
1437
1440
|
* @param val The hugeint value.
|
1438
1441
|
* @return The converted `double` element.
|
1439
1442
|
*/
|
1440
|
-
|
1443
|
+
DUCKDB_C_API double duckdb_hugeint_to_double(duckdb_hugeint val);
|
1441
1444
|
|
1442
1445
|
/*!
|
1443
1446
|
Converts a double value to a duckdb_hugeint object.
|
@@ -1447,7 +1450,7 @@ If the conversion fails because the double value is too big the result will be 0
|
|
1447
1450
|
* @param val The double value.
|
1448
1451
|
* @return The converted `duckdb_hugeint` element.
|
1449
1452
|
*/
|
1450
|
-
|
1453
|
+
DUCKDB_C_API duckdb_hugeint duckdb_double_to_hugeint(double val);
|
1451
1454
|
|
1452
1455
|
//===--------------------------------------------------------------------===//
|
1453
1456
|
// Unsigned Hugeint Helpers
|
@@ -1459,7 +1462,7 @@ Converts a duckdb_uhugeint object (as obtained from a `DUCKDB_TYPE_UHUGEINT` col
|
|
1459
1462
|
* @param val The uhugeint value.
|
1460
1463
|
* @return The converted `double` element.
|
1461
1464
|
*/
|
1462
|
-
|
1465
|
+
DUCKDB_C_API double duckdb_uhugeint_to_double(duckdb_uhugeint val);
|
1463
1466
|
|
1464
1467
|
/*!
|
1465
1468
|
Converts a double value to a duckdb_uhugeint object.
|
@@ -1469,7 +1472,7 @@ If the conversion fails because the double value is too big the result will be 0
|
|
1469
1472
|
* @param val The double value.
|
1470
1473
|
* @return The converted `duckdb_uhugeint` element.
|
1471
1474
|
*/
|
1472
|
-
|
1475
|
+
DUCKDB_C_API duckdb_uhugeint duckdb_double_to_uhugeint(double val);
|
1473
1476
|
|
1474
1477
|
//===--------------------------------------------------------------------===//
|
1475
1478
|
// Decimal Helpers
|
@@ -1483,7 +1486,7 @@ If the conversion fails because the double value is too big, or the width/scale
|
|
1483
1486
|
* @param val The double value.
|
1484
1487
|
* @return The converted `duckdb_decimal` element.
|
1485
1488
|
*/
|
1486
|
-
|
1489
|
+
DUCKDB_C_API duckdb_decimal duckdb_double_to_decimal(double val, uint8_t width, uint8_t scale);
|
1487
1490
|
|
1488
1491
|
/*!
|
1489
1492
|
Converts a duckdb_decimal object (as obtained from a `DUCKDB_TYPE_DECIMAL` column) into a double.
|
@@ -1491,7 +1494,7 @@ Converts a duckdb_decimal object (as obtained from a `DUCKDB_TYPE_DECIMAL` colum
|
|
1491
1494
|
* @param val The decimal value.
|
1492
1495
|
* @return The converted `double` element.
|
1493
1496
|
*/
|
1494
|
-
|
1497
|
+
DUCKDB_C_API double duckdb_decimal_to_double(duckdb_decimal val);
|
1495
1498
|
|
1496
1499
|
//===--------------------------------------------------------------------===//
|
1497
1500
|
// Prepared Statements
|
@@ -1519,15 +1522,15 @@ If the prepare fails, `duckdb_prepare_error` can be called to obtain the reason
|
|
1519
1522
|
* @param out_prepared_statement The resulting prepared statement object
|
1520
1523
|
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
1521
1524
|
*/
|
1522
|
-
|
1523
|
-
|
1525
|
+
DUCKDB_C_API duckdb_state duckdb_prepare(duckdb_connection connection, const char *query,
|
1526
|
+
duckdb_prepared_statement *out_prepared_statement);
|
1524
1527
|
|
1525
1528
|
/*!
|
1526
1529
|
Closes the prepared statement and de-allocates all memory allocated for the statement.
|
1527
1530
|
|
1528
1531
|
* @param prepared_statement The prepared statement to destroy.
|
1529
1532
|
*/
|
1530
|
-
|
1533
|
+
DUCKDB_C_API void duckdb_destroy_prepare(duckdb_prepared_statement *prepared_statement);
|
1531
1534
|
|
1532
1535
|
/*!
|
1533
1536
|
Returns the error message associated with the given prepared statement.
|
@@ -1538,7 +1541,7 @@ The error message should not be freed. It will be de-allocated when `duckdb_dest
|
|
1538
1541
|
* @param prepared_statement The prepared statement to obtain the error from.
|
1539
1542
|
* @return The error message, or `nullptr` if there is none.
|
1540
1543
|
*/
|
1541
|
-
|
1544
|
+
DUCKDB_C_API const char *duckdb_prepare_error(duckdb_prepared_statement prepared_statement);
|
1542
1545
|
|
1543
1546
|
/*!
|
1544
1547
|
Returns the number of parameters that can be provided to the given prepared statement.
|
@@ -1547,7 +1550,7 @@ Returns 0 if the query was not successfully prepared.
|
|
1547
1550
|
|
1548
1551
|
* @param prepared_statement The prepared statement to obtain the number of parameters for.
|
1549
1552
|
*/
|
1550
|
-
|
1553
|
+
DUCKDB_C_API idx_t duckdb_nparams(duckdb_prepared_statement prepared_statement);
|
1551
1554
|
|
1552
1555
|
/*!
|
1553
1556
|
Returns the name used to identify the parameter
|
@@ -1557,7 +1560,7 @@ Returns NULL if the index is out of range for the provided prepared statement.
|
|
1557
1560
|
|
1558
1561
|
* @param prepared_statement The prepared statement for which to get the parameter name from.
|
1559
1562
|
*/
|
1560
|
-
|
1563
|
+
DUCKDB_C_API const char *duckdb_parameter_name(duckdb_prepared_statement prepared_statement, idx_t index);
|
1561
1564
|
|
1562
1565
|
/*!
|
1563
1566
|
Returns the parameter type for the parameter at the given index.
|
@@ -1568,7 +1571,7 @@ Returns `DUCKDB_TYPE_INVALID` if the parameter index is out of range or the stat
|
|
1568
1571
|
* @param param_idx The parameter index.
|
1569
1572
|
* @return The parameter type
|
1570
1573
|
*/
|
1571
|
-
|
1574
|
+
DUCKDB_C_API duckdb_type duckdb_param_type(duckdb_prepared_statement prepared_statement, idx_t param_idx);
|
1572
1575
|
|
1573
1576
|
/*!
|
1574
1577
|
Returns the logical type for the parameter at the given index.
|
@@ -1581,12 +1584,13 @@ The return type of this call should be destroyed with `duckdb_destroy_logical_ty
|
|
1581
1584
|
* @param param_idx The parameter index.
|
1582
1585
|
* @return The logical type of the parameter
|
1583
1586
|
*/
|
1584
|
-
|
1587
|
+
DUCKDB_C_API duckdb_logical_type duckdb_param_logical_type(duckdb_prepared_statement prepared_statement,
|
1588
|
+
idx_t param_idx);
|
1585
1589
|
|
1586
1590
|
/*!
|
1587
1591
|
Clear the params bind to the prepared statement.
|
1588
1592
|
*/
|
1589
|
-
|
1593
|
+
DUCKDB_C_API duckdb_state duckdb_clear_bindings(duckdb_prepared_statement prepared_statement);
|
1590
1594
|
|
1591
1595
|
/*!
|
1592
1596
|
Returns the statement type of the statement to be executed
|
@@ -1594,7 +1598,7 @@ Returns the statement type of the statement to be executed
|
|
1594
1598
|
* @param statement The prepared statement.
|
1595
1599
|
* @return duckdb_statement_type value or DUCKDB_STATEMENT_TYPE_INVALID
|
1596
1600
|
*/
|
1597
|
-
|
1601
|
+
DUCKDB_C_API duckdb_statement_type duckdb_prepared_statement_type(duckdb_prepared_statement statement);
|
1598
1602
|
|
1599
1603
|
//===--------------------------------------------------------------------===//
|
1600
1604
|
// Bind Values To Prepared Statements
|
@@ -1603,140 +1607,143 @@ DUCKDB_API duckdb_statement_type duckdb_prepared_statement_type(duckdb_prepared_
|
|
1603
1607
|
/*!
|
1604
1608
|
Binds a value to the prepared statement at the specified index.
|
1605
1609
|
*/
|
1606
|
-
|
1607
|
-
|
1610
|
+
DUCKDB_C_API duckdb_state duckdb_bind_value(duckdb_prepared_statement prepared_statement, idx_t param_idx,
|
1611
|
+
duckdb_value val);
|
1608
1612
|
|
1609
1613
|
/*!
|
1610
1614
|
Retrieve the index of the parameter for the prepared statement, identified by name
|
1611
1615
|
*/
|
1612
|
-
|
1613
|
-
|
1616
|
+
DUCKDB_C_API duckdb_state duckdb_bind_parameter_index(duckdb_prepared_statement prepared_statement,
|
1617
|
+
idx_t *param_idx_out, const char *name);
|
1614
1618
|
|
1615
1619
|
/*!
|
1616
1620
|
Binds a bool value to the prepared statement at the specified index.
|
1617
1621
|
*/
|
1618
|
-
|
1622
|
+
DUCKDB_C_API duckdb_state duckdb_bind_boolean(duckdb_prepared_statement prepared_statement, idx_t param_idx, bool val);
|
1619
1623
|
|
1620
1624
|
/*!
|
1621
1625
|
Binds an int8_t value to the prepared statement at the specified index.
|
1622
1626
|
*/
|
1623
|
-
|
1627
|
+
DUCKDB_C_API duckdb_state duckdb_bind_int8(duckdb_prepared_statement prepared_statement, idx_t param_idx, int8_t val);
|
1624
1628
|
|
1625
1629
|
/*!
|
1626
1630
|
Binds an int16_t value to the prepared statement at the specified index.
|
1627
1631
|
*/
|
1628
|
-
|
1632
|
+
DUCKDB_C_API duckdb_state duckdb_bind_int16(duckdb_prepared_statement prepared_statement, idx_t param_idx, int16_t val);
|
1629
1633
|
|
1630
1634
|
/*!
|
1631
1635
|
Binds an int32_t value to the prepared statement at the specified index.
|
1632
1636
|
*/
|
1633
|
-
|
1637
|
+
DUCKDB_C_API duckdb_state duckdb_bind_int32(duckdb_prepared_statement prepared_statement, idx_t param_idx, int32_t val);
|
1634
1638
|
|
1635
1639
|
/*!
|
1636
1640
|
Binds an int64_t value to the prepared statement at the specified index.
|
1637
1641
|
*/
|
1638
|
-
|
1642
|
+
DUCKDB_C_API duckdb_state duckdb_bind_int64(duckdb_prepared_statement prepared_statement, idx_t param_idx, int64_t val);
|
1639
1643
|
|
1640
1644
|
/*!
|
1641
1645
|
Binds a duckdb_hugeint value to the prepared statement at the specified index.
|
1642
1646
|
*/
|
1643
|
-
|
1644
|
-
|
1647
|
+
DUCKDB_C_API duckdb_state duckdb_bind_hugeint(duckdb_prepared_statement prepared_statement, idx_t param_idx,
|
1648
|
+
duckdb_hugeint val);
|
1645
1649
|
|
1646
1650
|
/*!
|
1647
1651
|
Binds an duckdb_uhugeint value to the prepared statement at the specified index.
|
1648
1652
|
*/
|
1649
|
-
|
1650
|
-
|
1653
|
+
DUCKDB_C_API duckdb_state duckdb_bind_uhugeint(duckdb_prepared_statement prepared_statement, idx_t param_idx,
|
1654
|
+
duckdb_uhugeint val);
|
1651
1655
|
|
1652
1656
|
/*!
|
1653
1657
|
Binds a duckdb_decimal value to the prepared statement at the specified index.
|
1654
1658
|
*/
|
1655
|
-
|
1656
|
-
|
1659
|
+
DUCKDB_C_API duckdb_state duckdb_bind_decimal(duckdb_prepared_statement prepared_statement, idx_t param_idx,
|
1660
|
+
duckdb_decimal val);
|
1657
1661
|
|
1658
1662
|
/*!
|
1659
1663
|
Binds an uint8_t value to the prepared statement at the specified index.
|
1660
1664
|
*/
|
1661
|
-
|
1665
|
+
DUCKDB_C_API duckdb_state duckdb_bind_uint8(duckdb_prepared_statement prepared_statement, idx_t param_idx, uint8_t val);
|
1662
1666
|
|
1663
1667
|
/*!
|
1664
1668
|
Binds an uint16_t value to the prepared statement at the specified index.
|
1665
1669
|
*/
|
1666
|
-
|
1670
|
+
DUCKDB_C_API duckdb_state duckdb_bind_uint16(duckdb_prepared_statement prepared_statement, idx_t param_idx,
|
1671
|
+
uint16_t val);
|
1667
1672
|
|
1668
1673
|
/*!
|
1669
1674
|
Binds an uint32_t value to the prepared statement at the specified index.
|
1670
1675
|
*/
|
1671
|
-
|
1676
|
+
DUCKDB_C_API duckdb_state duckdb_bind_uint32(duckdb_prepared_statement prepared_statement, idx_t param_idx,
|
1677
|
+
uint32_t val);
|
1672
1678
|
|
1673
1679
|
/*!
|
1674
1680
|
Binds an uint64_t value to the prepared statement at the specified index.
|
1675
1681
|
*/
|
1676
|
-
|
1682
|
+
DUCKDB_C_API duckdb_state duckdb_bind_uint64(duckdb_prepared_statement prepared_statement, idx_t param_idx,
|
1683
|
+
uint64_t val);
|
1677
1684
|
|
1678
1685
|
/*!
|
1679
1686
|
Binds a float value to the prepared statement at the specified index.
|
1680
1687
|
*/
|
1681
|
-
|
1688
|
+
DUCKDB_C_API duckdb_state duckdb_bind_float(duckdb_prepared_statement prepared_statement, idx_t param_idx, float val);
|
1682
1689
|
|
1683
1690
|
/*!
|
1684
1691
|
Binds a double value to the prepared statement at the specified index.
|
1685
1692
|
*/
|
1686
|
-
|
1693
|
+
DUCKDB_C_API duckdb_state duckdb_bind_double(duckdb_prepared_statement prepared_statement, idx_t param_idx, double val);
|
1687
1694
|
|
1688
1695
|
/*!
|
1689
1696
|
Binds a duckdb_date value to the prepared statement at the specified index.
|
1690
1697
|
*/
|
1691
|
-
|
1692
|
-
|
1698
|
+
DUCKDB_C_API duckdb_state duckdb_bind_date(duckdb_prepared_statement prepared_statement, idx_t param_idx,
|
1699
|
+
duckdb_date val);
|
1693
1700
|
|
1694
1701
|
/*!
|
1695
1702
|
Binds a duckdb_time value to the prepared statement at the specified index.
|
1696
1703
|
*/
|
1697
|
-
|
1698
|
-
|
1704
|
+
DUCKDB_C_API duckdb_state duckdb_bind_time(duckdb_prepared_statement prepared_statement, idx_t param_idx,
|
1705
|
+
duckdb_time val);
|
1699
1706
|
|
1700
1707
|
/*!
|
1701
1708
|
Binds a duckdb_timestamp value to the prepared statement at the specified index.
|
1702
1709
|
*/
|
1703
|
-
|
1704
|
-
|
1710
|
+
DUCKDB_C_API duckdb_state duckdb_bind_timestamp(duckdb_prepared_statement prepared_statement, idx_t param_idx,
|
1711
|
+
duckdb_timestamp val);
|
1705
1712
|
|
1706
1713
|
/*!
|
1707
1714
|
Binds a duckdb_timestamp value to the prepared statement at the specified index.
|
1708
1715
|
*/
|
1709
|
-
|
1710
|
-
|
1716
|
+
DUCKDB_C_API duckdb_state duckdb_bind_timestamp_tz(duckdb_prepared_statement prepared_statement, idx_t param_idx,
|
1717
|
+
duckdb_timestamp val);
|
1711
1718
|
|
1712
1719
|
/*!
|
1713
1720
|
Binds a duckdb_interval value to the prepared statement at the specified index.
|
1714
1721
|
*/
|
1715
|
-
|
1716
|
-
|
1722
|
+
DUCKDB_C_API duckdb_state duckdb_bind_interval(duckdb_prepared_statement prepared_statement, idx_t param_idx,
|
1723
|
+
duckdb_interval val);
|
1717
1724
|
|
1718
1725
|
/*!
|
1719
1726
|
Binds a null-terminated varchar value to the prepared statement at the specified index.
|
1720
1727
|
*/
|
1721
|
-
|
1722
|
-
|
1728
|
+
DUCKDB_C_API duckdb_state duckdb_bind_varchar(duckdb_prepared_statement prepared_statement, idx_t param_idx,
|
1729
|
+
const char *val);
|
1723
1730
|
|
1724
1731
|
/*!
|
1725
1732
|
Binds a varchar value to the prepared statement at the specified index.
|
1726
1733
|
*/
|
1727
|
-
|
1728
|
-
|
1734
|
+
DUCKDB_C_API duckdb_state duckdb_bind_varchar_length(duckdb_prepared_statement prepared_statement, idx_t param_idx,
|
1735
|
+
const char *val, idx_t length);
|
1729
1736
|
|
1730
1737
|
/*!
|
1731
1738
|
Binds a blob value to the prepared statement at the specified index.
|
1732
1739
|
*/
|
1733
|
-
|
1734
|
-
|
1740
|
+
DUCKDB_C_API duckdb_state duckdb_bind_blob(duckdb_prepared_statement prepared_statement, idx_t param_idx,
|
1741
|
+
const void *data, idx_t length);
|
1735
1742
|
|
1736
1743
|
/*!
|
1737
1744
|
Binds a NULL value to the prepared statement at the specified index.
|
1738
1745
|
*/
|
1739
|
-
|
1746
|
+
DUCKDB_C_API duckdb_state duckdb_bind_null(duckdb_prepared_statement prepared_statement, idx_t param_idx);
|
1740
1747
|
|
1741
1748
|
//===--------------------------------------------------------------------===//
|
1742
1749
|
// Execute Prepared Statements
|
@@ -1754,8 +1761,8 @@ Note that the result must be freed with `duckdb_destroy_result`.
|
|
1754
1761
|
* @param out_result The query result.
|
1755
1762
|
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
1756
1763
|
*/
|
1757
|
-
|
1758
|
-
|
1764
|
+
DUCKDB_C_API duckdb_state duckdb_execute_prepared(duckdb_prepared_statement prepared_statement,
|
1765
|
+
duckdb_result *out_result);
|
1759
1766
|
|
1760
1767
|
#ifndef DUCKDB_API_NO_DEPRECATED
|
1761
1768
|
/*!
|
@@ -1773,8 +1780,8 @@ Note that the result must be freed with `duckdb_destroy_result`.
|
|
1773
1780
|
* @param out_result The query result.
|
1774
1781
|
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
1775
1782
|
*/
|
1776
|
-
|
1777
|
-
|
1783
|
+
DUCKDB_C_API duckdb_state duckdb_execute_prepared_streaming(duckdb_prepared_statement prepared_statement,
|
1784
|
+
duckdb_result *out_result);
|
1778
1785
|
|
1779
1786
|
#endif
|
1780
1787
|
//===--------------------------------------------------------------------===//
|
@@ -1794,8 +1801,8 @@ If the extract fails, `duckdb_extract_statements_error` can be called to obtain
|
|
1794
1801
|
* @param out_extracted_statements The resulting extracted statements object
|
1795
1802
|
* @return The number of extracted statements or 0 on failure.
|
1796
1803
|
*/
|
1797
|
-
|
1798
|
-
|
1804
|
+
DUCKDB_C_API idx_t duckdb_extract_statements(duckdb_connection connection, const char *query,
|
1805
|
+
duckdb_extracted_statements *out_extracted_statements);
|
1799
1806
|
|
1800
1807
|
/*!
|
1801
1808
|
Prepare an extracted statement.
|
@@ -1810,10 +1817,10 @@ If the prepare fails, `duckdb_prepare_error` can be called to obtain the reason
|
|
1810
1817
|
* @param out_prepared_statement The resulting prepared statement object
|
1811
1818
|
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
1812
1819
|
*/
|
1813
|
-
|
1814
|
-
|
1815
|
-
|
1816
|
-
|
1820
|
+
DUCKDB_C_API duckdb_state duckdb_prepare_extracted_statement(duckdb_connection connection,
|
1821
|
+
duckdb_extracted_statements extracted_statements,
|
1822
|
+
idx_t index,
|
1823
|
+
duckdb_prepared_statement *out_prepared_statement);
|
1817
1824
|
|
1818
1825
|
/*!
|
1819
1826
|
Returns the error message contained within the extracted statements.
|
@@ -1822,13 +1829,13 @@ The result of this function must not be freed. It will be cleaned up when `duckd
|
|
1822
1829
|
* @param extracted_statements The extracted statements to fetch the error from.
|
1823
1830
|
* @return The error of the extracted statements.
|
1824
1831
|
*/
|
1825
|
-
|
1832
|
+
DUCKDB_C_API const char *duckdb_extract_statements_error(duckdb_extracted_statements extracted_statements);
|
1826
1833
|
|
1827
1834
|
/*!
|
1828
1835
|
De-allocates all memory allocated for the extracted statements.
|
1829
1836
|
* @param extracted_statements The extracted statements to destroy.
|
1830
1837
|
*/
|
1831
|
-
|
1838
|
+
DUCKDB_C_API void duckdb_destroy_extracted(duckdb_extracted_statements *extracted_statements);
|
1832
1839
|
|
1833
1840
|
//===--------------------------------------------------------------------===//
|
1834
1841
|
// Pending Result Interface
|
@@ -1846,8 +1853,8 @@ Note that after calling `duckdb_pending_prepared`, the pending result should alw
|
|
1846
1853
|
* @param out_result The pending query result.
|
1847
1854
|
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
1848
1855
|
*/
|
1849
|
-
|
1850
|
-
|
1856
|
+
DUCKDB_C_API duckdb_state duckdb_pending_prepared(duckdb_prepared_statement prepared_statement,
|
1857
|
+
duckdb_pending_result *out_result);
|
1851
1858
|
|
1852
1859
|
#ifndef DUCKDB_API_NO_DEPRECATED
|
1853
1860
|
/*!
|
@@ -1864,8 +1871,8 @@ Note that after calling `duckdb_pending_prepared_streaming`, the pending result
|
|
1864
1871
|
* @param out_result The pending query result.
|
1865
1872
|
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
1866
1873
|
*/
|
1867
|
-
|
1868
|
-
|
1874
|
+
DUCKDB_C_API duckdb_state duckdb_pending_prepared_streaming(duckdb_prepared_statement prepared_statement,
|
1875
|
+
duckdb_pending_result *out_result);
|
1869
1876
|
|
1870
1877
|
#endif
|
1871
1878
|
/*!
|
@@ -1873,7 +1880,7 @@ Closes the pending result and de-allocates all memory allocated for the result.
|
|
1873
1880
|
|
1874
1881
|
* @param pending_result The pending result to destroy.
|
1875
1882
|
*/
|
1876
|
-
|
1883
|
+
DUCKDB_C_API void duckdb_destroy_pending(duckdb_pending_result *pending_result);
|
1877
1884
|
|
1878
1885
|
/*!
|
1879
1886
|
Returns the error message contained within the pending result.
|
@@ -1883,7 +1890,7 @@ The result of this function must not be freed. It will be cleaned up when `duckd
|
|
1883
1890
|
* @param pending_result The pending result to fetch the error from.
|
1884
1891
|
* @return The error of the pending result.
|
1885
1892
|
*/
|
1886
|
-
|
1893
|
+
DUCKDB_C_API const char *duckdb_pending_error(duckdb_pending_result pending_result);
|
1887
1894
|
|
1888
1895
|
/*!
|
1889
1896
|
Executes a single task within the query, returning whether or not the query is ready.
|
@@ -1897,7 +1904,7 @@ The error message can be obtained by calling duckdb_pending_error on the pending
|
|
1897
1904
|
* @param pending_result The pending result to execute a task within.
|
1898
1905
|
* @return The state of the pending result after the execution.
|
1899
1906
|
*/
|
1900
|
-
|
1907
|
+
DUCKDB_C_API duckdb_pending_state duckdb_pending_execute_task(duckdb_pending_result pending_result);
|
1901
1908
|
|
1902
1909
|
/*!
|
1903
1910
|
If this returns DUCKDB_PENDING_RESULT_READY, the duckdb_execute_pending function can be called to obtain the result.
|
@@ -1909,7 +1916,7 @@ The error message can be obtained by calling duckdb_pending_error on the pending
|
|
1909
1916
|
* @param pending_result The pending result.
|
1910
1917
|
* @return The state of the pending result.
|
1911
1918
|
*/
|
1912
|
-
|
1919
|
+
DUCKDB_C_API duckdb_pending_state duckdb_pending_execute_check_state(duckdb_pending_result pending_result);
|
1913
1920
|
|
1914
1921
|
/*!
|
1915
1922
|
Fully execute a pending query result, returning the final query result.
|
@@ -1923,7 +1930,7 @@ Note that the result must be freed with `duckdb_destroy_result`.
|
|
1923
1930
|
* @param out_result The result object.
|
1924
1931
|
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
1925
1932
|
*/
|
1926
|
-
|
1933
|
+
DUCKDB_C_API duckdb_state duckdb_execute_pending(duckdb_pending_result pending_result, duckdb_result *out_result);
|
1927
1934
|
|
1928
1935
|
/*!
|
1929
1936
|
Returns whether a duckdb_pending_state is finished executing. For example if `pending_state` is
|
@@ -1932,7 +1939,7 @@ DUCKDB_PENDING_RESULT_READY, this function will return true.
|
|
1932
1939
|
* @param pending_state The pending state on which to decide whether to finish execution.
|
1933
1940
|
* @return Boolean indicating pending execution should be considered finished.
|
1934
1941
|
*/
|
1935
|
-
|
1942
|
+
DUCKDB_C_API bool duckdb_pending_execution_is_finished(duckdb_pending_state pending_state);
|
1936
1943
|
|
1937
1944
|
//===--------------------------------------------------------------------===//
|
1938
1945
|
// Value Interface
|
@@ -1943,7 +1950,7 @@ Destroys the value and de-allocates all memory allocated for that type.
|
|
1943
1950
|
|
1944
1951
|
* @param value The value to destroy.
|
1945
1952
|
*/
|
1946
|
-
|
1953
|
+
DUCKDB_C_API void duckdb_destroy_value(duckdb_value *value);
|
1947
1954
|
|
1948
1955
|
/*!
|
1949
1956
|
Creates a value from a null-terminated string
|
@@ -1951,7 +1958,7 @@ Creates a value from a null-terminated string
|
|
1951
1958
|
* @param text The null-terminated string
|
1952
1959
|
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
1953
1960
|
*/
|
1954
|
-
|
1961
|
+
DUCKDB_C_API duckdb_value duckdb_create_varchar(const char *text);
|
1955
1962
|
|
1956
1963
|
/*!
|
1957
1964
|
Creates a value from a string
|
@@ -1960,7 +1967,7 @@ Creates a value from a string
|
|
1960
1967
|
* @param length The length of the text
|
1961
1968
|
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
1962
1969
|
*/
|
1963
|
-
|
1970
|
+
DUCKDB_C_API duckdb_value duckdb_create_varchar_length(const char *text, idx_t length);
|
1964
1971
|
|
1965
1972
|
/*!
|
1966
1973
|
Creates a value from a boolean
|
@@ -1968,7 +1975,7 @@ Creates a value from a boolean
|
|
1968
1975
|
* @param input The boolean value
|
1969
1976
|
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
1970
1977
|
*/
|
1971
|
-
|
1978
|
+
DUCKDB_C_API duckdb_value duckdb_create_bool(bool input);
|
1972
1979
|
|
1973
1980
|
/*!
|
1974
1981
|
Creates a value from a int8_t (a tinyint)
|
@@ -1976,7 +1983,7 @@ Creates a value from a int8_t (a tinyint)
|
|
1976
1983
|
* @param input The tinyint value
|
1977
1984
|
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
1978
1985
|
*/
|
1979
|
-
|
1986
|
+
DUCKDB_C_API duckdb_value duckdb_create_int8(int8_t input);
|
1980
1987
|
|
1981
1988
|
/*!
|
1982
1989
|
Creates a value from a uint8_t (a utinyint)
|
@@ -1984,7 +1991,7 @@ Creates a value from a uint8_t (a utinyint)
|
|
1984
1991
|
* @param input The utinyint value
|
1985
1992
|
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
1986
1993
|
*/
|
1987
|
-
|
1994
|
+
DUCKDB_C_API duckdb_value duckdb_create_uint8(uint8_t input);
|
1988
1995
|
|
1989
1996
|
/*!
|
1990
1997
|
Creates a value from a int16_t (a smallint)
|
@@ -1992,7 +1999,7 @@ Creates a value from a int16_t (a smallint)
|
|
1992
1999
|
* @param input The smallint value
|
1993
2000
|
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
1994
2001
|
*/
|
1995
|
-
|
2002
|
+
DUCKDB_C_API duckdb_value duckdb_create_int16(int16_t input);
|
1996
2003
|
|
1997
2004
|
/*!
|
1998
2005
|
Creates a value from a uint16_t (a usmallint)
|
@@ -2000,7 +2007,7 @@ Creates a value from a uint16_t (a usmallint)
|
|
2000
2007
|
* @param input The usmallint value
|
2001
2008
|
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
2002
2009
|
*/
|
2003
|
-
|
2010
|
+
DUCKDB_C_API duckdb_value duckdb_create_uint16(uint16_t input);
|
2004
2011
|
|
2005
2012
|
/*!
|
2006
2013
|
Creates a value from a int32_t (an integer)
|
@@ -2008,7 +2015,7 @@ Creates a value from a int32_t (an integer)
|
|
2008
2015
|
* @param input The integer value
|
2009
2016
|
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
2010
2017
|
*/
|
2011
|
-
|
2018
|
+
DUCKDB_C_API duckdb_value duckdb_create_int32(int32_t input);
|
2012
2019
|
|
2013
2020
|
/*!
|
2014
2021
|
Creates a value from a uint32_t (a uinteger)
|
@@ -2016,7 +2023,7 @@ Creates a value from a uint32_t (a uinteger)
|
|
2016
2023
|
* @param input The uinteger value
|
2017
2024
|
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
2018
2025
|
*/
|
2019
|
-
|
2026
|
+
DUCKDB_C_API duckdb_value duckdb_create_uint32(uint32_t input);
|
2020
2027
|
|
2021
2028
|
/*!
|
2022
2029
|
Creates a value from a uint64_t (a ubigint)
|
@@ -2024,14 +2031,14 @@ Creates a value from a uint64_t (a ubigint)
|
|
2024
2031
|
* @param input The ubigint value
|
2025
2032
|
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
2026
2033
|
*/
|
2027
|
-
|
2034
|
+
DUCKDB_C_API duckdb_value duckdb_create_uint64(uint64_t input);
|
2028
2035
|
|
2029
2036
|
/*!
|
2030
2037
|
Creates a value from an int64
|
2031
2038
|
|
2032
2039
|
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
2033
2040
|
*/
|
2034
|
-
|
2041
|
+
DUCKDB_C_API duckdb_value duckdb_create_int64(int64_t val);
|
2035
2042
|
|
2036
2043
|
/*!
|
2037
2044
|
Creates a value from a hugeint
|
@@ -2039,7 +2046,7 @@ Creates a value from a hugeint
|
|
2039
2046
|
* @param input The hugeint value
|
2040
2047
|
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
2041
2048
|
*/
|
2042
|
-
|
2049
|
+
DUCKDB_C_API duckdb_value duckdb_create_hugeint(duckdb_hugeint input);
|
2043
2050
|
|
2044
2051
|
/*!
|
2045
2052
|
Creates a value from a uhugeint
|
@@ -2047,7 +2054,7 @@ Creates a value from a uhugeint
|
|
2047
2054
|
* @param input The uhugeint value
|
2048
2055
|
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
2049
2056
|
*/
|
2050
|
-
|
2057
|
+
DUCKDB_C_API duckdb_value duckdb_create_uhugeint(duckdb_uhugeint input);
|
2051
2058
|
|
2052
2059
|
/*!
|
2053
2060
|
Creates a VARINT value from a duckdb_varint
|
@@ -2055,7 +2062,7 @@ Creates a VARINT value from a duckdb_varint
|
|
2055
2062
|
* @param input The duckdb_varint value
|
2056
2063
|
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
2057
2064
|
*/
|
2058
|
-
|
2065
|
+
DUCKDB_C_API duckdb_value duckdb_create_varint(duckdb_varint input);
|
2059
2066
|
|
2060
2067
|
/*!
|
2061
2068
|
Creates a DECIMAL value from a duckdb_decimal
|
@@ -2063,7 +2070,7 @@ Creates a DECIMAL value from a duckdb_decimal
|
|
2063
2070
|
* @param input The duckdb_decimal value
|
2064
2071
|
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
2065
2072
|
*/
|
2066
|
-
|
2073
|
+
DUCKDB_C_API duckdb_value duckdb_create_decimal(duckdb_decimal input);
|
2067
2074
|
|
2068
2075
|
/*!
|
2069
2076
|
Creates a value from a float
|
@@ -2071,7 +2078,7 @@ Creates a value from a float
|
|
2071
2078
|
* @param input The float value
|
2072
2079
|
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
2073
2080
|
*/
|
2074
|
-
|
2081
|
+
DUCKDB_C_API duckdb_value duckdb_create_float(float input);
|
2075
2082
|
|
2076
2083
|
/*!
|
2077
2084
|
Creates a value from a double
|
@@ -2079,7 +2086,7 @@ Creates a value from a double
|
|
2079
2086
|
* @param input The double value
|
2080
2087
|
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
2081
2088
|
*/
|
2082
|
-
|
2089
|
+
DUCKDB_C_API duckdb_value duckdb_create_double(double input);
|
2083
2090
|
|
2084
2091
|
/*!
|
2085
2092
|
Creates a value from a date
|
@@ -2087,7 +2094,7 @@ Creates a value from a date
|
|
2087
2094
|
* @param input The date value
|
2088
2095
|
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
2089
2096
|
*/
|
2090
|
-
|
2097
|
+
DUCKDB_C_API duckdb_value duckdb_create_date(duckdb_date input);
|
2091
2098
|
|
2092
2099
|
/*!
|
2093
2100
|
Creates a value from a time
|
@@ -2095,7 +2102,7 @@ Creates a value from a time
|
|
2095
2102
|
* @param input The time value
|
2096
2103
|
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
2097
2104
|
*/
|
2098
|
-
|
2105
|
+
DUCKDB_C_API duckdb_value duckdb_create_time(duckdb_time input);
|
2099
2106
|
|
2100
2107
|
/*!
|
2101
2108
|
Creates a value from a time_tz.
|
@@ -2104,7 +2111,7 @@ Not to be confused with `duckdb_create_time_tz`, which creates a duckdb_time_tz_
|
|
2104
2111
|
* @param value The time_tz value
|
2105
2112
|
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
2106
2113
|
*/
|
2107
|
-
|
2114
|
+
DUCKDB_C_API duckdb_value duckdb_create_time_tz_value(duckdb_time_tz value);
|
2108
2115
|
|
2109
2116
|
/*!
|
2110
2117
|
Creates a TIMESTAMP value from a duckdb_timestamp
|
@@ -2112,7 +2119,7 @@ Creates a TIMESTAMP value from a duckdb_timestamp
|
|
2112
2119
|
* @param input The duckdb_timestamp value
|
2113
2120
|
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
2114
2121
|
*/
|
2115
|
-
|
2122
|
+
DUCKDB_C_API duckdb_value duckdb_create_timestamp(duckdb_timestamp input);
|
2116
2123
|
|
2117
2124
|
/*!
|
2118
2125
|
Creates a TIMESTAMP_TZ value from a duckdb_timestamp
|
@@ -2120,7 +2127,7 @@ Creates a TIMESTAMP_TZ value from a duckdb_timestamp
|
|
2120
2127
|
* @param input The duckdb_timestamp value
|
2121
2128
|
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
2122
2129
|
*/
|
2123
|
-
|
2130
|
+
DUCKDB_C_API duckdb_value duckdb_create_timestamp_tz(duckdb_timestamp input);
|
2124
2131
|
|
2125
2132
|
/*!
|
2126
2133
|
Creates a TIMESTAMP_S value from a duckdb_timestamp_s
|
@@ -2128,7 +2135,7 @@ Creates a TIMESTAMP_S value from a duckdb_timestamp_s
|
|
2128
2135
|
* @param input The duckdb_timestamp_s value
|
2129
2136
|
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
2130
2137
|
*/
|
2131
|
-
|
2138
|
+
DUCKDB_C_API duckdb_value duckdb_create_timestamp_s(duckdb_timestamp_s input);
|
2132
2139
|
|
2133
2140
|
/*!
|
2134
2141
|
Creates a TIMESTAMP_MS value from a duckdb_timestamp_ms
|
@@ -2136,7 +2143,7 @@ Creates a TIMESTAMP_MS value from a duckdb_timestamp_ms
|
|
2136
2143
|
* @param input The duckdb_timestamp_ms value
|
2137
2144
|
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
2138
2145
|
*/
|
2139
|
-
|
2146
|
+
DUCKDB_C_API duckdb_value duckdb_create_timestamp_ms(duckdb_timestamp_ms input);
|
2140
2147
|
|
2141
2148
|
/*!
|
2142
2149
|
Creates a TIMESTAMP_NS value from a duckdb_timestamp_ns
|
@@ -2144,7 +2151,7 @@ Creates a TIMESTAMP_NS value from a duckdb_timestamp_ns
|
|
2144
2151
|
* @param input The duckdb_timestamp_ns value
|
2145
2152
|
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
2146
2153
|
*/
|
2147
|
-
|
2154
|
+
DUCKDB_C_API duckdb_value duckdb_create_timestamp_ns(duckdb_timestamp_ns input);
|
2148
2155
|
|
2149
2156
|
/*!
|
2150
2157
|
Creates a value from an interval
|
@@ -2152,7 +2159,7 @@ Creates a value from an interval
|
|
2152
2159
|
* @param input The interval value
|
2153
2160
|
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
2154
2161
|
*/
|
2155
|
-
|
2162
|
+
DUCKDB_C_API duckdb_value duckdb_create_interval(duckdb_interval input);
|
2156
2163
|
|
2157
2164
|
/*!
|
2158
2165
|
Creates a value from a blob
|
@@ -2161,7 +2168,7 @@ Creates a value from a blob
|
|
2161
2168
|
* @param length The length of the blob data
|
2162
2169
|
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
2163
2170
|
*/
|
2164
|
-
|
2171
|
+
DUCKDB_C_API duckdb_value duckdb_create_blob(const uint8_t *data, idx_t length);
|
2165
2172
|
|
2166
2173
|
/*!
|
2167
2174
|
Creates a BIT value from a duckdb_bit
|
@@ -2169,7 +2176,7 @@ Creates a BIT value from a duckdb_bit
|
|
2169
2176
|
* @param input The duckdb_bit value
|
2170
2177
|
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
2171
2178
|
*/
|
2172
|
-
|
2179
|
+
DUCKDB_C_API duckdb_value duckdb_create_bit(duckdb_bit input);
|
2173
2180
|
|
2174
2181
|
/*!
|
2175
2182
|
Creates a UUID value from a uhugeint
|
@@ -2177,7 +2184,7 @@ Creates a UUID value from a uhugeint
|
|
2177
2184
|
* @param input The duckdb_uhugeint containing the UUID
|
2178
2185
|
* @return The value. This must be destroyed with `duckdb_destroy_value`.
|
2179
2186
|
*/
|
2180
|
-
|
2187
|
+
DUCKDB_C_API duckdb_value duckdb_create_uuid(duckdb_uhugeint input);
|
2181
2188
|
|
2182
2189
|
/*!
|
2183
2190
|
Returns the boolean value of the given value.
|
@@ -2185,7 +2192,7 @@ Returns the boolean value of the given value.
|
|
2185
2192
|
* @param val A duckdb_value containing a boolean
|
2186
2193
|
* @return A boolean, or false if the value cannot be converted
|
2187
2194
|
*/
|
2188
|
-
|
2195
|
+
DUCKDB_C_API bool duckdb_get_bool(duckdb_value val);
|
2189
2196
|
|
2190
2197
|
/*!
|
2191
2198
|
Returns the int8_t value of the given value.
|
@@ -2193,7 +2200,7 @@ Returns the int8_t value of the given value.
|
|
2193
2200
|
* @param val A duckdb_value containing a tinyint
|
2194
2201
|
* @return A int8_t, or MinValue<int8> if the value cannot be converted
|
2195
2202
|
*/
|
2196
|
-
|
2203
|
+
DUCKDB_C_API int8_t duckdb_get_int8(duckdb_value val);
|
2197
2204
|
|
2198
2205
|
/*!
|
2199
2206
|
Returns the uint8_t value of the given value.
|
@@ -2201,7 +2208,7 @@ Returns the uint8_t value of the given value.
|
|
2201
2208
|
* @param val A duckdb_value containing a utinyint
|
2202
2209
|
* @return A uint8_t, or MinValue<uint8> if the value cannot be converted
|
2203
2210
|
*/
|
2204
|
-
|
2211
|
+
DUCKDB_C_API uint8_t duckdb_get_uint8(duckdb_value val);
|
2205
2212
|
|
2206
2213
|
/*!
|
2207
2214
|
Returns the int16_t value of the given value.
|
@@ -2209,7 +2216,7 @@ Returns the int16_t value of the given value.
|
|
2209
2216
|
* @param val A duckdb_value containing a smallint
|
2210
2217
|
* @return A int16_t, or MinValue<int16> if the value cannot be converted
|
2211
2218
|
*/
|
2212
|
-
|
2219
|
+
DUCKDB_C_API int16_t duckdb_get_int16(duckdb_value val);
|
2213
2220
|
|
2214
2221
|
/*!
|
2215
2222
|
Returns the uint16_t value of the given value.
|
@@ -2217,7 +2224,7 @@ Returns the uint16_t value of the given value.
|
|
2217
2224
|
* @param val A duckdb_value containing a usmallint
|
2218
2225
|
* @return A uint16_t, or MinValue<uint16> if the value cannot be converted
|
2219
2226
|
*/
|
2220
|
-
|
2227
|
+
DUCKDB_C_API uint16_t duckdb_get_uint16(duckdb_value val);
|
2221
2228
|
|
2222
2229
|
/*!
|
2223
2230
|
Returns the int32_t value of the given value.
|
@@ -2225,7 +2232,7 @@ Returns the int32_t value of the given value.
|
|
2225
2232
|
* @param val A duckdb_value containing a integer
|
2226
2233
|
* @return A int32_t, or MinValue<int32> if the value cannot be converted
|
2227
2234
|
*/
|
2228
|
-
|
2235
|
+
DUCKDB_C_API int32_t duckdb_get_int32(duckdb_value val);
|
2229
2236
|
|
2230
2237
|
/*!
|
2231
2238
|
Returns the uint32_t value of the given value.
|
@@ -2233,7 +2240,7 @@ Returns the uint32_t value of the given value.
|
|
2233
2240
|
* @param val A duckdb_value containing a uinteger
|
2234
2241
|
* @return A uint32_t, or MinValue<uint32> if the value cannot be converted
|
2235
2242
|
*/
|
2236
|
-
|
2243
|
+
DUCKDB_C_API uint32_t duckdb_get_uint32(duckdb_value val);
|
2237
2244
|
|
2238
2245
|
/*!
|
2239
2246
|
Returns the int64_t value of the given value.
|
@@ -2241,7 +2248,7 @@ Returns the int64_t value of the given value.
|
|
2241
2248
|
* @param val A duckdb_value containing a bigint
|
2242
2249
|
* @return A int64_t, or MinValue<int64> if the value cannot be converted
|
2243
2250
|
*/
|
2244
|
-
|
2251
|
+
DUCKDB_C_API int64_t duckdb_get_int64(duckdb_value val);
|
2245
2252
|
|
2246
2253
|
/*!
|
2247
2254
|
Returns the uint64_t value of the given value.
|
@@ -2249,7 +2256,7 @@ Returns the uint64_t value of the given value.
|
|
2249
2256
|
* @param val A duckdb_value containing a ubigint
|
2250
2257
|
* @return A uint64_t, or MinValue<uint64> if the value cannot be converted
|
2251
2258
|
*/
|
2252
|
-
|
2259
|
+
DUCKDB_C_API uint64_t duckdb_get_uint64(duckdb_value val);
|
2253
2260
|
|
2254
2261
|
/*!
|
2255
2262
|
Returns the hugeint value of the given value.
|
@@ -2257,7 +2264,7 @@ Returns the hugeint value of the given value.
|
|
2257
2264
|
* @param val A duckdb_value containing a hugeint
|
2258
2265
|
* @return A duckdb_hugeint, or MinValue<hugeint> if the value cannot be converted
|
2259
2266
|
*/
|
2260
|
-
|
2267
|
+
DUCKDB_C_API duckdb_hugeint duckdb_get_hugeint(duckdb_value val);
|
2261
2268
|
|
2262
2269
|
/*!
|
2263
2270
|
Returns the uhugeint value of the given value.
|
@@ -2265,7 +2272,7 @@ Returns the uhugeint value of the given value.
|
|
2265
2272
|
* @param val A duckdb_value containing a uhugeint
|
2266
2273
|
* @return A duckdb_uhugeint, or MinValue<uhugeint> if the value cannot be converted
|
2267
2274
|
*/
|
2268
|
-
|
2275
|
+
DUCKDB_C_API duckdb_uhugeint duckdb_get_uhugeint(duckdb_value val);
|
2269
2276
|
|
2270
2277
|
/*!
|
2271
2278
|
Returns the duckdb_varint value of the given value.
|
@@ -2274,7 +2281,7 @@ The `data` field must be destroyed with `duckdb_free`.
|
|
2274
2281
|
* @param val A duckdb_value containing a VARINT
|
2275
2282
|
* @return A duckdb_varint. The `data` field must be destroyed with `duckdb_free`.
|
2276
2283
|
*/
|
2277
|
-
|
2284
|
+
DUCKDB_C_API duckdb_varint duckdb_get_varint(duckdb_value val);
|
2278
2285
|
|
2279
2286
|
/*!
|
2280
2287
|
Returns the duckdb_decimal value of the given value.
|
@@ -2282,7 +2289,7 @@ Returns the duckdb_decimal value of the given value.
|
|
2282
2289
|
* @param val A duckdb_value containing a DECIMAL
|
2283
2290
|
* @return A duckdb_decimal, or MinValue<decimal> if the value cannot be converted
|
2284
2291
|
*/
|
2285
|
-
|
2292
|
+
DUCKDB_C_API duckdb_decimal duckdb_get_decimal(duckdb_value val);
|
2286
2293
|
|
2287
2294
|
/*!
|
2288
2295
|
Returns the float value of the given value.
|
@@ -2290,7 +2297,7 @@ Returns the float value of the given value.
|
|
2290
2297
|
* @param val A duckdb_value containing a float
|
2291
2298
|
* @return A float, or NAN if the value cannot be converted
|
2292
2299
|
*/
|
2293
|
-
|
2300
|
+
DUCKDB_C_API float duckdb_get_float(duckdb_value val);
|
2294
2301
|
|
2295
2302
|
/*!
|
2296
2303
|
Returns the double value of the given value.
|
@@ -2298,7 +2305,7 @@ Returns the double value of the given value.
|
|
2298
2305
|
* @param val A duckdb_value containing a double
|
2299
2306
|
* @return A double, or NAN if the value cannot be converted
|
2300
2307
|
*/
|
2301
|
-
|
2308
|
+
DUCKDB_C_API double duckdb_get_double(duckdb_value val);
|
2302
2309
|
|
2303
2310
|
/*!
|
2304
2311
|
Returns the date value of the given value.
|
@@ -2306,7 +2313,7 @@ Returns the date value of the given value.
|
|
2306
2313
|
* @param val A duckdb_value containing a date
|
2307
2314
|
* @return A duckdb_date, or MinValue<date> if the value cannot be converted
|
2308
2315
|
*/
|
2309
|
-
|
2316
|
+
DUCKDB_C_API duckdb_date duckdb_get_date(duckdb_value val);
|
2310
2317
|
|
2311
2318
|
/*!
|
2312
2319
|
Returns the time value of the given value.
|
@@ -2314,7 +2321,7 @@ Returns the time value of the given value.
|
|
2314
2321
|
* @param val A duckdb_value containing a time
|
2315
2322
|
* @return A duckdb_time, or MinValue<time> if the value cannot be converted
|
2316
2323
|
*/
|
2317
|
-
|
2324
|
+
DUCKDB_C_API duckdb_time duckdb_get_time(duckdb_value val);
|
2318
2325
|
|
2319
2326
|
/*!
|
2320
2327
|
Returns the time_tz value of the given value.
|
@@ -2322,7 +2329,7 @@ Returns the time_tz value of the given value.
|
|
2322
2329
|
* @param val A duckdb_value containing a time_tz
|
2323
2330
|
* @return A duckdb_time_tz, or MinValue<time_tz> if the value cannot be converted
|
2324
2331
|
*/
|
2325
|
-
|
2332
|
+
DUCKDB_C_API duckdb_time_tz duckdb_get_time_tz(duckdb_value val);
|
2326
2333
|
|
2327
2334
|
/*!
|
2328
2335
|
Returns the TIMESTAMP value of the given value.
|
@@ -2330,7 +2337,7 @@ Returns the TIMESTAMP value of the given value.
|
|
2330
2337
|
* @param val A duckdb_value containing a TIMESTAMP
|
2331
2338
|
* @return A duckdb_timestamp, or MinValue<timestamp> if the value cannot be converted
|
2332
2339
|
*/
|
2333
|
-
|
2340
|
+
DUCKDB_C_API duckdb_timestamp duckdb_get_timestamp(duckdb_value val);
|
2334
2341
|
|
2335
2342
|
/*!
|
2336
2343
|
Returns the TIMESTAMP_TZ value of the given value.
|
@@ -2338,7 +2345,7 @@ Returns the TIMESTAMP_TZ value of the given value.
|
|
2338
2345
|
* @param val A duckdb_value containing a TIMESTAMP_TZ
|
2339
2346
|
* @return A duckdb_timestamp, or MinValue<timestamp_tz> if the value cannot be converted
|
2340
2347
|
*/
|
2341
|
-
|
2348
|
+
DUCKDB_C_API duckdb_timestamp duckdb_get_timestamp_tz(duckdb_value val);
|
2342
2349
|
|
2343
2350
|
/*!
|
2344
2351
|
Returns the duckdb_timestamp_s value of the given value.
|
@@ -2346,7 +2353,7 @@ Returns the duckdb_timestamp_s value of the given value.
|
|
2346
2353
|
* @param val A duckdb_value containing a TIMESTAMP_S
|
2347
2354
|
* @return A duckdb_timestamp_s, or MinValue<timestamp_s> if the value cannot be converted
|
2348
2355
|
*/
|
2349
|
-
|
2356
|
+
DUCKDB_C_API duckdb_timestamp_s duckdb_get_timestamp_s(duckdb_value val);
|
2350
2357
|
|
2351
2358
|
/*!
|
2352
2359
|
Returns the duckdb_timestamp_ms value of the given value.
|
@@ -2354,7 +2361,7 @@ Returns the duckdb_timestamp_ms value of the given value.
|
|
2354
2361
|
* @param val A duckdb_value containing a TIMESTAMP_MS
|
2355
2362
|
* @return A duckdb_timestamp_ms, or MinValue<timestamp_ms> if the value cannot be converted
|
2356
2363
|
*/
|
2357
|
-
|
2364
|
+
DUCKDB_C_API duckdb_timestamp_ms duckdb_get_timestamp_ms(duckdb_value val);
|
2358
2365
|
|
2359
2366
|
/*!
|
2360
2367
|
Returns the duckdb_timestamp_ns value of the given value.
|
@@ -2362,7 +2369,7 @@ Returns the duckdb_timestamp_ns value of the given value.
|
|
2362
2369
|
* @param val A duckdb_value containing a TIMESTAMP_NS
|
2363
2370
|
* @return A duckdb_timestamp_ns, or MinValue<timestamp_ns> if the value cannot be converted
|
2364
2371
|
*/
|
2365
|
-
|
2372
|
+
DUCKDB_C_API duckdb_timestamp_ns duckdb_get_timestamp_ns(duckdb_value val);
|
2366
2373
|
|
2367
2374
|
/*!
|
2368
2375
|
Returns the interval value of the given value.
|
@@ -2370,7 +2377,7 @@ Returns the interval value of the given value.
|
|
2370
2377
|
* @param val A duckdb_value containing a interval
|
2371
2378
|
* @return A duckdb_interval, or MinValue<interval> if the value cannot be converted
|
2372
2379
|
*/
|
2373
|
-
|
2380
|
+
DUCKDB_C_API duckdb_interval duckdb_get_interval(duckdb_value val);
|
2374
2381
|
|
2375
2382
|
/*!
|
2376
2383
|
Returns the type of the given value. The type is valid as long as the value is not destroyed.
|
@@ -2379,7 +2386,7 @@ The type itself must not be destroyed.
|
|
2379
2386
|
* @param val A duckdb_value
|
2380
2387
|
* @return A duckdb_logical_type.
|
2381
2388
|
*/
|
2382
|
-
|
2389
|
+
DUCKDB_C_API duckdb_logical_type duckdb_get_value_type(duckdb_value val);
|
2383
2390
|
|
2384
2391
|
/*!
|
2385
2392
|
Returns the blob value of the given value.
|
@@ -2387,7 +2394,7 @@ Returns the blob value of the given value.
|
|
2387
2394
|
* @param val A duckdb_value containing a blob
|
2388
2395
|
* @return A duckdb_blob
|
2389
2396
|
*/
|
2390
|
-
|
2397
|
+
DUCKDB_C_API duckdb_blob duckdb_get_blob(duckdb_value val);
|
2391
2398
|
|
2392
2399
|
/*!
|
2393
2400
|
Returns the duckdb_bit value of the given value.
|
@@ -2396,7 +2403,7 @@ The `data` field must be destroyed with `duckdb_free`.
|
|
2396
2403
|
* @param val A duckdb_value containing a BIT
|
2397
2404
|
* @return A duckdb_bit
|
2398
2405
|
*/
|
2399
|
-
|
2406
|
+
DUCKDB_C_API duckdb_bit duckdb_get_bit(duckdb_value val);
|
2400
2407
|
|
2401
2408
|
/*!
|
2402
2409
|
Returns a duckdb_uhugeint representing the UUID value of the given value.
|
@@ -2404,7 +2411,7 @@ Returns a duckdb_uhugeint representing the UUID value of the given value.
|
|
2404
2411
|
* @param val A duckdb_value containing a UUID
|
2405
2412
|
* @return A duckdb_uhugeint representing the UUID value
|
2406
2413
|
*/
|
2407
|
-
|
2414
|
+
DUCKDB_C_API duckdb_uhugeint duckdb_get_uuid(duckdb_value val);
|
2408
2415
|
|
2409
2416
|
/*!
|
2410
2417
|
Obtains a string representation of the given value.
|
@@ -2413,7 +2420,7 @@ The result must be destroyed with `duckdb_free`.
|
|
2413
2420
|
* @param value The value
|
2414
2421
|
* @return The string value. This must be destroyed with `duckdb_free`.
|
2415
2422
|
*/
|
2416
|
-
|
2423
|
+
DUCKDB_C_API char *duckdb_get_varchar(duckdb_value value);
|
2417
2424
|
|
2418
2425
|
/*!
|
2419
2426
|
Creates a struct value from a type and an array of values. Must be destroyed with `duckdb_destroy_value`.
|
@@ -2422,7 +2429,7 @@ Creates a struct value from a type and an array of values. Must be destroyed wit
|
|
2422
2429
|
* @param values The values for the struct fields
|
2423
2430
|
* @return The struct value, or nullptr, if any child type is `DUCKDB_TYPE_ANY` or `DUCKDB_TYPE_INVALID`.
|
2424
2431
|
*/
|
2425
|
-
|
2432
|
+
DUCKDB_C_API duckdb_value duckdb_create_struct_value(duckdb_logical_type type, duckdb_value *values);
|
2426
2433
|
|
2427
2434
|
/*!
|
2428
2435
|
Creates a list value from a child (element) type and an array of values of length `value_count`.
|
@@ -2433,7 +2440,7 @@ Must be destroyed with `duckdb_destroy_value`.
|
|
2433
2440
|
* @param value_count The number of values in the list
|
2434
2441
|
* @return The list value, or nullptr, if the child type is `DUCKDB_TYPE_ANY` or `DUCKDB_TYPE_INVALID`.
|
2435
2442
|
*/
|
2436
|
-
|
2443
|
+
DUCKDB_C_API duckdb_value duckdb_create_list_value(duckdb_logical_type type, duckdb_value *values, idx_t value_count);
|
2437
2444
|
|
2438
2445
|
/*!
|
2439
2446
|
Creates an array value from a child (element) type and an array of values of length `value_count`.
|
@@ -2444,7 +2451,7 @@ Must be destroyed with `duckdb_destroy_value`.
|
|
2444
2451
|
* @param value_count The number of values in the array
|
2445
2452
|
* @return The array value, or nullptr, if the child type is `DUCKDB_TYPE_ANY` or `DUCKDB_TYPE_INVALID`.
|
2446
2453
|
*/
|
2447
|
-
|
2454
|
+
DUCKDB_C_API duckdb_value duckdb_create_array_value(duckdb_logical_type type, duckdb_value *values, idx_t value_count);
|
2448
2455
|
|
2449
2456
|
/*!
|
2450
2457
|
Returns the number of elements in a MAP value.
|
@@ -2452,7 +2459,7 @@ Returns the number of elements in a MAP value.
|
|
2452
2459
|
* @param value The MAP value.
|
2453
2460
|
* @return The number of elements in the map.
|
2454
2461
|
*/
|
2455
|
-
|
2462
|
+
DUCKDB_C_API idx_t duckdb_get_map_size(duckdb_value value);
|
2456
2463
|
|
2457
2464
|
/*!
|
2458
2465
|
Returns the MAP key at index as a duckdb_value.
|
@@ -2461,7 +2468,7 @@ Returns the MAP key at index as a duckdb_value.
|
|
2461
2468
|
* @param index The index of the key.
|
2462
2469
|
* @return The key as a duckdb_value.
|
2463
2470
|
*/
|
2464
|
-
|
2471
|
+
DUCKDB_C_API duckdb_value duckdb_get_map_key(duckdb_value value, idx_t index);
|
2465
2472
|
|
2466
2473
|
/*!
|
2467
2474
|
Returns the MAP value at index as a duckdb_value.
|
@@ -2470,7 +2477,7 @@ Returns the MAP value at index as a duckdb_value.
|
|
2470
2477
|
* @param index The index of the value.
|
2471
2478
|
* @return The value as a duckdb_value.
|
2472
2479
|
*/
|
2473
|
-
|
2480
|
+
DUCKDB_C_API duckdb_value duckdb_get_map_value(duckdb_value value, idx_t index);
|
2474
2481
|
|
2475
2482
|
/*!
|
2476
2483
|
Returns whether the value's type is SQLNULL or not.
|
@@ -2478,14 +2485,14 @@ Returns whether the value's type is SQLNULL or not.
|
|
2478
2485
|
* @param value The value to check.
|
2479
2486
|
* @return True, if the value's type is SQLNULL, otherwise false.
|
2480
2487
|
*/
|
2481
|
-
|
2488
|
+
DUCKDB_C_API bool duckdb_is_null_value(duckdb_value value);
|
2482
2489
|
|
2483
2490
|
/*!
|
2484
2491
|
Creates a value of type SQLNULL.
|
2485
2492
|
|
2486
2493
|
* @return The duckdb_value representing SQLNULL. This must be destroyed with `duckdb_destroy_value`.
|
2487
2494
|
*/
|
2488
|
-
|
2495
|
+
DUCKDB_C_API duckdb_value duckdb_create_null_value();
|
2489
2496
|
|
2490
2497
|
/*!
|
2491
2498
|
Returns the number of elements in a LIST value.
|
@@ -2493,7 +2500,7 @@ Returns the number of elements in a LIST value.
|
|
2493
2500
|
* @param value The LIST value.
|
2494
2501
|
* @return The number of elements in the list.
|
2495
2502
|
*/
|
2496
|
-
|
2503
|
+
DUCKDB_C_API idx_t duckdb_get_list_size(duckdb_value value);
|
2497
2504
|
|
2498
2505
|
/*!
|
2499
2506
|
Returns the LIST child at index as a duckdb_value.
|
@@ -2502,7 +2509,7 @@ Returns the LIST child at index as a duckdb_value.
|
|
2502
2509
|
* @param index The index of the child.
|
2503
2510
|
* @return The child as a duckdb_value.
|
2504
2511
|
*/
|
2505
|
-
|
2512
|
+
DUCKDB_C_API duckdb_value duckdb_get_list_child(duckdb_value value, idx_t index);
|
2506
2513
|
|
2507
2514
|
/*!
|
2508
2515
|
Creates an enum value from a type and a value. Must be destroyed with `duckdb_destroy_value`.
|
@@ -2511,7 +2518,7 @@ Creates an enum value from a type and a value. Must be destroyed with `duckdb_de
|
|
2511
2518
|
* @param value The value for the enum
|
2512
2519
|
* @return The enum value, or nullptr.
|
2513
2520
|
*/
|
2514
|
-
|
2521
|
+
DUCKDB_C_API duckdb_value duckdb_create_enum_value(duckdb_logical_type type, uint64_t value);
|
2515
2522
|
|
2516
2523
|
/*!
|
2517
2524
|
Returns the enum value of the given value.
|
@@ -2519,7 +2526,7 @@ Returns the enum value of the given value.
|
|
2519
2526
|
* @param value A duckdb_value containing an enum
|
2520
2527
|
* @return A uint64_t, or MinValue<uint64> if the value cannot be converted
|
2521
2528
|
*/
|
2522
|
-
|
2529
|
+
DUCKDB_C_API uint64_t duckdb_get_enum_value(duckdb_value value);
|
2523
2530
|
|
2524
2531
|
/*!
|
2525
2532
|
Returns the STRUCT child at index as a duckdb_value.
|
@@ -2528,7 +2535,7 @@ Returns the STRUCT child at index as a duckdb_value.
|
|
2528
2535
|
* @param index The index of the child.
|
2529
2536
|
* @return The child as a duckdb_value.
|
2530
2537
|
*/
|
2531
|
-
|
2538
|
+
DUCKDB_C_API duckdb_value duckdb_get_struct_child(duckdb_value value, idx_t index);
|
2532
2539
|
|
2533
2540
|
//===--------------------------------------------------------------------===//
|
2534
2541
|
// Logical Type Interface
|
@@ -2544,7 +2551,7 @@ Returns an invalid logical type, if type is: `DUCKDB_TYPE_INVALID`, `DUCKDB_TYPE
|
|
2544
2551
|
* @param type The primitive type to create.
|
2545
2552
|
* @return The logical type.
|
2546
2553
|
*/
|
2547
|
-
|
2554
|
+
DUCKDB_C_API duckdb_logical_type duckdb_create_logical_type(duckdb_type type);
|
2548
2555
|
|
2549
2556
|
/*!
|
2550
2557
|
Returns the alias of a duckdb_logical_type, if set, else `nullptr`.
|
@@ -2553,7 +2560,7 @@ The result must be destroyed with `duckdb_free`.
|
|
2553
2560
|
* @param type The logical type
|
2554
2561
|
* @return The alias or `nullptr`
|
2555
2562
|
*/
|
2556
|
-
|
2563
|
+
DUCKDB_C_API char *duckdb_logical_type_get_alias(duckdb_logical_type type);
|
2557
2564
|
|
2558
2565
|
/*!
|
2559
2566
|
Sets the alias of a duckdb_logical_type.
|
@@ -2561,7 +2568,7 @@ Sets the alias of a duckdb_logical_type.
|
|
2561
2568
|
* @param type The logical type
|
2562
2569
|
* @param alias The alias to set
|
2563
2570
|
*/
|
2564
|
-
|
2571
|
+
DUCKDB_C_API void duckdb_logical_type_set_alias(duckdb_logical_type type, const char *alias);
|
2565
2572
|
|
2566
2573
|
/*!
|
2567
2574
|
Creates a LIST type from its child type.
|
@@ -2570,7 +2577,7 @@ The return type must be destroyed with `duckdb_destroy_logical_type`.
|
|
2570
2577
|
* @param type The child type of the list
|
2571
2578
|
* @return The logical type.
|
2572
2579
|
*/
|
2573
|
-
|
2580
|
+
DUCKDB_C_API duckdb_logical_type duckdb_create_list_type(duckdb_logical_type type);
|
2574
2581
|
|
2575
2582
|
/*!
|
2576
2583
|
Creates an ARRAY type from its child type.
|
@@ -2580,7 +2587,7 @@ The return type must be destroyed with `duckdb_destroy_logical_type`.
|
|
2580
2587
|
* @param array_size The number of elements in the array.
|
2581
2588
|
* @return The logical type.
|
2582
2589
|
*/
|
2583
|
-
|
2590
|
+
DUCKDB_C_API duckdb_logical_type duckdb_create_array_type(duckdb_logical_type type, idx_t array_size);
|
2584
2591
|
|
2585
2592
|
/*!
|
2586
2593
|
Creates a MAP type from its key type and value type.
|
@@ -2590,7 +2597,7 @@ The return type must be destroyed with `duckdb_destroy_logical_type`.
|
|
2590
2597
|
* @param value_type The map's value type.
|
2591
2598
|
* @return The logical type.
|
2592
2599
|
*/
|
2593
|
-
|
2600
|
+
DUCKDB_C_API duckdb_logical_type duckdb_create_map_type(duckdb_logical_type key_type, duckdb_logical_type value_type);
|
2594
2601
|
|
2595
2602
|
/*!
|
2596
2603
|
Creates a UNION type from the passed arrays.
|
@@ -2601,8 +2608,8 @@ The return type must be destroyed with `duckdb_destroy_logical_type`.
|
|
2601
2608
|
* @param member_count The number of union members.
|
2602
2609
|
* @return The logical type.
|
2603
2610
|
*/
|
2604
|
-
|
2605
|
-
|
2611
|
+
DUCKDB_C_API duckdb_logical_type duckdb_create_union_type(duckdb_logical_type *member_types, const char **member_names,
|
2612
|
+
idx_t member_count);
|
2606
2613
|
|
2607
2614
|
/*!
|
2608
2615
|
Creates a STRUCT type based on the member types and names.
|
@@ -2613,8 +2620,8 @@ The resulting type must be destroyed with `duckdb_destroy_logical_type`.
|
|
2613
2620
|
* @param member_count The number of members of the struct.
|
2614
2621
|
* @return The logical type.
|
2615
2622
|
*/
|
2616
|
-
|
2617
|
-
|
2623
|
+
DUCKDB_C_API duckdb_logical_type duckdb_create_struct_type(duckdb_logical_type *member_types, const char **member_names,
|
2624
|
+
idx_t member_count);
|
2618
2625
|
|
2619
2626
|
/*!
|
2620
2627
|
Creates an ENUM type from the passed member name array.
|
@@ -2624,7 +2631,7 @@ The resulting type should be destroyed with `duckdb_destroy_logical_type`.
|
|
2624
2631
|
* @param member_count The number of elements that were specified in the array.
|
2625
2632
|
* @return The logical type.
|
2626
2633
|
*/
|
2627
|
-
|
2634
|
+
DUCKDB_C_API duckdb_logical_type duckdb_create_enum_type(const char **member_names, idx_t member_count);
|
2628
2635
|
|
2629
2636
|
/*!
|
2630
2637
|
Creates a DECIMAL type with the specified width and scale.
|
@@ -2634,7 +2641,7 @@ The resulting type should be destroyed with `duckdb_destroy_logical_type`.
|
|
2634
2641
|
* @param scale The scale of the decimal type
|
2635
2642
|
* @return The logical type.
|
2636
2643
|
*/
|
2637
|
-
|
2644
|
+
DUCKDB_C_API duckdb_logical_type duckdb_create_decimal_type(uint8_t width, uint8_t scale);
|
2638
2645
|
|
2639
2646
|
/*!
|
2640
2647
|
Retrieves the enum `duckdb_type` of a `duckdb_logical_type`.
|
@@ -2642,7 +2649,7 @@ Retrieves the enum `duckdb_type` of a `duckdb_logical_type`.
|
|
2642
2649
|
* @param type The logical type.
|
2643
2650
|
* @return The `duckdb_type` id.
|
2644
2651
|
*/
|
2645
|
-
|
2652
|
+
DUCKDB_C_API duckdb_type duckdb_get_type_id(duckdb_logical_type type);
|
2646
2653
|
|
2647
2654
|
/*!
|
2648
2655
|
Retrieves the width of a decimal type.
|
@@ -2650,7 +2657,7 @@ Retrieves the width of a decimal type.
|
|
2650
2657
|
* @param type The logical type object
|
2651
2658
|
* @return The width of the decimal type
|
2652
2659
|
*/
|
2653
|
-
|
2660
|
+
DUCKDB_C_API uint8_t duckdb_decimal_width(duckdb_logical_type type);
|
2654
2661
|
|
2655
2662
|
/*!
|
2656
2663
|
Retrieves the scale of a decimal type.
|
@@ -2658,7 +2665,7 @@ Retrieves the scale of a decimal type.
|
|
2658
2665
|
* @param type The logical type object
|
2659
2666
|
* @return The scale of the decimal type
|
2660
2667
|
*/
|
2661
|
-
|
2668
|
+
DUCKDB_C_API uint8_t duckdb_decimal_scale(duckdb_logical_type type);
|
2662
2669
|
|
2663
2670
|
/*!
|
2664
2671
|
Retrieves the internal storage type of a decimal type.
|
@@ -2666,7 +2673,7 @@ Retrieves the internal storage type of a decimal type.
|
|
2666
2673
|
* @param type The logical type object
|
2667
2674
|
* @return The internal type of the decimal type
|
2668
2675
|
*/
|
2669
|
-
|
2676
|
+
DUCKDB_C_API duckdb_type duckdb_decimal_internal_type(duckdb_logical_type type);
|
2670
2677
|
|
2671
2678
|
/*!
|
2672
2679
|
Retrieves the internal storage type of an enum type.
|
@@ -2674,7 +2681,7 @@ Retrieves the internal storage type of an enum type.
|
|
2674
2681
|
* @param type The logical type object
|
2675
2682
|
* @return The internal type of the enum type
|
2676
2683
|
*/
|
2677
|
-
|
2684
|
+
DUCKDB_C_API duckdb_type duckdb_enum_internal_type(duckdb_logical_type type);
|
2678
2685
|
|
2679
2686
|
/*!
|
2680
2687
|
Retrieves the dictionary size of the enum type.
|
@@ -2682,7 +2689,7 @@ Retrieves the dictionary size of the enum type.
|
|
2682
2689
|
* @param type The logical type object
|
2683
2690
|
* @return The dictionary size of the enum type
|
2684
2691
|
*/
|
2685
|
-
|
2692
|
+
DUCKDB_C_API uint32_t duckdb_enum_dictionary_size(duckdb_logical_type type);
|
2686
2693
|
|
2687
2694
|
/*!
|
2688
2695
|
Retrieves the dictionary value at the specified position from the enum.
|
@@ -2693,7 +2700,7 @@ The result must be freed with `duckdb_free`.
|
|
2693
2700
|
* @param index The index in the dictionary
|
2694
2701
|
* @return The string value of the enum type. Must be freed with `duckdb_free`.
|
2695
2702
|
*/
|
2696
|
-
|
2703
|
+
DUCKDB_C_API char *duckdb_enum_dictionary_value(duckdb_logical_type type, idx_t index);
|
2697
2704
|
|
2698
2705
|
/*!
|
2699
2706
|
Retrieves the child type of the given LIST type. Also accepts MAP types.
|
@@ -2702,7 +2709,7 @@ The result must be freed with `duckdb_destroy_logical_type`.
|
|
2702
2709
|
* @param type The logical type, either LIST or MAP.
|
2703
2710
|
* @return The child type of the LIST or MAP type.
|
2704
2711
|
*/
|
2705
|
-
|
2712
|
+
DUCKDB_C_API duckdb_logical_type duckdb_list_type_child_type(duckdb_logical_type type);
|
2706
2713
|
|
2707
2714
|
/*!
|
2708
2715
|
Retrieves the child type of the given ARRAY type.
|
@@ -2712,7 +2719,7 @@ The result must be freed with `duckdb_destroy_logical_type`.
|
|
2712
2719
|
* @param type The logical type. Must be ARRAY.
|
2713
2720
|
* @return The child type of the ARRAY type.
|
2714
2721
|
*/
|
2715
|
-
|
2722
|
+
DUCKDB_C_API duckdb_logical_type duckdb_array_type_child_type(duckdb_logical_type type);
|
2716
2723
|
|
2717
2724
|
/*!
|
2718
2725
|
Retrieves the array size of the given array type.
|
@@ -2720,7 +2727,7 @@ Retrieves the array size of the given array type.
|
|
2720
2727
|
* @param type The logical type object
|
2721
2728
|
* @return The fixed number of elements the values of this array type can store.
|
2722
2729
|
*/
|
2723
|
-
|
2730
|
+
DUCKDB_C_API idx_t duckdb_array_type_array_size(duckdb_logical_type type);
|
2724
2731
|
|
2725
2732
|
/*!
|
2726
2733
|
Retrieves the key type of the given map type.
|
@@ -2730,7 +2737,7 @@ The result must be freed with `duckdb_destroy_logical_type`.
|
|
2730
2737
|
* @param type The logical type object
|
2731
2738
|
* @return The key type of the map type. Must be destroyed with `duckdb_destroy_logical_type`.
|
2732
2739
|
*/
|
2733
|
-
|
2740
|
+
DUCKDB_C_API duckdb_logical_type duckdb_map_type_key_type(duckdb_logical_type type);
|
2734
2741
|
|
2735
2742
|
/*!
|
2736
2743
|
Retrieves the value type of the given map type.
|
@@ -2740,7 +2747,7 @@ The result must be freed with `duckdb_destroy_logical_type`.
|
|
2740
2747
|
* @param type The logical type object
|
2741
2748
|
* @return The value type of the map type. Must be destroyed with `duckdb_destroy_logical_type`.
|
2742
2749
|
*/
|
2743
|
-
|
2750
|
+
DUCKDB_C_API duckdb_logical_type duckdb_map_type_value_type(duckdb_logical_type type);
|
2744
2751
|
|
2745
2752
|
/*!
|
2746
2753
|
Returns the number of children of a struct type.
|
@@ -2748,7 +2755,7 @@ Returns the number of children of a struct type.
|
|
2748
2755
|
* @param type The logical type object
|
2749
2756
|
* @return The number of children of a struct type.
|
2750
2757
|
*/
|
2751
|
-
|
2758
|
+
DUCKDB_C_API idx_t duckdb_struct_type_child_count(duckdb_logical_type type);
|
2752
2759
|
|
2753
2760
|
/*!
|
2754
2761
|
Retrieves the name of the struct child.
|
@@ -2759,7 +2766,7 @@ The result must be freed with `duckdb_free`.
|
|
2759
2766
|
* @param index The child index
|
2760
2767
|
* @return The name of the struct type. Must be freed with `duckdb_free`.
|
2761
2768
|
*/
|
2762
|
-
|
2769
|
+
DUCKDB_C_API char *duckdb_struct_type_child_name(duckdb_logical_type type, idx_t index);
|
2763
2770
|
|
2764
2771
|
/*!
|
2765
2772
|
Retrieves the child type of the given struct type at the specified index.
|
@@ -2770,7 +2777,7 @@ The result must be freed with `duckdb_destroy_logical_type`.
|
|
2770
2777
|
* @param index The child index
|
2771
2778
|
* @return The child type of the struct type. Must be destroyed with `duckdb_destroy_logical_type`.
|
2772
2779
|
*/
|
2773
|
-
|
2780
|
+
DUCKDB_C_API duckdb_logical_type duckdb_struct_type_child_type(duckdb_logical_type type, idx_t index);
|
2774
2781
|
|
2775
2782
|
/*!
|
2776
2783
|
Returns the number of members that the union type has.
|
@@ -2778,7 +2785,7 @@ Returns the number of members that the union type has.
|
|
2778
2785
|
* @param type The logical type (union) object
|
2779
2786
|
* @return The number of members of a union type.
|
2780
2787
|
*/
|
2781
|
-
|
2788
|
+
DUCKDB_C_API idx_t duckdb_union_type_member_count(duckdb_logical_type type);
|
2782
2789
|
|
2783
2790
|
/*!
|
2784
2791
|
Retrieves the name of the union member.
|
@@ -2789,7 +2796,7 @@ The result must be freed with `duckdb_free`.
|
|
2789
2796
|
* @param index The child index
|
2790
2797
|
* @return The name of the union member. Must be freed with `duckdb_free`.
|
2791
2798
|
*/
|
2792
|
-
|
2799
|
+
DUCKDB_C_API char *duckdb_union_type_member_name(duckdb_logical_type type, idx_t index);
|
2793
2800
|
|
2794
2801
|
/*!
|
2795
2802
|
Retrieves the child type of the given union member at the specified index.
|
@@ -2800,14 +2807,14 @@ The result must be freed with `duckdb_destroy_logical_type`.
|
|
2800
2807
|
* @param index The child index
|
2801
2808
|
* @return The child type of the union member. Must be destroyed with `duckdb_destroy_logical_type`.
|
2802
2809
|
*/
|
2803
|
-
|
2810
|
+
DUCKDB_C_API duckdb_logical_type duckdb_union_type_member_type(duckdb_logical_type type, idx_t index);
|
2804
2811
|
|
2805
2812
|
/*!
|
2806
2813
|
Destroys the logical type and de-allocates all memory allocated for that type.
|
2807
2814
|
|
2808
2815
|
* @param type The logical type to destroy.
|
2809
2816
|
*/
|
2810
|
-
|
2817
|
+
DUCKDB_C_API void duckdb_destroy_logical_type(duckdb_logical_type *type);
|
2811
2818
|
|
2812
2819
|
/*!
|
2813
2820
|
Registers a custom type within the given connection.
|
@@ -2817,8 +2824,8 @@ The type must have an alias
|
|
2817
2824
|
* @param type The custom type to register
|
2818
2825
|
* @return Whether or not the registration was successful.
|
2819
2826
|
*/
|
2820
|
-
|
2821
|
-
|
2827
|
+
DUCKDB_C_API duckdb_state duckdb_register_logical_type(duckdb_connection con, duckdb_logical_type type,
|
2828
|
+
duckdb_create_type_info info);
|
2822
2829
|
|
2823
2830
|
//===--------------------------------------------------------------------===//
|
2824
2831
|
// Data Chunk Interface
|
@@ -2832,14 +2839,14 @@ The result must be destroyed with `duckdb_destroy_data_chunk`.
|
|
2832
2839
|
* @param column_count The number of columns.
|
2833
2840
|
* @return The data chunk.
|
2834
2841
|
*/
|
2835
|
-
|
2842
|
+
DUCKDB_C_API duckdb_data_chunk duckdb_create_data_chunk(duckdb_logical_type *types, idx_t column_count);
|
2836
2843
|
|
2837
2844
|
/*!
|
2838
2845
|
Destroys the data chunk and de-allocates all memory allocated for that chunk.
|
2839
2846
|
|
2840
2847
|
* @param chunk The data chunk to destroy.
|
2841
2848
|
*/
|
2842
|
-
|
2849
|
+
DUCKDB_C_API void duckdb_destroy_data_chunk(duckdb_data_chunk *chunk);
|
2843
2850
|
|
2844
2851
|
/*!
|
2845
2852
|
Resets a data chunk, clearing the validity masks and setting the cardinality of the data chunk to 0.
|
@@ -2848,7 +2855,7 @@ data and validity pointers
|
|
2848
2855
|
|
2849
2856
|
* @param chunk The data chunk to reset.
|
2850
2857
|
*/
|
2851
|
-
|
2858
|
+
DUCKDB_C_API void duckdb_data_chunk_reset(duckdb_data_chunk chunk);
|
2852
2859
|
|
2853
2860
|
/*!
|
2854
2861
|
Retrieves the number of columns in a data chunk.
|
@@ -2856,7 +2863,7 @@ Retrieves the number of columns in a data chunk.
|
|
2856
2863
|
* @param chunk The data chunk to get the data from
|
2857
2864
|
* @return The number of columns in the data chunk
|
2858
2865
|
*/
|
2859
|
-
|
2866
|
+
DUCKDB_C_API idx_t duckdb_data_chunk_get_column_count(duckdb_data_chunk chunk);
|
2860
2867
|
|
2861
2868
|
/*!
|
2862
2869
|
Retrieves the vector at the specified column index in the data chunk.
|
@@ -2867,7 +2874,7 @@ It does NOT need to be destroyed.
|
|
2867
2874
|
* @param chunk The data chunk to get the data from
|
2868
2875
|
* @return The vector
|
2869
2876
|
*/
|
2870
|
-
|
2877
|
+
DUCKDB_C_API duckdb_vector duckdb_data_chunk_get_vector(duckdb_data_chunk chunk, idx_t col_idx);
|
2871
2878
|
|
2872
2879
|
/*!
|
2873
2880
|
Retrieves the current number of tuples in a data chunk.
|
@@ -2875,7 +2882,7 @@ Retrieves the current number of tuples in a data chunk.
|
|
2875
2882
|
* @param chunk The data chunk to get the data from
|
2876
2883
|
* @return The number of tuples in the data chunk
|
2877
2884
|
*/
|
2878
|
-
|
2885
|
+
DUCKDB_C_API idx_t duckdb_data_chunk_get_size(duckdb_data_chunk chunk);
|
2879
2886
|
|
2880
2887
|
/*!
|
2881
2888
|
Sets the current number of tuples in a data chunk.
|
@@ -2883,7 +2890,7 @@ Sets the current number of tuples in a data chunk.
|
|
2883
2890
|
* @param chunk The data chunk to set the size in
|
2884
2891
|
* @param size The number of tuples in the data chunk
|
2885
2892
|
*/
|
2886
|
-
|
2893
|
+
DUCKDB_C_API void duckdb_data_chunk_set_size(duckdb_data_chunk chunk, idx_t size);
|
2887
2894
|
|
2888
2895
|
//===--------------------------------------------------------------------===//
|
2889
2896
|
// Vector Interface
|
@@ -2897,7 +2904,7 @@ The result must be destroyed with `duckdb_destroy_logical_type`.
|
|
2897
2904
|
* @param vector The vector get the data from
|
2898
2905
|
* @return The type of the vector
|
2899
2906
|
*/
|
2900
|
-
|
2907
|
+
DUCKDB_C_API duckdb_logical_type duckdb_vector_get_column_type(duckdb_vector vector);
|
2901
2908
|
|
2902
2909
|
/*!
|
2903
2910
|
Retrieves the data pointer of the vector.
|
@@ -2908,7 +2915,7 @@ How to read or write values depends on the type of the vector.
|
|
2908
2915
|
* @param vector The vector to get the data from
|
2909
2916
|
* @return The data pointer
|
2910
2917
|
*/
|
2911
|
-
|
2918
|
+
DUCKDB_C_API void *duckdb_vector_get_data(duckdb_vector vector);
|
2912
2919
|
|
2913
2920
|
/*!
|
2914
2921
|
Retrieves the validity mask pointer of the specified vector.
|
@@ -2930,7 +2937,7 @@ Alternatively, the (slower) duckdb_validity_row_is_valid function can be used.
|
|
2930
2937
|
* @param vector The vector to get the data from
|
2931
2938
|
* @return The pointer to the validity mask, or NULL if no validity mask is present
|
2932
2939
|
*/
|
2933
|
-
|
2940
|
+
DUCKDB_C_API uint64_t *duckdb_vector_get_validity(duckdb_vector vector);
|
2934
2941
|
|
2935
2942
|
/*!
|
2936
2943
|
Ensures the validity mask is writable by allocating it.
|
@@ -2940,7 +2947,7 @@ This allows NULL values to be written to the vector, regardless of whether a val
|
|
2940
2947
|
|
2941
2948
|
* @param vector The vector to alter
|
2942
2949
|
*/
|
2943
|
-
|
2950
|
+
DUCKDB_C_API void duckdb_vector_ensure_validity_writable(duckdb_vector vector);
|
2944
2951
|
|
2945
2952
|
/*!
|
2946
2953
|
Assigns a string element in the vector at the specified location.
|
@@ -2949,7 +2956,7 @@ Assigns a string element in the vector at the specified location.
|
|
2949
2956
|
* @param index The row position in the vector to assign the string to
|
2950
2957
|
* @param str The null-terminated string
|
2951
2958
|
*/
|
2952
|
-
|
2959
|
+
DUCKDB_C_API void duckdb_vector_assign_string_element(duckdb_vector vector, idx_t index, const char *str);
|
2953
2960
|
|
2954
2961
|
/*!
|
2955
2962
|
Assigns a string element in the vector at the specified location. You may also use this function to assign BLOBs.
|
@@ -2959,8 +2966,8 @@ Assigns a string element in the vector at the specified location. You may also u
|
|
2959
2966
|
* @param str The string
|
2960
2967
|
* @param str_len The length of the string (in bytes)
|
2961
2968
|
*/
|
2962
|
-
|
2963
|
-
|
2969
|
+
DUCKDB_C_API void duckdb_vector_assign_string_element_len(duckdb_vector vector, idx_t index, const char *str,
|
2970
|
+
idx_t str_len);
|
2964
2971
|
|
2965
2972
|
/*!
|
2966
2973
|
Retrieves the child vector of a list vector.
|
@@ -2970,7 +2977,7 @@ The resulting vector is valid as long as the parent vector is valid.
|
|
2970
2977
|
* @param vector The vector
|
2971
2978
|
* @return The child vector
|
2972
2979
|
*/
|
2973
|
-
|
2980
|
+
DUCKDB_C_API duckdb_vector duckdb_list_vector_get_child(duckdb_vector vector);
|
2974
2981
|
|
2975
2982
|
/*!
|
2976
2983
|
Returns the size of the child vector of the list.
|
@@ -2978,7 +2985,7 @@ Returns the size of the child vector of the list.
|
|
2978
2985
|
* @param vector The vector
|
2979
2986
|
* @return The size of the child list
|
2980
2987
|
*/
|
2981
|
-
|
2988
|
+
DUCKDB_C_API idx_t duckdb_list_vector_get_size(duckdb_vector vector);
|
2982
2989
|
|
2983
2990
|
/*!
|
2984
2991
|
Sets the total size of the underlying child-vector of a list vector.
|
@@ -2987,7 +2994,7 @@ Sets the total size of the underlying child-vector of a list vector.
|
|
2987
2994
|
* @param size The size of the child list.
|
2988
2995
|
* @return The duckdb state. Returns DuckDBError if the vector is nullptr.
|
2989
2996
|
*/
|
2990
|
-
|
2997
|
+
DUCKDB_C_API duckdb_state duckdb_list_vector_set_size(duckdb_vector vector, idx_t size);
|
2991
2998
|
|
2992
2999
|
/*!
|
2993
3000
|
Sets the total capacity of the underlying child-vector of a list.
|
@@ -2999,7 +3006,7 @@ data and validity pointers
|
|
2999
3006
|
* @param required_capacity the total capacity to reserve.
|
3000
3007
|
* @return The duckdb state. Returns DuckDBError if the vector is nullptr.
|
3001
3008
|
*/
|
3002
|
-
|
3009
|
+
DUCKDB_C_API duckdb_state duckdb_list_vector_reserve(duckdb_vector vector, idx_t required_capacity);
|
3003
3010
|
|
3004
3011
|
/*!
|
3005
3012
|
Retrieves the child vector of a struct vector.
|
@@ -3010,7 +3017,7 @@ The resulting vector is valid as long as the parent vector is valid.
|
|
3010
3017
|
* @param index The child index
|
3011
3018
|
* @return The child vector
|
3012
3019
|
*/
|
3013
|
-
|
3020
|
+
DUCKDB_C_API duckdb_vector duckdb_struct_vector_get_child(duckdb_vector vector, idx_t index);
|
3014
3021
|
|
3015
3022
|
/*!
|
3016
3023
|
Retrieves the child vector of a array vector.
|
@@ -3021,7 +3028,7 @@ The resulting vector has the size of the parent vector multiplied by the array s
|
|
3021
3028
|
* @param vector The vector
|
3022
3029
|
* @return The child vector
|
3023
3030
|
*/
|
3024
|
-
|
3031
|
+
DUCKDB_C_API duckdb_vector duckdb_array_vector_get_child(duckdb_vector vector);
|
3025
3032
|
|
3026
3033
|
//===--------------------------------------------------------------------===//
|
3027
3034
|
// Validity Mask Functions
|
@@ -3034,7 +3041,7 @@ Returns whether or not a row is valid (i.e. not NULL) in the given validity mask
|
|
3034
3041
|
* @param row The row index
|
3035
3042
|
* @return true if the row is valid, false otherwise
|
3036
3043
|
*/
|
3037
|
-
|
3044
|
+
DUCKDB_C_API bool duckdb_validity_row_is_valid(uint64_t *validity, idx_t row);
|
3038
3045
|
|
3039
3046
|
/*!
|
3040
3047
|
In a validity mask, sets a specific row to either valid or invalid.
|
@@ -3046,7 +3053,7 @@ to ensure that there is a validity mask to write to.
|
|
3046
3053
|
* @param row The row index
|
3047
3054
|
* @param valid Whether or not to set the row to valid, or invalid
|
3048
3055
|
*/
|
3049
|
-
|
3056
|
+
DUCKDB_C_API void duckdb_validity_set_row_validity(uint64_t *validity, idx_t row, bool valid);
|
3050
3057
|
|
3051
3058
|
/*!
|
3052
3059
|
In a validity mask, sets a specific row to invalid.
|
@@ -3056,7 +3063,7 @@ Equivalent to `duckdb_validity_set_row_validity` with valid set to false.
|
|
3056
3063
|
* @param validity The validity mask
|
3057
3064
|
* @param row The row index
|
3058
3065
|
*/
|
3059
|
-
|
3066
|
+
DUCKDB_C_API void duckdb_validity_set_row_invalid(uint64_t *validity, idx_t row);
|
3060
3067
|
|
3061
3068
|
/*!
|
3062
3069
|
In a validity mask, sets a specific row to valid.
|
@@ -3066,7 +3073,7 @@ Equivalent to `duckdb_validity_set_row_validity` with valid set to true.
|
|
3066
3073
|
* @param validity The validity mask
|
3067
3074
|
* @param row The row index
|
3068
3075
|
*/
|
3069
|
-
|
3076
|
+
DUCKDB_C_API void duckdb_validity_set_row_valid(uint64_t *validity, idx_t row);
|
3070
3077
|
|
3071
3078
|
//===--------------------------------------------------------------------===//
|
3072
3079
|
// Scalar Functions
|
@@ -3079,14 +3086,14 @@ The return value should be destroyed with `duckdb_destroy_scalar_function`.
|
|
3079
3086
|
|
3080
3087
|
* @return The scalar function object.
|
3081
3088
|
*/
|
3082
|
-
|
3089
|
+
DUCKDB_C_API duckdb_scalar_function duckdb_create_scalar_function();
|
3083
3090
|
|
3084
3091
|
/*!
|
3085
3092
|
Destroys the given scalar function object.
|
3086
3093
|
|
3087
3094
|
* @param scalar_function The scalar function to destroy
|
3088
3095
|
*/
|
3089
|
-
|
3096
|
+
DUCKDB_C_API void duckdb_destroy_scalar_function(duckdb_scalar_function *scalar_function);
|
3090
3097
|
|
3091
3098
|
/*!
|
3092
3099
|
Sets the name of the given scalar function.
|
@@ -3094,7 +3101,7 @@ Sets the name of the given scalar function.
|
|
3094
3101
|
* @param scalar_function The scalar function
|
3095
3102
|
* @param name The name of the scalar function
|
3096
3103
|
*/
|
3097
|
-
|
3104
|
+
DUCKDB_C_API void duckdb_scalar_function_set_name(duckdb_scalar_function scalar_function, const char *name);
|
3098
3105
|
|
3099
3106
|
/*!
|
3100
3107
|
Sets the parameters of the given scalar function to varargs. Does not require adding parameters with
|
@@ -3104,7 +3111,7 @@ duckdb_scalar_function_add_parameter.
|
|
3104
3111
|
* @param type The type of the arguments.
|
3105
3112
|
* @return The parameter type. Cannot contain INVALID.
|
3106
3113
|
*/
|
3107
|
-
|
3114
|
+
DUCKDB_C_API void duckdb_scalar_function_set_varargs(duckdb_scalar_function scalar_function, duckdb_logical_type type);
|
3108
3115
|
|
3109
3116
|
/*!
|
3110
3117
|
Sets the parameters of the given scalar function to varargs. Does not require adding parameters with
|
@@ -3112,7 +3119,7 @@ duckdb_scalar_function_add_parameter.
|
|
3112
3119
|
|
3113
3120
|
* @param scalar_function The scalar function.
|
3114
3121
|
*/
|
3115
|
-
|
3122
|
+
DUCKDB_C_API void duckdb_scalar_function_set_special_handling(duckdb_scalar_function scalar_function);
|
3116
3123
|
|
3117
3124
|
/*!
|
3118
3125
|
Sets the Function Stability of the scalar function to VOLATILE, indicating the function should be re-run for every row.
|
@@ -3120,7 +3127,7 @@ This limits optimization that can be performed for the function.
|
|
3120
3127
|
|
3121
3128
|
* @param scalar_function The scalar function.
|
3122
3129
|
*/
|
3123
|
-
|
3130
|
+
DUCKDB_C_API void duckdb_scalar_function_set_volatile(duckdb_scalar_function scalar_function);
|
3124
3131
|
|
3125
3132
|
/*!
|
3126
3133
|
Adds a parameter to the scalar function.
|
@@ -3128,7 +3135,8 @@ Adds a parameter to the scalar function.
|
|
3128
3135
|
* @param scalar_function The scalar function.
|
3129
3136
|
* @param type The parameter type. Cannot contain INVALID.
|
3130
3137
|
*/
|
3131
|
-
|
3138
|
+
DUCKDB_C_API void duckdb_scalar_function_add_parameter(duckdb_scalar_function scalar_function,
|
3139
|
+
duckdb_logical_type type);
|
3132
3140
|
|
3133
3141
|
/*!
|
3134
3142
|
Sets the return type of the scalar function.
|
@@ -3136,8 +3144,8 @@ Sets the return type of the scalar function.
|
|
3136
3144
|
* @param scalar_function The scalar function
|
3137
3145
|
* @param type Cannot contain INVALID or ANY.
|
3138
3146
|
*/
|
3139
|
-
|
3140
|
-
|
3147
|
+
DUCKDB_C_API void duckdb_scalar_function_set_return_type(duckdb_scalar_function scalar_function,
|
3148
|
+
duckdb_logical_type type);
|
3141
3149
|
|
3142
3150
|
/*!
|
3143
3151
|
Assigns extra information to the scalar function that can be fetched during binding, etc.
|
@@ -3146,8 +3154,8 @@ Assigns extra information to the scalar function that can be fetched during bind
|
|
3146
3154
|
* @param extra_info The extra information
|
3147
3155
|
* @param destroy The callback that will be called to destroy the bind data (if any)
|
3148
3156
|
*/
|
3149
|
-
|
3150
|
-
|
3157
|
+
DUCKDB_C_API void duckdb_scalar_function_set_extra_info(duckdb_scalar_function scalar_function, void *extra_info,
|
3158
|
+
duckdb_delete_callback_t destroy);
|
3151
3159
|
|
3152
3160
|
/*!
|
3153
3161
|
Sets the main function of the scalar function.
|
@@ -3155,8 +3163,8 @@ Sets the main function of the scalar function.
|
|
3155
3163
|
* @param scalar_function The scalar function
|
3156
3164
|
* @param function The function
|
3157
3165
|
*/
|
3158
|
-
|
3159
|
-
|
3166
|
+
DUCKDB_C_API void duckdb_scalar_function_set_function(duckdb_scalar_function scalar_function,
|
3167
|
+
duckdb_scalar_function_t function);
|
3160
3168
|
|
3161
3169
|
/*!
|
3162
3170
|
Register the scalar function object within the given connection.
|
@@ -3169,7 +3177,8 @@ If the function is incomplete or a function with this name already exists DuckDB
|
|
3169
3177
|
* @param scalar_function The function pointer
|
3170
3178
|
* @return Whether or not the registration was successful.
|
3171
3179
|
*/
|
3172
|
-
|
3180
|
+
DUCKDB_C_API duckdb_state duckdb_register_scalar_function(duckdb_connection con,
|
3181
|
+
duckdb_scalar_function scalar_function);
|
3173
3182
|
|
3174
3183
|
/*!
|
3175
3184
|
Retrieves the extra info of the function as set in `duckdb_scalar_function_set_extra_info`.
|
@@ -3177,7 +3186,7 @@ Retrieves the extra info of the function as set in `duckdb_scalar_function_set_e
|
|
3177
3186
|
* @param info The info object.
|
3178
3187
|
* @return The extra info.
|
3179
3188
|
*/
|
3180
|
-
|
3189
|
+
DUCKDB_C_API void *duckdb_scalar_function_get_extra_info(duckdb_function_info info);
|
3181
3190
|
|
3182
3191
|
/*!
|
3183
3192
|
Report that an error has occurred while executing the scalar function.
|
@@ -3185,7 +3194,7 @@ Report that an error has occurred while executing the scalar function.
|
|
3185
3194
|
* @param info The info object.
|
3186
3195
|
* @param error The error message
|
3187
3196
|
*/
|
3188
|
-
|
3197
|
+
DUCKDB_C_API void duckdb_scalar_function_set_error(duckdb_function_info info, const char *error);
|
3189
3198
|
|
3190
3199
|
/*!
|
3191
3200
|
Creates a new empty scalar function set.
|
@@ -3194,13 +3203,13 @@ The return value should be destroyed with `duckdb_destroy_scalar_function_set`.
|
|
3194
3203
|
|
3195
3204
|
* @return The scalar function set object.
|
3196
3205
|
*/
|
3197
|
-
|
3206
|
+
DUCKDB_C_API duckdb_scalar_function_set duckdb_create_scalar_function_set(const char *name);
|
3198
3207
|
|
3199
3208
|
/*!
|
3200
3209
|
Destroys the given scalar function set object.
|
3201
3210
|
|
3202
3211
|
*/
|
3203
|
-
|
3212
|
+
DUCKDB_C_API void duckdb_destroy_scalar_function_set(duckdb_scalar_function_set *scalar_function_set);
|
3204
3213
|
|
3205
3214
|
/*!
|
3206
3215
|
Adds the scalar function as a new overload to the scalar function set.
|
@@ -3210,8 +3219,8 @@ Returns DuckDBError if the function could not be added, for example if the overl
|
|
3210
3219
|
* @param set The scalar function set
|
3211
3220
|
* @param function The function to add
|
3212
3221
|
*/
|
3213
|
-
|
3214
|
-
|
3222
|
+
DUCKDB_C_API duckdb_state duckdb_add_scalar_function_to_set(duckdb_scalar_function_set set,
|
3223
|
+
duckdb_scalar_function function);
|
3215
3224
|
|
3216
3225
|
/*!
|
3217
3226
|
Register the scalar function set within the given connection.
|
@@ -3224,7 +3233,7 @@ If the set is incomplete or a function with this name already exists DuckDBError
|
|
3224
3233
|
* @param set The function set to register
|
3225
3234
|
* @return Whether or not the registration was successful.
|
3226
3235
|
*/
|
3227
|
-
|
3236
|
+
DUCKDB_C_API duckdb_state duckdb_register_scalar_function_set(duckdb_connection con, duckdb_scalar_function_set set);
|
3228
3237
|
|
3229
3238
|
//===--------------------------------------------------------------------===//
|
3230
3239
|
// Aggregate Functions
|
@@ -3237,13 +3246,13 @@ The return value should be destroyed with `duckdb_destroy_aggregate_function`.
|
|
3237
3246
|
|
3238
3247
|
* @return The aggregate function object.
|
3239
3248
|
*/
|
3240
|
-
|
3249
|
+
DUCKDB_C_API duckdb_aggregate_function duckdb_create_aggregate_function();
|
3241
3250
|
|
3242
3251
|
/*!
|
3243
3252
|
Destroys the given aggregate function object.
|
3244
3253
|
|
3245
3254
|
*/
|
3246
|
-
|
3255
|
+
DUCKDB_C_API void duckdb_destroy_aggregate_function(duckdb_aggregate_function *aggregate_function);
|
3247
3256
|
|
3248
3257
|
/*!
|
3249
3258
|
Sets the name of the given aggregate function.
|
@@ -3251,7 +3260,7 @@ Sets the name of the given aggregate function.
|
|
3251
3260
|
* @param aggregate_function The aggregate function
|
3252
3261
|
* @param name The name of the aggregate function
|
3253
3262
|
*/
|
3254
|
-
|
3263
|
+
DUCKDB_C_API void duckdb_aggregate_function_set_name(duckdb_aggregate_function aggregate_function, const char *name);
|
3255
3264
|
|
3256
3265
|
/*!
|
3257
3266
|
Adds a parameter to the aggregate function.
|
@@ -3259,8 +3268,8 @@ Adds a parameter to the aggregate function.
|
|
3259
3268
|
* @param aggregate_function The aggregate function.
|
3260
3269
|
* @param type The parameter type. Cannot contain INVALID.
|
3261
3270
|
*/
|
3262
|
-
|
3263
|
-
|
3271
|
+
DUCKDB_C_API void duckdb_aggregate_function_add_parameter(duckdb_aggregate_function aggregate_function,
|
3272
|
+
duckdb_logical_type type);
|
3264
3273
|
|
3265
3274
|
/*!
|
3266
3275
|
Sets the return type of the aggregate function.
|
@@ -3268,8 +3277,8 @@ Sets the return type of the aggregate function.
|
|
3268
3277
|
* @param aggregate_function The aggregate function.
|
3269
3278
|
* @param type The return type. Cannot contain INVALID or ANY.
|
3270
3279
|
*/
|
3271
|
-
|
3272
|
-
|
3280
|
+
DUCKDB_C_API void duckdb_aggregate_function_set_return_type(duckdb_aggregate_function aggregate_function,
|
3281
|
+
duckdb_logical_type type);
|
3273
3282
|
|
3274
3283
|
/*!
|
3275
3284
|
Sets the main functions of the aggregate function.
|
@@ -3281,12 +3290,12 @@ Sets the main functions of the aggregate function.
|
|
3281
3290
|
* @param combine combine states
|
3282
3291
|
* @param finalize finalize states
|
3283
3292
|
*/
|
3284
|
-
|
3285
|
-
|
3286
|
-
|
3287
|
-
|
3288
|
-
|
3289
|
-
|
3293
|
+
DUCKDB_C_API void duckdb_aggregate_function_set_functions(duckdb_aggregate_function aggregate_function,
|
3294
|
+
duckdb_aggregate_state_size state_size,
|
3295
|
+
duckdb_aggregate_init_t state_init,
|
3296
|
+
duckdb_aggregate_update_t update,
|
3297
|
+
duckdb_aggregate_combine_t combine,
|
3298
|
+
duckdb_aggregate_finalize_t finalize);
|
3290
3299
|
|
3291
3300
|
/*!
|
3292
3301
|
Sets the state destructor callback of the aggregate function (optional)
|
@@ -3294,8 +3303,8 @@ Sets the state destructor callback of the aggregate function (optional)
|
|
3294
3303
|
* @param aggregate_function The aggregate function
|
3295
3304
|
* @param destroy state destroy callback
|
3296
3305
|
*/
|
3297
|
-
|
3298
|
-
|
3306
|
+
DUCKDB_C_API void duckdb_aggregate_function_set_destructor(duckdb_aggregate_function aggregate_function,
|
3307
|
+
duckdb_aggregate_destroy_t destroy);
|
3299
3308
|
|
3300
3309
|
/*!
|
3301
3310
|
Register the aggregate function object within the given connection.
|
@@ -3307,15 +3316,15 @@ If the function is incomplete or a function with this name already exists DuckDB
|
|
3307
3316
|
* @param con The connection to register it in.
|
3308
3317
|
* @return Whether or not the registration was successful.
|
3309
3318
|
*/
|
3310
|
-
|
3311
|
-
|
3319
|
+
DUCKDB_C_API duckdb_state duckdb_register_aggregate_function(duckdb_connection con,
|
3320
|
+
duckdb_aggregate_function aggregate_function);
|
3312
3321
|
|
3313
3322
|
/*!
|
3314
3323
|
Sets the NULL handling of the aggregate function to SPECIAL_HANDLING.
|
3315
3324
|
|
3316
3325
|
* @param aggregate_function The aggregate function
|
3317
3326
|
*/
|
3318
|
-
|
3327
|
+
DUCKDB_C_API void duckdb_aggregate_function_set_special_handling(duckdb_aggregate_function aggregate_function);
|
3319
3328
|
|
3320
3329
|
/*!
|
3321
3330
|
Assigns extra information to the scalar function that can be fetched during binding, etc.
|
@@ -3324,8 +3333,8 @@ Assigns extra information to the scalar function that can be fetched during bind
|
|
3324
3333
|
* @param extra_info The extra information
|
3325
3334
|
* @param destroy The callback that will be called to destroy the bind data (if any)
|
3326
3335
|
*/
|
3327
|
-
|
3328
|
-
|
3336
|
+
DUCKDB_C_API void duckdb_aggregate_function_set_extra_info(duckdb_aggregate_function aggregate_function,
|
3337
|
+
void *extra_info, duckdb_delete_callback_t destroy);
|
3329
3338
|
|
3330
3339
|
/*!
|
3331
3340
|
Retrieves the extra info of the function as set in `duckdb_aggregate_function_set_extra_info`.
|
@@ -3333,7 +3342,7 @@ Retrieves the extra info of the function as set in `duckdb_aggregate_function_se
|
|
3333
3342
|
* @param info The info object
|
3334
3343
|
* @return The extra info
|
3335
3344
|
*/
|
3336
|
-
|
3345
|
+
DUCKDB_C_API void *duckdb_aggregate_function_get_extra_info(duckdb_function_info info);
|
3337
3346
|
|
3338
3347
|
/*!
|
3339
3348
|
Report that an error has occurred while executing the aggregate function.
|
@@ -3341,7 +3350,7 @@ Report that an error has occurred while executing the aggregate function.
|
|
3341
3350
|
* @param info The info object
|
3342
3351
|
* @param error The error message
|
3343
3352
|
*/
|
3344
|
-
|
3353
|
+
DUCKDB_C_API void duckdb_aggregate_function_set_error(duckdb_function_info info, const char *error);
|
3345
3354
|
|
3346
3355
|
/*!
|
3347
3356
|
Creates a new empty aggregate function set.
|
@@ -3350,13 +3359,13 @@ The return value should be destroyed with `duckdb_destroy_aggregate_function_set
|
|
3350
3359
|
|
3351
3360
|
* @return The aggregate function set object.
|
3352
3361
|
*/
|
3353
|
-
|
3362
|
+
DUCKDB_C_API duckdb_aggregate_function_set duckdb_create_aggregate_function_set(const char *name);
|
3354
3363
|
|
3355
3364
|
/*!
|
3356
3365
|
Destroys the given aggregate function set object.
|
3357
3366
|
|
3358
3367
|
*/
|
3359
|
-
|
3368
|
+
DUCKDB_C_API void duckdb_destroy_aggregate_function_set(duckdb_aggregate_function_set *aggregate_function_set);
|
3360
3369
|
|
3361
3370
|
/*!
|
3362
3371
|
Adds the aggregate function as a new overload to the aggregate function set.
|
@@ -3366,8 +3375,8 @@ Returns DuckDBError if the function could not be added, for example if the overl
|
|
3366
3375
|
* @param set The aggregate function set
|
3367
3376
|
* @param function The function to add
|
3368
3377
|
*/
|
3369
|
-
|
3370
|
-
|
3378
|
+
DUCKDB_C_API duckdb_state duckdb_add_aggregate_function_to_set(duckdb_aggregate_function_set set,
|
3379
|
+
duckdb_aggregate_function function);
|
3371
3380
|
|
3372
3381
|
/*!
|
3373
3382
|
Register the aggregate function set within the given connection.
|
@@ -3380,8 +3389,8 @@ If the set is incomplete or a function with this name already exists DuckDBError
|
|
3380
3389
|
* @param set The function set to register
|
3381
3390
|
* @return Whether or not the registration was successful.
|
3382
3391
|
*/
|
3383
|
-
|
3384
|
-
|
3392
|
+
DUCKDB_C_API duckdb_state duckdb_register_aggregate_function_set(duckdb_connection con,
|
3393
|
+
duckdb_aggregate_function_set set);
|
3385
3394
|
|
3386
3395
|
//===--------------------------------------------------------------------===//
|
3387
3396
|
// Table Functions
|
@@ -3394,14 +3403,14 @@ The return value should be destroyed with `duckdb_destroy_table_function`.
|
|
3394
3403
|
|
3395
3404
|
* @return The table function object.
|
3396
3405
|
*/
|
3397
|
-
|
3406
|
+
DUCKDB_C_API duckdb_table_function duckdb_create_table_function();
|
3398
3407
|
|
3399
3408
|
/*!
|
3400
3409
|
Destroys the given table function object.
|
3401
3410
|
|
3402
3411
|
* @param table_function The table function to destroy
|
3403
3412
|
*/
|
3404
|
-
|
3413
|
+
DUCKDB_C_API void duckdb_destroy_table_function(duckdb_table_function *table_function);
|
3405
3414
|
|
3406
3415
|
/*!
|
3407
3416
|
Sets the name of the given table function.
|
@@ -3409,7 +3418,7 @@ Sets the name of the given table function.
|
|
3409
3418
|
* @param table_function The table function
|
3410
3419
|
* @param name The name of the table function
|
3411
3420
|
*/
|
3412
|
-
|
3421
|
+
DUCKDB_C_API void duckdb_table_function_set_name(duckdb_table_function table_function, const char *name);
|
3413
3422
|
|
3414
3423
|
/*!
|
3415
3424
|
Adds a parameter to the table function.
|
@@ -3417,7 +3426,7 @@ Adds a parameter to the table function.
|
|
3417
3426
|
* @param table_function The table function.
|
3418
3427
|
* @param type The parameter type. Cannot contain INVALID.
|
3419
3428
|
*/
|
3420
|
-
|
3429
|
+
DUCKDB_C_API void duckdb_table_function_add_parameter(duckdb_table_function table_function, duckdb_logical_type type);
|
3421
3430
|
|
3422
3431
|
/*!
|
3423
3432
|
Adds a named parameter to the table function.
|
@@ -3426,8 +3435,8 @@ Adds a named parameter to the table function.
|
|
3426
3435
|
* @param name The parameter name.
|
3427
3436
|
* @param type The parameter type. Cannot contain INVALID.
|
3428
3437
|
*/
|
3429
|
-
|
3430
|
-
|
3438
|
+
DUCKDB_C_API void duckdb_table_function_add_named_parameter(duckdb_table_function table_function, const char *name,
|
3439
|
+
duckdb_logical_type type);
|
3431
3440
|
|
3432
3441
|
/*!
|
3433
3442
|
Assigns extra information to the table function that can be fetched during binding, etc.
|
@@ -3436,8 +3445,8 @@ Assigns extra information to the table function that can be fetched during bindi
|
|
3436
3445
|
* @param extra_info The extra information
|
3437
3446
|
* @param destroy The callback that will be called to destroy the bind data (if any)
|
3438
3447
|
*/
|
3439
|
-
|
3440
|
-
|
3448
|
+
DUCKDB_C_API void duckdb_table_function_set_extra_info(duckdb_table_function table_function, void *extra_info,
|
3449
|
+
duckdb_delete_callback_t destroy);
|
3441
3450
|
|
3442
3451
|
/*!
|
3443
3452
|
Sets the bind function of the table function.
|
@@ -3445,7 +3454,8 @@ Sets the bind function of the table function.
|
|
3445
3454
|
* @param table_function The table function
|
3446
3455
|
* @param bind The bind function
|
3447
3456
|
*/
|
3448
|
-
|
3457
|
+
DUCKDB_C_API void duckdb_table_function_set_bind(duckdb_table_function table_function,
|
3458
|
+
duckdb_table_function_bind_t bind);
|
3449
3459
|
|
3450
3460
|
/*!
|
3451
3461
|
Sets the init function of the table function.
|
@@ -3453,7 +3463,8 @@ Sets the init function of the table function.
|
|
3453
3463
|
* @param table_function The table function
|
3454
3464
|
* @param init The init function
|
3455
3465
|
*/
|
3456
|
-
|
3466
|
+
DUCKDB_C_API void duckdb_table_function_set_init(duckdb_table_function table_function,
|
3467
|
+
duckdb_table_function_init_t init);
|
3457
3468
|
|
3458
3469
|
/*!
|
3459
3470
|
Sets the thread-local init function of the table function.
|
@@ -3461,8 +3472,8 @@ Sets the thread-local init function of the table function.
|
|
3461
3472
|
* @param table_function The table function
|
3462
3473
|
* @param init The init function
|
3463
3474
|
*/
|
3464
|
-
|
3465
|
-
|
3475
|
+
DUCKDB_C_API void duckdb_table_function_set_local_init(duckdb_table_function table_function,
|
3476
|
+
duckdb_table_function_init_t init);
|
3466
3477
|
|
3467
3478
|
/*!
|
3468
3479
|
Sets the main function of the table function.
|
@@ -3470,8 +3481,8 @@ Sets the main function of the table function.
|
|
3470
3481
|
* @param table_function The table function
|
3471
3482
|
* @param function The function
|
3472
3483
|
*/
|
3473
|
-
|
3474
|
-
|
3484
|
+
DUCKDB_C_API void duckdb_table_function_set_function(duckdb_table_function table_function,
|
3485
|
+
duckdb_table_function_t function);
|
3475
3486
|
|
3476
3487
|
/*!
|
3477
3488
|
Sets whether or not the given table function supports projection pushdown.
|
@@ -3483,7 +3494,8 @@ If this is set to false (the default), the system will expect all columns to be
|
|
3483
3494
|
* @param table_function The table function
|
3484
3495
|
* @param pushdown True if the table function supports projection pushdown, false otherwise.
|
3485
3496
|
*/
|
3486
|
-
|
3497
|
+
DUCKDB_C_API void duckdb_table_function_supports_projection_pushdown(duckdb_table_function table_function,
|
3498
|
+
bool pushdown);
|
3487
3499
|
|
3488
3500
|
/*!
|
3489
3501
|
Register the table function object within the given connection.
|
@@ -3496,7 +3508,7 @@ If the function is incomplete or a function with this name already exists DuckDB
|
|
3496
3508
|
* @param function The function pointer
|
3497
3509
|
* @return Whether or not the registration was successful.
|
3498
3510
|
*/
|
3499
|
-
|
3511
|
+
DUCKDB_C_API duckdb_state duckdb_register_table_function(duckdb_connection con, duckdb_table_function function);
|
3500
3512
|
|
3501
3513
|
//===--------------------------------------------------------------------===//
|
3502
3514
|
// Table Function Bind
|
@@ -3508,7 +3520,7 @@ Retrieves the extra info of the function as set in `duckdb_table_function_set_ex
|
|
3508
3520
|
* @param info The info object
|
3509
3521
|
* @return The extra info
|
3510
3522
|
*/
|
3511
|
-
|
3523
|
+
DUCKDB_C_API void *duckdb_bind_get_extra_info(duckdb_bind_info info);
|
3512
3524
|
|
3513
3525
|
/*!
|
3514
3526
|
Adds a result column to the output of the table function.
|
@@ -3517,7 +3529,7 @@ Adds a result column to the output of the table function.
|
|
3517
3529
|
* @param name The column name.
|
3518
3530
|
* @param type The logical column type.
|
3519
3531
|
*/
|
3520
|
-
|
3532
|
+
DUCKDB_C_API void duckdb_bind_add_result_column(duckdb_bind_info info, const char *name, duckdb_logical_type type);
|
3521
3533
|
|
3522
3534
|
/*!
|
3523
3535
|
Retrieves the number of regular (non-named) parameters to the function.
|
@@ -3525,7 +3537,7 @@ Retrieves the number of regular (non-named) parameters to the function.
|
|
3525
3537
|
* @param info The info object
|
3526
3538
|
* @return The number of parameters
|
3527
3539
|
*/
|
3528
|
-
|
3540
|
+
DUCKDB_C_API idx_t duckdb_bind_get_parameter_count(duckdb_bind_info info);
|
3529
3541
|
|
3530
3542
|
/*!
|
3531
3543
|
Retrieves the parameter at the given index.
|
@@ -3536,7 +3548,7 @@ The result must be destroyed with `duckdb_destroy_value`.
|
|
3536
3548
|
* @param index The index of the parameter to get
|
3537
3549
|
* @return The value of the parameter. Must be destroyed with `duckdb_destroy_value`.
|
3538
3550
|
*/
|
3539
|
-
|
3551
|
+
DUCKDB_C_API duckdb_value duckdb_bind_get_parameter(duckdb_bind_info info, idx_t index);
|
3540
3552
|
|
3541
3553
|
/*!
|
3542
3554
|
Retrieves a named parameter with the given name.
|
@@ -3547,7 +3559,7 @@ The result must be destroyed with `duckdb_destroy_value`.
|
|
3547
3559
|
* @param name The name of the parameter
|
3548
3560
|
* @return The value of the parameter. Must be destroyed with `duckdb_destroy_value`.
|
3549
3561
|
*/
|
3550
|
-
|
3562
|
+
DUCKDB_C_API duckdb_value duckdb_bind_get_named_parameter(duckdb_bind_info info, const char *name);
|
3551
3563
|
|
3552
3564
|
/*!
|
3553
3565
|
Sets the user-provided bind data in the bind object. This object can be retrieved again during execution.
|
@@ -3556,7 +3568,7 @@ Sets the user-provided bind data in the bind object. This object can be retrieve
|
|
3556
3568
|
* @param bind_data The bind data object.
|
3557
3569
|
* @param destroy The callback that will be called to destroy the bind data (if any)
|
3558
3570
|
*/
|
3559
|
-
|
3571
|
+
DUCKDB_C_API void duckdb_bind_set_bind_data(duckdb_bind_info info, void *bind_data, duckdb_delete_callback_t destroy);
|
3560
3572
|
|
3561
3573
|
/*!
|
3562
3574
|
Sets the cardinality estimate for the table function, used for optimization.
|
@@ -3564,7 +3576,7 @@ Sets the cardinality estimate for the table function, used for optimization.
|
|
3564
3576
|
* @param info The bind data object.
|
3565
3577
|
* @param is_exact Whether or not the cardinality estimate is exact, or an approximation
|
3566
3578
|
*/
|
3567
|
-
|
3579
|
+
DUCKDB_C_API void duckdb_bind_set_cardinality(duckdb_bind_info info, idx_t cardinality, bool is_exact);
|
3568
3580
|
|
3569
3581
|
/*!
|
3570
3582
|
Report that an error has occurred while calling bind.
|
@@ -3572,7 +3584,7 @@ Report that an error has occurred while calling bind.
|
|
3572
3584
|
* @param info The info object
|
3573
3585
|
* @param error The error message
|
3574
3586
|
*/
|
3575
|
-
|
3587
|
+
DUCKDB_C_API void duckdb_bind_set_error(duckdb_bind_info info, const char *error);
|
3576
3588
|
|
3577
3589
|
//===--------------------------------------------------------------------===//
|
3578
3590
|
// Table Function Init
|
@@ -3584,7 +3596,7 @@ Retrieves the extra info of the function as set in `duckdb_table_function_set_ex
|
|
3584
3596
|
* @param info The info object
|
3585
3597
|
* @return The extra info
|
3586
3598
|
*/
|
3587
|
-
|
3599
|
+
DUCKDB_C_API void *duckdb_init_get_extra_info(duckdb_init_info info);
|
3588
3600
|
|
3589
3601
|
/*!
|
3590
3602
|
Gets the bind data set by `duckdb_bind_set_bind_data` during the bind.
|
@@ -3595,7 +3607,7 @@ For tracking state, use the init data instead.
|
|
3595
3607
|
* @param info The info object
|
3596
3608
|
* @return The bind data object
|
3597
3609
|
*/
|
3598
|
-
|
3610
|
+
DUCKDB_C_API void *duckdb_init_get_bind_data(duckdb_init_info info);
|
3599
3611
|
|
3600
3612
|
/*!
|
3601
3613
|
Sets the user-provided init data in the init object. This object can be retrieved again during execution.
|
@@ -3604,7 +3616,7 @@ Sets the user-provided init data in the init object. This object can be retrieve
|
|
3604
3616
|
* @param init_data The init data object.
|
3605
3617
|
* @param destroy The callback that will be called to destroy the init data (if any)
|
3606
3618
|
*/
|
3607
|
-
|
3619
|
+
DUCKDB_C_API void duckdb_init_set_init_data(duckdb_init_info info, void *init_data, duckdb_delete_callback_t destroy);
|
3608
3620
|
|
3609
3621
|
/*!
|
3610
3622
|
Returns the number of projected columns.
|
@@ -3614,7 +3626,7 @@ This function must be used if projection pushdown is enabled to figure out which
|
|
3614
3626
|
* @param info The info object
|
3615
3627
|
* @return The number of projected columns.
|
3616
3628
|
*/
|
3617
|
-
|
3629
|
+
DUCKDB_C_API idx_t duckdb_init_get_column_count(duckdb_init_info info);
|
3618
3630
|
|
3619
3631
|
/*!
|
3620
3632
|
Returns the column index of the projected column at the specified position.
|
@@ -3625,7 +3637,7 @@ This function must be used if projection pushdown is enabled to figure out which
|
|
3625
3637
|
* @param column_index The index at which to get the projected column index, from 0..duckdb_init_get_column_count(info)
|
3626
3638
|
* @return The column index of the projected column.
|
3627
3639
|
*/
|
3628
|
-
|
3640
|
+
DUCKDB_C_API idx_t duckdb_init_get_column_index(duckdb_init_info info, idx_t column_index);
|
3629
3641
|
|
3630
3642
|
/*!
|
3631
3643
|
Sets how many threads can process this table function in parallel (default: 1)
|
@@ -3633,7 +3645,7 @@ Sets how many threads can process this table function in parallel (default: 1)
|
|
3633
3645
|
* @param info The info object
|
3634
3646
|
* @param max_threads The maximum amount of threads that can process this table function
|
3635
3647
|
*/
|
3636
|
-
|
3648
|
+
DUCKDB_C_API void duckdb_init_set_max_threads(duckdb_init_info info, idx_t max_threads);
|
3637
3649
|
|
3638
3650
|
/*!
|
3639
3651
|
Report that an error has occurred while calling init.
|
@@ -3641,7 +3653,7 @@ Report that an error has occurred while calling init.
|
|
3641
3653
|
* @param info The info object
|
3642
3654
|
* @param error The error message
|
3643
3655
|
*/
|
3644
|
-
|
3656
|
+
DUCKDB_C_API void duckdb_init_set_error(duckdb_init_info info, const char *error);
|
3645
3657
|
|
3646
3658
|
//===--------------------------------------------------------------------===//
|
3647
3659
|
// Table Function
|
@@ -3653,7 +3665,7 @@ Retrieves the extra info of the function as set in `duckdb_table_function_set_ex
|
|
3653
3665
|
* @param info The info object
|
3654
3666
|
* @return The extra info
|
3655
3667
|
*/
|
3656
|
-
|
3668
|
+
DUCKDB_C_API void *duckdb_function_get_extra_info(duckdb_function_info info);
|
3657
3669
|
|
3658
3670
|
/*!
|
3659
3671
|
Gets the bind data set by `duckdb_bind_set_bind_data` during the bind.
|
@@ -3664,7 +3676,7 @@ For tracking state, use the init data instead.
|
|
3664
3676
|
* @param info The info object
|
3665
3677
|
* @return The bind data object
|
3666
3678
|
*/
|
3667
|
-
|
3679
|
+
DUCKDB_C_API void *duckdb_function_get_bind_data(duckdb_function_info info);
|
3668
3680
|
|
3669
3681
|
/*!
|
3670
3682
|
Gets the init data set by `duckdb_init_set_init_data` during the init.
|
@@ -3672,7 +3684,7 @@ Gets the init data set by `duckdb_init_set_init_data` during the init.
|
|
3672
3684
|
* @param info The info object
|
3673
3685
|
* @return The init data object
|
3674
3686
|
*/
|
3675
|
-
|
3687
|
+
DUCKDB_C_API void *duckdb_function_get_init_data(duckdb_function_info info);
|
3676
3688
|
|
3677
3689
|
/*!
|
3678
3690
|
Gets the thread-local init data set by `duckdb_init_set_init_data` during the local_init.
|
@@ -3680,7 +3692,7 @@ Gets the thread-local init data set by `duckdb_init_set_init_data` during the lo
|
|
3680
3692
|
* @param info The info object
|
3681
3693
|
* @return The init data object
|
3682
3694
|
*/
|
3683
|
-
|
3695
|
+
DUCKDB_C_API void *duckdb_function_get_local_init_data(duckdb_function_info info);
|
3684
3696
|
|
3685
3697
|
/*!
|
3686
3698
|
Report that an error has occurred while executing the function.
|
@@ -3688,7 +3700,7 @@ Report that an error has occurred while executing the function.
|
|
3688
3700
|
* @param info The info object
|
3689
3701
|
* @param error The error message
|
3690
3702
|
*/
|
3691
|
-
|
3703
|
+
DUCKDB_C_API void duckdb_function_set_error(duckdb_function_info info, const char *error);
|
3692
3704
|
|
3693
3705
|
//===--------------------------------------------------------------------===//
|
3694
3706
|
// Replacement Scans
|
@@ -3702,8 +3714,8 @@ Add a replacement scan definition to the specified database.
|
|
3702
3714
|
* @param extra_data Extra data that is passed back into the specified callback
|
3703
3715
|
* @param delete_callback The delete callback to call on the extra data, if any
|
3704
3716
|
*/
|
3705
|
-
|
3706
|
-
|
3717
|
+
DUCKDB_C_API void duckdb_add_replacement_scan(duckdb_database db, duckdb_replacement_callback_t replacement,
|
3718
|
+
void *extra_data, duckdb_delete_callback_t delete_callback);
|
3707
3719
|
|
3708
3720
|
/*!
|
3709
3721
|
Sets the replacement function name. If this function is called in the replacement callback,
|
@@ -3712,7 +3724,8 @@ the replacement scan is performed. If it is not called, the replacement callback
|
|
3712
3724
|
* @param info The info object
|
3713
3725
|
* @param function_name The function name to substitute.
|
3714
3726
|
*/
|
3715
|
-
|
3727
|
+
DUCKDB_C_API void duckdb_replacement_scan_set_function_name(duckdb_replacement_scan_info info,
|
3728
|
+
const char *function_name);
|
3716
3729
|
|
3717
3730
|
/*!
|
3718
3731
|
Adds a parameter to the replacement scan function.
|
@@ -3720,7 +3733,7 @@ Adds a parameter to the replacement scan function.
|
|
3720
3733
|
* @param info The info object
|
3721
3734
|
* @param parameter The parameter to add.
|
3722
3735
|
*/
|
3723
|
-
|
3736
|
+
DUCKDB_C_API void duckdb_replacement_scan_add_parameter(duckdb_replacement_scan_info info, duckdb_value parameter);
|
3724
3737
|
|
3725
3738
|
/*!
|
3726
3739
|
Report that an error has occurred while executing the replacement scan.
|
@@ -3728,7 +3741,7 @@ Report that an error has occurred while executing the replacement scan.
|
|
3728
3741
|
* @param info The info object
|
3729
3742
|
* @param error The error message
|
3730
3743
|
*/
|
3731
|
-
|
3744
|
+
DUCKDB_C_API void duckdb_replacement_scan_set_error(duckdb_replacement_scan_info info, const char *error);
|
3732
3745
|
|
3733
3746
|
//===--------------------------------------------------------------------===//
|
3734
3747
|
// Profiling Info
|
@@ -3740,7 +3753,7 @@ Returns the root node of the profiling information. Returns nullptr, if profilin
|
|
3740
3753
|
* @param connection A connection object.
|
3741
3754
|
* @return A profiling information object.
|
3742
3755
|
*/
|
3743
|
-
|
3756
|
+
DUCKDB_C_API duckdb_profiling_info duckdb_get_profiling_info(duckdb_connection connection);
|
3744
3757
|
|
3745
3758
|
/*!
|
3746
3759
|
Returns the value of the metric of the current profiling info node. Returns nullptr, if the metric does
|
@@ -3751,7 +3764,7 @@ Returns the value of the metric of the current profiling info node. Returns null
|
|
3751
3764
|
* @param key The name of the requested metric.
|
3752
3765
|
* @return The value of the metric. Must be freed with `duckdb_destroy_value`
|
3753
3766
|
*/
|
3754
|
-
|
3767
|
+
DUCKDB_C_API duckdb_value duckdb_profiling_info_get_value(duckdb_profiling_info info, const char *key);
|
3755
3768
|
|
3756
3769
|
/*!
|
3757
3770
|
Returns the key-value metric map of this profiling node as a MAP duckdb_value.
|
@@ -3760,7 +3773,7 @@ The individual elements are accessible via the duckdb_value MAP functions.
|
|
3760
3773
|
* @param info A profiling information object.
|
3761
3774
|
* @return The key-value metric map as a MAP duckdb_value.
|
3762
3775
|
*/
|
3763
|
-
|
3776
|
+
DUCKDB_C_API duckdb_value duckdb_profiling_info_get_metrics(duckdb_profiling_info info);
|
3764
3777
|
|
3765
3778
|
/*!
|
3766
3779
|
Returns the number of children in the current profiling info node.
|
@@ -3768,7 +3781,7 @@ Returns the number of children in the current profiling info node.
|
|
3768
3781
|
* @param info A profiling information object.
|
3769
3782
|
* @return The number of children in the current node.
|
3770
3783
|
*/
|
3771
|
-
|
3784
|
+
DUCKDB_C_API idx_t duckdb_profiling_info_get_child_count(duckdb_profiling_info info);
|
3772
3785
|
|
3773
3786
|
/*!
|
3774
3787
|
Returns the child node at the specified index.
|
@@ -3777,7 +3790,7 @@ Returns the child node at the specified index.
|
|
3777
3790
|
* @param index The index of the child node.
|
3778
3791
|
* @return The child node at the specified index.
|
3779
3792
|
*/
|
3780
|
-
|
3793
|
+
DUCKDB_C_API duckdb_profiling_info duckdb_profiling_info_get_child(duckdb_profiling_info info, idx_t index);
|
3781
3794
|
|
3782
3795
|
//===--------------------------------------------------------------------===//
|
3783
3796
|
// Appender
|
@@ -3808,8 +3821,8 @@ Note that the object must be destroyed with `duckdb_appender_destroy`.
|
|
3808
3821
|
* @param out_appender The resulting appender object.
|
3809
3822
|
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
3810
3823
|
*/
|
3811
|
-
|
3812
|
-
|
3824
|
+
DUCKDB_C_API duckdb_state duckdb_appender_create(duckdb_connection connection, const char *schema, const char *table,
|
3825
|
+
duckdb_appender *out_appender);
|
3813
3826
|
|
3814
3827
|
/*!
|
3815
3828
|
Creates an appender object.
|
@@ -3823,9 +3836,9 @@ Note that the object must be destroyed with `duckdb_appender_destroy`.
|
|
3823
3836
|
* @param out_appender The resulting appender object.
|
3824
3837
|
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
3825
3838
|
*/
|
3826
|
-
|
3827
|
-
|
3828
|
-
|
3839
|
+
DUCKDB_C_API duckdb_state duckdb_appender_create_ext(duckdb_connection connection, const char *catalog,
|
3840
|
+
const char *schema, const char *table,
|
3841
|
+
duckdb_appender *out_appender);
|
3829
3842
|
|
3830
3843
|
/*!
|
3831
3844
|
Returns the number of columns that belong to the appender.
|
@@ -3834,7 +3847,7 @@ If there is no active column list, then this equals the table's physical columns
|
|
3834
3847
|
* @param appender The appender to get the column count from.
|
3835
3848
|
* @return The number of columns in the data chunks.
|
3836
3849
|
*/
|
3837
|
-
|
3850
|
+
DUCKDB_C_API idx_t duckdb_appender_column_count(duckdb_appender appender);
|
3838
3851
|
|
3839
3852
|
/*!
|
3840
3853
|
Returns the type of the column at the specified index. This is either a type in the active column list, or the same type
|
@@ -3846,7 +3859,7 @@ Note: The resulting type must be destroyed with `duckdb_destroy_logical_type`.
|
|
3846
3859
|
* @param col_idx The index of the column to get the type of.
|
3847
3860
|
* @return The `duckdb_logical_type` of the column.
|
3848
3861
|
*/
|
3849
|
-
|
3862
|
+
DUCKDB_C_API duckdb_logical_type duckdb_appender_column_type(duckdb_appender appender, idx_t col_idx);
|
3850
3863
|
|
3851
3864
|
/*!
|
3852
3865
|
Returns the error message associated with the given appender.
|
@@ -3857,7 +3870,7 @@ The error message should not be freed. It will be de-allocated when `duckdb_appe
|
|
3857
3870
|
* @param appender The appender to get the error from.
|
3858
3871
|
* @return The error message, or `nullptr` if there is none.
|
3859
3872
|
*/
|
3860
|
-
|
3873
|
+
DUCKDB_C_API const char *duckdb_appender_error(duckdb_appender appender);
|
3861
3874
|
|
3862
3875
|
/*!
|
3863
3876
|
Flush the appender to the table, forcing the cache of the appender to be cleared. If flushing the data triggers a
|
@@ -3868,7 +3881,7 @@ duckdb_appender_destroy to destroy the invalidated appender.
|
|
3868
3881
|
* @param appender The appender to flush.
|
3869
3882
|
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
3870
3883
|
*/
|
3871
|
-
|
3884
|
+
DUCKDB_C_API duckdb_state duckdb_appender_flush(duckdb_appender appender);
|
3872
3885
|
|
3873
3886
|
/*!
|
3874
3887
|
Closes the appender by flushing all intermediate states and closing it for further appends. If flushing the data
|
@@ -3879,7 +3892,7 @@ appender.
|
|
3879
3892
|
* @param appender The appender to flush and close.
|
3880
3893
|
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
3881
3894
|
*/
|
3882
|
-
|
3895
|
+
DUCKDB_C_API duckdb_state duckdb_appender_close(duckdb_appender appender);
|
3883
3896
|
|
3884
3897
|
/*!
|
3885
3898
|
Closes the appender by flushing all intermediate states to the table and destroying it. By destroying it, this function
|
@@ -3891,7 +3904,7 @@ before destroying the appender, if you need insights into the specific error.
|
|
3891
3904
|
* @param appender The appender to flush, close and destroy.
|
3892
3905
|
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
3893
3906
|
*/
|
3894
|
-
|
3907
|
+
DUCKDB_C_API duckdb_state duckdb_appender_destroy(duckdb_appender *appender);
|
3895
3908
|
|
3896
3909
|
/*!
|
3897
3910
|
Appends a column to the active column list of the appender. Immediately flushes all previous data.
|
@@ -3902,7 +3915,7 @@ with their default values, or NULL.
|
|
3902
3915
|
* @param appender The appender to add the column to.
|
3903
3916
|
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
3904
3917
|
*/
|
3905
|
-
|
3918
|
+
DUCKDB_C_API duckdb_state duckdb_appender_add_column(duckdb_appender appender, const char *name);
|
3906
3919
|
|
3907
3920
|
/*!
|
3908
3921
|
Removes all columns from the active column list of the appender, resetting the appender to treat all columns as active.
|
@@ -3911,12 +3924,12 @@ Immediately flushes all previous data.
|
|
3911
3924
|
* @param appender The appender to clear the columns from.
|
3912
3925
|
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
3913
3926
|
*/
|
3914
|
-
|
3927
|
+
DUCKDB_C_API duckdb_state duckdb_appender_clear_columns(duckdb_appender appender);
|
3915
3928
|
|
3916
3929
|
/*!
|
3917
3930
|
A nop function, provided for backwards compatibility reasons. Does nothing. Only `duckdb_appender_end_row` is required.
|
3918
3931
|
*/
|
3919
|
-
|
3932
|
+
DUCKDB_C_API duckdb_state duckdb_appender_begin_row(duckdb_appender appender);
|
3920
3933
|
|
3921
3934
|
/*!
|
3922
3935
|
Finish the current row of appends. After end_row is called, the next row can be appended.
|
@@ -3924,12 +3937,12 @@ Finish the current row of appends. After end_row is called, the next row can be
|
|
3924
3937
|
* @param appender The appender.
|
3925
3938
|
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
3926
3939
|
*/
|
3927
|
-
|
3940
|
+
DUCKDB_C_API duckdb_state duckdb_appender_end_row(duckdb_appender appender);
|
3928
3941
|
|
3929
3942
|
/*!
|
3930
3943
|
Append a DEFAULT value (NULL if DEFAULT not available for column) to the appender.
|
3931
3944
|
*/
|
3932
|
-
|
3945
|
+
DUCKDB_C_API duckdb_state duckdb_append_default(duckdb_appender appender);
|
3933
3946
|
|
3934
3947
|
/*!
|
3935
3948
|
Append a DEFAULT value, at the specified row and column, (NULL if DEFAULT not available for column) to the chunk created
|
@@ -3942,118 +3955,118 @@ like nextval('seq') or random() are not supported.
|
|
3942
3955
|
* @param row The chunk row index to append the default value to.
|
3943
3956
|
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
3944
3957
|
*/
|
3945
|
-
|
3946
|
-
|
3958
|
+
DUCKDB_C_API duckdb_state duckdb_append_default_to_chunk(duckdb_appender appender, duckdb_data_chunk chunk, idx_t col,
|
3959
|
+
idx_t row);
|
3947
3960
|
|
3948
3961
|
/*!
|
3949
3962
|
Append a bool value to the appender.
|
3950
3963
|
*/
|
3951
|
-
|
3964
|
+
DUCKDB_C_API duckdb_state duckdb_append_bool(duckdb_appender appender, bool value);
|
3952
3965
|
|
3953
3966
|
/*!
|
3954
3967
|
Append an int8_t value to the appender.
|
3955
3968
|
*/
|
3956
|
-
|
3969
|
+
DUCKDB_C_API duckdb_state duckdb_append_int8(duckdb_appender appender, int8_t value);
|
3957
3970
|
|
3958
3971
|
/*!
|
3959
3972
|
Append an int16_t value to the appender.
|
3960
3973
|
*/
|
3961
|
-
|
3974
|
+
DUCKDB_C_API duckdb_state duckdb_append_int16(duckdb_appender appender, int16_t value);
|
3962
3975
|
|
3963
3976
|
/*!
|
3964
3977
|
Append an int32_t value to the appender.
|
3965
3978
|
*/
|
3966
|
-
|
3979
|
+
DUCKDB_C_API duckdb_state duckdb_append_int32(duckdb_appender appender, int32_t value);
|
3967
3980
|
|
3968
3981
|
/*!
|
3969
3982
|
Append an int64_t value to the appender.
|
3970
3983
|
*/
|
3971
|
-
|
3984
|
+
DUCKDB_C_API duckdb_state duckdb_append_int64(duckdb_appender appender, int64_t value);
|
3972
3985
|
|
3973
3986
|
/*!
|
3974
3987
|
Append a duckdb_hugeint value to the appender.
|
3975
3988
|
*/
|
3976
|
-
|
3989
|
+
DUCKDB_C_API duckdb_state duckdb_append_hugeint(duckdb_appender appender, duckdb_hugeint value);
|
3977
3990
|
|
3978
3991
|
/*!
|
3979
3992
|
Append a uint8_t value to the appender.
|
3980
3993
|
*/
|
3981
|
-
|
3994
|
+
DUCKDB_C_API duckdb_state duckdb_append_uint8(duckdb_appender appender, uint8_t value);
|
3982
3995
|
|
3983
3996
|
/*!
|
3984
3997
|
Append a uint16_t value to the appender.
|
3985
3998
|
*/
|
3986
|
-
|
3999
|
+
DUCKDB_C_API duckdb_state duckdb_append_uint16(duckdb_appender appender, uint16_t value);
|
3987
4000
|
|
3988
4001
|
/*!
|
3989
4002
|
Append a uint32_t value to the appender.
|
3990
4003
|
*/
|
3991
|
-
|
4004
|
+
DUCKDB_C_API duckdb_state duckdb_append_uint32(duckdb_appender appender, uint32_t value);
|
3992
4005
|
|
3993
4006
|
/*!
|
3994
4007
|
Append a uint64_t value to the appender.
|
3995
4008
|
*/
|
3996
|
-
|
4009
|
+
DUCKDB_C_API duckdb_state duckdb_append_uint64(duckdb_appender appender, uint64_t value);
|
3997
4010
|
|
3998
4011
|
/*!
|
3999
4012
|
Append a duckdb_uhugeint value to the appender.
|
4000
4013
|
*/
|
4001
|
-
|
4014
|
+
DUCKDB_C_API duckdb_state duckdb_append_uhugeint(duckdb_appender appender, duckdb_uhugeint value);
|
4002
4015
|
|
4003
4016
|
/*!
|
4004
4017
|
Append a float value to the appender.
|
4005
4018
|
*/
|
4006
|
-
|
4019
|
+
DUCKDB_C_API duckdb_state duckdb_append_float(duckdb_appender appender, float value);
|
4007
4020
|
|
4008
4021
|
/*!
|
4009
4022
|
Append a double value to the appender.
|
4010
4023
|
*/
|
4011
|
-
|
4024
|
+
DUCKDB_C_API duckdb_state duckdb_append_double(duckdb_appender appender, double value);
|
4012
4025
|
|
4013
4026
|
/*!
|
4014
4027
|
Append a duckdb_date value to the appender.
|
4015
4028
|
*/
|
4016
|
-
|
4029
|
+
DUCKDB_C_API duckdb_state duckdb_append_date(duckdb_appender appender, duckdb_date value);
|
4017
4030
|
|
4018
4031
|
/*!
|
4019
4032
|
Append a duckdb_time value to the appender.
|
4020
4033
|
*/
|
4021
|
-
|
4034
|
+
DUCKDB_C_API duckdb_state duckdb_append_time(duckdb_appender appender, duckdb_time value);
|
4022
4035
|
|
4023
4036
|
/*!
|
4024
4037
|
Append a duckdb_timestamp value to the appender.
|
4025
4038
|
*/
|
4026
|
-
|
4039
|
+
DUCKDB_C_API duckdb_state duckdb_append_timestamp(duckdb_appender appender, duckdb_timestamp value);
|
4027
4040
|
|
4028
4041
|
/*!
|
4029
4042
|
Append a duckdb_interval value to the appender.
|
4030
4043
|
*/
|
4031
|
-
|
4044
|
+
DUCKDB_C_API duckdb_state duckdb_append_interval(duckdb_appender appender, duckdb_interval value);
|
4032
4045
|
|
4033
4046
|
/*!
|
4034
4047
|
Append a varchar value to the appender.
|
4035
4048
|
*/
|
4036
|
-
|
4049
|
+
DUCKDB_C_API duckdb_state duckdb_append_varchar(duckdb_appender appender, const char *val);
|
4037
4050
|
|
4038
4051
|
/*!
|
4039
4052
|
Append a varchar value to the appender.
|
4040
4053
|
*/
|
4041
|
-
|
4054
|
+
DUCKDB_C_API duckdb_state duckdb_append_varchar_length(duckdb_appender appender, const char *val, idx_t length);
|
4042
4055
|
|
4043
4056
|
/*!
|
4044
4057
|
Append a blob value to the appender.
|
4045
4058
|
*/
|
4046
|
-
|
4059
|
+
DUCKDB_C_API duckdb_state duckdb_append_blob(duckdb_appender appender, const void *data, idx_t length);
|
4047
4060
|
|
4048
4061
|
/*!
|
4049
4062
|
Append a NULL value to the appender (of any type).
|
4050
4063
|
*/
|
4051
|
-
|
4064
|
+
DUCKDB_C_API duckdb_state duckdb_append_null(duckdb_appender appender);
|
4052
4065
|
|
4053
4066
|
/*!
|
4054
4067
|
Append a duckdb_value to the appender.
|
4055
4068
|
*/
|
4056
|
-
|
4069
|
+
DUCKDB_C_API duckdb_state duckdb_append_value(duckdb_appender appender, duckdb_value value);
|
4057
4070
|
|
4058
4071
|
/*!
|
4059
4072
|
Appends a pre-filled data chunk to the specified appender.
|
@@ -4063,7 +4076,7 @@ Appends a pre-filled data chunk to the specified appender.
|
|
4063
4076
|
* @param chunk The data chunk to append.
|
4064
4077
|
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
4065
4078
|
*/
|
4066
|
-
|
4079
|
+
DUCKDB_C_API duckdb_state duckdb_append_data_chunk(duckdb_appender appender, duckdb_data_chunk chunk);
|
4067
4080
|
|
4068
4081
|
//===--------------------------------------------------------------------===//
|
4069
4082
|
// Table Description
|
@@ -4079,8 +4092,8 @@ resulting table_description, even if the function returns `DuckDBError`.
|
|
4079
4092
|
* @param out The resulting table description object.
|
4080
4093
|
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
4081
4094
|
*/
|
4082
|
-
|
4083
|
-
|
4095
|
+
DUCKDB_C_API duckdb_state duckdb_table_description_create(duckdb_connection connection, const char *schema,
|
4096
|
+
const char *table, duckdb_table_description *out);
|
4084
4097
|
|
4085
4098
|
/*!
|
4086
4099
|
Creates a table description object. Note that `duckdb_table_description_destroy` must be called on the resulting
|
@@ -4093,16 +4106,16 @@ table_description, even if the function returns `DuckDBError`.
|
|
4093
4106
|
* @param out The resulting table description object.
|
4094
4107
|
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
4095
4108
|
*/
|
4096
|
-
|
4097
|
-
|
4098
|
-
|
4109
|
+
DUCKDB_C_API duckdb_state duckdb_table_description_create_ext(duckdb_connection connection, const char *catalog,
|
4110
|
+
const char *schema, const char *table,
|
4111
|
+
duckdb_table_description *out);
|
4099
4112
|
|
4100
4113
|
/*!
|
4101
4114
|
Destroy the TableDescription object.
|
4102
4115
|
|
4103
4116
|
* @param table_description The table_description to destroy.
|
4104
4117
|
*/
|
4105
|
-
|
4118
|
+
DUCKDB_C_API void duckdb_table_description_destroy(duckdb_table_description *table_description);
|
4106
4119
|
|
4107
4120
|
/*!
|
4108
4121
|
Returns the error message associated with the given table_description.
|
@@ -4112,7 +4125,7 @@ The error message should not be freed. It will be de-allocated when `duckdb_tabl
|
|
4112
4125
|
* @param table_description The table_description to get the error from.
|
4113
4126
|
* @return The error message, or `nullptr` if there is none.
|
4114
4127
|
*/
|
4115
|
-
|
4128
|
+
DUCKDB_C_API const char *duckdb_table_description_error(duckdb_table_description table_description);
|
4116
4129
|
|
4117
4130
|
/*!
|
4118
4131
|
Check if the column at 'index' index of the table has a DEFAULT expression.
|
@@ -4122,7 +4135,7 @@ Check if the column at 'index' index of the table has a DEFAULT expression.
|
|
4122
4135
|
* @param out The out-parameter used to store the result.
|
4123
4136
|
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
4124
4137
|
*/
|
4125
|
-
|
4138
|
+
DUCKDB_C_API duckdb_state duckdb_column_has_default(duckdb_table_description table_description, idx_t index, bool *out);
|
4126
4139
|
|
4127
4140
|
/*!
|
4128
4141
|
Obtain the column name at 'index'.
|
@@ -4132,7 +4145,7 @@ The out result must be destroyed with `duckdb_free`.
|
|
4132
4145
|
* @param index The index of the column to query.
|
4133
4146
|
* @return The column name.
|
4134
4147
|
*/
|
4135
|
-
|
4148
|
+
DUCKDB_C_API char *duckdb_table_description_get_column_name(duckdb_table_description table_description, idx_t index);
|
4136
4149
|
|
4137
4150
|
//===--------------------------------------------------------------------===//
|
4138
4151
|
// Arrow Interface
|
@@ -4154,7 +4167,7 @@ query fails, otherwise the error stored within the result will not be freed corr
|
|
4154
4167
|
* @param out_result The query result.
|
4155
4168
|
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
4156
4169
|
*/
|
4157
|
-
|
4170
|
+
DUCKDB_C_API duckdb_state duckdb_query_arrow(duckdb_connection connection, const char *query, duckdb_arrow *out_result);
|
4158
4171
|
|
4159
4172
|
/*!
|
4160
4173
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
@@ -4166,7 +4179,7 @@ ArrowSchema object.
|
|
4166
4179
|
* @param out_schema The output schema.
|
4167
4180
|
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
4168
4181
|
*/
|
4169
|
-
|
4182
|
+
DUCKDB_C_API duckdb_state duckdb_query_arrow_schema(duckdb_arrow result, duckdb_arrow_schema *out_schema);
|
4170
4183
|
|
4171
4184
|
/*!
|
4172
4185
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
@@ -4178,8 +4191,8 @@ ArrowSchema object.
|
|
4178
4191
|
* @param out_schema The output schema.
|
4179
4192
|
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
4180
4193
|
*/
|
4181
|
-
|
4182
|
-
|
4194
|
+
DUCKDB_C_API duckdb_state duckdb_prepared_arrow_schema(duckdb_prepared_statement prepared,
|
4195
|
+
duckdb_arrow_schema *out_schema);
|
4183
4196
|
|
4184
4197
|
/*!
|
4185
4198
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
@@ -4191,7 +4204,8 @@ ArrowArray object.
|
|
4191
4204
|
* @param chunk The data chunk to convert.
|
4192
4205
|
* @param out_array The output array.
|
4193
4206
|
*/
|
4194
|
-
|
4207
|
+
DUCKDB_C_API void duckdb_result_arrow_array(duckdb_result result, duckdb_data_chunk chunk,
|
4208
|
+
duckdb_arrow_array *out_array);
|
4195
4209
|
|
4196
4210
|
/*!
|
4197
4211
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
@@ -4206,7 +4220,7 @@ So consume the out_array before calling this function again.
|
|
4206
4220
|
* @param out_array The output array.
|
4207
4221
|
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
4208
4222
|
*/
|
4209
|
-
|
4223
|
+
DUCKDB_C_API duckdb_state duckdb_query_arrow_array(duckdb_arrow result, duckdb_arrow_array *out_array);
|
4210
4224
|
|
4211
4225
|
/*!
|
4212
4226
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
@@ -4216,7 +4230,7 @@ Returns the number of columns present in the arrow result object.
|
|
4216
4230
|
* @param result The result object.
|
4217
4231
|
* @return The number of columns present in the result object.
|
4218
4232
|
*/
|
4219
|
-
|
4233
|
+
DUCKDB_C_API idx_t duckdb_arrow_column_count(duckdb_arrow result);
|
4220
4234
|
|
4221
4235
|
/*!
|
4222
4236
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
@@ -4226,7 +4240,7 @@ Returns the number of rows present in the arrow result object.
|
|
4226
4240
|
* @param result The result object.
|
4227
4241
|
* @return The number of rows present in the result object.
|
4228
4242
|
*/
|
4229
|
-
|
4243
|
+
DUCKDB_C_API idx_t duckdb_arrow_row_count(duckdb_arrow result);
|
4230
4244
|
|
4231
4245
|
/*!
|
4232
4246
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
@@ -4237,7 +4251,7 @@ INSERT/UPDATE/DELETE queries. For other queries the rows_changed will be 0.
|
|
4237
4251
|
* @param result The result object.
|
4238
4252
|
* @return The number of rows changed.
|
4239
4253
|
*/
|
4240
|
-
|
4254
|
+
DUCKDB_C_API idx_t duckdb_arrow_rows_changed(duckdb_arrow result);
|
4241
4255
|
|
4242
4256
|
/*!
|
4243
4257
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
@@ -4250,7 +4264,7 @@ The error message should not be freed. It will be de-allocated when `duckdb_dest
|
|
4250
4264
|
* @param result The result object to fetch the error from.
|
4251
4265
|
* @return The error of the result.
|
4252
4266
|
*/
|
4253
|
-
|
4267
|
+
DUCKDB_C_API const char *duckdb_query_arrow_error(duckdb_arrow result);
|
4254
4268
|
|
4255
4269
|
/*!
|
4256
4270
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
@@ -4259,7 +4273,7 @@ Closes the result and de-allocates all memory allocated for the arrow result.
|
|
4259
4273
|
|
4260
4274
|
* @param result The result to destroy.
|
4261
4275
|
*/
|
4262
|
-
|
4276
|
+
DUCKDB_C_API void duckdb_destroy_arrow(duckdb_arrow *result);
|
4263
4277
|
|
4264
4278
|
/*!
|
4265
4279
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
@@ -4268,7 +4282,7 @@ Releases the arrow array stream and de-allocates its memory.
|
|
4268
4282
|
|
4269
4283
|
* @param stream_p The arrow array stream to destroy.
|
4270
4284
|
*/
|
4271
|
-
|
4285
|
+
DUCKDB_C_API void duckdb_destroy_arrow_stream(duckdb_arrow_stream *stream_p);
|
4272
4286
|
|
4273
4287
|
/*!
|
4274
4288
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
@@ -4280,8 +4294,8 @@ Note that after running `duckdb_execute_prepared_arrow`, `duckdb_destroy_arrow`
|
|
4280
4294
|
* @param out_result The query result.
|
4281
4295
|
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
4282
4296
|
*/
|
4283
|
-
|
4284
|
-
|
4297
|
+
DUCKDB_C_API duckdb_state duckdb_execute_prepared_arrow(duckdb_prepared_statement prepared_statement,
|
4298
|
+
duckdb_arrow *out_result);
|
4285
4299
|
|
4286
4300
|
/*!
|
4287
4301
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
@@ -4293,8 +4307,8 @@ Scans the Arrow stream and creates a view with the given name.
|
|
4293
4307
|
* @param arrow Arrow stream wrapper.
|
4294
4308
|
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
4295
4309
|
*/
|
4296
|
-
|
4297
|
-
|
4310
|
+
DUCKDB_C_API duckdb_state duckdb_arrow_scan(duckdb_connection connection, const char *table_name,
|
4311
|
+
duckdb_arrow_stream arrow);
|
4298
4312
|
|
4299
4313
|
/*!
|
4300
4314
|
**DEPRECATION NOTICE**: This method is scheduled for removal in a future release.
|
@@ -4309,9 +4323,9 @@ Note that after running `duckdb_arrow_array_scan`, `duckdb_destroy_arrow_stream`
|
|
4309
4323
|
* @param out_stream Output array stream that wraps around the passed schema, for releasing/deleting once done.
|
4310
4324
|
* @return `DuckDBSuccess` on success or `DuckDBError` on failure.
|
4311
4325
|
*/
|
4312
|
-
|
4313
|
-
|
4314
|
-
|
4326
|
+
DUCKDB_C_API duckdb_state duckdb_arrow_array_scan(duckdb_connection connection, const char *table_name,
|
4327
|
+
duckdb_arrow_schema arrow_schema, duckdb_arrow_array arrow_array,
|
4328
|
+
duckdb_arrow_stream *out_stream);
|
4315
4329
|
|
4316
4330
|
#endif
|
4317
4331
|
//===--------------------------------------------------------------------===//
|
@@ -4326,7 +4340,7 @@ Will return after `max_tasks` have been executed, or if there are no more tasks
|
|
4326
4340
|
* @param database The database object to execute tasks for
|
4327
4341
|
* @param max_tasks The maximum amount of tasks to execute
|
4328
4342
|
*/
|
4329
|
-
|
4343
|
+
DUCKDB_C_API void duckdb_execute_tasks(duckdb_database database, idx_t max_tasks);
|
4330
4344
|
|
4331
4345
|
/*!
|
4332
4346
|
Creates a task state that can be used with duckdb_execute_tasks_state to execute tasks until
|
@@ -4337,7 +4351,7 @@ Creates a task state that can be used with duckdb_execute_tasks_state to execute
|
|
4337
4351
|
* @param database The database object to create the task state for
|
4338
4352
|
* @return The task state that can be used with duckdb_execute_tasks_state.
|
4339
4353
|
*/
|
4340
|
-
|
4354
|
+
DUCKDB_C_API duckdb_task_state duckdb_create_task_state(duckdb_database database);
|
4341
4355
|
|
4342
4356
|
/*!
|
4343
4357
|
Execute DuckDB tasks on this thread.
|
@@ -4347,7 +4361,7 @@ Multiple threads can share the same duckdb_task_state.
|
|
4347
4361
|
|
4348
4362
|
* @param state The task state of the executor
|
4349
4363
|
*/
|
4350
|
-
|
4364
|
+
DUCKDB_C_API void duckdb_execute_tasks_state(duckdb_task_state state);
|
4351
4365
|
|
4352
4366
|
/*!
|
4353
4367
|
Execute DuckDB tasks on this thread.
|
@@ -4361,14 +4375,14 @@ Multiple threads can share the same duckdb_task_state.
|
|
4361
4375
|
* @param max_tasks The maximum amount of tasks to execute
|
4362
4376
|
* @return The amount of tasks that have actually been executed
|
4363
4377
|
*/
|
4364
|
-
|
4378
|
+
DUCKDB_C_API idx_t duckdb_execute_n_tasks_state(duckdb_task_state state, idx_t max_tasks);
|
4365
4379
|
|
4366
4380
|
/*!
|
4367
4381
|
Finish execution on a specific task.
|
4368
4382
|
|
4369
4383
|
* @param state The task state to finish execution
|
4370
4384
|
*/
|
4371
|
-
|
4385
|
+
DUCKDB_C_API void duckdb_finish_execution(duckdb_task_state state);
|
4372
4386
|
|
4373
4387
|
/*!
|
4374
4388
|
Check if the provided duckdb_task_state has finished execution
|
@@ -4376,7 +4390,7 @@ Check if the provided duckdb_task_state has finished execution
|
|
4376
4390
|
* @param state The task state to inspect
|
4377
4391
|
* @return Whether or not duckdb_finish_execution has been called on the task state
|
4378
4392
|
*/
|
4379
|
-
|
4393
|
+
DUCKDB_C_API bool duckdb_task_state_is_finished(duckdb_task_state state);
|
4380
4394
|
|
4381
4395
|
/*!
|
4382
4396
|
Destroys the task state returned from duckdb_create_task_state.
|
@@ -4386,14 +4400,14 @@ on the task state.
|
|
4386
4400
|
|
4387
4401
|
* @param state The task state to clean up
|
4388
4402
|
*/
|
4389
|
-
|
4403
|
+
DUCKDB_C_API void duckdb_destroy_task_state(duckdb_task_state state);
|
4390
4404
|
|
4391
4405
|
/*!
|
4392
4406
|
Returns true if the execution of the current query is finished.
|
4393
4407
|
|
4394
4408
|
* @param con The connection on which to check
|
4395
4409
|
*/
|
4396
|
-
|
4410
|
+
DUCKDB_C_API bool duckdb_execution_is_finished(duckdb_connection con);
|
4397
4411
|
|
4398
4412
|
//===--------------------------------------------------------------------===//
|
4399
4413
|
// Streaming Result Interface
|
@@ -4418,7 +4432,7 @@ It is not known beforehand how many chunks will be returned by this result.
|
|
4418
4432
|
* @param result The result object to fetch the data chunk from.
|
4419
4433
|
* @return The resulting data chunk. Returns `NULL` if the result has an error.
|
4420
4434
|
*/
|
4421
|
-
|
4435
|
+
DUCKDB_C_API duckdb_data_chunk duckdb_stream_fetch_chunk(duckdb_result result);
|
4422
4436
|
|
4423
4437
|
#endif
|
4424
4438
|
/*!
|
@@ -4431,7 +4445,7 @@ It is not known beforehand how many chunks will be returned by this result.
|
|
4431
4445
|
* @param result The result object to fetch the data chunk from.
|
4432
4446
|
* @return The resulting data chunk. Returns `NULL` if the result has an error.
|
4433
4447
|
*/
|
4434
|
-
|
4448
|
+
DUCKDB_C_API duckdb_data_chunk duckdb_fetch_chunk(duckdb_result result);
|
4435
4449
|
|
4436
4450
|
//===--------------------------------------------------------------------===//
|
4437
4451
|
// Cast Functions
|
@@ -4442,7 +4456,7 @@ Creates a new cast function object.
|
|
4442
4456
|
|
4443
4457
|
* @return The cast function object.
|
4444
4458
|
*/
|
4445
|
-
|
4459
|
+
DUCKDB_C_API duckdb_cast_function duckdb_create_cast_function();
|
4446
4460
|
|
4447
4461
|
/*!
|
4448
4462
|
Sets the source type of the cast function.
|
@@ -4450,8 +4464,8 @@ Sets the source type of the cast function.
|
|
4450
4464
|
* @param cast_function The cast function object.
|
4451
4465
|
* @param source_type The source type to set.
|
4452
4466
|
*/
|
4453
|
-
|
4454
|
-
|
4467
|
+
DUCKDB_C_API void duckdb_cast_function_set_source_type(duckdb_cast_function cast_function,
|
4468
|
+
duckdb_logical_type source_type);
|
4455
4469
|
|
4456
4470
|
/*!
|
4457
4471
|
Sets the target type of the cast function.
|
@@ -4459,8 +4473,8 @@ Sets the target type of the cast function.
|
|
4459
4473
|
* @param cast_function The cast function object.
|
4460
4474
|
* @param target_type The target type to set.
|
4461
4475
|
*/
|
4462
|
-
|
4463
|
-
|
4476
|
+
DUCKDB_C_API void duckdb_cast_function_set_target_type(duckdb_cast_function cast_function,
|
4477
|
+
duckdb_logical_type target_type);
|
4464
4478
|
|
4465
4479
|
/*!
|
4466
4480
|
Sets the "cost" of implicitly casting the source type to the target type using this function.
|
@@ -4468,7 +4482,7 @@ Sets the "cost" of implicitly casting the source type to the target type using t
|
|
4468
4482
|
* @param cast_function The cast function object.
|
4469
4483
|
* @param cost The cost to set.
|
4470
4484
|
*/
|
4471
|
-
|
4485
|
+
DUCKDB_C_API void duckdb_cast_function_set_implicit_cast_cost(duckdb_cast_function cast_function, int64_t cost);
|
4472
4486
|
|
4473
4487
|
/*!
|
4474
4488
|
Sets the actual cast function to use.
|
@@ -4476,7 +4490,8 @@ Sets the actual cast function to use.
|
|
4476
4490
|
* @param cast_function The cast function object.
|
4477
4491
|
* @param function The function to set.
|
4478
4492
|
*/
|
4479
|
-
|
4493
|
+
DUCKDB_C_API void duckdb_cast_function_set_function(duckdb_cast_function cast_function,
|
4494
|
+
duckdb_cast_function_t function);
|
4480
4495
|
|
4481
4496
|
/*!
|
4482
4497
|
Assigns extra information to the cast function that can be fetched during execution, etc.
|
@@ -4484,8 +4499,8 @@ Assigns extra information to the cast function that can be fetched during execut
|
|
4484
4499
|
* @param extra_info The extra information
|
4485
4500
|
* @param destroy The callback that will be called to destroy the extra information (if any)
|
4486
4501
|
*/
|
4487
|
-
|
4488
|
-
|
4502
|
+
DUCKDB_C_API void duckdb_cast_function_set_extra_info(duckdb_cast_function cast_function, void *extra_info,
|
4503
|
+
duckdb_delete_callback_t destroy);
|
4489
4504
|
|
4490
4505
|
/*!
|
4491
4506
|
Retrieves the extra info of the function as set in `duckdb_cast_function_set_extra_info`.
|
@@ -4493,7 +4508,7 @@ Retrieves the extra info of the function as set in `duckdb_cast_function_set_ext
|
|
4493
4508
|
* @param info The info object.
|
4494
4509
|
* @return The extra info.
|
4495
4510
|
*/
|
4496
|
-
|
4511
|
+
DUCKDB_C_API void *duckdb_cast_function_get_extra_info(duckdb_function_info info);
|
4497
4512
|
|
4498
4513
|
/*!
|
4499
4514
|
Get the cast execution mode from the given function info.
|
@@ -4501,7 +4516,7 @@ Get the cast execution mode from the given function info.
|
|
4501
4516
|
* @param info The info object.
|
4502
4517
|
* @return The cast mode.
|
4503
4518
|
*/
|
4504
|
-
|
4519
|
+
DUCKDB_C_API duckdb_cast_mode duckdb_cast_function_get_cast_mode(duckdb_function_info info);
|
4505
4520
|
|
4506
4521
|
/*!
|
4507
4522
|
Report that an error has occurred while executing the cast function.
|
@@ -4509,7 +4524,7 @@ Report that an error has occurred while executing the cast function.
|
|
4509
4524
|
* @param info The info object.
|
4510
4525
|
* @param error The error message.
|
4511
4526
|
*/
|
4512
|
-
|
4527
|
+
DUCKDB_C_API void duckdb_cast_function_set_error(duckdb_function_info info, const char *error);
|
4513
4528
|
|
4514
4529
|
/*!
|
4515
4530
|
Report that an error has occurred while executing the cast function, setting the corresponding output row to NULL.
|
@@ -4519,8 +4534,8 @@ Report that an error has occurred while executing the cast function, setting the
|
|
4519
4534
|
* @param row The index of the row within the output vector to set to NULL.
|
4520
4535
|
* @param output The output vector.
|
4521
4536
|
*/
|
4522
|
-
|
4523
|
-
|
4537
|
+
DUCKDB_C_API void duckdb_cast_function_set_row_error(duckdb_function_info info, const char *error, idx_t row,
|
4538
|
+
duckdb_vector output);
|
4524
4539
|
|
4525
4540
|
/*!
|
4526
4541
|
Registers a cast function within the given connection.
|
@@ -4529,14 +4544,14 @@ Registers a cast function within the given connection.
|
|
4529
4544
|
* @param cast_function The cast function to register.
|
4530
4545
|
* @return Whether or not the registration was successful.
|
4531
4546
|
*/
|
4532
|
-
|
4547
|
+
DUCKDB_C_API duckdb_state duckdb_register_cast_function(duckdb_connection con, duckdb_cast_function cast_function);
|
4533
4548
|
|
4534
4549
|
/*!
|
4535
4550
|
Destroys the cast function object.
|
4536
4551
|
|
4537
4552
|
* @param cast_function The cast function object.
|
4538
4553
|
*/
|
4539
|
-
|
4554
|
+
DUCKDB_C_API void duckdb_destroy_cast_function(duckdb_cast_function *cast_function);
|
4540
4555
|
|
4541
4556
|
#endif
|
4542
4557
|
|