duckdb 0.6.2-dev772.0 → 0.6.2-dev889.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 +1 -1
- package/package.json +1 -1
- package/src/connection.cpp +2 -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 +1 -1
- package/src/duckdb/extension/icu/icu-makedate.cpp +1 -1
- package/src/duckdb/extension/icu/icu-strptime.cpp +2 -2
- package/src/duckdb/extension/icu/icu-timezone.cpp +6 -5
- package/src/duckdb/extension/json/json-extension.cpp +1 -1
- package/src/duckdb/extension/parquet/parquet-extension.cpp +1 -1
- package/src/duckdb/src/catalog/catalog.cpp +516 -177
- package/src/duckdb/src/catalog/catalog_entry/index_catalog_entry.cpp +1 -0
- package/src/duckdb/src/catalog/catalog_entry/schema_catalog_entry.cpp +66 -49
- package/src/duckdb/src/catalog/catalog_entry/table_catalog_entry.cpp +15 -16
- package/src/duckdb/src/catalog/catalog_entry/view_catalog_entry.cpp +1 -1
- package/src/duckdb/src/catalog/catalog_entry.cpp +6 -2
- package/src/duckdb/src/catalog/catalog_search_path.cpp +177 -22
- package/src/duckdb/src/catalog/catalog_set.cpp +134 -72
- package/src/duckdb/src/catalog/catalog_transaction.cpp +28 -0
- package/src/duckdb/src/catalog/default/default_views.cpp +4 -4
- package/src/duckdb/src/catalog/dependency_list.cpp +13 -0
- package/src/duckdb/src/catalog/dependency_manager.cpp +19 -13
- package/src/duckdb/src/common/constants.cpp +8 -0
- package/src/duckdb/src/common/enums/catalog_type.cpp +2 -0
- package/src/duckdb/src/common/enums/logical_operator_type.cpp +2 -0
- package/src/duckdb/src/common/enums/physical_operator_type.cpp +2 -0
- package/src/duckdb/src/common/enums/statement_type.cpp +2 -0
- package/src/duckdb/src/common/file_system.cpp +1 -1
- package/src/duckdb/src/common/string_util.cpp +5 -1
- package/src/duckdb/src/execution/index/art/art.cpp +1 -1
- package/src/duckdb/src/execution/operator/helper/physical_transaction.cpp +1 -0
- package/src/duckdb/src/execution/operator/join/physical_index_join.cpp +1 -1
- package/src/duckdb/src/execution/operator/persistent/physical_batch_insert.cpp +3 -2
- package/src/duckdb/src/execution/operator/persistent/physical_delete.cpp +1 -1
- package/src/duckdb/src/execution/operator/persistent/physical_export.cpp +1 -1
- package/src/duckdb/src/execution/operator/persistent/physical_insert.cpp +4 -3
- package/src/duckdb/src/execution/operator/schema/physical_alter.cpp +1 -1
- package/src/duckdb/src/execution/operator/schema/physical_attach.cpp +72 -0
- package/src/duckdb/src/execution/operator/schema/physical_create_function.cpp +2 -1
- package/src/duckdb/src/execution/operator/schema/physical_create_index.cpp +3 -3
- package/src/duckdb/src/execution/operator/schema/physical_create_schema.cpp +5 -1
- package/src/duckdb/src/execution/operator/schema/physical_create_sequence.cpp +2 -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 +1 -1
- package/src/duckdb/src/execution/operator/schema/physical_create_view.cpp +2 -1
- package/src/duckdb/src/execution/operator/schema/physical_drop.cpp +10 -2
- package/src/duckdb/src/execution/physical_plan/plan_comparison_join.cpp +4 -4
- package/src/duckdb/src/execution/physical_plan/plan_create_index.cpp +1 -1
- package/src/duckdb/src/execution/physical_plan/plan_create_table.cpp +2 -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_simple.cpp +4 -0
- package/src/duckdb/src/execution/physical_plan/plan_update.cpp +1 -1
- package/src/duckdb/src/execution/physical_plan_generator.cpp +3 -2
- package/src/duckdb/src/function/built_in_functions.cpp +88 -0
- package/src/duckdb/src/function/function.cpp +0 -79
- package/src/duckdb/src/function/function_binder.cpp +2 -1
- package/src/duckdb/src/function/pragma/pragma_queries.cpp +10 -1
- package/src/duckdb/src/function/scalar/date/current.cpp +2 -2
- package/src/duckdb/src/function/scalar/list/list_aggregates.cpp +3 -2
- package/src/duckdb/src/function/scalar/sequence/nextval.cpp +14 -17
- package/src/duckdb/src/function/scalar/system/aggregate_export.cpp +2 -2
- package/src/duckdb/src/function/scalar/system/system_functions.cpp +7 -4
- package/src/duckdb/src/function/table/checkpoint.cpp +37 -4
- package/src/duckdb/src/function/table/read_csv.cpp +1 -1
- package/src/duckdb/src/function/table/system/duckdb_columns.cpp +32 -25
- package/src/duckdb/src/function/table/system/duckdb_constraints.cpp +26 -22
- package/src/duckdb/src/function/table/system/duckdb_dependencies.cpp +1 -1
- package/src/duckdb/src/function/table/system/duckdb_extensions.cpp +1 -1
- package/src/duckdb/src/function/table/system/duckdb_functions.cpp +22 -15
- package/src/duckdb/src/function/table/system/duckdb_indexes.cpp +25 -18
- package/src/duckdb/src/function/table/system/duckdb_schemas.cpp +16 -8
- package/src/duckdb/src/function/table/system/duckdb_sequences.cpp +26 -19
- package/src/duckdb/src/function/table/system/duckdb_tables.cpp +24 -17
- package/src/duckdb/src/function/table/system/duckdb_types.cpp +22 -16
- package/src/duckdb/src/function/table/system/duckdb_views.cpp +20 -13
- package/src/duckdb/src/function/table/system/pragma_collations.cpp +3 -4
- package/src/duckdb/src/function/table/system/pragma_database_list.cpp +20 -12
- package/src/duckdb/src/function/table/system/pragma_database_size.cpp +39 -24
- package/src/duckdb/src/function/table/system/pragma_storage_info.cpp +1 -7
- package/src/duckdb/src/function/table/system/pragma_table_info.cpp +3 -2
- package/src/duckdb/src/function/table/system_functions.cpp +0 -1
- package/src/duckdb/src/function/table/table_scan.cpp +13 -10
- package/src/duckdb/src/function/table/version/pragma_version.cpp +2 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog.hpp +102 -81
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/aggregate_function_catalog_entry.hpp +4 -0
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/collate_catalog_entry.hpp +4 -0
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/copy_function_catalog_entry.hpp +4 -0
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/index_catalog_entry.hpp +4 -0
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/pragma_function_catalog_entry.hpp +4 -0
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/scalar_function_catalog_entry.hpp +4 -0
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/scalar_macro_catalog_entry.hpp +4 -0
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/schema_catalog_entry.hpp +21 -14
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/sequence_catalog_entry.hpp +4 -0
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_catalog_entry.hpp +4 -0
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_function_catalog_entry.hpp +4 -0
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_macro_catalog_entry.hpp +4 -0
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/type_catalog_entry.hpp +4 -0
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/view_catalog_entry.hpp +4 -0
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry.hpp +2 -0
- package/src/duckdb/src/include/duckdb/catalog/catalog_search_path.hpp +30 -11
- package/src/duckdb/src/include/duckdb/catalog/catalog_set.hpp +35 -20
- package/src/duckdb/src/include/duckdb/catalog/catalog_transaction.hpp +32 -0
- package/src/duckdb/src/include/duckdb/catalog/dependency_list.hpp +27 -0
- package/src/duckdb/src/include/duckdb/catalog/dependency_manager.hpp +6 -4
- package/src/duckdb/src/include/duckdb/common/allocator.hpp +3 -0
- package/src/duckdb/src/include/duckdb/common/constants.hpp +8 -3
- package/src/duckdb/src/include/duckdb/common/enums/catalog_type.hpp +1 -0
- package/src/duckdb/src/include/duckdb/common/enums/logical_operator_type.hpp +1 -0
- package/src/duckdb/src/include/duckdb/common/enums/physical_operator_type.hpp +1 -0
- package/src/duckdb/src/include/duckdb/common/enums/statement_type.hpp +10 -4
- package/src/duckdb/src/include/duckdb/common/file_system.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/string_util.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/index/art/art.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_attach.hpp +33 -0
- package/src/duckdb/src/include/duckdb/execution/physical_plan_generator.hpp +2 -1
- package/src/duckdb/src/include/duckdb/function/aggregate/algebraic_functions.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/aggregate/distributive_functions.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/aggregate/holistic_functions.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/aggregate/nested_functions.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/aggregate/regression_functions.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/built_in_functions.hpp +78 -0
- package/src/duckdb/src/include/duckdb/function/function.hpp +0 -61
- package/src/duckdb/src/include/duckdb/function/function_serialization.hpp +1 -2
- package/src/duckdb/src/include/duckdb/function/pragma/pragma_functions.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/scalar/blob_functions.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/scalar/date_functions.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/scalar/enum_functions.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/scalar/generic_functions.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/scalar/math_functions.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/scalar/nested_functions.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/scalar/operators.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/scalar/regexp.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/scalar/sequence_functions.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/scalar/string_functions.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/scalar/trigonometric_functions.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/scalar/uuid_functions.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/scalar_function.hpp +2 -1
- package/src/duckdb/src/include/duckdb/function/table/arrow.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/table/range.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/table/read_csv.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/table/summary.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/table/system_functions.hpp +1 -4
- package/src/duckdb/src/include/duckdb/function/table/table_scan.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/table_function.hpp +2 -1
- package/src/duckdb/src/include/duckdb/main/attached_database.hpp +64 -0
- package/src/duckdb/src/include/duckdb/main/client_context.hpp +3 -3
- package/src/duckdb/src/include/duckdb/main/client_data.hpp +2 -1
- package/src/duckdb/src/include/duckdb/main/config.hpp +3 -0
- package/src/duckdb/src/include/duckdb/main/database.hpp +6 -6
- package/src/duckdb/src/include/duckdb/main/database_manager.hpp +69 -0
- package/src/duckdb/src/include/duckdb/main/settings.hpp +10 -0
- package/src/duckdb/src/include/duckdb/main/valid_checker.hpp +2 -2
- package/src/duckdb/src/include/duckdb/parser/expression/function_expression.hpp +3 -1
- package/src/duckdb/src/include/duckdb/parser/expression/window_expression.hpp +3 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_function_info.hpp +2 -2
- package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_info.hpp +18 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_table_info.hpp +53 -56
- package/src/duckdb/src/include/duckdb/parser/parsed_data/attach_info.hpp +39 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/copy_info.hpp +4 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_aggregate_function_info.hpp +3 -18
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_collation_info.hpp +4 -13
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_copy_function_info.hpp +3 -12
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_index_info.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_info.hpp +5 -3
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_pragma_function_info.hpp +3 -14
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_table_function_info.hpp +3 -19
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_table_info.hpp +3 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_view_info.hpp +7 -34
- package/src/duckdb/src/include/duckdb/parser/parsed_data/drop_info.hpp +7 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/exported_table_data.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/parser_extension.hpp +2 -2
- package/src/duckdb/src/include/duckdb/parser/qualified_name.hpp +10 -2
- package/src/duckdb/src/include/duckdb/parser/query_error_context.hpp +2 -2
- package/src/duckdb/src/include/duckdb/parser/statement/attach_statement.hpp +29 -0
- package/src/duckdb/src/include/duckdb/parser/statement/export_statement.hpp +1 -0
- package/src/duckdb/src/include/duckdb/parser/statement/insert_statement.hpp +2 -0
- package/src/duckdb/src/include/duckdb/parser/statement/list.hpp +1 -0
- package/src/duckdb/src/include/duckdb/parser/tableref/basetableref.hpp +4 -1
- package/src/duckdb/src/include/duckdb/parser/tokens.hpp +1 -0
- package/src/duckdb/src/include/duckdb/parser/transformer.hpp +2 -0
- package/src/duckdb/src/include/duckdb/planner/bind_context.hpp +2 -0
- package/src/duckdb/src/include/duckdb/planner/binder.hpp +11 -1
- package/src/duckdb/src/include/duckdb/planner/parsed_data/bound_create_table_info.hpp +2 -1
- package/src/duckdb/src/include/duckdb/storage/buffer_manager.hpp +1 -0
- package/src/duckdb/src/include/duckdb/storage/checkpoint_manager.hpp +13 -6
- package/src/duckdb/src/include/duckdb/storage/data_table.hpp +10 -2
- package/src/duckdb/src/include/duckdb/storage/single_file_block_manager.hpp +2 -2
- package/src/duckdb/src/include/duckdb/storage/statistics/base_statistics.hpp +2 -2
- package/src/duckdb/src/include/duckdb/storage/storage_manager.hpp +9 -12
- package/src/duckdb/src/include/duckdb/storage/table/data_table_info.hpp +3 -7
- package/src/duckdb/src/include/duckdb/storage/table/row_group.hpp +5 -6
- package/src/duckdb/src/include/duckdb/storage/write_ahead_log.hpp +9 -7
- package/src/duckdb/src/include/duckdb/transaction/local_storage.hpp +3 -1
- package/src/duckdb/src/include/duckdb/transaction/meta_transaction.hpp +64 -0
- package/src/duckdb/src/include/duckdb/transaction/transaction.hpp +14 -23
- package/src/duckdb/src/include/duckdb/transaction/transaction_context.hpp +12 -8
- package/src/duckdb/src/include/duckdb/transaction/transaction_manager.hpp +5 -10
- package/src/duckdb/src/include/duckdb/transaction/undo_buffer.hpp +1 -1
- package/src/duckdb/src/main/attached_database.cpp +97 -0
- package/src/duckdb/src/main/capi/table_function-c.cpp +1 -1
- package/src/duckdb/src/main/client_context.cpp +28 -22
- package/src/duckdb/src/main/client_data.cpp +5 -2
- package/src/duckdb/src/main/config.cpp +1 -0
- package/src/duckdb/src/main/connection.cpp +1 -1
- package/src/duckdb/src/main/database.cpp +54 -40
- package/src/duckdb/src/main/database_manager.cpp +95 -0
- package/src/duckdb/src/main/materialized_query_result.cpp +1 -1
- package/src/duckdb/src/main/prepared_statement_data.cpp +1 -2
- package/src/duckdb/src/main/query_result.cpp +4 -4
- package/src/duckdb/src/main/settings/settings.cpp +22 -6
- package/src/duckdb/src/main/stream_query_result.cpp +1 -1
- package/src/duckdb/src/parser/expression/columnref_expression.cpp +9 -3
- package/src/duckdb/src/parser/expression/function_expression.cpp +15 -13
- package/src/duckdb/src/parser/expression/window_expression.cpp +6 -4
- package/src/duckdb/src/parser/parsed_data/alter_function_info.cpp +7 -7
- package/src/duckdb/src/parser/parsed_data/alter_info.cpp +12 -2
- package/src/duckdb/src/parser/parsed_data/alter_table_info.cpp +96 -98
- package/src/duckdb/src/parser/parsed_data/create_aggregate_function_info.cpp +27 -0
- package/src/duckdb/src/parser/parsed_data/create_collation_info.cpp +23 -0
- package/src/duckdb/src/parser/parsed_data/create_copy_function_info.cpp +21 -0
- package/src/duckdb/src/parser/parsed_data/create_info.cpp +3 -0
- package/src/duckdb/src/parser/parsed_data/create_pragma_function_info.cpp +23 -0
- package/src/duckdb/src/parser/parsed_data/create_scalar_function_info.cpp +3 -1
- package/src/duckdb/src/parser/parsed_data/create_table_function_info.cpp +28 -0
- package/src/duckdb/src/parser/parsed_data/create_table_info.cpp +9 -3
- package/src/duckdb/src/parser/parsed_data/create_view_info.cpp +49 -0
- package/src/duckdb/src/parser/statement/attach_statement.cpp +15 -0
- package/src/duckdb/src/parser/statement/insert_statement.cpp +6 -2
- package/src/duckdb/src/parser/tableref/basetableref.cpp +9 -4
- package/src/duckdb/src/parser/transform/constraint/transform_constraint.cpp +15 -13
- package/src/duckdb/src/parser/transform/expression/transform_function.cpp +17 -7
- package/src/duckdb/src/parser/transform/expression/transform_operator.cpp +4 -9
- package/src/duckdb/src/parser/transform/helpers/nodetype_to_string.cpp +4 -0
- package/src/duckdb/src/parser/transform/statement/transform_alter_sequence.cpp +5 -4
- package/src/duckdb/src/parser/transform/statement/transform_alter_table.cpp +8 -10
- package/src/duckdb/src/parser/transform/statement/transform_attach.cpp +32 -0
- package/src/duckdb/src/parser/transform/statement/transform_checkpoint.cpp +7 -2
- package/src/duckdb/src/parser/transform/statement/transform_copy.cpp +1 -0
- package/src/duckdb/src/parser/transform/statement/transform_create_function.cpp +1 -0
- package/src/duckdb/src/parser/transform/statement/transform_create_schema.cpp +1 -0
- package/src/duckdb/src/parser/transform/statement/transform_create_sequence.cpp +1 -0
- package/src/duckdb/src/parser/transform/statement/transform_create_table.cpp +5 -5
- package/src/duckdb/src/parser/transform/statement/transform_create_table_as.cpp +1 -0
- package/src/duckdb/src/parser/transform/statement/transform_create_type.cpp +6 -13
- package/src/duckdb/src/parser/transform/statement/transform_create_view.cpp +6 -6
- package/src/duckdb/src/parser/transform/statement/transform_drop.cpp +11 -2
- package/src/duckdb/src/parser/transform/statement/transform_export.cpp +5 -1
- package/src/duckdb/src/parser/transform/statement/transform_insert.cpp +1 -0
- package/src/duckdb/src/parser/transform/statement/transform_rename.cpp +12 -36
- package/src/duckdb/src/parser/transform/statement/transform_show.cpp +3 -1
- package/src/duckdb/src/parser/transform/statement/transform_use.cpp +21 -0
- package/src/duckdb/src/parser/transform/tableref/transform_base_tableref.cpp +11 -3
- package/src/duckdb/src/parser/transformer.cpp +4 -0
- package/src/duckdb/src/planner/bind_context.cpp +11 -2
- package/src/duckdb/src/planner/binder/expression/bind_cast_expression.cpp +1 -1
- package/src/duckdb/src/planner/binder/expression/bind_columnref_expression.cpp +43 -13
- package/src/duckdb/src/planner/binder/expression/bind_comparison_expression.cpp +1 -1
- package/src/duckdb/src/planner/binder/expression/bind_function_expression.cpp +2 -3
- package/src/duckdb/src/planner/binder/expression/bind_window_expression.cpp +2 -3
- package/src/duckdb/src/planner/binder/statement/bind_attach.cpp +20 -0
- package/src/duckdb/src/planner/binder/statement/bind_copy.cpp +7 -4
- package/src/duckdb/src/planner/binder/statement/bind_create.cpp +79 -27
- package/src/duckdb/src/planner/binder/statement/bind_create_table.cpp +11 -7
- package/src/duckdb/src/planner/binder/statement/bind_delete.cpp +1 -1
- package/src/duckdb/src/planner/binder/statement/bind_drop.cpp +13 -5
- package/src/duckdb/src/planner/binder/statement/bind_export.cpp +6 -3
- package/src/duckdb/src/planner/binder/statement/bind_extension.cpp +1 -1
- package/src/duckdb/src/planner/binder/statement/bind_insert.cpp +3 -2
- package/src/duckdb/src/planner/binder/statement/bind_pragma.cpp +2 -2
- package/src/duckdb/src/planner/binder/statement/bind_prepare.cpp +0 -2
- package/src/duckdb/src/planner/binder/statement/bind_simple.cpp +11 -6
- package/src/duckdb/src/planner/binder/statement/bind_update.cpp +1 -1
- package/src/duckdb/src/planner/binder/tableref/bind_basetableref.cpp +10 -6
- package/src/duckdb/src/planner/binder/tableref/bind_table_function.cpp +2 -4
- package/src/duckdb/src/planner/binder.cpp +17 -2
- package/src/duckdb/src/planner/logical_operator.cpp +5 -12
- package/src/duckdb/src/planner/operator/logical_copy_to_file.cpp +3 -4
- package/src/duckdb/src/planner/operator/logical_create.cpp +1 -4
- package/src/duckdb/src/planner/operator/logical_create_index.cpp +2 -2
- package/src/duckdb/src/planner/operator/logical_delete.cpp +2 -3
- package/src/duckdb/src/planner/operator/logical_insert.cpp +1 -1
- package/src/duckdb/src/planner/operator/logical_update.cpp +1 -1
- package/src/duckdb/src/planner/parsed_data/bound_create_table_info.cpp +1 -1
- package/src/duckdb/src/planner/planner.cpp +3 -2
- package/src/duckdb/src/planner/pragma_handler.cpp +1 -1
- package/src/duckdb/src/storage/buffer_manager.cpp +5 -0
- package/src/duckdb/src/storage/checkpoint_manager.cpp +10 -17
- package/src/duckdb/src/storage/data_table.cpp +34 -24
- package/src/duckdb/src/storage/local_storage.cpp +7 -3
- package/src/duckdb/src/storage/single_file_block_manager.cpp +3 -3
- package/src/duckdb/src/storage/storage_manager.cpp +25 -42
- package/src/duckdb/src/storage/table/column_data.cpp +2 -1
- package/src/duckdb/src/storage/table/row_group.cpp +7 -2
- package/src/duckdb/src/storage/wal_replay.cpp +6 -22
- package/src/duckdb/src/storage/write_ahead_log.cpp +3 -3
- package/src/duckdb/src/transaction/meta_transaction.cpp +106 -0
- package/src/duckdb/src/transaction/transaction.cpp +21 -21
- package/src/duckdb/src/transaction/transaction_context.cpp +44 -8
- package/src/duckdb/src/transaction/transaction_manager.cpp +20 -20
- package/src/duckdb/src/transaction/undo_buffer.cpp +1 -3
- package/src/duckdb/third_party/libpg_query/include/nodes/nodes.hpp +2 -0
- package/src/duckdb/third_party/libpg_query/include/nodes/parsenodes.hpp +27 -1
- package/src/duckdb/third_party/libpg_query/include/parser/gram.hpp +99 -97
- package/src/duckdb/third_party/libpg_query/include/parser/kwlist.hpp +1 -0
- package/src/duckdb/third_party/libpg_query/src_backend_parser_gram.cpp +15206 -14793
- package/src/duckdb/ub_src_catalog.cpp +4 -0
- package/src/duckdb/ub_src_execution_operator_schema.cpp +2 -0
- package/src/duckdb/ub_src_function.cpp +2 -0
- package/src/duckdb/ub_src_function_table_system.cpp +0 -2
- package/src/duckdb/ub_src_main.cpp +4 -0
- package/src/duckdb/ub_src_parser_parsed_data.cpp +12 -0
- package/src/duckdb/ub_src_parser_statement.cpp +2 -0
- package/src/duckdb/ub_src_parser_transform_statement.cpp +4 -0
- package/src/duckdb/ub_src_planner_binder_statement.cpp +2 -0
- package/src/duckdb/ub_src_transaction.cpp +2 -0
- package/src/duckdb/src/function/table/system/pragma_functions.cpp +0 -120
|
@@ -21,8 +21,8 @@ enum AlterForeignKeyType : uint8_t { AFT_ADD = 0, AFT_DELETE = 1 };
|
|
|
21
21
|
// Change Ownership
|
|
22
22
|
//===--------------------------------------------------------------------===//
|
|
23
23
|
struct ChangeOwnershipInfo : public AlterInfo {
|
|
24
|
-
ChangeOwnershipInfo(CatalogType entry_catalog_type, string
|
|
25
|
-
string owner_name, bool if_exists);
|
|
24
|
+
ChangeOwnershipInfo(CatalogType entry_catalog_type, string entry_catalog, string entry_schema, string entry_name,
|
|
25
|
+
string owner_schema, string owner_name, bool if_exists);
|
|
26
26
|
|
|
27
27
|
// Catalog type refers to the entry type, since this struct is usually built from an
|
|
28
28
|
// ALTER <TYPE> <schema>.<name> OWNED BY <owner_schema>.<owner_name> statement
|
|
@@ -55,7 +55,7 @@ enum class AlterTableType : uint8_t {
|
|
|
55
55
|
};
|
|
56
56
|
|
|
57
57
|
struct AlterTableInfo : public AlterInfo {
|
|
58
|
-
AlterTableInfo(AlterTableType type,
|
|
58
|
+
AlterTableInfo(AlterTableType type, AlterEntryData data);
|
|
59
59
|
~AlterTableInfo() override;
|
|
60
60
|
|
|
61
61
|
AlterTableType alter_table_type;
|
|
@@ -71,7 +71,7 @@ public:
|
|
|
71
71
|
// RenameColumnInfo
|
|
72
72
|
//===--------------------------------------------------------------------===//
|
|
73
73
|
struct RenameColumnInfo : public AlterTableInfo {
|
|
74
|
-
RenameColumnInfo(
|
|
74
|
+
RenameColumnInfo(AlterEntryData data, string old_name_p, string new_name_p);
|
|
75
75
|
~RenameColumnInfo() override;
|
|
76
76
|
|
|
77
77
|
//! Column old name
|
|
@@ -82,14 +82,14 @@ struct RenameColumnInfo : public AlterTableInfo {
|
|
|
82
82
|
public:
|
|
83
83
|
unique_ptr<AlterInfo> Copy() const override;
|
|
84
84
|
void SerializeAlterTable(FieldWriter &writer) const override;
|
|
85
|
-
static unique_ptr<AlterInfo> Deserialize(FieldReader &reader,
|
|
85
|
+
static unique_ptr<AlterInfo> Deserialize(FieldReader &reader, AlterEntryData data);
|
|
86
86
|
};
|
|
87
87
|
|
|
88
88
|
//===--------------------------------------------------------------------===//
|
|
89
89
|
// RenameTableInfo
|
|
90
90
|
//===--------------------------------------------------------------------===//
|
|
91
91
|
struct RenameTableInfo : public AlterTableInfo {
|
|
92
|
-
RenameTableInfo(
|
|
92
|
+
RenameTableInfo(AlterEntryData data, string new_name);
|
|
93
93
|
~RenameTableInfo() override;
|
|
94
94
|
|
|
95
95
|
//! Relation new name
|
|
@@ -98,14 +98,14 @@ struct RenameTableInfo : public AlterTableInfo {
|
|
|
98
98
|
public:
|
|
99
99
|
unique_ptr<AlterInfo> Copy() const override;
|
|
100
100
|
void SerializeAlterTable(FieldWriter &writer) const override;
|
|
101
|
-
static unique_ptr<AlterInfo> Deserialize(FieldReader &reader,
|
|
101
|
+
static unique_ptr<AlterInfo> Deserialize(FieldReader &reader, AlterEntryData data);
|
|
102
102
|
};
|
|
103
103
|
|
|
104
104
|
//===--------------------------------------------------------------------===//
|
|
105
105
|
// AddColumnInfo
|
|
106
106
|
//===--------------------------------------------------------------------===//
|
|
107
107
|
struct AddColumnInfo : public AlterTableInfo {
|
|
108
|
-
AddColumnInfo(
|
|
108
|
+
AddColumnInfo(AlterEntryData data, ColumnDefinition new_column, bool if_column_not_exists);
|
|
109
109
|
~AddColumnInfo() override;
|
|
110
110
|
|
|
111
111
|
//! New column
|
|
@@ -116,15 +116,14 @@ struct AddColumnInfo : public AlterTableInfo {
|
|
|
116
116
|
public:
|
|
117
117
|
unique_ptr<AlterInfo> Copy() const override;
|
|
118
118
|
void SerializeAlterTable(FieldWriter &writer) const override;
|
|
119
|
-
static unique_ptr<AlterInfo> Deserialize(FieldReader &reader,
|
|
119
|
+
static unique_ptr<AlterInfo> Deserialize(FieldReader &reader, AlterEntryData data);
|
|
120
120
|
};
|
|
121
121
|
|
|
122
122
|
//===--------------------------------------------------------------------===//
|
|
123
123
|
// RemoveColumnInfo
|
|
124
124
|
//===--------------------------------------------------------------------===//
|
|
125
125
|
struct RemoveColumnInfo : public AlterTableInfo {
|
|
126
|
-
RemoveColumnInfo(
|
|
127
|
-
bool cascade);
|
|
126
|
+
RemoveColumnInfo(AlterEntryData data, string removed_column, bool if_column_exists, bool cascade);
|
|
128
127
|
~RemoveColumnInfo() override;
|
|
129
128
|
|
|
130
129
|
//! The column to remove
|
|
@@ -137,14 +136,14 @@ struct RemoveColumnInfo : public AlterTableInfo {
|
|
|
137
136
|
public:
|
|
138
137
|
unique_ptr<AlterInfo> Copy() const override;
|
|
139
138
|
void SerializeAlterTable(FieldWriter &writer) const override;
|
|
140
|
-
static unique_ptr<AlterInfo> Deserialize(FieldReader &reader,
|
|
139
|
+
static unique_ptr<AlterInfo> Deserialize(FieldReader &reader, AlterEntryData data);
|
|
141
140
|
};
|
|
142
141
|
|
|
143
142
|
//===--------------------------------------------------------------------===//
|
|
144
143
|
// ChangeColumnTypeInfo
|
|
145
144
|
//===--------------------------------------------------------------------===//
|
|
146
145
|
struct ChangeColumnTypeInfo : public AlterTableInfo {
|
|
147
|
-
ChangeColumnTypeInfo(
|
|
146
|
+
ChangeColumnTypeInfo(AlterEntryData data, string column_name, LogicalType target_type,
|
|
148
147
|
unique_ptr<ParsedExpression> expression);
|
|
149
148
|
~ChangeColumnTypeInfo() override;
|
|
150
149
|
|
|
@@ -158,15 +157,14 @@ struct ChangeColumnTypeInfo : public AlterTableInfo {
|
|
|
158
157
|
public:
|
|
159
158
|
unique_ptr<AlterInfo> Copy() const override;
|
|
160
159
|
void SerializeAlterTable(FieldWriter &writer) const override;
|
|
161
|
-
static unique_ptr<AlterInfo> Deserialize(FieldReader &reader,
|
|
160
|
+
static unique_ptr<AlterInfo> Deserialize(FieldReader &reader, AlterEntryData data);
|
|
162
161
|
};
|
|
163
162
|
|
|
164
163
|
//===--------------------------------------------------------------------===//
|
|
165
164
|
// SetDefaultInfo
|
|
166
165
|
//===--------------------------------------------------------------------===//
|
|
167
166
|
struct SetDefaultInfo : public AlterTableInfo {
|
|
168
|
-
SetDefaultInfo(
|
|
169
|
-
unique_ptr<ParsedExpression> new_default);
|
|
167
|
+
SetDefaultInfo(AlterEntryData data, string column_name, unique_ptr<ParsedExpression> new_default);
|
|
170
168
|
~SetDefaultInfo() override;
|
|
171
169
|
|
|
172
170
|
//! The column name to alter
|
|
@@ -177,16 +175,15 @@ struct SetDefaultInfo : public AlterTableInfo {
|
|
|
177
175
|
public:
|
|
178
176
|
unique_ptr<AlterInfo> Copy() const override;
|
|
179
177
|
void SerializeAlterTable(FieldWriter &writer) const override;
|
|
180
|
-
static unique_ptr<AlterInfo> Deserialize(FieldReader &reader,
|
|
178
|
+
static unique_ptr<AlterInfo> Deserialize(FieldReader &reader, AlterEntryData data);
|
|
181
179
|
};
|
|
182
180
|
|
|
183
181
|
//===--------------------------------------------------------------------===//
|
|
184
182
|
// AlterForeignKeyInfo
|
|
185
183
|
//===--------------------------------------------------------------------===//
|
|
186
184
|
struct AlterForeignKeyInfo : public AlterTableInfo {
|
|
187
|
-
AlterForeignKeyInfo(
|
|
188
|
-
vector<
|
|
189
|
-
AlterForeignKeyType type);
|
|
185
|
+
AlterForeignKeyInfo(AlterEntryData data, string fk_table, vector<string> pk_columns, vector<string> fk_columns,
|
|
186
|
+
vector<PhysicalIndex> pk_keys, vector<PhysicalIndex> fk_keys, AlterForeignKeyType type);
|
|
190
187
|
~AlterForeignKeyInfo() override;
|
|
191
188
|
|
|
192
189
|
string fk_table;
|
|
@@ -199,7 +196,39 @@ struct AlterForeignKeyInfo : public AlterTableInfo {
|
|
|
199
196
|
public:
|
|
200
197
|
unique_ptr<AlterInfo> Copy() const override;
|
|
201
198
|
void SerializeAlterTable(FieldWriter &writer) const override;
|
|
202
|
-
static unique_ptr<AlterInfo> Deserialize(FieldReader &reader,
|
|
199
|
+
static unique_ptr<AlterInfo> Deserialize(FieldReader &reader, AlterEntryData data);
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
//===--------------------------------------------------------------------===//
|
|
203
|
+
// SetNotNullInfo
|
|
204
|
+
//===--------------------------------------------------------------------===//
|
|
205
|
+
struct SetNotNullInfo : public AlterTableInfo {
|
|
206
|
+
SetNotNullInfo(AlterEntryData data, string column_name);
|
|
207
|
+
~SetNotNullInfo() override;
|
|
208
|
+
|
|
209
|
+
//! The column name to alter
|
|
210
|
+
string column_name;
|
|
211
|
+
|
|
212
|
+
public:
|
|
213
|
+
unique_ptr<AlterInfo> Copy() const override;
|
|
214
|
+
void SerializeAlterTable(FieldWriter &writer) const override;
|
|
215
|
+
static unique_ptr<AlterInfo> Deserialize(FieldReader &reader, AlterEntryData data);
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
//===--------------------------------------------------------------------===//
|
|
219
|
+
// DropNotNullInfo
|
|
220
|
+
//===--------------------------------------------------------------------===//
|
|
221
|
+
struct DropNotNullInfo : public AlterTableInfo {
|
|
222
|
+
DropNotNullInfo(AlterEntryData data, string column_name);
|
|
223
|
+
~DropNotNullInfo() override;
|
|
224
|
+
|
|
225
|
+
//! The column name to alter
|
|
226
|
+
string column_name;
|
|
227
|
+
|
|
228
|
+
public:
|
|
229
|
+
unique_ptr<AlterInfo> Copy() const override;
|
|
230
|
+
void SerializeAlterTable(FieldWriter &writer) const override;
|
|
231
|
+
static unique_ptr<AlterInfo> Deserialize(FieldReader &reader, AlterEntryData data);
|
|
203
232
|
};
|
|
204
233
|
|
|
205
234
|
//===--------------------------------------------------------------------===//
|
|
@@ -208,7 +237,7 @@ public:
|
|
|
208
237
|
enum class AlterViewType : uint8_t { INVALID = 0, RENAME_VIEW = 1 };
|
|
209
238
|
|
|
210
239
|
struct AlterViewInfo : public AlterInfo {
|
|
211
|
-
AlterViewInfo(AlterViewType type,
|
|
240
|
+
AlterViewInfo(AlterViewType type, AlterEntryData data);
|
|
212
241
|
~AlterViewInfo() override;
|
|
213
242
|
|
|
214
243
|
AlterViewType alter_view_type;
|
|
@@ -224,7 +253,7 @@ public:
|
|
|
224
253
|
// RenameViewInfo
|
|
225
254
|
//===--------------------------------------------------------------------===//
|
|
226
255
|
struct RenameViewInfo : public AlterViewInfo {
|
|
227
|
-
RenameViewInfo(
|
|
256
|
+
RenameViewInfo(AlterEntryData data, string new_name);
|
|
228
257
|
~RenameViewInfo() override;
|
|
229
258
|
|
|
230
259
|
//! Relation new name
|
|
@@ -233,39 +262,7 @@ struct RenameViewInfo : public AlterViewInfo {
|
|
|
233
262
|
public:
|
|
234
263
|
unique_ptr<AlterInfo> Copy() const override;
|
|
235
264
|
void SerializeAlterView(FieldWriter &writer) const override;
|
|
236
|
-
static unique_ptr<AlterInfo> Deserialize(FieldReader &reader,
|
|
237
|
-
};
|
|
238
|
-
|
|
239
|
-
//===--------------------------------------------------------------------===//
|
|
240
|
-
// SetNotNullInfo
|
|
241
|
-
//===--------------------------------------------------------------------===//
|
|
242
|
-
struct SetNotNullInfo : public AlterTableInfo {
|
|
243
|
-
SetNotNullInfo(string schema, string table, bool if_exists, string column_name);
|
|
244
|
-
~SetNotNullInfo() override;
|
|
245
|
-
|
|
246
|
-
//! The column name to alter
|
|
247
|
-
string column_name;
|
|
248
|
-
|
|
249
|
-
public:
|
|
250
|
-
unique_ptr<AlterInfo> Copy() const override;
|
|
251
|
-
void SerializeAlterTable(FieldWriter &writer) const override;
|
|
252
|
-
static unique_ptr<AlterInfo> Deserialize(FieldReader &reader, string schema, string table, bool if_exists);
|
|
253
|
-
};
|
|
254
|
-
|
|
255
|
-
//===--------------------------------------------------------------------===//
|
|
256
|
-
// DropNotNullInfo
|
|
257
|
-
//===--------------------------------------------------------------------===//
|
|
258
|
-
struct DropNotNullInfo : public AlterTableInfo {
|
|
259
|
-
DropNotNullInfo(string schema, string table, bool if_exists, string column_name);
|
|
260
|
-
~DropNotNullInfo() override;
|
|
261
|
-
|
|
262
|
-
//! The column name to alter
|
|
263
|
-
string column_name;
|
|
264
|
-
|
|
265
|
-
public:
|
|
266
|
-
unique_ptr<AlterInfo> Copy() const override;
|
|
267
|
-
void SerializeAlterTable(FieldWriter &writer) const override;
|
|
268
|
-
static unique_ptr<AlterInfo> Deserialize(FieldReader &reader, string schema, string table, bool if_exists);
|
|
265
|
+
static unique_ptr<AlterInfo> Deserialize(FieldReader &reader, AlterEntryData data);
|
|
269
266
|
};
|
|
270
267
|
|
|
271
268
|
} // namespace duckdb
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
//===----------------------------------------------------------------------===//
|
|
2
|
+
// DuckDB
|
|
3
|
+
//
|
|
4
|
+
// duckdb/parser/parsed_data/attach_info.hpp
|
|
5
|
+
//
|
|
6
|
+
//
|
|
7
|
+
//===----------------------------------------------------------------------===//
|
|
8
|
+
|
|
9
|
+
#pragma once
|
|
10
|
+
|
|
11
|
+
#include "duckdb/parser/parsed_data/parse_info.hpp"
|
|
12
|
+
#include "duckdb/common/vector.hpp"
|
|
13
|
+
#include "duckdb/common/unordered_map.hpp"
|
|
14
|
+
#include "duckdb/common/types/value.hpp"
|
|
15
|
+
|
|
16
|
+
namespace duckdb {
|
|
17
|
+
|
|
18
|
+
struct AttachInfo : public ParseInfo {
|
|
19
|
+
AttachInfo() {
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
//! The alias of the attached database
|
|
23
|
+
string name;
|
|
24
|
+
//! The path to the attached database
|
|
25
|
+
string path;
|
|
26
|
+
//! Set of (key, value) options
|
|
27
|
+
unordered_map<string, Value> options;
|
|
28
|
+
|
|
29
|
+
public:
|
|
30
|
+
unique_ptr<AttachInfo> Copy() const {
|
|
31
|
+
auto result = make_unique<AttachInfo>();
|
|
32
|
+
result->name = name;
|
|
33
|
+
result->path = path;
|
|
34
|
+
result->options = options;
|
|
35
|
+
return result;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
} // namespace duckdb
|
|
@@ -16,9 +16,11 @@
|
|
|
16
16
|
namespace duckdb {
|
|
17
17
|
|
|
18
18
|
struct CopyInfo : public ParseInfo {
|
|
19
|
-
CopyInfo() : schema(DEFAULT_SCHEMA) {
|
|
19
|
+
CopyInfo() : catalog(INVALID_CATALOG), schema(DEFAULT_SCHEMA) {
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
//! The catalog name to copy to/from
|
|
23
|
+
string catalog;
|
|
22
24
|
//! The schema name to copy to/from
|
|
23
25
|
string schema;
|
|
24
26
|
//! The table name to copy to/from
|
|
@@ -37,6 +39,7 @@ struct CopyInfo : public ParseInfo {
|
|
|
37
39
|
public:
|
|
38
40
|
unique_ptr<CopyInfo> Copy() const {
|
|
39
41
|
auto result = make_unique<CopyInfo>();
|
|
42
|
+
result->catalog = catalog;
|
|
40
43
|
result->schema = schema;
|
|
41
44
|
result->table = table;
|
|
42
45
|
result->select_list = select_list;
|
|
@@ -14,28 +14,13 @@
|
|
|
14
14
|
namespace duckdb {
|
|
15
15
|
|
|
16
16
|
struct CreateAggregateFunctionInfo : public CreateFunctionInfo {
|
|
17
|
-
explicit CreateAggregateFunctionInfo(AggregateFunction function)
|
|
18
|
-
|
|
19
|
-
name = function.name;
|
|
20
|
-
functions.AddFunction(move(function));
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
explicit CreateAggregateFunctionInfo(AggregateFunctionSet set)
|
|
24
|
-
: CreateFunctionInfo(CatalogType::AGGREGATE_FUNCTION_ENTRY), functions(move(set)) {
|
|
25
|
-
name = functions.name;
|
|
26
|
-
for (auto &func : functions.functions) {
|
|
27
|
-
func.name = functions.name;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
17
|
+
explicit CreateAggregateFunctionInfo(AggregateFunction function);
|
|
18
|
+
explicit CreateAggregateFunctionInfo(AggregateFunctionSet set);
|
|
30
19
|
|
|
31
20
|
AggregateFunctionSet functions;
|
|
32
21
|
|
|
33
22
|
public:
|
|
34
|
-
unique_ptr<CreateInfo> Copy() const override
|
|
35
|
-
auto result = make_unique<CreateAggregateFunctionInfo>(functions);
|
|
36
|
-
CopyProperties(*result);
|
|
37
|
-
return move(result);
|
|
38
|
-
}
|
|
23
|
+
unique_ptr<CreateInfo> Copy() const override;
|
|
39
24
|
};
|
|
40
25
|
|
|
41
26
|
} // namespace duckdb
|
|
@@ -14,11 +14,8 @@
|
|
|
14
14
|
namespace duckdb {
|
|
15
15
|
|
|
16
16
|
struct CreateCollationInfo : public CreateInfo {
|
|
17
|
-
CreateCollationInfo(string name_p, ScalarFunction function_p, bool combinable_p,
|
|
18
|
-
|
|
19
|
-
not_required_for_equality(not_required_for_equality_p) {
|
|
20
|
-
this->name = move(name_p);
|
|
21
|
-
}
|
|
17
|
+
DUCKDB_API CreateCollationInfo(string name_p, ScalarFunction function_p, bool combinable_p,
|
|
18
|
+
bool not_required_for_equality_p);
|
|
22
19
|
|
|
23
20
|
//! The name of the collation
|
|
24
21
|
string name;
|
|
@@ -32,16 +29,10 @@ struct CreateCollationInfo : public CreateInfo {
|
|
|
32
29
|
bool not_required_for_equality;
|
|
33
30
|
|
|
34
31
|
protected:
|
|
35
|
-
void SerializeInternal(Serializer &) const override
|
|
36
|
-
throw NotImplementedException("Cannot serialize '%s'", CatalogTypeToString(type));
|
|
37
|
-
}
|
|
32
|
+
void SerializeInternal(Serializer &) const override;
|
|
38
33
|
|
|
39
34
|
public:
|
|
40
|
-
unique_ptr<CreateInfo> Copy() const override
|
|
41
|
-
auto result = make_unique<CreateCollationInfo>(name, function, combinable, not_required_for_equality);
|
|
42
|
-
CopyProperties(*result);
|
|
43
|
-
return move(result);
|
|
44
|
-
}
|
|
35
|
+
unique_ptr<CreateInfo> Copy() const override;
|
|
45
36
|
};
|
|
46
37
|
|
|
47
38
|
} // namespace duckdb
|
|
@@ -14,10 +14,7 @@
|
|
|
14
14
|
namespace duckdb {
|
|
15
15
|
|
|
16
16
|
struct CreateCopyFunctionInfo : public CreateInfo {
|
|
17
|
-
explicit CreateCopyFunctionInfo(CopyFunction function)
|
|
18
|
-
: CreateInfo(CatalogType::COPY_FUNCTION_ENTRY), function(function) {
|
|
19
|
-
this->name = function.name;
|
|
20
|
-
}
|
|
17
|
+
DUCKDB_API explicit CreateCopyFunctionInfo(CopyFunction function);
|
|
21
18
|
|
|
22
19
|
//! Function name
|
|
23
20
|
string name;
|
|
@@ -25,16 +22,10 @@ struct CreateCopyFunctionInfo : public CreateInfo {
|
|
|
25
22
|
CopyFunction function;
|
|
26
23
|
|
|
27
24
|
protected:
|
|
28
|
-
void SerializeInternal(Serializer &) const override
|
|
29
|
-
throw NotImplementedException("Cannot serialize '%s'", CatalogTypeToString(type));
|
|
30
|
-
}
|
|
25
|
+
void SerializeInternal(Serializer &) const override;
|
|
31
26
|
|
|
32
27
|
public:
|
|
33
|
-
unique_ptr<CreateInfo> Copy() const override
|
|
34
|
-
auto result = make_unique<CreateCopyFunctionInfo>(function);
|
|
35
|
-
CopyProperties(*result);
|
|
36
|
-
return move(result);
|
|
37
|
-
}
|
|
28
|
+
unique_ptr<CreateInfo> Copy() const override;
|
|
38
29
|
};
|
|
39
30
|
|
|
40
31
|
} // namespace duckdb
|
|
@@ -44,7 +44,7 @@ protected:
|
|
|
44
44
|
void SerializeInternal(Serializer &serializer) const override;
|
|
45
45
|
|
|
46
46
|
public:
|
|
47
|
-
unique_ptr<CreateInfo> Copy() const override;
|
|
47
|
+
DUCKDB_API unique_ptr<CreateInfo> Copy() const override;
|
|
48
48
|
|
|
49
49
|
static unique_ptr<CreateIndexInfo> Deserialize(Deserializer &deserializer);
|
|
50
50
|
};
|
|
@@ -28,15 +28,17 @@ enum class OnCreateConflict : uint8_t {
|
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
struct CreateInfo : public ParseInfo {
|
|
31
|
-
explicit CreateInfo(CatalogType type, string schema = DEFAULT_SCHEMA)
|
|
32
|
-
: type(type), schema(schema), on_conflict(OnCreateConflict::ERROR_ON_CONFLICT),
|
|
33
|
-
internal(false) {
|
|
31
|
+
explicit CreateInfo(CatalogType type, string schema = DEFAULT_SCHEMA, string catalog_p = INVALID_CATALOG)
|
|
32
|
+
: type(type), catalog(move(catalog_p)), schema(schema), on_conflict(OnCreateConflict::ERROR_ON_CONFLICT),
|
|
33
|
+
temporary(false), internal(false) {
|
|
34
34
|
}
|
|
35
35
|
~CreateInfo() override {
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
//! The to-be-created catalog type
|
|
39
39
|
CatalogType type;
|
|
40
|
+
//! The catalog name of the entry
|
|
41
|
+
string catalog;
|
|
40
42
|
//! The schema name of the entry
|
|
41
43
|
string schema;
|
|
42
44
|
//! What to do on create conflict
|
|
@@ -15,24 +15,13 @@
|
|
|
15
15
|
namespace duckdb {
|
|
16
16
|
|
|
17
17
|
struct CreatePragmaFunctionInfo : public CreateFunctionInfo {
|
|
18
|
-
explicit CreatePragmaFunctionInfo(PragmaFunction function)
|
|
19
|
-
|
|
20
|
-
name = function.name;
|
|
21
|
-
functions.AddFunction(move(function));
|
|
22
|
-
}
|
|
23
|
-
CreatePragmaFunctionInfo(string name, PragmaFunctionSet functions_)
|
|
24
|
-
: CreateFunctionInfo(CatalogType::PRAGMA_FUNCTION_ENTRY), functions(functions_) {
|
|
25
|
-
this->name = name;
|
|
26
|
-
}
|
|
18
|
+
DUCKDB_API explicit CreatePragmaFunctionInfo(PragmaFunction function);
|
|
19
|
+
DUCKDB_API CreatePragmaFunctionInfo(string name, PragmaFunctionSet functions_);
|
|
27
20
|
|
|
28
21
|
PragmaFunctionSet functions;
|
|
29
22
|
|
|
30
23
|
public:
|
|
31
|
-
unique_ptr<CreateInfo> Copy() const override
|
|
32
|
-
auto result = make_unique<CreatePragmaFunctionInfo>(functions.name, functions);
|
|
33
|
-
CopyProperties(*result);
|
|
34
|
-
return move(result);
|
|
35
|
-
}
|
|
24
|
+
DUCKDB_API unique_ptr<CreateInfo> Copy() const override;
|
|
36
25
|
};
|
|
37
26
|
|
|
38
27
|
} // namespace duckdb
|
|
@@ -14,30 +14,14 @@
|
|
|
14
14
|
namespace duckdb {
|
|
15
15
|
|
|
16
16
|
struct CreateTableFunctionInfo : public CreateFunctionInfo {
|
|
17
|
-
explicit CreateTableFunctionInfo(TableFunction function)
|
|
18
|
-
|
|
19
|
-
name = function.name;
|
|
20
|
-
functions.AddFunction(move(function));
|
|
21
|
-
}
|
|
22
|
-
explicit CreateTableFunctionInfo(TableFunctionSet set)
|
|
23
|
-
: CreateFunctionInfo(CatalogType::TABLE_FUNCTION_ENTRY), functions(move(set)) {
|
|
24
|
-
name = functions.name;
|
|
25
|
-
for (auto &func : functions.functions) {
|
|
26
|
-
func.name = functions.name;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
17
|
+
DUCKDB_API explicit CreateTableFunctionInfo(TableFunction function);
|
|
18
|
+
DUCKDB_API explicit CreateTableFunctionInfo(TableFunctionSet set);
|
|
29
19
|
|
|
30
20
|
//! The table functions
|
|
31
21
|
TableFunctionSet functions;
|
|
32
22
|
|
|
33
23
|
public:
|
|
34
|
-
unique_ptr<CreateInfo> Copy() const
|
|
35
|
-
TableFunctionSet set(name);
|
|
36
|
-
set.functions = functions.functions;
|
|
37
|
-
auto result = make_unique<CreateTableFunctionInfo>(move(set));
|
|
38
|
-
CopyProperties(*result);
|
|
39
|
-
return move(result);
|
|
40
|
-
}
|
|
24
|
+
DUCKDB_API unique_ptr<CreateInfo> Copy() const;
|
|
41
25
|
};
|
|
42
26
|
|
|
43
27
|
} // namespace duckdb
|
|
@@ -17,10 +17,12 @@
|
|
|
17
17
|
#include "duckdb/parser/column_list.hpp"
|
|
18
18
|
|
|
19
19
|
namespace duckdb {
|
|
20
|
+
class SchemaCatalogEntry;
|
|
20
21
|
|
|
21
22
|
struct CreateTableInfo : public CreateInfo {
|
|
22
23
|
DUCKDB_API CreateTableInfo();
|
|
23
|
-
DUCKDB_API CreateTableInfo(string schema, string name);
|
|
24
|
+
DUCKDB_API CreateTableInfo(string catalog, string schema, string name);
|
|
25
|
+
DUCKDB_API CreateTableInfo(SchemaCatalogEntry *schema, string name);
|
|
24
26
|
|
|
25
27
|
//! Table name to insert to
|
|
26
28
|
string table;
|
|
@@ -12,13 +12,12 @@
|
|
|
12
12
|
#include "duckdb/parser/statement/select_statement.hpp"
|
|
13
13
|
|
|
14
14
|
namespace duckdb {
|
|
15
|
+
class SchemaCatalogEntry;
|
|
15
16
|
|
|
16
17
|
struct CreateViewInfo : public CreateInfo {
|
|
17
|
-
CreateViewInfo()
|
|
18
|
-
|
|
19
|
-
CreateViewInfo(string
|
|
20
|
-
: CreateInfo(CatalogType::VIEW_ENTRY, schema), view_name(view_name) {
|
|
21
|
-
}
|
|
18
|
+
CreateViewInfo();
|
|
19
|
+
CreateViewInfo(SchemaCatalogEntry *schema, string view_name);
|
|
20
|
+
CreateViewInfo(string catalog_p, string schema_p, string view_name);
|
|
22
21
|
|
|
23
22
|
//! Table name to insert to
|
|
24
23
|
string view_name;
|
|
@@ -30,38 +29,12 @@ struct CreateViewInfo : public CreateInfo {
|
|
|
30
29
|
unique_ptr<SelectStatement> query;
|
|
31
30
|
|
|
32
31
|
public:
|
|
33
|
-
unique_ptr<CreateInfo> Copy() const override
|
|
34
|
-
auto result = make_unique<CreateViewInfo>(schema, view_name);
|
|
35
|
-
CopyProperties(*result);
|
|
36
|
-
result->aliases = aliases;
|
|
37
|
-
result->types = types;
|
|
38
|
-
result->query = unique_ptr_cast<SQLStatement, SelectStatement>(query->Copy());
|
|
39
|
-
return move(result);
|
|
40
|
-
}
|
|
32
|
+
unique_ptr<CreateInfo> Copy() const override;
|
|
41
33
|
|
|
42
|
-
static unique_ptr<CreateViewInfo> Deserialize(Deserializer &deserializer)
|
|
43
|
-
auto result = make_unique<CreateViewInfo>();
|
|
44
|
-
result->DeserializeBase(deserializer);
|
|
45
|
-
|
|
46
|
-
FieldReader reader(deserializer);
|
|
47
|
-
result->view_name = reader.ReadRequired<string>();
|
|
48
|
-
result->aliases = reader.ReadRequiredList<string>();
|
|
49
|
-
result->types = reader.ReadRequiredSerializableList<LogicalType, LogicalType>();
|
|
50
|
-
result->query = reader.ReadOptional<SelectStatement>(nullptr);
|
|
51
|
-
reader.Finalize();
|
|
52
|
-
|
|
53
|
-
return result;
|
|
54
|
-
}
|
|
34
|
+
static unique_ptr<CreateViewInfo> Deserialize(Deserializer &deserializer);
|
|
55
35
|
|
|
56
36
|
protected:
|
|
57
|
-
void SerializeInternal(Serializer &serializer) const override
|
|
58
|
-
FieldWriter writer(serializer);
|
|
59
|
-
writer.WriteString(view_name);
|
|
60
|
-
writer.WriteList<string>(aliases);
|
|
61
|
-
writer.WriteRegularSerializableList(types);
|
|
62
|
-
writer.WriteOptional(query);
|
|
63
|
-
writer.Finalize();
|
|
64
|
-
}
|
|
37
|
+
void SerializeInternal(Serializer &serializer) const override;
|
|
65
38
|
};
|
|
66
39
|
|
|
67
40
|
} // namespace duckdb
|
|
@@ -14,11 +14,13 @@
|
|
|
14
14
|
namespace duckdb {
|
|
15
15
|
|
|
16
16
|
struct DropInfo : public ParseInfo {
|
|
17
|
-
DropInfo() : schema(INVALID_SCHEMA), if_exists(false), cascade(false) {
|
|
17
|
+
DropInfo() : catalog(INVALID_CATALOG), schema(INVALID_SCHEMA), if_exists(false), cascade(false) {
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
//! The catalog type to drop
|
|
21
21
|
CatalogType type;
|
|
22
|
+
//! Catalog name to drop from, if any
|
|
23
|
+
string catalog;
|
|
22
24
|
//! Schema name to drop from, if any
|
|
23
25
|
string schema;
|
|
24
26
|
//! Element name to drop
|
|
@@ -28,15 +30,19 @@ struct DropInfo : public ParseInfo {
|
|
|
28
30
|
//! Cascade drop (drop all dependents instead of throwing an error if there
|
|
29
31
|
//! are any)
|
|
30
32
|
bool cascade = false;
|
|
33
|
+
//! Allow dropping of internal system entries
|
|
34
|
+
bool allow_drop_internal = false;
|
|
31
35
|
|
|
32
36
|
public:
|
|
33
37
|
unique_ptr<DropInfo> Copy() const {
|
|
34
38
|
auto result = make_unique<DropInfo>();
|
|
35
39
|
result->type = type;
|
|
40
|
+
result->catalog = catalog;
|
|
36
41
|
result->schema = schema;
|
|
37
42
|
result->name = name;
|
|
38
43
|
result->if_exists = if_exists;
|
|
39
44
|
result->cascade = cascade;
|
|
45
|
+
result->allow_drop_internal = allow_drop_internal;
|
|
40
46
|
return result;
|
|
41
47
|
}
|
|
42
48
|
};
|
|
@@ -62,8 +62,8 @@ struct ParserExtensionPlanResult {
|
|
|
62
62
|
TableFunction function;
|
|
63
63
|
//! Parameters to the function
|
|
64
64
|
vector<Value> parameters;
|
|
65
|
-
//!
|
|
66
|
-
|
|
65
|
+
//! The set of databases that will be modified by this statement (empty for a read-only statement)
|
|
66
|
+
unordered_set<string> modified_databases;
|
|
67
67
|
//! Whether or not the statement requires a valid transaction to be executed
|
|
68
68
|
bool requires_valid_transaction = true;
|
|
69
69
|
//! What type of result set the statement returns
|
|
@@ -16,12 +16,14 @@
|
|
|
16
16
|
namespace duckdb {
|
|
17
17
|
|
|
18
18
|
struct QualifiedName {
|
|
19
|
+
string catalog;
|
|
19
20
|
string schema;
|
|
20
21
|
string name;
|
|
21
22
|
|
|
22
23
|
//! Parse the (optional) schema and a name from a string in the format of e.g. "schema"."table"; if there is no dot
|
|
23
24
|
//! the schema will be set to INVALID_SCHEMA
|
|
24
25
|
static QualifiedName Parse(const string &input) {
|
|
26
|
+
string catalog;
|
|
25
27
|
string schema;
|
|
26
28
|
string name;
|
|
27
29
|
idx_t idx = 0;
|
|
@@ -57,15 +59,21 @@ struct QualifiedName {
|
|
|
57
59
|
throw ParserException("Unterminated quote in qualified name!");
|
|
58
60
|
end:
|
|
59
61
|
if (entries.empty()) {
|
|
62
|
+
catalog = INVALID_CATALOG;
|
|
60
63
|
schema = INVALID_SCHEMA;
|
|
61
64
|
name = entry;
|
|
62
65
|
} else if (entries.size() == 1) {
|
|
66
|
+
catalog = INVALID_CATALOG;
|
|
63
67
|
schema = entries[0];
|
|
64
68
|
name = entry;
|
|
69
|
+
} else if (entries.size() == 2) {
|
|
70
|
+
catalog = entries[0];
|
|
71
|
+
schema = entries[1];
|
|
72
|
+
name = entry;
|
|
65
73
|
} else {
|
|
66
|
-
throw ParserException("Expected schema.entry or entry: too many entries found");
|
|
74
|
+
throw ParserException("Expected catalog.entry, schema.entry or entry: too many entries found");
|
|
67
75
|
}
|
|
68
|
-
return QualifiedName {schema, name};
|
|
76
|
+
return QualifiedName {catalog, schema, name};
|
|
69
77
|
}
|
|
70
78
|
};
|
|
71
79
|
|