| 1 | //===----------------------------------------------------------------------===// |
| 2 | // DuckDB |
| 3 | // |
| 4 | // duckdb/parser/parsed_data/drop_info.hpp |
| 5 | // |
| 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | |
| 9 | #pragma once |
| 10 | |
| 11 | #include "duckdb/common/enums/catalog_type.hpp" |
| 12 | #include "duckdb/common/field_writer.hpp" |
| 13 | #include "duckdb/parser/parsed_data/parse_info.hpp" |
| 14 | |
| 15 | namespace duckdb { |
| 16 | |
| 17 | struct DropInfo : public ParseInfo { |
| 18 | DropInfo(); |
| 19 | |
| 20 | //! The catalog type to drop |
| 21 | CatalogType type; |
| 22 | //! Catalog name to drop from, if any |
| 23 | string catalog; |
| 24 | //! Schema name to drop from, if any |
| 25 | string schema; |
| 26 | //! Element name to drop |
| 27 | string name; |
| 28 | //! Ignore if the entry does not exist instead of failing |
| 29 | OnEntryNotFound if_not_found = OnEntryNotFound::THROW_EXCEPTION; |
| 30 | //! Cascade drop (drop all dependents instead of throwing an error if there |
| 31 | //! are any) |
| 32 | bool cascade = false; |
| 33 | //! Allow dropping of internal system entries |
| 34 | bool allow_drop_internal = false; |
| 35 | |
| 36 | public: |
| 37 | unique_ptr<DropInfo> Copy() const; |
| 38 | |
| 39 | void Serialize(Serializer &serializer) const; |
| 40 | static unique_ptr<ParseInfo> Deserialize(Deserializer &deserializer); |
| 41 | }; |
| 42 | |
| 43 | } // namespace duckdb |
| 44 | |