duckdb 0.7.2-dev3515.0 → 0.7.2-dev3546.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.
Files changed (62) hide show
  1. package/configure.py +2 -0
  2. package/package.json +1 -1
  3. package/src/duckdb/extension/json/json_functions/read_json.cpp +1 -0
  4. package/src/duckdb/src/catalog/catalog_entry/macro_catalog_entry.cpp +42 -0
  5. package/src/duckdb/src/catalog/catalog_search_path.cpp +5 -0
  6. package/src/duckdb/src/catalog/catalog_set.cpp +1 -1
  7. package/src/duckdb/src/common/constants.cpp +1 -0
  8. package/src/duckdb/src/common/types/vector.cpp +3 -3
  9. package/src/duckdb/src/common/types/vector_buffer.cpp +11 -3
  10. package/src/duckdb/src/common/types/vector_cache.cpp +5 -5
  11. package/src/duckdb/src/execution/operator/schema/physical_create_type.cpp +2 -2
  12. package/src/duckdb/src/function/macro_function.cpp +43 -0
  13. package/src/duckdb/src/function/scalar/strftime_format.cpp +1 -0
  14. package/src/duckdb/src/function/scalar_macro_function.cpp +10 -0
  15. package/src/duckdb/src/function/table/copy_csv.cpp +2 -6
  16. package/src/duckdb/src/function/table/read_csv.cpp +17 -0
  17. package/src/duckdb/src/function/table/version/pragma_version.cpp +2 -2
  18. package/src/duckdb/src/function/table_macro_function.cpp +10 -0
  19. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/macro_catalog_entry.hpp +3 -1
  20. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/scalar_macro_catalog_entry.hpp +0 -6
  21. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_macro_catalog_entry.hpp +0 -6
  22. package/src/duckdb/src/include/duckdb/common/constants.hpp +2 -0
  23. package/src/duckdb/src/include/duckdb/common/field_writer.hpp +3 -3
  24. package/src/duckdb/src/include/duckdb/common/types/vector_buffer.hpp +12 -2
  25. package/src/duckdb/src/include/duckdb/execution/operator/persistent/csv_reader_options.hpp +1 -2
  26. package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_type.hpp +1 -1
  27. package/src/duckdb/src/include/duckdb/function/macro_function.hpp +7 -1
  28. package/src/duckdb/src/include/duckdb/function/scalar/strftime_format.hpp +3 -4
  29. package/src/duckdb/src/include/duckdb/function/scalar_macro_function.hpp +7 -2
  30. package/src/duckdb/src/include/duckdb/function/table_macro_function.hpp +5 -0
  31. package/src/duckdb/src/include/duckdb/parser/parsed_data/attach_info.hpp +4 -7
  32. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_macro_info.hpp +8 -12
  33. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_sequence_info.hpp +6 -20
  34. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_type_info.hpp +6 -18
  35. package/src/duckdb/src/include/duckdb/parser/parsed_data/detach_info.hpp +4 -8
  36. package/src/duckdb/src/include/duckdb/parser/parsed_data/drop_info.hpp +4 -38
  37. package/src/duckdb/src/include/duckdb/parser/parsed_data/transaction_info.hpp +5 -2
  38. package/src/duckdb/src/include/duckdb/parser/parsed_data/vacuum_info.hpp +10 -10
  39. package/src/duckdb/src/parser/parsed_data/attach_info.cpp +42 -0
  40. package/src/duckdb/src/parser/parsed_data/create_index_info.cpp +0 -7
  41. package/src/duckdb/src/parser/parsed_data/create_info.cpp +19 -8
  42. package/src/duckdb/src/parser/parsed_data/create_macro_info.cpp +46 -0
  43. package/src/duckdb/src/parser/parsed_data/create_sequence_info.cpp +56 -0
  44. package/src/duckdb/src/parser/parsed_data/create_type_info.cpp +47 -0
  45. package/src/duckdb/src/parser/parsed_data/detach_info.cpp +34 -0
  46. package/src/duckdb/src/parser/parsed_data/drop_info.cpp +46 -0
  47. package/src/duckdb/src/parser/parsed_data/transaction_info.cpp +24 -0
  48. package/src/duckdb/src/parser/parsed_data/vacuum_info.cpp +37 -0
  49. package/src/duckdb/src/planner/binder/expression/bind_star_expression.cpp +27 -9
  50. package/src/duckdb/src/planner/binder/statement/bind_create.cpp +2 -1
  51. package/src/duckdb/src/planner/binder/statement/bind_create_table.cpp +1 -0
  52. package/src/duckdb/src/planner/logical_operator.cpp +1 -2
  53. package/src/duckdb/src/planner/operator/logical_create_index.cpp +16 -25
  54. package/src/duckdb/src/planner/operator/logical_insert.cpp +30 -0
  55. package/src/duckdb/src/planner/operator/logical_simple.cpp +33 -5
  56. package/src/duckdb/src/planner/parsed_data/bound_create_table_info.cpp +6 -16
  57. package/src/duckdb/src/planner/planner.cpp +4 -13
  58. package/src/duckdb/src/storage/checkpoint_manager.cpp +12 -6
  59. package/src/duckdb/src/storage/storage_info.cpp +1 -1
  60. package/src/duckdb/ub_src_catalog_catalog_entry.cpp +1 -1
  61. package/src/duckdb/ub_src_parser_parsed_data.cpp +16 -0
  62. package/src/duckdb/src/catalog/catalog_entry/scalar_macro_catalog_entry.cpp +0 -104
@@ -29,10 +29,7 @@ enum class SequenceInfo : uint8_t {
29
29
  };
30
30
 
31
31
  struct CreateSequenceInfo : public CreateInfo {
32
- CreateSequenceInfo()
33
- : CreateInfo(CatalogType::SEQUENCE_ENTRY, INVALID_SCHEMA), name(string()), usage_count(0), increment(1),
34
- min_value(1), max_value(NumericLimits<int64_t>::Maximum()), start_value(1), cycle(false) {
35
- }
32
+ CreateSequenceInfo();
36
33
 
37
34
  //! Sequence name to create
38
35
  string name;
@@ -50,24 +47,13 @@ struct CreateSequenceInfo : public CreateInfo {
50
47
  bool cycle;
51
48
 
52
49
  public:
53
- unique_ptr<CreateInfo> Copy() const override {
54
- auto result = make_uniq<CreateSequenceInfo>();
55
- CopyProperties(*result);
56
- result->name = name;
57
- result->schema = schema;
58
- result->usage_count = usage_count;
59
- result->increment = increment;
60
- result->min_value = min_value;
61
- result->max_value = max_value;
62
- result->start_value = start_value;
63
- result->cycle = cycle;
64
- return std::move(result);
65
- }
50
+ unique_ptr<CreateInfo> Copy() const override;
51
+
52
+ public:
53
+ DUCKDB_API static unique_ptr<CreateSequenceInfo> Deserialize(Deserializer &deserializer);
66
54
 
67
55
  protected:
68
- void SerializeInternal(Serializer &) const override {
69
- throw NotImplementedException("Cannot serialize '%s'", CatalogTypeToString(type));
70
- }
56
+ void SerializeInternal(Serializer &) const override;
71
57
  };
72
58
 
73
59
  } // namespace duckdb
@@ -16,11 +16,8 @@
16
16
  namespace duckdb {
17
17
 
18
18
  struct CreateTypeInfo : public CreateInfo {
19
- CreateTypeInfo() : CreateInfo(CatalogType::TYPE_ENTRY) {
20
- }
21
- CreateTypeInfo(string name_p, LogicalType type_p)
22
- : CreateInfo(CatalogType::TYPE_ENTRY), name(std::move(name_p)), type(std::move(type_p)) {
23
- }
19
+ CreateTypeInfo();
20
+ CreateTypeInfo(string name_p, LogicalType type_p);
24
21
 
25
22
  //! Name of the Type
26
23
  string name;
@@ -30,21 +27,12 @@ struct CreateTypeInfo : public CreateInfo {
30
27
  unique_ptr<SQLStatement> query;
31
28
 
32
29
  public:
33
- unique_ptr<CreateInfo> Copy() const override {
34
- auto result = make_uniq<CreateTypeInfo>();
35
- CopyProperties(*result);
36
- result->name = name;
37
- result->type = type;
38
- if (query) {
39
- result->query = query->Copy();
40
- }
41
- return std::move(result);
42
- }
30
+ unique_ptr<CreateInfo> Copy() const override;
31
+
32
+ DUCKDB_API static unique_ptr<CreateTypeInfo> Deserialize(Deserializer &deserializer);
43
33
 
44
34
  protected:
45
- void SerializeInternal(Serializer &) const override {
46
- throw NotImplementedException("Cannot serialize '%s'", CatalogTypeToString(CreateInfo::type));
47
- }
35
+ void SerializeInternal(Serializer &) const override;
48
36
  };
49
37
 
50
38
  } // namespace duckdb
@@ -14,8 +14,7 @@
14
14
  namespace duckdb {
15
15
 
16
16
  struct DetachInfo : public ParseInfo {
17
- DetachInfo() {
18
- }
17
+ DetachInfo();
19
18
 
20
19
  //! The alias of the attached database
21
20
  string name;
@@ -23,11 +22,8 @@ struct DetachInfo : public ParseInfo {
23
22
  OnEntryNotFound if_not_found;
24
23
 
25
24
  public:
26
- unique_ptr<DetachInfo> Copy() const {
27
- auto result = make_uniq<DetachInfo>();
28
- result->name = name;
29
- result->if_not_found = if_not_found;
30
- return result;
31
- }
25
+ unique_ptr<DetachInfo> Copy() const;
26
+ void Serialize(Serializer &serializer) const;
27
+ static unique_ptr<ParseInfo> Deserialize(Deserializer &deserializer);
32
28
  };
33
29
  } // namespace duckdb
@@ -15,8 +15,7 @@
15
15
  namespace duckdb {
16
16
 
17
17
  struct DropInfo : public ParseInfo {
18
- DropInfo() : catalog(INVALID_CATALOG), schema(INVALID_SCHEMA), cascade(false) {
19
- }
18
+ DropInfo();
20
19
 
21
20
  //! The catalog type to drop
22
21
  CatalogType type;
@@ -35,43 +34,10 @@ struct DropInfo : public ParseInfo {
35
34
  bool allow_drop_internal = false;
36
35
 
37
36
  public:
38
- unique_ptr<DropInfo> Copy() const {
39
- auto result = make_uniq<DropInfo>();
40
- result->type = type;
41
- result->catalog = catalog;
42
- result->schema = schema;
43
- result->name = name;
44
- result->if_not_found = if_not_found;
45
- result->cascade = cascade;
46
- result->allow_drop_internal = allow_drop_internal;
47
- return result;
48
- }
37
+ unique_ptr<DropInfo> Copy() const;
49
38
 
50
- void Serialize(Serializer &serializer) const {
51
- FieldWriter writer(serializer);
52
- writer.WriteField<CatalogType>(type);
53
- writer.WriteString(catalog);
54
- writer.WriteString(schema);
55
- writer.WriteString(name);
56
- writer.WriteField(if_not_found);
57
- writer.WriteField(cascade);
58
- writer.WriteField(allow_drop_internal);
59
- writer.Finalize();
60
- }
61
-
62
- static unique_ptr<ParseInfo> Deserialize(Deserializer &deserializer) {
63
- FieldReader reader(deserializer);
64
- auto drop_info = make_uniq<DropInfo>();
65
- drop_info->type = reader.ReadRequired<CatalogType>();
66
- drop_info->catalog = reader.ReadRequired<string>();
67
- drop_info->schema = reader.ReadRequired<string>();
68
- drop_info->name = reader.ReadRequired<string>();
69
- drop_info->if_not_found = reader.ReadRequired<OnEntryNotFound>();
70
- drop_info->cascade = reader.ReadRequired<bool>();
71
- drop_info->allow_drop_internal = reader.ReadRequired<bool>();
72
- reader.Finalize();
73
- return std::move(drop_info);
74
- }
39
+ void Serialize(Serializer &serializer) const;
40
+ static unique_ptr<ParseInfo> Deserialize(Deserializer &deserializer);
75
41
  };
76
42
 
77
43
  } // namespace duckdb
@@ -15,11 +15,14 @@ namespace duckdb {
15
15
  enum class TransactionType : uint8_t { INVALID, BEGIN_TRANSACTION, COMMIT, ROLLBACK };
16
16
 
17
17
  struct TransactionInfo : public ParseInfo {
18
- explicit TransactionInfo(TransactionType type) : type(type) {
19
- }
18
+ explicit TransactionInfo(TransactionType type);
20
19
 
21
20
  //! The type of transaction statement
22
21
  TransactionType type;
22
+
23
+ public:
24
+ void Serialize(Serializer &serializer) const;
25
+ static unique_ptr<ParseInfo> Deserialize(Deserializer &deserializer);
23
26
  };
24
27
 
25
28
  } // namespace duckdb
@@ -17,22 +17,16 @@
17
17
  namespace duckdb {
18
18
 
19
19
  struct VacuumOptions {
20
+ VacuumOptions() : vacuum(false), analyze(false) {
21
+ }
22
+
20
23
  bool vacuum;
21
24
  bool analyze;
22
25
  };
23
26
 
24
27
  struct VacuumInfo : public ParseInfo {
25
28
  public:
26
- explicit VacuumInfo(VacuumOptions options) : options(options), has_table(false) {};
27
-
28
- unique_ptr<VacuumInfo> Copy() {
29
- auto result = make_uniq<VacuumInfo>(options);
30
- result->has_table = has_table;
31
- if (has_table) {
32
- result->ref = ref->Copy();
33
- }
34
- return result;
35
- }
29
+ explicit VacuumInfo(VacuumOptions options);
36
30
 
37
31
  const VacuumOptions options;
38
32
 
@@ -42,6 +36,12 @@ public:
42
36
  optional_ptr<TableCatalogEntry> table;
43
37
  unordered_map<idx_t, idx_t> column_id_map;
44
38
  vector<string> columns;
39
+
40
+ public:
41
+ unique_ptr<VacuumInfo> Copy();
42
+
43
+ void Serialize(Serializer &serializer) const;
44
+ static unique_ptr<ParseInfo> Deserialize(Deserializer &deserializer);
45
45
  };
46
46
 
47
47
  } // namespace duckdb
@@ -0,0 +1,42 @@
1
+ #include "duckdb/parser/parsed_data/attach_info.hpp"
2
+ #include "duckdb/common/field_writer.hpp"
3
+
4
+ namespace duckdb {
5
+
6
+ unique_ptr<AttachInfo> AttachInfo::Copy() const {
7
+ auto result = make_uniq<AttachInfo>();
8
+ result->name = name;
9
+ result->path = path;
10
+ result->options = options;
11
+ return result;
12
+ }
13
+
14
+ void AttachInfo::Serialize(Serializer &main_serializer) const {
15
+ FieldWriter writer(main_serializer);
16
+ writer.WriteString(name);
17
+ writer.WriteString(path);
18
+ writer.WriteField<uint32_t>(options.size());
19
+ auto &serializer = writer.GetSerializer();
20
+ for (auto &kv : options) {
21
+ serializer.WriteString(kv.first);
22
+ kv.second.Serialize(serializer);
23
+ }
24
+ writer.Finalize();
25
+ }
26
+
27
+ unique_ptr<ParseInfo> AttachInfo::Deserialize(Deserializer &deserializer) {
28
+ FieldReader reader(deserializer);
29
+ auto attach_info = make_uniq<AttachInfo>();
30
+ attach_info->name = reader.ReadRequired<string>();
31
+ attach_info->path = reader.ReadRequired<string>();
32
+ auto default_attach_count = reader.ReadRequired<uint32_t>();
33
+ auto &source = reader.GetSource();
34
+ for (idx_t i = 0; i < default_attach_count; i++) {
35
+ auto name = source.Read<string>();
36
+ attach_info->options[name] = Value::Deserialize(source);
37
+ }
38
+ reader.Finalize();
39
+ return std::move(attach_info);
40
+ }
41
+
42
+ } // namespace duckdb
@@ -5,7 +5,6 @@
5
5
  namespace duckdb {
6
6
 
7
7
  unique_ptr<CreateInfo> CreateIndexInfo::Copy() const {
8
-
9
8
  auto result = make_uniq<CreateIndexInfo>();
10
9
  CopyProperties(*result);
11
10
 
@@ -27,24 +26,20 @@ unique_ptr<CreateInfo> CreateIndexInfo::Copy() const {
27
26
  }
28
27
 
29
28
  void CreateIndexInfo::SerializeInternal(Serializer &serializer) const {
30
-
31
29
  FieldWriter writer(serializer);
32
30
  writer.WriteField(index_type);
33
31
  writer.WriteString(index_name);
34
32
  writer.WriteField(constraint_type);
35
33
 
36
- writer.WriteSerializableList<ParsedExpression>(expressions);
37
34
  writer.WriteSerializableList<ParsedExpression>(parsed_expressions);
38
35
 
39
36
  writer.WriteRegularSerializableList(scan_types);
40
37
  writer.WriteList<string>(names);
41
38
  writer.WriteList<column_t>(column_ids);
42
-
43
39
  writer.Finalize();
44
40
  }
45
41
 
46
42
  unique_ptr<CreateIndexInfo> CreateIndexInfo::Deserialize(Deserializer &deserializer) {
47
-
48
43
  auto result = make_uniq<CreateIndexInfo>();
49
44
  result->DeserializeBase(deserializer);
50
45
 
@@ -53,13 +48,11 @@ unique_ptr<CreateIndexInfo> CreateIndexInfo::Deserialize(Deserializer &deseriali
53
48
  result->index_name = reader.ReadRequired<string>();
54
49
  result->constraint_type = reader.ReadRequired<IndexConstraintType>();
55
50
 
56
- result->expressions = reader.ReadRequiredSerializableList<ParsedExpression>();
57
51
  result->parsed_expressions = reader.ReadRequiredSerializableList<ParsedExpression>();
58
52
 
59
53
  result->scan_types = reader.ReadRequiredSerializableList<LogicalType, LogicalType>();
60
54
  result->names = reader.ReadRequiredList<string>();
61
55
  result->column_ids = reader.ReadRequiredList<column_t>();
62
-
63
56
  reader.Finalize();
64
57
  return result;
65
58
  }
@@ -4,18 +4,13 @@
4
4
  #include "duckdb/parser/parsed_data/create_schema_info.hpp"
5
5
  #include "duckdb/parser/parsed_data/create_table_info.hpp"
6
6
  #include "duckdb/parser/parsed_data/create_view_info.hpp"
7
+ #include "duckdb/parser/parsed_data/create_sequence_info.hpp"
7
8
  #include "duckdb/parser/parsed_data/create_database_info.hpp"
9
+ #include "duckdb/parser/parsed_data/create_type_info.hpp"
8
10
  #include "duckdb/parser/parsed_data/alter_info.hpp"
11
+ #include "duckdb/parser/parsed_data/create_macro_info.hpp"
9
12
 
10
13
  namespace duckdb {
11
- void CreateInfo::DeserializeBase(Deserializer &deserializer) {
12
- this->catalog = deserializer.Read<string>();
13
- this->schema = deserializer.Read<string>();
14
- this->on_conflict = deserializer.Read<OnCreateConflict>();
15
- this->temporary = deserializer.Read<bool>();
16
- this->internal = deserializer.Read<bool>();
17
- this->sql = deserializer.Read<string>();
18
- }
19
14
 
20
15
  void CreateInfo::Serialize(Serializer &serializer) const {
21
16
  serializer.Write(type);
@@ -28,6 +23,15 @@ void CreateInfo::Serialize(Serializer &serializer) const {
28
23
  SerializeInternal(serializer);
29
24
  }
30
25
 
26
+ void CreateInfo::DeserializeBase(Deserializer &deserializer) {
27
+ this->catalog = deserializer.Read<string>();
28
+ this->schema = deserializer.Read<string>();
29
+ this->on_conflict = deserializer.Read<OnCreateConflict>();
30
+ this->temporary = deserializer.Read<bool>();
31
+ this->internal = deserializer.Read<bool>();
32
+ this->sql = deserializer.Read<string>();
33
+ }
34
+
31
35
  unique_ptr<CreateInfo> CreateInfo::Deserialize(Deserializer &deserializer) {
32
36
  auto type = deserializer.Read<CatalogType>();
33
37
  switch (type) {
@@ -41,6 +45,13 @@ unique_ptr<CreateInfo> CreateInfo::Deserialize(Deserializer &deserializer) {
41
45
  return CreateViewInfo::Deserialize(deserializer);
42
46
  case CatalogType::DATABASE_ENTRY:
43
47
  return CreateDatabaseInfo::Deserialize(deserializer);
48
+ case CatalogType::TYPE_ENTRY:
49
+ return CreateTypeInfo::Deserialize(deserializer);
50
+ case CatalogType::MACRO_ENTRY:
51
+ case CatalogType::TABLE_MACRO_ENTRY:
52
+ return CreateMacroInfo::Deserialize(deserializer);
53
+ case CatalogType::SEQUENCE_ENTRY:
54
+ return CreateSequenceInfo::Deserialize(deserializer);
44
55
  default:
45
56
  throw NotImplementedException("Cannot deserialize '%s'", CatalogTypeToString(type));
46
57
  }
@@ -0,0 +1,46 @@
1
+ #include "duckdb/parser/parsed_data/create_macro_info.hpp"
2
+ #include "duckdb/catalog/catalog_entry/schema_catalog_entry.hpp"
3
+ #include "duckdb/catalog/catalog_entry/table_catalog_entry.hpp"
4
+ #include "duckdb/catalog/catalog.hpp"
5
+
6
+ namespace duckdb {
7
+
8
+ CreateMacroInfo::CreateMacroInfo() : CreateFunctionInfo(CatalogType::MACRO_ENTRY, INVALID_SCHEMA) {
9
+ }
10
+
11
+ CreateMacroInfo::CreateMacroInfo(CatalogType type) : CreateFunctionInfo(type, INVALID_SCHEMA) {
12
+ }
13
+
14
+ unique_ptr<CreateInfo> CreateMacroInfo::Copy() const {
15
+ auto result = make_uniq<CreateMacroInfo>();
16
+ result->function = function->Copy();
17
+ result->name = name;
18
+ CopyProperties(*result);
19
+ return std::move(result);
20
+ }
21
+
22
+ void CreateMacroInfo::SerializeInternal(Serializer &serializer) const {
23
+ FieldWriter writer(serializer);
24
+ writer.WriteString(name);
25
+ writer.WriteSerializable(*function);
26
+ writer.Finalize();
27
+ }
28
+
29
+ unique_ptr<CreateMacroInfo> CreateMacroInfo::Deserialize(Deserializer &deserializer) {
30
+ auto result = make_uniq<CreateMacroInfo>();
31
+ result->DeserializeBase(deserializer);
32
+
33
+ FieldReader reader(deserializer);
34
+ result->name = reader.ReadRequired<string>();
35
+ result->function = reader.ReadRequiredSerializable<MacroFunction>();
36
+ reader.Finalize();
37
+
38
+ if (result->function->type == MacroType::TABLE_MACRO) {
39
+ result->type = CatalogType::TABLE_MACRO_ENTRY;
40
+ } else {
41
+ result->type = CatalogType::MACRO_ENTRY;
42
+ }
43
+ return result;
44
+ }
45
+
46
+ } // namespace duckdb
@@ -0,0 +1,56 @@
1
+ #include "duckdb/parser/parsed_data/create_sequence_info.hpp"
2
+ #include "duckdb/catalog/catalog_entry/schema_catalog_entry.hpp"
3
+ #include "duckdb/catalog/catalog_entry/table_catalog_entry.hpp"
4
+ #include "duckdb/catalog/catalog.hpp"
5
+
6
+ namespace duckdb {
7
+
8
+ CreateSequenceInfo::CreateSequenceInfo()
9
+ : CreateInfo(CatalogType::SEQUENCE_ENTRY, INVALID_SCHEMA), name(string()), usage_count(0), increment(1),
10
+ min_value(1), max_value(NumericLimits<int64_t>::Maximum()), start_value(1), cycle(false) {
11
+ }
12
+
13
+ unique_ptr<CreateInfo> CreateSequenceInfo::Copy() const {
14
+ auto result = make_uniq<CreateSequenceInfo>();
15
+ CopyProperties(*result);
16
+ result->name = name;
17
+ result->schema = schema;
18
+ result->usage_count = usage_count;
19
+ result->increment = increment;
20
+ result->min_value = min_value;
21
+ result->max_value = max_value;
22
+ result->start_value = start_value;
23
+ result->cycle = cycle;
24
+ return std::move(result);
25
+ }
26
+
27
+ void CreateSequenceInfo::SerializeInternal(Serializer &serializer) const {
28
+ FieldWriter writer(serializer);
29
+ writer.WriteString(name);
30
+ writer.WriteField(usage_count);
31
+ writer.WriteField(increment);
32
+ writer.WriteField(min_value);
33
+ writer.WriteField(max_value);
34
+ writer.WriteField(start_value);
35
+ writer.WriteField(cycle);
36
+ writer.Finalize();
37
+ }
38
+
39
+ unique_ptr<CreateSequenceInfo> CreateSequenceInfo::Deserialize(Deserializer &deserializer) {
40
+ auto result = make_uniq<CreateSequenceInfo>();
41
+ result->DeserializeBase(deserializer);
42
+
43
+ FieldReader reader(deserializer);
44
+ result->name = reader.ReadRequired<string>();
45
+ result->usage_count = reader.ReadRequired<uint64_t>();
46
+ result->increment = reader.ReadRequired<int64_t>();
47
+ result->min_value = reader.ReadRequired<int64_t>();
48
+ result->max_value = reader.ReadRequired<int64_t>();
49
+ result->start_value = reader.ReadRequired<int64_t>();
50
+ result->cycle = reader.ReadRequired<bool>();
51
+ reader.Finalize();
52
+
53
+ return result;
54
+ }
55
+
56
+ } // namespace duckdb
@@ -0,0 +1,47 @@
1
+ #include "duckdb/parser/parsed_data/create_type_info.hpp"
2
+ #include "duckdb/catalog/catalog_entry/schema_catalog_entry.hpp"
3
+ #include "duckdb/catalog/catalog_entry/table_catalog_entry.hpp"
4
+ #include "duckdb/catalog/catalog.hpp"
5
+
6
+ namespace duckdb {
7
+
8
+ CreateTypeInfo::CreateTypeInfo() : CreateInfo(CatalogType::TYPE_ENTRY) {
9
+ }
10
+ CreateTypeInfo::CreateTypeInfo(string name_p, LogicalType type_p)
11
+ : CreateInfo(CatalogType::TYPE_ENTRY), name(std::move(name_p)), type(std::move(type_p)) {
12
+ }
13
+
14
+ unique_ptr<CreateInfo> CreateTypeInfo::Copy() const {
15
+ auto result = make_uniq<CreateTypeInfo>();
16
+ CopyProperties(*result);
17
+ result->name = name;
18
+ result->type = type;
19
+ if (query) {
20
+ result->query = query->Copy();
21
+ }
22
+ return std::move(result);
23
+ }
24
+
25
+ void CreateTypeInfo::SerializeInternal(Serializer &serializer) const {
26
+ FieldWriter writer(serializer);
27
+ writer.WriteString(name);
28
+ writer.WriteSerializable(type);
29
+ if (query) {
30
+ throw InternalException("Cannot serialize CreateTypeInfo with query");
31
+ }
32
+ writer.Finalize();
33
+ }
34
+
35
+ unique_ptr<CreateTypeInfo> CreateTypeInfo::Deserialize(Deserializer &deserializer) {
36
+ auto result = make_uniq<CreateTypeInfo>();
37
+ result->DeserializeBase(deserializer);
38
+
39
+ FieldReader reader(deserializer);
40
+ result->name = reader.ReadRequired<string>();
41
+ result->type = reader.ReadRequiredSerializable<LogicalType, LogicalType>();
42
+ reader.Finalize();
43
+
44
+ return result;
45
+ }
46
+
47
+ } // namespace duckdb
@@ -0,0 +1,34 @@
1
+ #include "duckdb/parser/parsed_data/detach_info.hpp"
2
+ #include "duckdb/common/field_writer.hpp"
3
+
4
+ namespace duckdb {
5
+
6
+ DetachInfo::DetachInfo() {
7
+ }
8
+
9
+ unique_ptr<DetachInfo> DetachInfo::Copy() const {
10
+ auto result = make_uniq<DetachInfo>();
11
+ result->name = name;
12
+ result->if_not_found = if_not_found;
13
+ return result;
14
+ }
15
+
16
+ void DetachInfo::Serialize(Serializer &serializer) const {
17
+ FieldWriter writer(serializer);
18
+ writer.WriteString(name);
19
+ writer.WriteField(if_not_found);
20
+ writer.Finalize();
21
+ }
22
+
23
+ unique_ptr<ParseInfo> DetachInfo::Deserialize(Deserializer &deserializer) {
24
+ auto result = make_uniq<DetachInfo>();
25
+
26
+ FieldReader reader(deserializer);
27
+ result->name = reader.ReadRequired<string>();
28
+ result->if_not_found = reader.ReadRequired<OnEntryNotFound>();
29
+ reader.Finalize();
30
+
31
+ return std::move(result);
32
+ }
33
+
34
+ } // namespace duckdb
@@ -0,0 +1,46 @@
1
+ #include "duckdb/parser/parsed_data/drop_info.hpp"
2
+
3
+ namespace duckdb {
4
+
5
+ DropInfo::DropInfo() : catalog(INVALID_CATALOG), schema(INVALID_SCHEMA), cascade(false) {
6
+ }
7
+
8
+ unique_ptr<DropInfo> DropInfo::Copy() const {
9
+ auto result = make_uniq<DropInfo>();
10
+ result->type = type;
11
+ result->catalog = catalog;
12
+ result->schema = schema;
13
+ result->name = name;
14
+ result->if_not_found = if_not_found;
15
+ result->cascade = cascade;
16
+ result->allow_drop_internal = allow_drop_internal;
17
+ return result;
18
+ }
19
+
20
+ void DropInfo::Serialize(Serializer &serializer) const {
21
+ FieldWriter writer(serializer);
22
+ writer.WriteField<CatalogType>(type);
23
+ writer.WriteString(catalog);
24
+ writer.WriteString(schema);
25
+ writer.WriteString(name);
26
+ writer.WriteField(if_not_found);
27
+ writer.WriteField(cascade);
28
+ writer.WriteField(allow_drop_internal);
29
+ writer.Finalize();
30
+ }
31
+
32
+ unique_ptr<ParseInfo> DropInfo::Deserialize(Deserializer &deserializer) {
33
+ FieldReader reader(deserializer);
34
+ auto drop_info = make_uniq<DropInfo>();
35
+ drop_info->type = reader.ReadRequired<CatalogType>();
36
+ drop_info->catalog = reader.ReadRequired<string>();
37
+ drop_info->schema = reader.ReadRequired<string>();
38
+ drop_info->name = reader.ReadRequired<string>();
39
+ drop_info->if_not_found = reader.ReadRequired<OnEntryNotFound>();
40
+ drop_info->cascade = reader.ReadRequired<bool>();
41
+ drop_info->allow_drop_internal = reader.ReadRequired<bool>();
42
+ reader.Finalize();
43
+ return std::move(drop_info);
44
+ }
45
+
46
+ } // namespace duckdb
@@ -0,0 +1,24 @@
1
+ #include "duckdb/parser/parsed_data/transaction_info.hpp"
2
+ #include "duckdb/common/field_writer.hpp"
3
+
4
+ namespace duckdb {
5
+
6
+ TransactionInfo::TransactionInfo(TransactionType type) : type(type) {
7
+ }
8
+
9
+ void TransactionInfo::Serialize(Serializer &serializer) const {
10
+ FieldWriter writer(serializer);
11
+ writer.WriteField(type);
12
+ writer.Finalize();
13
+ }
14
+
15
+ unique_ptr<ParseInfo> TransactionInfo::Deserialize(Deserializer &deserializer) {
16
+ FieldReader reader(deserializer);
17
+ auto transaction_type = reader.ReadRequired<TransactionType>();
18
+ reader.Finalize();
19
+
20
+ auto transaction_info = make_uniq<TransactionInfo>(transaction_type);
21
+ return std::move(transaction_info);
22
+ }
23
+
24
+ } // namespace duckdb
@@ -0,0 +1,37 @@
1
+ #include "duckdb/parser/parsed_data/vacuum_info.hpp"
2
+ #include "duckdb/common/field_writer.hpp"
3
+
4
+ namespace duckdb {
5
+
6
+ VacuumInfo::VacuumInfo(VacuumOptions options) : options(options), has_table(false) {
7
+ }
8
+
9
+ unique_ptr<VacuumInfo> VacuumInfo::Copy() {
10
+ auto result = make_uniq<VacuumInfo>(options);
11
+ result->has_table = has_table;
12
+ if (has_table) {
13
+ result->ref = ref->Copy();
14
+ }
15
+ return result;
16
+ }
17
+
18
+ void VacuumInfo::Serialize(Serializer &serializer) const {
19
+ FieldWriter writer(serializer);
20
+ writer.WriteField(options.analyze);
21
+ writer.WriteField(options.vacuum);
22
+ writer.Finalize();
23
+ }
24
+
25
+ unique_ptr<ParseInfo> VacuumInfo::Deserialize(Deserializer &deserializer) {
26
+
27
+ VacuumOptions options;
28
+ FieldReader reader(deserializer);
29
+ options.analyze = reader.ReadRequired<bool>();
30
+ options.vacuum = reader.ReadRequired<bool>();
31
+ reader.Finalize();
32
+
33
+ auto vacuum_info = make_uniq<VacuumInfo>(options);
34
+ return std::move(vacuum_info);
35
+ }
36
+
37
+ } // namespace duckdb