duckdb 0.7.2-dev2507.0 → 0.7.2-dev2675.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/binding.gyp +7 -7
- package/package.json +2 -2
- package/src/connection.cpp +1 -1
- package/src/duckdb/extension/icu/icu-dateadd.cpp +3 -3
- package/src/duckdb/extension/icu/icu-datepart.cpp +3 -3
- package/src/duckdb/extension/icu/icu-datesub.cpp +2 -2
- package/src/duckdb/extension/icu/icu-datetrunc.cpp +1 -1
- package/src/duckdb/extension/icu/icu-extension.cpp +3 -3
- package/src/duckdb/extension/icu/icu-list-range.cpp +2 -2
- package/src/duckdb/extension/icu/icu-makedate.cpp +1 -1
- package/src/duckdb/extension/icu/icu-strptime.cpp +4 -4
- package/src/duckdb/extension/icu/icu-table-range.cpp +2 -2
- package/src/duckdb/extension/icu/icu-timebucket.cpp +1 -1
- package/src/duckdb/extension/icu/icu-timezone.cpp +4 -4
- package/src/duckdb/extension/json/json-extension.cpp +6 -6
- package/src/duckdb/extension/parquet/parquet-extension.cpp +9 -8
- package/src/duckdb/extension/parquet/parquet_statistics.cpp +3 -0
- package/src/duckdb/src/catalog/catalog.cpp +166 -127
- package/src/duckdb/src/catalog/catalog_entry/copy_function_catalog_entry.cpp +3 -3
- package/src/duckdb/src/catalog/catalog_entry/duck_index_entry.cpp +1 -1
- package/src/duckdb/src/catalog/catalog_entry/duck_schema_entry.cpp +90 -82
- package/src/duckdb/src/catalog/catalog_entry/duck_table_entry.cpp +65 -67
- package/src/duckdb/src/catalog/catalog_entry/index_catalog_entry.cpp +3 -3
- package/src/duckdb/src/catalog/catalog_entry/pragma_function_catalog_entry.cpp +4 -4
- package/src/duckdb/src/catalog/catalog_entry/scalar_function_catalog_entry.cpp +8 -8
- package/src/duckdb/src/catalog/catalog_entry/scalar_macro_catalog_entry.cpp +10 -10
- package/src/duckdb/src/catalog/catalog_entry/schema_catalog_entry.cpp +6 -6
- package/src/duckdb/src/catalog/catalog_entry/sequence_catalog_entry.cpp +6 -6
- package/src/duckdb/src/catalog/catalog_entry/table_catalog_entry.cpp +4 -4
- package/src/duckdb/src/catalog/catalog_entry/table_function_catalog_entry.cpp +9 -9
- package/src/duckdb/src/catalog/catalog_entry/type_catalog_entry.cpp +5 -5
- package/src/duckdb/src/catalog/catalog_entry/view_catalog_entry.cpp +23 -23
- package/src/duckdb/src/catalog/catalog_entry.cpp +27 -6
- package/src/duckdb/src/catalog/catalog_search_path.cpp +2 -2
- package/src/duckdb/src/catalog/catalog_set.cpp +84 -87
- package/src/duckdb/src/catalog/catalog_transaction.cpp +1 -1
- package/src/duckdb/src/catalog/default/default_functions.cpp +1 -1
- package/src/duckdb/src/catalog/default/default_schemas.cpp +1 -1
- package/src/duckdb/src/catalog/default/default_types.cpp +1 -1
- package/src/duckdb/src/catalog/default/default_views.cpp +1 -1
- package/src/duckdb/src/catalog/dependency_list.cpp +2 -2
- package/src/duckdb/src/catalog/dependency_manager.cpp +9 -10
- package/src/duckdb/src/catalog/duck_catalog.cpp +30 -26
- package/src/duckdb/src/catalog/similar_catalog_entry.cpp +1 -1
- package/src/duckdb/src/common/radix_partitioning.cpp +1 -1
- package/src/duckdb/src/common/types.cpp +15 -27
- package/src/duckdb/src/execution/index/art/art.cpp +286 -269
- package/src/duckdb/src/execution/index/art/art_key.cpp +22 -32
- package/src/duckdb/src/execution/index/art/fixed_size_allocator.cpp +224 -0
- package/src/duckdb/src/execution/index/art/iterator.cpp +142 -123
- package/src/duckdb/src/execution/index/art/leaf.cpp +319 -170
- package/src/duckdb/src/execution/index/art/leaf_segment.cpp +42 -0
- package/src/duckdb/src/execution/index/art/node.cpp +444 -379
- package/src/duckdb/src/execution/index/art/node16.cpp +178 -114
- package/src/duckdb/src/execution/index/art/node256.cpp +117 -79
- package/src/duckdb/src/execution/index/art/node4.cpp +169 -114
- package/src/duckdb/src/execution/index/art/node48.cpp +175 -105
- package/src/duckdb/src/execution/index/art/prefix.cpp +405 -127
- package/src/duckdb/src/execution/index/art/prefix_segment.cpp +42 -0
- package/src/duckdb/src/execution/index/art/swizzleable_pointer.cpp +10 -85
- package/src/duckdb/src/execution/operator/join/physical_index_join.cpp +4 -3
- package/src/duckdb/src/execution/operator/persistent/base_csv_reader.cpp +2 -2
- package/src/duckdb/src/execution/operator/persistent/csv_reader_options.cpp +2 -0
- package/src/duckdb/src/execution/operator/persistent/physical_batch_insert.cpp +4 -3
- package/src/duckdb/src/execution/operator/persistent/physical_export.cpp +19 -18
- package/src/duckdb/src/execution/operator/persistent/physical_insert.cpp +5 -5
- package/src/duckdb/src/execution/operator/schema/physical_alter.cpp +1 -1
- package/src/duckdb/src/execution/operator/schema/physical_create_function.cpp +1 -1
- package/src/duckdb/src/execution/operator/schema/physical_create_index.cpp +17 -17
- package/src/duckdb/src/execution/operator/schema/physical_create_schema.cpp +1 -1
- package/src/duckdb/src/execution/operator/schema/physical_create_sequence.cpp +1 -1
- package/src/duckdb/src/execution/operator/schema/physical_create_table.cpp +2 -2
- package/src/duckdb/src/execution/operator/schema/physical_create_type.cpp +4 -3
- package/src/duckdb/src/execution/operator/schema/physical_create_view.cpp +1 -1
- package/src/duckdb/src/execution/operator/schema/physical_detach.cpp +1 -1
- package/src/duckdb/src/execution/operator/schema/physical_drop.cpp +2 -2
- package/src/duckdb/src/execution/physical_plan/plan_aggregate.cpp +1 -1
- package/src/duckdb/src/execution/physical_plan/plan_comparison_join.cpp +4 -4
- package/src/duckdb/src/execution/physical_plan/plan_create_table.cpp +4 -3
- package/src/duckdb/src/execution/physical_plan/plan_delete.cpp +1 -1
- package/src/duckdb/src/execution/physical_plan/plan_insert.cpp +1 -1
- package/src/duckdb/src/execution/physical_plan/plan_update.cpp +1 -1
- package/src/duckdb/src/function/built_in_functions.cpp +10 -10
- package/src/duckdb/src/function/function_binder.cpp +3 -3
- package/src/duckdb/src/function/scalar/list/list_aggregates.cpp +5 -6
- package/src/duckdb/src/function/scalar/operators/arithmetic.cpp +2 -2
- package/src/duckdb/src/function/scalar/sequence/nextval.cpp +9 -8
- package/src/duckdb/src/function/scalar/system/aggregate_export.cpp +6 -6
- package/src/duckdb/src/function/table/arrow.cpp +5 -5
- package/src/duckdb/src/function/table/read_csv.cpp +5 -1
- package/src/duckdb/src/function/table/system/duckdb_columns.cpp +8 -7
- package/src/duckdb/src/function/table/system/duckdb_constraints.cpp +14 -14
- package/src/duckdb/src/function/table/system/duckdb_databases.cpp +2 -2
- package/src/duckdb/src/function/table/system/duckdb_functions.cpp +26 -25
- package/src/duckdb/src/function/table/system/duckdb_indexes.cpp +13 -12
- package/src/duckdb/src/function/table/system/duckdb_schemas.cpp +7 -7
- package/src/duckdb/src/function/table/system/duckdb_sequences.cpp +8 -9
- package/src/duckdb/src/function/table/system/duckdb_tables.cpp +10 -9
- package/src/duckdb/src/function/table/system/duckdb_types.cpp +13 -13
- package/src/duckdb/src/function/table/system/duckdb_views.cpp +11 -10
- package/src/duckdb/src/function/table/system/pragma_collations.cpp +2 -2
- package/src/duckdb/src/function/table/system/pragma_database_size.cpp +5 -5
- package/src/duckdb/src/function/table/system/pragma_storage_info.cpp +3 -3
- package/src/duckdb/src/function/table/system/pragma_table_info.cpp +2 -2
- package/src/duckdb/src/function/table/table_scan.cpp +39 -37
- package/src/duckdb/src/function/table/version/pragma_version.cpp +2 -2
- package/src/duckdb/src/function/udf_function.cpp +2 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog.hpp +122 -81
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/aggregate_function_catalog_entry.hpp +2 -3
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/collate_catalog_entry.hpp +3 -3
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/copy_function_catalog_entry.hpp +1 -1
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/duck_index_entry.hpp +1 -1
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/duck_schema_entry.hpp +24 -20
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/duck_table_entry.hpp +3 -3
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/index_catalog_entry.hpp +1 -1
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/macro_catalog_entry.hpp +2 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/pragma_function_catalog_entry.hpp +1 -1
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/scalar_function_catalog_entry.hpp +2 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/scalar_macro_catalog_entry.hpp +1 -1
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/schema_catalog_entry.hpp +22 -17
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/sequence_catalog_entry.hpp +1 -1
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_catalog_entry.hpp +1 -1
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_function_catalog_entry.hpp +2 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_macro_catalog_entry.hpp +1 -1
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/type_catalog_entry.hpp +1 -1
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/view_catalog_entry.hpp +3 -3
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry.hpp +28 -7
- package/src/duckdb/src/include/duckdb/catalog/catalog_set.hpp +20 -19
- package/src/duckdb/src/include/duckdb/catalog/duck_catalog.hpp +9 -9
- package/src/duckdb/src/include/duckdb/catalog/similar_catalog_entry.hpp +2 -1
- package/src/duckdb/src/include/duckdb/catalog/standard_entry.hpp +10 -4
- package/src/duckdb/src/include/duckdb/common/enums/on_entry_not_found.hpp +17 -0
- package/src/duckdb/src/include/duckdb/common/queue.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/types.hpp +3 -4
- package/src/duckdb/src/include/duckdb/execution/index/art/art.hpp +53 -45
- package/src/duckdb/src/include/duckdb/execution/index/art/art_key.hpp +29 -24
- package/src/duckdb/src/include/duckdb/execution/index/art/fixed_size_allocator.hpp +114 -0
- package/src/duckdb/src/include/duckdb/execution/index/art/iterator.hpp +26 -20
- package/src/duckdb/src/include/duckdb/execution/index/art/leaf.hpp +63 -39
- package/src/duckdb/src/include/duckdb/execution/index/art/leaf_segment.hpp +36 -0
- package/src/duckdb/src/include/duckdb/execution/index/art/node.hpp +98 -116
- package/src/duckdb/src/include/duckdb/execution/index/art/node16.hpp +48 -36
- package/src/duckdb/src/include/duckdb/execution/index/art/node256.hpp +52 -35
- package/src/duckdb/src/include/duckdb/execution/index/art/node4.hpp +46 -36
- package/src/duckdb/src/include/duckdb/execution/index/art/node48.hpp +57 -35
- package/src/duckdb/src/include/duckdb/execution/index/art/prefix.hpp +57 -50
- package/src/duckdb/src/include/duckdb/execution/index/art/prefix_segment.hpp +40 -0
- package/src/duckdb/src/include/duckdb/execution/index/art/swizzleable_pointer.hpp +38 -31
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/csv_file_handle.hpp +2 -1
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/csv_reader_options.hpp +2 -0
- package/src/duckdb/src/include/duckdb/function/function_serialization.hpp +4 -4
- package/src/duckdb/src/include/duckdb/function/scalar_function.hpp +3 -2
- package/src/duckdb/src/include/duckdb/function/table/table_scan.hpp +5 -4
- package/src/duckdb/src/include/duckdb/function/table_function.hpp +28 -15
- package/src/duckdb/src/include/duckdb/main/attached_database.hpp +2 -0
- package/src/duckdb/src/include/duckdb/main/client_context.hpp +1 -1
- package/src/duckdb/src/include/duckdb/main/database_manager.hpp +3 -2
- package/src/duckdb/src/include/duckdb/parser/expression/bound_expression.hpp +2 -0
- package/src/duckdb/src/include/duckdb/parser/keyword_helper.hpp +2 -2
- package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_info.hpp +7 -5
- package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_table_info.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_table_info.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_view_info.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/detach_info.hpp +3 -2
- package/src/duckdb/src/include/duckdb/parser/parsed_data/drop_info.hpp +5 -5
- package/src/duckdb/src/include/duckdb/parser/parsed_data/parse_info.hpp +13 -0
- package/src/duckdb/src/include/duckdb/parser/statement/insert_statement.hpp +4 -1
- package/src/duckdb/src/include/duckdb/parser/tableref.hpp +5 -2
- package/src/duckdb/src/include/duckdb/parser/transformer.hpp +4 -1
- package/src/duckdb/src/include/duckdb/planner/binder.hpp +2 -2
- package/src/duckdb/src/include/duckdb/planner/expression_binder/base_select_binder.hpp +1 -2
- package/src/duckdb/src/include/duckdb/planner/expression_binder.hpp +4 -7
- package/src/duckdb/src/include/duckdb/planner/operator/logical_get.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/buffer_manager.hpp +0 -5
- package/src/duckdb/src/include/duckdb/storage/index.hpp +13 -28
- package/src/duckdb/src/include/duckdb/storage/standard_buffer_manager.hpp +0 -2
- package/src/duckdb/src/include/duckdb/transaction/cleanup_state.hpp +5 -0
- package/src/duckdb/src/include/duckdb/transaction/transaction.hpp +12 -0
- package/src/duckdb/src/include/duckdb.h +26 -0
- package/src/duckdb/src/main/attached_database.cpp +12 -6
- package/src/duckdb/src/main/capi/helper-c.cpp +7 -0
- package/src/duckdb/src/main/capi/table_function-c.cpp +17 -16
- package/src/duckdb/src/main/client_context.cpp +12 -11
- package/src/duckdb/src/main/database_manager.cpp +13 -12
- package/src/duckdb/src/optimizer/join_order/cardinality_estimator.cpp +1 -2
- package/src/duckdb/src/parser/parsed_data/alter_info.cpp +3 -3
- package/src/duckdb/src/parser/parsed_data/alter_scalar_function_info.cpp +2 -2
- package/src/duckdb/src/parser/parsed_data/alter_table_function_info.cpp +2 -2
- package/src/duckdb/src/parser/parsed_data/alter_table_info.cpp +9 -9
- package/src/duckdb/src/parser/parsed_data/create_scalar_function_info.cpp +2 -2
- package/src/duckdb/src/parser/parsed_data/create_table_function_info.cpp +2 -2
- package/src/duckdb/src/parser/parsed_data/create_table_info.cpp +2 -2
- package/src/duckdb/src/parser/parsed_data/create_view_info.cpp +2 -2
- package/src/duckdb/src/parser/statement/insert_statement.cpp +15 -6
- package/src/duckdb/src/parser/transform/constraint/transform_constraint.cpp +1 -1
- package/src/duckdb/src/parser/transform/expression/transform_function.cpp +18 -5
- package/src/duckdb/src/parser/transform/statement/transform_alter_sequence.cpp +3 -2
- package/src/duckdb/src/parser/transform/statement/transform_alter_table.cpp +5 -1
- package/src/duckdb/src/parser/transform/statement/transform_detach.cpp +1 -1
- package/src/duckdb/src/parser/transform/statement/transform_drop.cpp +1 -1
- package/src/duckdb/src/parser/transform/statement/transform_insert.cpp +5 -7
- package/src/duckdb/src/parser/transform/statement/transform_rename.cpp +1 -1
- package/src/duckdb/src/planner/binder/expression/bind_aggregate_expression.cpp +26 -27
- package/src/duckdb/src/planner/binder/expression/bind_between_expression.cpp +17 -17
- package/src/duckdb/src/planner/binder/expression/bind_case_expression.cpp +9 -9
- package/src/duckdb/src/planner/binder/expression/bind_cast_expression.cpp +6 -6
- package/src/duckdb/src/planner/binder/expression/bind_collate_expression.cpp +6 -6
- package/src/duckdb/src/planner/binder/expression/bind_columnref_expression.cpp +2 -2
- package/src/duckdb/src/planner/binder/expression/bind_comparison_expression.cpp +21 -21
- package/src/duckdb/src/planner/binder/expression/bind_conjunction_expression.cpp +2 -3
- package/src/duckdb/src/planner/binder/expression/bind_function_expression.cpp +33 -36
- package/src/duckdb/src/planner/binder/expression/bind_macro_expression.cpp +5 -5
- package/src/duckdb/src/planner/binder/expression/bind_operator_expression.cpp +23 -23
- package/src/duckdb/src/planner/binder/expression/bind_subquery_expression.cpp +4 -4
- package/src/duckdb/src/planner/binder/expression/bind_unnest_expression.cpp +7 -7
- package/src/duckdb/src/planner/binder/expression/bind_window_expression.cpp +23 -23
- package/src/duckdb/src/planner/binder/query_node/bind_table_macro_node.cpp +4 -4
- package/src/duckdb/src/planner/binder/statement/bind_copy.cpp +14 -13
- package/src/duckdb/src/planner/binder/statement/bind_create.cpp +56 -42
- package/src/duckdb/src/planner/binder/statement/bind_create_table.cpp +3 -3
- package/src/duckdb/src/planner/binder/statement/bind_delete.cpp +1 -1
- package/src/duckdb/src/planner/binder/statement/bind_drop.cpp +4 -4
- package/src/duckdb/src/planner/binder/statement/bind_export.cpp +10 -10
- package/src/duckdb/src/planner/binder/statement/bind_insert.cpp +16 -11
- package/src/duckdb/src/planner/binder/statement/bind_pragma.cpp +4 -4
- package/src/duckdb/src/planner/binder/statement/bind_simple.cpp +5 -4
- package/src/duckdb/src/planner/binder/statement/bind_update.cpp +1 -1
- package/src/duckdb/src/planner/binder/tableref/bind_basetableref.cpp +3 -3
- package/src/duckdb/src/planner/binder/tableref/bind_table_function.cpp +10 -12
- package/src/duckdb/src/planner/binder.cpp +2 -2
- package/src/duckdb/src/planner/expression/bound_expression.cpp +11 -2
- package/src/duckdb/src/planner/operator/logical_copy_to_file.cpp +2 -5
- package/src/duckdb/src/planner/operator/logical_create.cpp +2 -1
- package/src/duckdb/src/planner/operator/logical_create_index.cpp +2 -2
- package/src/duckdb/src/planner/operator/logical_delete.cpp +2 -2
- package/src/duckdb/src/planner/operator/logical_get.cpp +1 -1
- package/src/duckdb/src/planner/operator/logical_insert.cpp +2 -7
- package/src/duckdb/src/planner/operator/logical_update.cpp +2 -6
- package/src/duckdb/src/planner/parsed_data/bound_create_table_info.cpp +2 -2
- package/src/duckdb/src/planner/pragma_handler.cpp +3 -4
- package/src/duckdb/src/storage/checkpoint_manager.cpp +57 -55
- package/src/duckdb/src/storage/data_table.cpp +9 -9
- package/src/duckdb/src/storage/index.cpp +18 -6
- package/src/duckdb/src/storage/local_storage.cpp +8 -2
- package/src/duckdb/src/storage/standard_buffer_manager.cpp +0 -9
- package/src/duckdb/src/storage/table/update_segment.cpp +1 -1
- package/src/duckdb/src/storage/wal_replay.cpp +29 -31
- package/src/duckdb/src/storage/write_ahead_log.cpp +8 -8
- package/src/duckdb/src/transaction/cleanup_state.cpp +7 -1
- package/src/duckdb/src/transaction/commit_state.cpp +3 -4
- package/src/duckdb/src/transaction/transaction_context.cpp +1 -1
- package/src/duckdb/src/transaction/undo_buffer.cpp +8 -0
- package/src/duckdb/ub_extension_icu_third_party_icu_i18n.cpp +4 -4
- package/src/duckdb/ub_src_execution_index_art.cpp +7 -1
@@ -15,7 +15,7 @@
|
|
15
15
|
#include "duckdb/common/reference_map.hpp"
|
16
16
|
#include "duckdb/common/atomic.hpp"
|
17
17
|
#include "duckdb/common/optional_ptr.hpp"
|
18
|
-
|
18
|
+
#include "duckdb/common/enums/on_entry_not_found.hpp"
|
19
19
|
#include <functional>
|
20
20
|
|
21
21
|
namespace duckdb {
|
@@ -110,100 +110,121 @@ public:
|
|
110
110
|
DUCKDB_API CatalogTransaction GetCatalogTransaction(ClientContext &context);
|
111
111
|
|
112
112
|
//! Creates a schema in the catalog.
|
113
|
-
DUCKDB_API virtual CatalogEntry
|
114
|
-
|
113
|
+
DUCKDB_API virtual optional_ptr<CatalogEntry> CreateSchema(CatalogTransaction transaction,
|
114
|
+
CreateSchemaInfo &info) = 0;
|
115
|
+
DUCKDB_API optional_ptr<CatalogEntry> CreateSchema(ClientContext &context, CreateSchemaInfo &info);
|
115
116
|
//! Creates a table in the catalog.
|
116
|
-
DUCKDB_API CatalogEntry
|
117
|
-
DUCKDB_API CatalogEntry
|
117
|
+
DUCKDB_API optional_ptr<CatalogEntry> CreateTable(CatalogTransaction transaction, BoundCreateTableInfo &info);
|
118
|
+
DUCKDB_API optional_ptr<CatalogEntry> CreateTable(ClientContext &context, BoundCreateTableInfo &info);
|
118
119
|
//! Creates a table in the catalog.
|
119
|
-
DUCKDB_API CatalogEntry
|
120
|
+
DUCKDB_API optional_ptr<CatalogEntry> CreateTable(ClientContext &context, unique_ptr<CreateTableInfo> info);
|
120
121
|
//! Create a table function in the catalog
|
121
|
-
DUCKDB_API CatalogEntry
|
122
|
-
|
122
|
+
DUCKDB_API optional_ptr<CatalogEntry> CreateTableFunction(CatalogTransaction transaction,
|
123
|
+
CreateTableFunctionInfo &info);
|
124
|
+
DUCKDB_API optional_ptr<CatalogEntry> CreateTableFunction(ClientContext &context, CreateTableFunctionInfo &info);
|
125
|
+
// Kept for backwards compatibility
|
126
|
+
DUCKDB_API optional_ptr<CatalogEntry> CreateTableFunction(ClientContext &context,
|
127
|
+
optional_ptr<CreateTableFunctionInfo> info);
|
123
128
|
//! Create a copy function in the catalog
|
124
|
-
DUCKDB_API CatalogEntry
|
125
|
-
|
129
|
+
DUCKDB_API optional_ptr<CatalogEntry> CreateCopyFunction(CatalogTransaction transaction,
|
130
|
+
CreateCopyFunctionInfo &info);
|
131
|
+
DUCKDB_API optional_ptr<CatalogEntry> CreateCopyFunction(ClientContext &context, CreateCopyFunctionInfo &info);
|
126
132
|
//! Create a pragma function in the catalog
|
127
|
-
DUCKDB_API CatalogEntry
|
128
|
-
|
133
|
+
DUCKDB_API optional_ptr<CatalogEntry> CreatePragmaFunction(CatalogTransaction transaction,
|
134
|
+
CreatePragmaFunctionInfo &info);
|
135
|
+
DUCKDB_API optional_ptr<CatalogEntry> CreatePragmaFunction(ClientContext &context, CreatePragmaFunctionInfo &info);
|
129
136
|
//! Create a scalar or aggregate function in the catalog
|
130
|
-
DUCKDB_API CatalogEntry
|
131
|
-
DUCKDB_API CatalogEntry
|
137
|
+
DUCKDB_API optional_ptr<CatalogEntry> CreateFunction(CatalogTransaction transaction, CreateFunctionInfo &info);
|
138
|
+
DUCKDB_API optional_ptr<CatalogEntry> CreateFunction(ClientContext &context, CreateFunctionInfo &info);
|
132
139
|
//! Creates a table in the catalog.
|
133
|
-
DUCKDB_API CatalogEntry
|
134
|
-
DUCKDB_API CatalogEntry
|
140
|
+
DUCKDB_API optional_ptr<CatalogEntry> CreateView(CatalogTransaction transaction, CreateViewInfo &info);
|
141
|
+
DUCKDB_API optional_ptr<CatalogEntry> CreateView(ClientContext &context, CreateViewInfo &info);
|
135
142
|
//! Creates a sequence in the catalog.
|
136
|
-
DUCKDB_API CatalogEntry
|
137
|
-
DUCKDB_API CatalogEntry
|
143
|
+
DUCKDB_API optional_ptr<CatalogEntry> CreateSequence(CatalogTransaction transaction, CreateSequenceInfo &info);
|
144
|
+
DUCKDB_API optional_ptr<CatalogEntry> CreateSequence(ClientContext &context, CreateSequenceInfo &info);
|
138
145
|
//! Creates a Enum in the catalog.
|
139
|
-
DUCKDB_API CatalogEntry
|
140
|
-
DUCKDB_API CatalogEntry
|
146
|
+
DUCKDB_API optional_ptr<CatalogEntry> CreateType(CatalogTransaction transaction, CreateTypeInfo &info);
|
147
|
+
DUCKDB_API optional_ptr<CatalogEntry> CreateType(ClientContext &context, CreateTypeInfo &info);
|
141
148
|
//! Creates a collation in the catalog
|
142
|
-
DUCKDB_API CatalogEntry
|
143
|
-
DUCKDB_API CatalogEntry
|
149
|
+
DUCKDB_API optional_ptr<CatalogEntry> CreateCollation(CatalogTransaction transaction, CreateCollationInfo &info);
|
150
|
+
DUCKDB_API optional_ptr<CatalogEntry> CreateCollation(ClientContext &context, CreateCollationInfo &info);
|
144
151
|
//! Creates an index in the catalog
|
145
|
-
DUCKDB_API CatalogEntry
|
146
|
-
DUCKDB_API CatalogEntry
|
152
|
+
DUCKDB_API optional_ptr<CatalogEntry> CreateIndex(CatalogTransaction transaction, CreateIndexInfo &info);
|
153
|
+
DUCKDB_API optional_ptr<CatalogEntry> CreateIndex(ClientContext &context, CreateIndexInfo &info);
|
147
154
|
|
148
155
|
//! Creates a table in the catalog.
|
149
|
-
DUCKDB_API CatalogEntry
|
150
|
-
|
156
|
+
DUCKDB_API optional_ptr<CatalogEntry> CreateTable(CatalogTransaction transaction, SchemaCatalogEntry &schema,
|
157
|
+
BoundCreateTableInfo &info);
|
151
158
|
//! Create a table function in the catalog
|
152
|
-
DUCKDB_API CatalogEntry
|
153
|
-
|
159
|
+
DUCKDB_API optional_ptr<CatalogEntry>
|
160
|
+
CreateTableFunction(CatalogTransaction transaction, SchemaCatalogEntry &schema, CreateTableFunctionInfo &info);
|
154
161
|
//! Create a copy function in the catalog
|
155
|
-
DUCKDB_API CatalogEntry
|
156
|
-
|
162
|
+
DUCKDB_API optional_ptr<CatalogEntry> CreateCopyFunction(CatalogTransaction transaction, SchemaCatalogEntry &schema,
|
163
|
+
CreateCopyFunctionInfo &info);
|
157
164
|
//! Create a pragma function in the catalog
|
158
|
-
DUCKDB_API CatalogEntry
|
159
|
-
|
165
|
+
DUCKDB_API optional_ptr<CatalogEntry>
|
166
|
+
CreatePragmaFunction(CatalogTransaction transaction, SchemaCatalogEntry &schema, CreatePragmaFunctionInfo &info);
|
160
167
|
//! Create a scalar or aggregate function in the catalog
|
161
|
-
DUCKDB_API CatalogEntry
|
162
|
-
|
168
|
+
DUCKDB_API optional_ptr<CatalogEntry> CreateFunction(CatalogTransaction transaction, SchemaCatalogEntry &schema,
|
169
|
+
CreateFunctionInfo &info);
|
163
170
|
//! Creates a view in the catalog
|
164
|
-
DUCKDB_API CatalogEntry
|
165
|
-
|
171
|
+
DUCKDB_API optional_ptr<CatalogEntry> CreateView(CatalogTransaction transaction, SchemaCatalogEntry &schema,
|
172
|
+
CreateViewInfo &info);
|
166
173
|
//! Creates a table in the catalog.
|
167
|
-
DUCKDB_API CatalogEntry
|
168
|
-
|
174
|
+
DUCKDB_API optional_ptr<CatalogEntry> CreateSequence(CatalogTransaction transaction, SchemaCatalogEntry &schema,
|
175
|
+
CreateSequenceInfo &info);
|
169
176
|
//! Creates a enum in the catalog.
|
170
|
-
DUCKDB_API CatalogEntry
|
171
|
-
|
177
|
+
DUCKDB_API optional_ptr<CatalogEntry> CreateType(CatalogTransaction transaction, SchemaCatalogEntry &schema,
|
178
|
+
CreateTypeInfo &info);
|
172
179
|
//! Creates a collation in the catalog
|
173
|
-
DUCKDB_API CatalogEntry
|
174
|
-
|
180
|
+
DUCKDB_API optional_ptr<CatalogEntry> CreateCollation(CatalogTransaction transaction, SchemaCatalogEntry &schema,
|
181
|
+
CreateCollationInfo &info);
|
175
182
|
|
176
183
|
//! Drops an entry from the catalog
|
177
|
-
DUCKDB_API void DropEntry(ClientContext &context, DropInfo
|
184
|
+
DUCKDB_API void DropEntry(ClientContext &context, DropInfo &info);
|
178
185
|
|
179
186
|
//! Returns the schema object with the specified name, or throws an exception if it does not exist
|
180
|
-
DUCKDB_API SchemaCatalogEntry
|
181
|
-
|
187
|
+
DUCKDB_API SchemaCatalogEntry &GetSchema(ClientContext &context, const string &name,
|
188
|
+
QueryErrorContext error_context = QueryErrorContext());
|
189
|
+
DUCKDB_API optional_ptr<SchemaCatalogEntry> GetSchema(ClientContext &context, const string &name,
|
190
|
+
OnEntryNotFound if_not_found,
|
191
|
+
QueryErrorContext error_context = QueryErrorContext());
|
192
|
+
DUCKDB_API SchemaCatalogEntry &GetSchema(CatalogTransaction transaction, const string &name,
|
182
193
|
QueryErrorContext error_context = QueryErrorContext());
|
183
|
-
DUCKDB_API virtual SchemaCatalogEntry
|
184
|
-
|
185
|
-
|
186
|
-
DUCKDB_API static SchemaCatalogEntry
|
187
|
-
const string &schema_name,
|
194
|
+
DUCKDB_API virtual optional_ptr<SchemaCatalogEntry>
|
195
|
+
GetSchema(CatalogTransaction transaction, const string &schema_name, OnEntryNotFound if_not_found,
|
196
|
+
QueryErrorContext error_context = QueryErrorContext()) = 0;
|
197
|
+
DUCKDB_API static SchemaCatalogEntry &GetSchema(ClientContext &context, const string &catalog_name,
|
198
|
+
const string &schema_name,
|
188
199
|
QueryErrorContext error_context = QueryErrorContext());
|
200
|
+
DUCKDB_API static optional_ptr<SchemaCatalogEntry> GetSchema(ClientContext &context, const string &catalog_name,
|
201
|
+
const string &schema_name,
|
202
|
+
OnEntryNotFound if_not_found,
|
203
|
+
QueryErrorContext error_context = QueryErrorContext());
|
189
204
|
//! Scans all the schemas in the system one-by-one, invoking the callback for each entry
|
190
|
-
DUCKDB_API virtual void ScanSchemas(ClientContext &context, std::function<void(
|
191
|
-
//! Gets the "schema.name" entry of the specified type, if
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
//!
|
198
|
-
|
199
|
-
|
205
|
+
DUCKDB_API virtual void ScanSchemas(ClientContext &context, std::function<void(SchemaCatalogEntry &)> callback) = 0;
|
206
|
+
//! Gets the "schema.name" entry of the specified type, if entry does not exist behavior depends on OnEntryNotFound
|
207
|
+
DUCKDB_API optional_ptr<CatalogEntry> GetEntry(ClientContext &context, CatalogType type, const string &schema,
|
208
|
+
const string &name, OnEntryNotFound if_not_found,
|
209
|
+
QueryErrorContext error_context = QueryErrorContext());
|
210
|
+
DUCKDB_API CatalogEntry &GetEntry(ClientContext &context, CatalogType type, const string &schema,
|
211
|
+
const string &name, QueryErrorContext error_context = QueryErrorContext());
|
212
|
+
//! Gets the "catalog.schema.name" entry of the specified type, if entry does not exist behavior depends on
|
213
|
+
//! OnEntryNotFound
|
214
|
+
DUCKDB_API static optional_ptr<CatalogEntry> GetEntry(ClientContext &context, CatalogType type,
|
215
|
+
const string &catalog, const string &schema,
|
216
|
+
const string &name, OnEntryNotFound if_not_found,
|
217
|
+
QueryErrorContext error_context = QueryErrorContext());
|
218
|
+
DUCKDB_API static CatalogEntry &GetEntry(ClientContext &context, CatalogType type, const string &catalog,
|
219
|
+
const string &schema, const string &name,
|
200
220
|
QueryErrorContext error_context = QueryErrorContext());
|
201
221
|
|
202
222
|
//! Gets the "schema.name" entry without a specified type, if entry does not exist an exception is thrown
|
203
|
-
DUCKDB_API CatalogEntry
|
223
|
+
DUCKDB_API CatalogEntry &GetEntry(ClientContext &context, const string &schema, const string &name);
|
204
224
|
|
205
225
|
//! Fetches a logical type from the catalog
|
206
|
-
DUCKDB_API LogicalType GetType(ClientContext &context, const string &schema, const string &names,
|
226
|
+
DUCKDB_API LogicalType GetType(ClientContext &context, const string &schema, const string &names,
|
227
|
+
OnEntryNotFound if_not_found);
|
207
228
|
|
208
229
|
DUCKDB_API static LogicalType GetType(ClientContext &context, const string &catalog_name, const string &schema,
|
209
230
|
const string &name);
|
@@ -212,20 +233,29 @@ public:
|
|
212
233
|
const string &name);
|
213
234
|
|
214
235
|
template <class T>
|
215
|
-
T
|
216
|
-
|
217
|
-
auto entry = GetEntry(context, T::Type, schema_name, name,
|
218
|
-
if (entry
|
236
|
+
optional_ptr<T> GetEntry(ClientContext &context, const string &schema_name, const string &name,
|
237
|
+
OnEntryNotFound if_not_found, QueryErrorContext error_context = QueryErrorContext()) {
|
238
|
+
auto entry = GetEntry(context, T::Type, schema_name, name, if_not_found, error_context);
|
239
|
+
if (!entry) {
|
240
|
+
return nullptr;
|
241
|
+
}
|
242
|
+
if (entry->type != T::Type) {
|
219
243
|
throw CatalogException(error_context.FormatError("%s is not an %s", name, T::Name));
|
220
244
|
}
|
221
|
-
return (
|
245
|
+
return &entry->template Cast<T>();
|
246
|
+
}
|
247
|
+
template <class T>
|
248
|
+
T &GetEntry(ClientContext &context, const string &schema_name, const string &name,
|
249
|
+
QueryErrorContext error_context = QueryErrorContext()) {
|
250
|
+
auto entry = GetEntry<T>(context, schema_name, name, OnEntryNotFound::THROW_EXCEPTION, error_context);
|
251
|
+
return *entry;
|
222
252
|
}
|
223
253
|
|
224
254
|
//! Append a scalar or aggregate function to the catalog
|
225
|
-
DUCKDB_API CatalogEntry
|
255
|
+
DUCKDB_API optional_ptr<CatalogEntry> AddFunction(ClientContext &context, CreateFunctionInfo &info);
|
226
256
|
|
227
257
|
//! Alter an existing entry in the catalog.
|
228
|
-
DUCKDB_API void Alter(ClientContext &context, AlterInfo
|
258
|
+
DUCKDB_API void Alter(ClientContext &context, AlterInfo &info);
|
229
259
|
|
230
260
|
virtual unique_ptr<PhysicalOperator> PlanCreateTableAs(ClientContext &context, LogicalCreateTable &op,
|
231
261
|
unique_ptr<PhysicalOperator> plan) = 0;
|
@@ -245,19 +275,30 @@ public:
|
|
245
275
|
|
246
276
|
public:
|
247
277
|
template <class T>
|
248
|
-
static T
|
249
|
-
|
250
|
-
|
251
|
-
auto entry = GetEntry(context, T::Type, catalog_name, schema_name, name,
|
252
|
-
if (entry
|
278
|
+
static optional_ptr<T> GetEntry(ClientContext &context, const string &catalog_name, const string &schema_name,
|
279
|
+
const string &name, OnEntryNotFound if_not_found,
|
280
|
+
QueryErrorContext error_context = QueryErrorContext()) {
|
281
|
+
auto entry = GetEntry(context, T::Type, catalog_name, schema_name, name, if_not_found, error_context);
|
282
|
+
if (!entry) {
|
283
|
+
return nullptr;
|
284
|
+
}
|
285
|
+
if (entry->type != T::Type) {
|
253
286
|
throw CatalogException(error_context.FormatError("%s is not an %s", name, T::Name));
|
254
287
|
}
|
255
|
-
return (
|
288
|
+
return &entry->template Cast<T>();
|
289
|
+
}
|
290
|
+
template <class T>
|
291
|
+
static T &GetEntry(ClientContext &context, const string &catalog_name, const string &schema_name,
|
292
|
+
const string &name, QueryErrorContext error_context = QueryErrorContext()) {
|
293
|
+
auto entry =
|
294
|
+
GetEntry<T>(context, catalog_name, schema_name, name, OnEntryNotFound::THROW_EXCEPTION, error_context);
|
295
|
+
return *entry;
|
256
296
|
}
|
257
297
|
|
258
|
-
DUCKDB_API vector<SchemaCatalogEntry
|
259
|
-
DUCKDB_API static vector<SchemaCatalogEntry
|
260
|
-
|
298
|
+
DUCKDB_API vector<reference<SchemaCatalogEntry>> GetSchemas(ClientContext &context);
|
299
|
+
DUCKDB_API static vector<reference<SchemaCatalogEntry>> GetSchemas(ClientContext &context,
|
300
|
+
const string &catalog_name);
|
301
|
+
DUCKDB_API static vector<reference<SchemaCatalogEntry>> GetAllSchemas(ClientContext &context);
|
261
302
|
|
262
303
|
virtual void Verify();
|
263
304
|
|
@@ -271,9 +312,9 @@ private:
|
|
271
312
|
CatalogEntryLookup LookupEntryInternal(CatalogTransaction transaction, CatalogType type, const string &schema,
|
272
313
|
const string &name);
|
273
314
|
CatalogEntryLookup LookupEntry(ClientContext &context, CatalogType type, const string &schema, const string &name,
|
274
|
-
|
315
|
+
OnEntryNotFound if_not_found, QueryErrorContext error_context = QueryErrorContext());
|
275
316
|
static CatalogEntryLookup LookupEntry(ClientContext &context, vector<CatalogLookup> &lookups, CatalogType type,
|
276
|
-
const string &name,
|
317
|
+
const string &name, OnEntryNotFound if_not_found,
|
277
318
|
QueryErrorContext error_context = QueryErrorContext());
|
278
319
|
|
279
320
|
//! Return an exception with did-you-mean suggestion.
|
@@ -286,7 +327,7 @@ private:
|
|
286
327
|
static SimilarCatalogEntry SimilarEntryInSchemas(ClientContext &context, const string &entry_name, CatalogType type,
|
287
328
|
const reference_set_t<SchemaCatalogEntry> &schemas);
|
288
329
|
|
289
|
-
virtual void DropSchema(ClientContext &context, DropInfo
|
330
|
+
virtual void DropSchema(ClientContext &context, DropInfo &info) = 0;
|
290
331
|
|
291
332
|
public:
|
292
333
|
template <class TARGET>
|
package/src/duckdb/src/include/duckdb/catalog/catalog_entry/aggregate_function_catalog_entry.hpp
CHANGED
@@ -22,9 +22,8 @@ public:
|
|
22
22
|
static constexpr const char *Name = "aggregate function";
|
23
23
|
|
24
24
|
public:
|
25
|
-
AggregateFunctionCatalogEntry(Catalog
|
26
|
-
: StandardEntry(CatalogType::AGGREGATE_FUNCTION_ENTRY, schema, catalog, info
|
27
|
-
functions(info->functions) {
|
25
|
+
AggregateFunctionCatalogEntry(Catalog &catalog, SchemaCatalogEntry &schema, CreateAggregateFunctionInfo &info)
|
26
|
+
: StandardEntry(CatalogType::AGGREGATE_FUNCTION_ENTRY, schema, catalog, info.name), functions(info.functions) {
|
28
27
|
}
|
29
28
|
|
30
29
|
//! The aggregate functions
|
@@ -21,9 +21,9 @@ public:
|
|
21
21
|
static constexpr const char *Name = "collation";
|
22
22
|
|
23
23
|
public:
|
24
|
-
CollateCatalogEntry(Catalog
|
25
|
-
: StandardEntry(CatalogType::COLLATION_ENTRY, schema, catalog, info
|
26
|
-
combinable(info
|
24
|
+
CollateCatalogEntry(Catalog &catalog, SchemaCatalogEntry &schema, CreateCollationInfo &info)
|
25
|
+
: StandardEntry(CatalogType::COLLATION_ENTRY, schema, catalog, info.name), function(info.function),
|
26
|
+
combinable(info.combinable), not_required_for_equality(info.not_required_for_equality) {
|
27
27
|
}
|
28
28
|
|
29
29
|
//! The collation function to push in case collation is required
|
@@ -24,7 +24,7 @@ public:
|
|
24
24
|
static constexpr const char *Name = "copy function";
|
25
25
|
|
26
26
|
public:
|
27
|
-
CopyFunctionCatalogEntry(Catalog
|
27
|
+
CopyFunctionCatalogEntry(Catalog &catalog, SchemaCatalogEntry &schema, CreateCopyFunctionInfo &info);
|
28
28
|
|
29
29
|
//! The copy function
|
30
30
|
CopyFunction function;
|
@@ -16,7 +16,7 @@ namespace duckdb {
|
|
16
16
|
class DuckIndexEntry : public IndexCatalogEntry {
|
17
17
|
public:
|
18
18
|
//! Create an IndexCatalogEntry and initialize storage for it
|
19
|
-
DuckIndexEntry(Catalog
|
19
|
+
DuckIndexEntry(Catalog &catalog, SchemaCatalogEntry &schema, CreateIndexInfo &info);
|
20
20
|
~DuckIndexEntry();
|
21
21
|
|
22
22
|
shared_ptr<DataTableInfo> info;
|
@@ -15,7 +15,7 @@ namespace duckdb {
|
|
15
15
|
//! A schema in the catalog
|
16
16
|
class DuckSchemaEntry : public SchemaCatalogEntry {
|
17
17
|
public:
|
18
|
-
DuckSchemaEntry(Catalog
|
18
|
+
DuckSchemaEntry(Catalog &catalog, string name, bool is_internal);
|
19
19
|
|
20
20
|
private:
|
21
21
|
//! The catalog set holding the tables
|
@@ -38,26 +38,30 @@ private:
|
|
38
38
|
CatalogSet types;
|
39
39
|
|
40
40
|
public:
|
41
|
-
CatalogEntry
|
42
|
-
|
43
|
-
CatalogEntry
|
44
|
-
|
41
|
+
optional_ptr<CatalogEntry> AddEntry(CatalogTransaction transaction, unique_ptr<StandardEntry> entry,
|
42
|
+
OnCreateConflict on_conflict);
|
43
|
+
optional_ptr<CatalogEntry> AddEntryInternal(CatalogTransaction transaction, unique_ptr<StandardEntry> entry,
|
44
|
+
OnCreateConflict on_conflict, DependencyList dependencies);
|
45
45
|
|
46
|
-
CatalogEntry
|
47
|
-
CatalogEntry
|
48
|
-
CatalogEntry
|
49
|
-
|
50
|
-
CatalogEntry
|
51
|
-
CatalogEntry
|
52
|
-
CatalogEntry
|
53
|
-
|
54
|
-
CatalogEntry
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
46
|
+
optional_ptr<CatalogEntry> CreateTable(CatalogTransaction transaction, BoundCreateTableInfo &info) override;
|
47
|
+
optional_ptr<CatalogEntry> CreateFunction(CatalogTransaction transaction, CreateFunctionInfo &info) override;
|
48
|
+
optional_ptr<CatalogEntry> CreateIndex(ClientContext &context, CreateIndexInfo &info,
|
49
|
+
TableCatalogEntry &table) override;
|
50
|
+
optional_ptr<CatalogEntry> CreateView(CatalogTransaction transaction, CreateViewInfo &info) override;
|
51
|
+
optional_ptr<CatalogEntry> CreateSequence(CatalogTransaction transaction, CreateSequenceInfo &info) override;
|
52
|
+
optional_ptr<CatalogEntry> CreateTableFunction(CatalogTransaction transaction,
|
53
|
+
CreateTableFunctionInfo &info) override;
|
54
|
+
optional_ptr<CatalogEntry> CreateCopyFunction(CatalogTransaction transaction,
|
55
|
+
CreateCopyFunctionInfo &info) override;
|
56
|
+
optional_ptr<CatalogEntry> CreatePragmaFunction(CatalogTransaction transaction,
|
57
|
+
CreatePragmaFunctionInfo &info) override;
|
58
|
+
optional_ptr<CatalogEntry> CreateCollation(CatalogTransaction transaction, CreateCollationInfo &info) override;
|
59
|
+
optional_ptr<CatalogEntry> CreateType(CatalogTransaction transaction, CreateTypeInfo &info) override;
|
60
|
+
void Alter(ClientContext &context, AlterInfo &info) override;
|
61
|
+
void Scan(ClientContext &context, CatalogType type, const std::function<void(CatalogEntry &)> &callback) override;
|
62
|
+
void Scan(CatalogType type, const std::function<void(CatalogEntry &)> &callback) override;
|
63
|
+
void DropEntry(ClientContext &context, DropInfo &info) override;
|
64
|
+
optional_ptr<CatalogEntry> GetEntry(CatalogTransaction transaction, CatalogType type, const string &name) override;
|
61
65
|
SimilarCatalogEntry GetSimilarEntry(CatalogTransaction transaction, CatalogType type, const string &name) override;
|
62
66
|
|
63
67
|
void Verify(Catalog &catalog) override;
|
@@ -16,12 +16,12 @@ namespace duckdb {
|
|
16
16
|
class DuckTableEntry : public TableCatalogEntry {
|
17
17
|
public:
|
18
18
|
//! Create a TableCatalogEntry and initialize storage for it
|
19
|
-
DuckTableEntry(Catalog
|
19
|
+
DuckTableEntry(Catalog &catalog, SchemaCatalogEntry &schema, BoundCreateTableInfo &info,
|
20
20
|
std::shared_ptr<DataTable> inherited_storage = nullptr);
|
21
21
|
|
22
22
|
public:
|
23
|
-
unique_ptr<CatalogEntry> AlterEntry(ClientContext &context, AlterInfo
|
24
|
-
void UndoAlter(ClientContext &context, AlterInfo
|
23
|
+
unique_ptr<CatalogEntry> AlterEntry(ClientContext &context, AlterInfo &info) override;
|
24
|
+
void UndoAlter(ClientContext &context, AlterInfo &info) override;
|
25
25
|
//! Returns the underlying storage of the table
|
26
26
|
DataTable &GetStorage() override;
|
27
27
|
//! Returns a list of the bound constraints of the table
|
@@ -25,7 +25,7 @@ public:
|
|
25
25
|
|
26
26
|
public:
|
27
27
|
//! Create an IndexCatalogEntry and initialize storage for it
|
28
|
-
IndexCatalogEntry(Catalog
|
28
|
+
IndexCatalogEntry(Catalog &catalog, SchemaCatalogEntry &schema, CreateIndexInfo &info);
|
29
29
|
|
30
30
|
optional_ptr<Index> index;
|
31
31
|
string sql;
|
@@ -18,7 +18,7 @@ namespace duckdb {
|
|
18
18
|
//! A macro function in the catalog
|
19
19
|
class MacroCatalogEntry : public StandardEntry {
|
20
20
|
public:
|
21
|
-
MacroCatalogEntry(Catalog
|
21
|
+
MacroCatalogEntry(Catalog &catalog, SchemaCatalogEntry &schema, CreateMacroInfo &info);
|
22
22
|
|
23
23
|
//! The macro function
|
24
24
|
unique_ptr<MacroFunction> function;
|
@@ -28,7 +28,7 @@ public:
|
|
28
28
|
virtual void Serialize(Serializer &serializer) const = 0;
|
29
29
|
|
30
30
|
string ToSQL() const override {
|
31
|
-
return function->ToSQL(schema
|
31
|
+
return function->ToSQL(schema.name, name);
|
32
32
|
}
|
33
33
|
};
|
34
34
|
|
package/src/duckdb/src/include/duckdb/catalog/catalog_entry/pragma_function_catalog_entry.hpp
CHANGED
@@ -24,7 +24,7 @@ public:
|
|
24
24
|
static constexpr const char *Name = "pragma function";
|
25
25
|
|
26
26
|
public:
|
27
|
-
PragmaFunctionCatalogEntry(Catalog
|
27
|
+
PragmaFunctionCatalogEntry(Catalog &catalog, SchemaCatalogEntry &schema, CreatePragmaFunctionInfo &info);
|
28
28
|
|
29
29
|
//! The pragma functions
|
30
30
|
PragmaFunctionSet functions;
|
package/src/duckdb/src/include/duckdb/catalog/catalog_entry/scalar_function_catalog_entry.hpp
CHANGED
@@ -22,12 +22,12 @@ public:
|
|
22
22
|
static constexpr const char *Name = "scalar function";
|
23
23
|
|
24
24
|
public:
|
25
|
-
ScalarFunctionCatalogEntry(Catalog
|
25
|
+
ScalarFunctionCatalogEntry(Catalog &catalog, SchemaCatalogEntry &schema, CreateScalarFunctionInfo &info);
|
26
26
|
|
27
27
|
//! The scalar functions
|
28
28
|
ScalarFunctionSet functions;
|
29
29
|
|
30
30
|
public:
|
31
|
-
unique_ptr<CatalogEntry> AlterEntry(ClientContext &context, AlterInfo
|
31
|
+
unique_ptr<CatalogEntry> AlterEntry(ClientContext &context, AlterInfo &info) override;
|
32
32
|
};
|
33
33
|
} // namespace duckdb
|
@@ -22,7 +22,7 @@ public:
|
|
22
22
|
static constexpr const char *Name = "macro function";
|
23
23
|
|
24
24
|
public:
|
25
|
-
ScalarMacroCatalogEntry(Catalog
|
25
|
+
ScalarMacroCatalogEntry(Catalog &catalog, SchemaCatalogEntry &schema, CreateMacroInfo &info);
|
26
26
|
|
27
27
|
public:
|
28
28
|
//! Serialize the meta information of the ScalarMacroCatalogEntry
|
@@ -40,20 +40,20 @@ struct CreateTypeInfo;
|
|
40
40
|
struct DropInfo;
|
41
41
|
|
42
42
|
//! A schema in the catalog
|
43
|
-
class SchemaCatalogEntry : public
|
43
|
+
class SchemaCatalogEntry : public InCatalogEntry {
|
44
44
|
public:
|
45
45
|
static constexpr const CatalogType Type = CatalogType::SCHEMA_ENTRY;
|
46
46
|
static constexpr const char *Name = "schema";
|
47
47
|
|
48
48
|
public:
|
49
|
-
SchemaCatalogEntry(Catalog
|
49
|
+
SchemaCatalogEntry(Catalog &catalog, string name, bool is_internal);
|
50
50
|
|
51
51
|
public:
|
52
52
|
//! Scan the specified catalog set, invoking the callback method for every entry
|
53
53
|
virtual void Scan(ClientContext &context, CatalogType type,
|
54
|
-
const std::function<void(CatalogEntry
|
54
|
+
const std::function<void(CatalogEntry &)> &callback) = 0;
|
55
55
|
//! Scan the specified catalog set, invoking the callback method for every committed entry
|
56
|
-
virtual void Scan(CatalogType type, const std::function<void(CatalogEntry
|
56
|
+
virtual void Scan(CatalogType type, const std::function<void(CatalogEntry &)> &callback) = 0;
|
57
57
|
|
58
58
|
//! Serialize the meta information of the SchemaCatalogEntry a serializer
|
59
59
|
virtual void Serialize(Serializer &serializer) const;
|
@@ -63,35 +63,40 @@ public:
|
|
63
63
|
string ToSQL() const override;
|
64
64
|
|
65
65
|
//! Creates an index with the given name in the schema
|
66
|
-
virtual CatalogEntry
|
66
|
+
virtual optional_ptr<CatalogEntry> CreateIndex(ClientContext &context, CreateIndexInfo &info,
|
67
|
+
TableCatalogEntry &table) = 0;
|
67
68
|
//! Create a scalar or aggregate function within the given schema
|
68
|
-
virtual CatalogEntry
|
69
|
+
virtual optional_ptr<CatalogEntry> CreateFunction(CatalogTransaction transaction, CreateFunctionInfo &info) = 0;
|
69
70
|
//! Creates a table with the given name in the schema
|
70
|
-
virtual CatalogEntry
|
71
|
+
virtual optional_ptr<CatalogEntry> CreateTable(CatalogTransaction transaction, BoundCreateTableInfo &info) = 0;
|
71
72
|
//! Creates a view with the given name in the schema
|
72
|
-
virtual CatalogEntry
|
73
|
+
virtual optional_ptr<CatalogEntry> CreateView(CatalogTransaction transaction, CreateViewInfo &info) = 0;
|
73
74
|
//! Creates a sequence with the given name in the schema
|
74
|
-
virtual CatalogEntry
|
75
|
+
virtual optional_ptr<CatalogEntry> CreateSequence(CatalogTransaction transaction, CreateSequenceInfo &info) = 0;
|
75
76
|
//! Create a table function within the given schema
|
76
|
-
virtual CatalogEntry
|
77
|
+
virtual optional_ptr<CatalogEntry> CreateTableFunction(CatalogTransaction transaction,
|
78
|
+
CreateTableFunctionInfo &info) = 0;
|
77
79
|
//! Create a copy function within the given schema
|
78
|
-
virtual CatalogEntry
|
80
|
+
virtual optional_ptr<CatalogEntry> CreateCopyFunction(CatalogTransaction transaction,
|
81
|
+
CreateCopyFunctionInfo &info) = 0;
|
79
82
|
//! Create a pragma function within the given schema
|
80
|
-
virtual CatalogEntry
|
83
|
+
virtual optional_ptr<CatalogEntry> CreatePragmaFunction(CatalogTransaction transaction,
|
84
|
+
CreatePragmaFunctionInfo &info) = 0;
|
81
85
|
//! Create a collation within the given schema
|
82
|
-
virtual CatalogEntry
|
86
|
+
virtual optional_ptr<CatalogEntry> CreateCollation(CatalogTransaction transaction, CreateCollationInfo &info) = 0;
|
83
87
|
//! Create a enum within the given schema
|
84
|
-
virtual CatalogEntry
|
88
|
+
virtual optional_ptr<CatalogEntry> CreateType(CatalogTransaction transaction, CreateTypeInfo &info) = 0;
|
85
89
|
|
86
|
-
DUCKDB_API virtual CatalogEntry
|
90
|
+
DUCKDB_API virtual optional_ptr<CatalogEntry> GetEntry(CatalogTransaction transaction, CatalogType type,
|
91
|
+
const string &name) = 0;
|
87
92
|
DUCKDB_API virtual SimilarCatalogEntry GetSimilarEntry(CatalogTransaction transaction, CatalogType type,
|
88
93
|
const string &name);
|
89
94
|
|
90
95
|
//! Drops an entry from the schema
|
91
|
-
virtual void DropEntry(ClientContext &context, DropInfo
|
96
|
+
virtual void DropEntry(ClientContext &context, DropInfo &info) = 0;
|
92
97
|
|
93
98
|
//! Alters a catalog entry
|
94
|
-
virtual void Alter(ClientContext &context, AlterInfo
|
99
|
+
virtual void Alter(ClientContext &context, AlterInfo &info) = 0;
|
95
100
|
|
96
101
|
CatalogTransaction GetCatalogTransaction(ClientContext &context);
|
97
102
|
};
|
@@ -35,7 +35,7 @@ public:
|
|
35
35
|
|
36
36
|
public:
|
37
37
|
//! Create a real TableCatalogEntry and initialize storage for it
|
38
|
-
SequenceCatalogEntry(Catalog
|
38
|
+
SequenceCatalogEntry(Catalog &catalog, SchemaCatalogEntry &schema, CreateSequenceInfo &info);
|
39
39
|
|
40
40
|
//! Lock for getting a value on the sequence
|
41
41
|
mutex lock;
|
@@ -48,7 +48,7 @@ public:
|
|
48
48
|
|
49
49
|
public:
|
50
50
|
//! Create a TableCatalogEntry and initialize storage for it
|
51
|
-
DUCKDB_API TableCatalogEntry(Catalog
|
51
|
+
DUCKDB_API TableCatalogEntry(Catalog &catalog, SchemaCatalogEntry &schema, CreateTableInfo &info);
|
52
52
|
|
53
53
|
public:
|
54
54
|
DUCKDB_API bool HasGeneratedColumns() const;
|
package/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_function_catalog_entry.hpp
CHANGED
@@ -22,12 +22,12 @@ public:
|
|
22
22
|
static constexpr const char *Name = "table function";
|
23
23
|
|
24
24
|
public:
|
25
|
-
TableFunctionCatalogEntry(Catalog
|
25
|
+
TableFunctionCatalogEntry(Catalog &catalog, SchemaCatalogEntry &schema, CreateTableFunctionInfo &info);
|
26
26
|
|
27
27
|
//! The table function
|
28
28
|
TableFunctionSet functions;
|
29
29
|
|
30
30
|
public:
|
31
|
-
unique_ptr<CatalogEntry> AlterEntry(ClientContext &context, AlterInfo
|
31
|
+
unique_ptr<CatalogEntry> AlterEntry(ClientContext &context, AlterInfo &info) override;
|
32
32
|
};
|
33
33
|
} // namespace duckdb
|
@@ -21,7 +21,7 @@ public:
|
|
21
21
|
static constexpr const char *Name = "table macro function";
|
22
22
|
|
23
23
|
public:
|
24
|
-
TableMacroCatalogEntry(Catalog
|
24
|
+
TableMacroCatalogEntry(Catalog &catalog, SchemaCatalogEntry &schema, CreateMacroInfo &info);
|
25
25
|
|
26
26
|
public:
|
27
27
|
//! Serialize the meta information of the ScalarMacroCatalogEntry
|