1 | //===----------------------------------------------------------------------===// |
---|---|
2 | // DuckDB |
3 | // |
4 | // duckdb/parser/parsed_data/copy_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 | #include "duckdb/common/case_insensitive_map.hpp" |
16 | |
17 | namespace duckdb { |
18 | |
19 | struct CopyInfo : public ParseInfo { |
20 | CopyInfo() : catalog(INVALID_CATALOG), schema(DEFAULT_SCHEMA) { |
21 | } |
22 | |
23 | //! The catalog name to copy to/from |
24 | string catalog; |
25 | //! The schema name to copy to/from |
26 | string schema; |
27 | //! The table name to copy to/from |
28 | string table; |
29 | //! List of columns to copy to/from |
30 | vector<string> select_list; |
31 | //! Whether or not this is a copy to file (false) or copy from a file (true) |
32 | bool is_from; |
33 | //! The file format of the external file |
34 | string format; |
35 | //! The file path to copy to/from |
36 | string file_path; |
37 | //! Set of (key, value) options |
38 | case_insensitive_map_t<vector<Value>> options; |
39 | |
40 | public: |
41 | unique_ptr<CopyInfo> Copy() const { |
42 | auto result = make_uniq<CopyInfo>(); |
43 | result->catalog = catalog; |
44 | result->schema = schema; |
45 | result->table = table; |
46 | result->select_list = select_list; |
47 | result->file_path = file_path; |
48 | result->is_from = is_from; |
49 | result->format = format; |
50 | result->options = options; |
51 | return result; |
52 | } |
53 | }; |
54 | |
55 | } // namespace duckdb |
56 |