duckdb 0.8.2-dev1968.0 → 0.8.2-dev2044.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 (205) hide show
  1. package/package.json +1 -1
  2. package/src/duckdb/src/catalog/catalog.cpp +1 -1
  3. package/src/duckdb/src/catalog/catalog_entry/index_catalog_entry.cpp +17 -41
  4. package/src/duckdb/src/catalog/catalog_entry/macro_catalog_entry.cpp +2 -10
  5. package/src/duckdb/src/catalog/catalog_entry/schema_catalog_entry.cpp +4 -14
  6. package/src/duckdb/src/catalog/catalog_entry/sequence_catalog_entry.cpp +11 -28
  7. package/src/duckdb/src/catalog/catalog_entry/table_catalog_entry.cpp +11 -38
  8. package/src/duckdb/src/catalog/catalog_entry/view_catalog_entry.cpp +11 -27
  9. package/src/duckdb/src/catalog/catalog_entry.cpp +25 -1
  10. package/src/duckdb/src/common/enum_util.cpp +159 -0
  11. package/src/duckdb/src/common/extra_type_info.cpp +1 -2
  12. package/src/duckdb/src/common/serializer/binary_deserializer.cpp +3 -0
  13. package/src/duckdb/src/common/serializer/binary_serializer.cpp +4 -4
  14. package/src/duckdb/src/common/types/column/column_data_collection.cpp +43 -0
  15. package/src/duckdb/src/common/types/vector.cpp +1 -1
  16. package/src/duckdb/src/common/types.cpp +0 -12
  17. package/src/duckdb/src/execution/physical_plan/plan_comparison_join.cpp +1 -1
  18. package/src/duckdb/src/function/table/version/pragma_version.cpp +2 -2
  19. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/index_catalog_entry.hpp +1 -2
  20. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/macro_catalog_entry.hpp +1 -4
  21. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/schema_catalog_entry.hpp +2 -5
  22. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/sequence_catalog_entry.hpp +1 -6
  23. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_catalog_entry.hpp +2 -11
  24. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/view_catalog_entry.hpp +2 -5
  25. package/src/duckdb/src/include/duckdb/catalog/catalog_entry.hpp +14 -0
  26. package/src/duckdb/src/include/duckdb/common/constants.hpp +2 -0
  27. package/src/duckdb/src/include/duckdb/common/enum_util.hpp +32 -0
  28. package/src/duckdb/src/include/duckdb/common/enums/index_type.hpp +1 -1
  29. package/src/duckdb/src/include/duckdb/common/index_vector.hpp +12 -0
  30. package/src/duckdb/src/include/duckdb/common/serializer/binary_deserializer.hpp +28 -4
  31. package/src/duckdb/src/include/duckdb/common/serializer/binary_serializer.hpp +12 -5
  32. package/src/duckdb/src/include/duckdb/common/serializer/deserialization_data.hpp +110 -0
  33. package/src/duckdb/src/include/duckdb/common/serializer/format_deserializer.hpp +46 -1
  34. package/src/duckdb/src/include/duckdb/common/serializer/format_serializer.hpp +23 -21
  35. package/src/duckdb/src/include/duckdb/common/serializer/serialization_traits.hpp +12 -4
  36. package/src/duckdb/src/include/duckdb/common/types/column/column_data_collection.hpp +3 -0
  37. package/src/duckdb/src/include/duckdb/function/macro_function.hpp +3 -0
  38. package/src/duckdb/src/include/duckdb/function/scalar_macro_function.hpp +3 -0
  39. package/src/duckdb/src/include/duckdb/function/table_macro_function.hpp +3 -0
  40. package/src/duckdb/src/include/duckdb/parser/column_definition.hpp +6 -5
  41. package/src/duckdb/src/include/duckdb/parser/column_list.hpp +4 -0
  42. package/src/duckdb/src/include/duckdb/parser/constraint.hpp +5 -0
  43. package/src/duckdb/src/include/duckdb/parser/constraints/check_constraint.hpp +3 -0
  44. package/src/duckdb/src/include/duckdb/parser/constraints/foreign_key_constraint.hpp +6 -0
  45. package/src/duckdb/src/include/duckdb/parser/constraints/not_null_constraint.hpp +3 -0
  46. package/src/duckdb/src/include/duckdb/parser/constraints/unique_constraint.hpp +6 -0
  47. package/src/duckdb/src/include/duckdb/parser/expression/between_expression.hpp +1 -1
  48. package/src/duckdb/src/include/duckdb/parser/expression/case_expression.hpp +1 -1
  49. package/src/duckdb/src/include/duckdb/parser/expression/cast_expression.hpp +1 -1
  50. package/src/duckdb/src/include/duckdb/parser/expression/collate_expression.hpp +1 -1
  51. package/src/duckdb/src/include/duckdb/parser/expression/columnref_expression.hpp +1 -1
  52. package/src/duckdb/src/include/duckdb/parser/expression/comparison_expression.hpp +1 -1
  53. package/src/duckdb/src/include/duckdb/parser/expression/conjunction_expression.hpp +1 -1
  54. package/src/duckdb/src/include/duckdb/parser/expression/constant_expression.hpp +1 -1
  55. package/src/duckdb/src/include/duckdb/parser/expression/default_expression.hpp +1 -1
  56. package/src/duckdb/src/include/duckdb/parser/expression/function_expression.hpp +1 -1
  57. package/src/duckdb/src/include/duckdb/parser/expression/lambda_expression.hpp +1 -1
  58. package/src/duckdb/src/include/duckdb/parser/expression/operator_expression.hpp +1 -1
  59. package/src/duckdb/src/include/duckdb/parser/expression/parameter_expression.hpp +1 -1
  60. package/src/duckdb/src/include/duckdb/parser/expression/positional_reference_expression.hpp +1 -1
  61. package/src/duckdb/src/include/duckdb/parser/expression/star_expression.hpp +1 -1
  62. package/src/duckdb/src/include/duckdb/parser/expression/subquery_expression.hpp +1 -1
  63. package/src/duckdb/src/include/duckdb/parser/expression/window_expression.hpp +1 -1
  64. package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_info.hpp +12 -1
  65. package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_table_info.hpp +66 -2
  66. package/src/duckdb/src/include/duckdb/parser/parsed_data/attach_info.hpp +8 -1
  67. package/src/duckdb/src/include/duckdb/parser/parsed_data/copy_info.hpp +8 -1
  68. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_index_info.hpp +4 -1
  69. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_info.hpp +9 -2
  70. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_macro_info.hpp +3 -0
  71. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_schema_info.hpp +3 -0
  72. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_sequence_info.hpp +3 -0
  73. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_table_info.hpp +3 -0
  74. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_type_info.hpp +3 -0
  75. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_view_info.hpp +3 -0
  76. package/src/duckdb/src/include/duckdb/parser/parsed_data/detach_info.hpp +7 -0
  77. package/src/duckdb/src/include/duckdb/parser/parsed_data/drop_info.hpp +7 -0
  78. package/src/duckdb/src/include/duckdb/parser/parsed_data/exported_table_data.hpp +7 -0
  79. package/src/duckdb/src/include/duckdb/parser/parsed_data/load_info.hpp +13 -3
  80. package/src/duckdb/src/include/duckdb/parser/parsed_data/parse_info.hpp +22 -0
  81. package/src/duckdb/src/include/duckdb/parser/parsed_data/pragma_info.hpp +10 -0
  82. package/src/duckdb/src/include/duckdb/parser/parsed_data/show_select_info.hpp +7 -0
  83. package/src/duckdb/src/include/duckdb/parser/parsed_data/transaction_info.hpp +10 -0
  84. package/src/duckdb/src/include/duckdb/parser/parsed_data/vacuum_info.hpp +10 -0
  85. package/src/duckdb/src/include/duckdb/planner/bound_constraint.hpp +0 -8
  86. package/src/duckdb/src/include/duckdb/planner/bound_result_modifier.hpp +6 -0
  87. package/src/duckdb/src/include/duckdb/planner/column_binding.hpp +5 -0
  88. package/src/duckdb/src/include/duckdb/planner/expression/bound_between_expression.hpp +6 -0
  89. package/src/duckdb/src/include/duckdb/planner/expression/bound_case_expression.hpp +6 -0
  90. package/src/duckdb/src/include/duckdb/planner/expression/bound_cast_expression.hpp +6 -0
  91. package/src/duckdb/src/include/duckdb/planner/expression/bound_columnref_expression.hpp +3 -0
  92. package/src/duckdb/src/include/duckdb/planner/expression/bound_comparison_expression.hpp +3 -0
  93. package/src/duckdb/src/include/duckdb/planner/expression/bound_conjunction_expression.hpp +3 -0
  94. package/src/duckdb/src/include/duckdb/planner/expression/bound_constant_expression.hpp +3 -0
  95. package/src/duckdb/src/include/duckdb/planner/expression/bound_default_expression.hpp +3 -0
  96. package/src/duckdb/src/include/duckdb/planner/expression/bound_lambda_expression.hpp +3 -1
  97. package/src/duckdb/src/include/duckdb/planner/expression/bound_lambdaref_expression.hpp +3 -0
  98. package/src/duckdb/src/include/duckdb/planner/expression/bound_operator_expression.hpp +3 -0
  99. package/src/duckdb/src/include/duckdb/planner/expression/bound_parameter_data.hpp +5 -2
  100. package/src/duckdb/src/include/duckdb/planner/expression/bound_parameter_expression.hpp +7 -0
  101. package/src/duckdb/src/include/duckdb/planner/expression/bound_reference_expression.hpp +3 -0
  102. package/src/duckdb/src/include/duckdb/planner/expression/bound_unnest_expression.hpp +3 -0
  103. package/src/duckdb/src/include/duckdb/planner/expression/list.hpp +1 -0
  104. package/src/duckdb/src/include/duckdb/planner/expression.hpp +3 -0
  105. package/src/duckdb/src/include/duckdb/planner/joinside.hpp +3 -0
  106. package/src/duckdb/src/include/duckdb/planner/logical_operator.hpp +3 -0
  107. package/src/duckdb/src/include/duckdb/planner/operator/logical_aggregate.hpp +3 -0
  108. package/src/duckdb/src/include/duckdb/planner/operator/logical_any_join.hpp +3 -0
  109. package/src/duckdb/src/include/duckdb/planner/operator/logical_column_data_get.hpp +4 -0
  110. package/src/duckdb/src/include/duckdb/planner/operator/logical_comparison_join.hpp +9 -2
  111. package/src/duckdb/src/include/duckdb/planner/operator/logical_create.hpp +9 -6
  112. package/src/duckdb/src/include/duckdb/planner/operator/logical_create_index.hpp +2 -16
  113. package/src/duckdb/src/include/duckdb/planner/operator/logical_create_table.hpp +10 -6
  114. package/src/duckdb/src/include/duckdb/planner/operator/logical_cross_product.hpp +3 -0
  115. package/src/duckdb/src/include/duckdb/planner/operator/logical_cteref.hpp +2 -0
  116. package/src/duckdb/src/include/duckdb/planner/operator/logical_delete.hpp +7 -0
  117. package/src/duckdb/src/include/duckdb/planner/operator/logical_delim_get.hpp +3 -0
  118. package/src/duckdb/src/include/duckdb/planner/operator/logical_distinct.hpp +6 -10
  119. package/src/duckdb/src/include/duckdb/planner/operator/logical_dummy_scan.hpp +2 -0
  120. package/src/duckdb/src/include/duckdb/planner/operator/logical_empty_result.hpp +2 -0
  121. package/src/duckdb/src/include/duckdb/planner/operator/logical_explain.hpp +4 -0
  122. package/src/duckdb/src/include/duckdb/planner/operator/logical_expression_get.hpp +3 -0
  123. package/src/duckdb/src/include/duckdb/planner/operator/logical_filter.hpp +3 -0
  124. package/src/duckdb/src/include/duckdb/planner/operator/logical_insert.hpp +6 -0
  125. package/src/duckdb/src/include/duckdb/planner/operator/logical_limit.hpp +3 -0
  126. package/src/duckdb/src/include/duckdb/planner/operator/logical_limit_percent.hpp +3 -0
  127. package/src/duckdb/src/include/duckdb/planner/operator/logical_materialized_cte.hpp +5 -2
  128. package/src/duckdb/src/include/duckdb/planner/operator/logical_order.hpp +7 -35
  129. package/src/duckdb/src/include/duckdb/planner/operator/logical_pivot.hpp +6 -0
  130. package/src/duckdb/src/include/duckdb/planner/operator/logical_positional_join.hpp +3 -0
  131. package/src/duckdb/src/include/duckdb/planner/operator/logical_projection.hpp +3 -0
  132. package/src/duckdb/src/include/duckdb/planner/operator/logical_recursive_cte.hpp +5 -3
  133. package/src/duckdb/src/include/duckdb/planner/operator/logical_reset.hpp +4 -0
  134. package/src/duckdb/src/include/duckdb/planner/operator/logical_sample.hpp +6 -0
  135. package/src/duckdb/src/include/duckdb/planner/operator/logical_set.hpp +4 -0
  136. package/src/duckdb/src/include/duckdb/planner/operator/logical_set_operation.hpp +4 -0
  137. package/src/duckdb/src/include/duckdb/planner/operator/logical_show.hpp +3 -0
  138. package/src/duckdb/src/include/duckdb/planner/operator/logical_simple.hpp +3 -0
  139. package/src/duckdb/src/include/duckdb/planner/operator/logical_top_n.hpp +4 -0
  140. package/src/duckdb/src/include/duckdb/planner/operator/logical_unnest.hpp +2 -0
  141. package/src/duckdb/src/include/duckdb/planner/operator/logical_update.hpp +6 -0
  142. package/src/duckdb/src/include/duckdb/planner/operator/logical_window.hpp +3 -0
  143. package/src/duckdb/src/include/duckdb/planner/tableref/bound_pivotref.hpp +3 -0
  144. package/src/duckdb/src/optimizer/deliminator.cpp +5 -3
  145. package/src/duckdb/src/parser/column_definition.cpp +20 -32
  146. package/src/duckdb/src/parser/column_list.cpp +8 -0
  147. package/src/duckdb/src/parser/constraints/foreign_key_constraint.cpp +3 -0
  148. package/src/duckdb/src/parser/constraints/unique_constraint.cpp +3 -0
  149. package/src/duckdb/src/parser/expression/case_expression.cpp +0 -12
  150. package/src/duckdb/src/parser/parsed_data/alter_info.cpp +5 -2
  151. package/src/duckdb/src/parser/parsed_data/alter_table_info.cpp +38 -0
  152. package/src/duckdb/src/parser/parsed_data/create_index_info.cpp +3 -1
  153. package/src/duckdb/src/parser/parsed_data/create_sequence_info.cpp +2 -0
  154. package/src/duckdb/src/parser/parsed_data/detach_info.cpp +1 -1
  155. package/src/duckdb/src/parser/parsed_data/drop_info.cpp +1 -1
  156. package/src/duckdb/src/parser/parsed_data/sample_options.cpp +0 -18
  157. package/src/duckdb/src/parser/parsed_data/transaction_info.cpp +4 -1
  158. package/src/duckdb/src/parser/parsed_data/vacuum_info.cpp +1 -1
  159. package/src/duckdb/src/parser/query_node.cpp +0 -10
  160. package/src/duckdb/src/parser/result_modifier.cpp +0 -13
  161. package/src/duckdb/src/parser/statement/select_statement.cpp +0 -10
  162. package/src/duckdb/src/parser/tableref/pivotref.cpp +0 -16
  163. package/src/duckdb/src/parser/transform/statement/transform_create_index.cpp +5 -4
  164. package/src/duckdb/src/planner/binder/query_node/plan_subquery.cpp +1 -1
  165. package/src/duckdb/src/planner/binder/statement/bind_create.cpp +6 -1
  166. package/src/duckdb/src/planner/expression/bound_between_expression.cpp +4 -0
  167. package/src/duckdb/src/planner/expression/bound_cast_expression.cpp +13 -6
  168. package/src/duckdb/src/planner/expression/bound_parameter_expression.cpp +20 -12
  169. package/src/duckdb/src/planner/logical_operator.cpp +13 -1
  170. package/src/duckdb/src/planner/operator/logical_comparison_join.cpp +16 -2
  171. package/src/duckdb/src/planner/operator/logical_create.cpp +14 -0
  172. package/src/duckdb/src/planner/operator/logical_create_index.cpp +20 -0
  173. package/src/duckdb/src/planner/operator/logical_create_table.cpp +16 -0
  174. package/src/duckdb/src/planner/operator/logical_delete.cpp +9 -2
  175. package/src/duckdb/src/planner/operator/logical_delim_join.cpp +2 -4
  176. package/src/duckdb/src/planner/operator/logical_distinct.cpp +13 -0
  177. package/src/duckdb/src/planner/operator/logical_explain.cpp +1 -1
  178. package/src/duckdb/src/planner/operator/logical_insert.cpp +8 -2
  179. package/src/duckdb/src/planner/operator/logical_materialized_cte.cpp +3 -2
  180. package/src/duckdb/src/planner/operator/logical_order.cpp +39 -0
  181. package/src/duckdb/src/planner/operator/logical_pivot.cpp +3 -0
  182. package/src/duckdb/src/planner/operator/logical_recursive_cte.cpp +5 -5
  183. package/src/duckdb/src/planner/operator/logical_sample.cpp +3 -0
  184. package/src/duckdb/src/planner/operator/logical_update.cpp +8 -2
  185. package/src/duckdb/src/planner/parsed_data/bound_create_table_info.cpp +4 -2
  186. package/src/duckdb/src/planner/planner.cpp +11 -0
  187. package/src/duckdb/src/storage/checkpoint_manager.cpp +23 -23
  188. package/src/duckdb/src/storage/serialization/serialize_constraint.cpp +98 -0
  189. package/src/duckdb/src/storage/serialization/serialize_create_info.cpp +188 -0
  190. package/src/duckdb/src/storage/serialization/serialize_expression.cpp +274 -0
  191. package/src/duckdb/src/storage/serialization/serialize_logical_operator.cpp +729 -0
  192. package/src/duckdb/src/storage/serialization/serialize_macro_function.cpp +62 -0
  193. package/src/duckdb/src/storage/serialization/serialize_nodes.cpp +242 -0
  194. package/src/duckdb/src/storage/serialization/serialize_parse_info.cpp +419 -0
  195. package/src/duckdb/src/storage/serialization/serialize_parsed_expression.cpp +40 -38
  196. package/src/duckdb/src/storage/serialization/serialize_query_node.cpp +36 -36
  197. package/src/duckdb/src/storage/serialization/serialize_result_modifier.cpp +25 -14
  198. package/src/duckdb/src/storage/serialization/serialize_statement.cpp +22 -0
  199. package/src/duckdb/src/storage/serialization/serialize_tableref.cpp +47 -47
  200. package/src/duckdb/src/storage/serialization/serialize_types.cpp +25 -25
  201. package/src/duckdb/src/storage/storage_info.cpp +3 -2
  202. package/src/duckdb/src/storage/wal_replay.cpp +20 -19
  203. package/src/duckdb/ub_src_parser.cpp +0 -2
  204. package/src/duckdb/ub_src_storage_serialization.cpp +16 -0
  205. package/src/duckdb/src/parser/common_table_expression_info.cpp +0 -21
@@ -0,0 +1,62 @@
1
+ //===----------------------------------------------------------------------===//
2
+ // This file is automatically generated by scripts/generate_serialization.py
3
+ // Do not edit this file manually, your changes will be overwritten
4
+ //===----------------------------------------------------------------------===//
5
+
6
+ #include "duckdb/common/serializer/format_serializer.hpp"
7
+ #include "duckdb/common/serializer/format_deserializer.hpp"
8
+ #include "duckdb/function/macro_function.hpp"
9
+ #include "duckdb/function/scalar_macro_function.hpp"
10
+ #include "duckdb/function/table_macro_function.hpp"
11
+
12
+ namespace duckdb {
13
+
14
+ void MacroFunction::FormatSerialize(FormatSerializer &serializer) const {
15
+ serializer.WriteProperty("type", type);
16
+ serializer.WriteProperty("parameters", parameters);
17
+ serializer.WriteProperty("default_parameters", default_parameters);
18
+ }
19
+
20
+ unique_ptr<MacroFunction> MacroFunction::FormatDeserialize(FormatDeserializer &deserializer) {
21
+ auto type = deserializer.ReadProperty<MacroType>("type");
22
+ auto parameters = deserializer.ReadProperty<vector<unique_ptr<ParsedExpression>>>("parameters");
23
+ auto default_parameters = deserializer.ReadProperty<unordered_map<string, unique_ptr<ParsedExpression>>>("default_parameters");
24
+ unique_ptr<MacroFunction> result;
25
+ switch (type) {
26
+ case MacroType::SCALAR_MACRO:
27
+ result = ScalarMacroFunction::FormatDeserialize(deserializer);
28
+ break;
29
+ case MacroType::TABLE_MACRO:
30
+ result = TableMacroFunction::FormatDeserialize(deserializer);
31
+ break;
32
+ default:
33
+ throw SerializationException("Unsupported type for deserialization of MacroFunction!");
34
+ }
35
+ result->parameters = std::move(parameters);
36
+ result->default_parameters = std::move(default_parameters);
37
+ return result;
38
+ }
39
+
40
+ void ScalarMacroFunction::FormatSerialize(FormatSerializer &serializer) const {
41
+ MacroFunction::FormatSerialize(serializer);
42
+ serializer.WriteProperty("expression", *expression);
43
+ }
44
+
45
+ unique_ptr<MacroFunction> ScalarMacroFunction::FormatDeserialize(FormatDeserializer &deserializer) {
46
+ auto result = duckdb::unique_ptr<ScalarMacroFunction>(new ScalarMacroFunction());
47
+ deserializer.ReadProperty("expression", result->expression);
48
+ return std::move(result);
49
+ }
50
+
51
+ void TableMacroFunction::FormatSerialize(FormatSerializer &serializer) const {
52
+ MacroFunction::FormatSerialize(serializer);
53
+ serializer.WriteProperty("query_node", *query_node);
54
+ }
55
+
56
+ unique_ptr<MacroFunction> TableMacroFunction::FormatDeserialize(FormatDeserializer &deserializer) {
57
+ auto result = duckdb::unique_ptr<TableMacroFunction>(new TableMacroFunction());
58
+ deserializer.ReadProperty("query_node", result->query_node);
59
+ return std::move(result);
60
+ }
61
+
62
+ } // namespace duckdb
@@ -0,0 +1,242 @@
1
+ //===----------------------------------------------------------------------===//
2
+ // This file is automatically generated by scripts/generate_serialization.py
3
+ // Do not edit this file manually, your changes will be overwritten
4
+ //===----------------------------------------------------------------------===//
5
+
6
+ #include "duckdb/common/serializer/format_serializer.hpp"
7
+ #include "duckdb/common/serializer/format_deserializer.hpp"
8
+ #include "duckdb/common/types.hpp"
9
+ #include "duckdb/common/extra_type_info.hpp"
10
+ #include "duckdb/parser/common_table_expression_info.hpp"
11
+ #include "duckdb/parser/query_node.hpp"
12
+ #include "duckdb/parser/result_modifier.hpp"
13
+ #include "duckdb/planner/bound_result_modifier.hpp"
14
+ #include "duckdb/parser/expression/case_expression.hpp"
15
+ #include "duckdb/planner/expression/bound_case_expression.hpp"
16
+ #include "duckdb/parser/parsed_data/sample_options.hpp"
17
+ #include "duckdb/parser/tableref/pivotref.hpp"
18
+ #include "duckdb/planner/tableref/bound_pivotref.hpp"
19
+ #include "duckdb/parser/column_definition.hpp"
20
+ #include "duckdb/parser/column_list.hpp"
21
+ #include "duckdb/planner/column_binding.hpp"
22
+ #include "duckdb/planner/expression/bound_parameter_data.hpp"
23
+ #include "duckdb/planner/joinside.hpp"
24
+ #include "duckdb/parser/parsed_data/vacuum_info.hpp"
25
+
26
+ namespace duckdb {
27
+
28
+ void BoundCaseCheck::FormatSerialize(FormatSerializer &serializer) const {
29
+ serializer.WriteProperty("when_expr", *when_expr);
30
+ serializer.WriteProperty("then_expr", *then_expr);
31
+ }
32
+
33
+ BoundCaseCheck BoundCaseCheck::FormatDeserialize(FormatDeserializer &deserializer) {
34
+ BoundCaseCheck result;
35
+ deserializer.ReadProperty("when_expr", result.when_expr);
36
+ deserializer.ReadProperty("then_expr", result.then_expr);
37
+ return result;
38
+ }
39
+
40
+ void BoundOrderByNode::FormatSerialize(FormatSerializer &serializer) const {
41
+ serializer.WriteProperty("type", type);
42
+ serializer.WriteProperty("null_order", null_order);
43
+ serializer.WriteProperty("expression", *expression);
44
+ }
45
+
46
+ BoundOrderByNode BoundOrderByNode::FormatDeserialize(FormatDeserializer &deserializer) {
47
+ auto type = deserializer.ReadProperty<OrderType>("type");
48
+ auto null_order = deserializer.ReadProperty<OrderByNullType>("null_order");
49
+ auto expression = deserializer.ReadProperty<unique_ptr<Expression>>("expression");
50
+ BoundOrderByNode result(type, null_order, std::move(expression));
51
+ return result;
52
+ }
53
+
54
+ void BoundParameterData::FormatSerialize(FormatSerializer &serializer) const {
55
+ serializer.WriteProperty("value", value);
56
+ serializer.WriteProperty("return_type", return_type);
57
+ }
58
+
59
+ shared_ptr<BoundParameterData> BoundParameterData::FormatDeserialize(FormatDeserializer &deserializer) {
60
+ auto value = deserializer.ReadProperty<Value>("value");
61
+ auto result = duckdb::shared_ptr<BoundParameterData>(new BoundParameterData(value));
62
+ deserializer.ReadProperty("return_type", result->return_type);
63
+ return result;
64
+ }
65
+
66
+ void BoundPivotInfo::FormatSerialize(FormatSerializer &serializer) const {
67
+ serializer.WriteProperty("group_count", group_count);
68
+ serializer.WriteProperty("types", types);
69
+ serializer.WriteProperty("pivot_values", pivot_values);
70
+ serializer.WriteProperty("aggregates", aggregates);
71
+ }
72
+
73
+ BoundPivotInfo BoundPivotInfo::FormatDeserialize(FormatDeserializer &deserializer) {
74
+ BoundPivotInfo result;
75
+ deserializer.ReadProperty("group_count", result.group_count);
76
+ deserializer.ReadProperty("types", result.types);
77
+ deserializer.ReadProperty("pivot_values", result.pivot_values);
78
+ deserializer.ReadProperty("aggregates", result.aggregates);
79
+ return result;
80
+ }
81
+
82
+ void CaseCheck::FormatSerialize(FormatSerializer &serializer) const {
83
+ serializer.WriteProperty("when_expr", *when_expr);
84
+ serializer.WriteProperty("then_expr", *then_expr);
85
+ }
86
+
87
+ CaseCheck CaseCheck::FormatDeserialize(FormatDeserializer &deserializer) {
88
+ CaseCheck result;
89
+ deserializer.ReadProperty("when_expr", result.when_expr);
90
+ deserializer.ReadProperty("then_expr", result.then_expr);
91
+ return result;
92
+ }
93
+
94
+ void ColumnBinding::FormatSerialize(FormatSerializer &serializer) const {
95
+ serializer.WriteProperty("table_index", table_index);
96
+ serializer.WriteProperty("column_index", column_index);
97
+ }
98
+
99
+ ColumnBinding ColumnBinding::FormatDeserialize(FormatDeserializer &deserializer) {
100
+ ColumnBinding result;
101
+ deserializer.ReadProperty("table_index", result.table_index);
102
+ deserializer.ReadProperty("column_index", result.column_index);
103
+ return result;
104
+ }
105
+
106
+ void ColumnDefinition::FormatSerialize(FormatSerializer &serializer) const {
107
+ serializer.WriteProperty("name", name);
108
+ serializer.WriteProperty("type", type);
109
+ serializer.WriteOptionalProperty("expression", expression);
110
+ serializer.WriteProperty("category", category);
111
+ serializer.WriteProperty("compression_type", compression_type);
112
+ }
113
+
114
+ ColumnDefinition ColumnDefinition::FormatDeserialize(FormatDeserializer &deserializer) {
115
+ auto name = deserializer.ReadProperty<string>("name");
116
+ auto type = deserializer.ReadProperty<LogicalType>("type");
117
+ auto expression = deserializer.ReadOptionalProperty<unique_ptr<ParsedExpression>>("expression");
118
+ auto category = deserializer.ReadProperty<TableColumnType>("category");
119
+ ColumnDefinition result(std::move(name), std::move(type), std::move(expression), category);
120
+ deserializer.ReadProperty("compression_type", result.compression_type);
121
+ return result;
122
+ }
123
+
124
+ void ColumnList::FormatSerialize(FormatSerializer &serializer) const {
125
+ serializer.WriteProperty("columns", columns);
126
+ }
127
+
128
+ ColumnList ColumnList::FormatDeserialize(FormatDeserializer &deserializer) {
129
+ auto columns = deserializer.ReadProperty<vector<ColumnDefinition>>("columns");
130
+ ColumnList result(std::move(columns));
131
+ return result;
132
+ }
133
+
134
+ void CommonTableExpressionInfo::FormatSerialize(FormatSerializer &serializer) const {
135
+ serializer.WriteProperty("aliases", aliases);
136
+ serializer.WriteProperty("query", *query);
137
+ serializer.WriteProperty("materialized", materialized);
138
+ }
139
+
140
+ unique_ptr<CommonTableExpressionInfo> CommonTableExpressionInfo::FormatDeserialize(FormatDeserializer &deserializer) {
141
+ auto result = duckdb::unique_ptr<CommonTableExpressionInfo>(new CommonTableExpressionInfo());
142
+ deserializer.ReadProperty("aliases", result->aliases);
143
+ deserializer.ReadProperty("query", result->query);
144
+ deserializer.ReadProperty("materialized", result->materialized);
145
+ return result;
146
+ }
147
+
148
+ void CommonTableExpressionMap::FormatSerialize(FormatSerializer &serializer) const {
149
+ serializer.WriteProperty("map", map);
150
+ }
151
+
152
+ CommonTableExpressionMap CommonTableExpressionMap::FormatDeserialize(FormatDeserializer &deserializer) {
153
+ CommonTableExpressionMap result;
154
+ deserializer.ReadProperty("map", result.map);
155
+ return result;
156
+ }
157
+
158
+ void JoinCondition::FormatSerialize(FormatSerializer &serializer) const {
159
+ serializer.WriteProperty("left", *left);
160
+ serializer.WriteProperty("right", *right);
161
+ serializer.WriteProperty("comparison", comparison);
162
+ }
163
+
164
+ JoinCondition JoinCondition::FormatDeserialize(FormatDeserializer &deserializer) {
165
+ JoinCondition result;
166
+ deserializer.ReadProperty("left", result.left);
167
+ deserializer.ReadProperty("right", result.right);
168
+ deserializer.ReadProperty("comparison", result.comparison);
169
+ return result;
170
+ }
171
+
172
+ void LogicalType::FormatSerialize(FormatSerializer &serializer) const {
173
+ serializer.WriteProperty("id", id_);
174
+ serializer.WriteOptionalProperty("type_info", type_info_);
175
+ }
176
+
177
+ LogicalType LogicalType::FormatDeserialize(FormatDeserializer &deserializer) {
178
+ auto id = deserializer.ReadProperty<LogicalTypeId>("id");
179
+ auto type_info = deserializer.ReadOptionalProperty<shared_ptr<ExtraTypeInfo>>("type_info");
180
+ LogicalType result(id, std::move(type_info));
181
+ return result;
182
+ }
183
+
184
+ void OrderByNode::FormatSerialize(FormatSerializer &serializer) const {
185
+ serializer.WriteProperty("type", type);
186
+ serializer.WriteProperty("null_order", null_order);
187
+ serializer.WriteProperty("expression", *expression);
188
+ }
189
+
190
+ OrderByNode OrderByNode::FormatDeserialize(FormatDeserializer &deserializer) {
191
+ auto type = deserializer.ReadProperty<OrderType>("type");
192
+ auto null_order = deserializer.ReadProperty<OrderByNullType>("null_order");
193
+ auto expression = deserializer.ReadProperty<unique_ptr<ParsedExpression>>("expression");
194
+ OrderByNode result(type, null_order, std::move(expression));
195
+ return result;
196
+ }
197
+
198
+ void PivotColumn::FormatSerialize(FormatSerializer &serializer) const {
199
+ serializer.WriteProperty("pivot_expressions", pivot_expressions);
200
+ serializer.WriteProperty("unpivot_names", unpivot_names);
201
+ serializer.WriteProperty("entries", entries);
202
+ serializer.WriteProperty("pivot_enum", pivot_enum);
203
+ }
204
+
205
+ PivotColumn PivotColumn::FormatDeserialize(FormatDeserializer &deserializer) {
206
+ PivotColumn result;
207
+ deserializer.ReadProperty("pivot_expressions", result.pivot_expressions);
208
+ deserializer.ReadProperty("unpivot_names", result.unpivot_names);
209
+ deserializer.ReadProperty("entries", result.entries);
210
+ deserializer.ReadProperty("pivot_enum", result.pivot_enum);
211
+ return result;
212
+ }
213
+
214
+ void SampleOptions::FormatSerialize(FormatSerializer &serializer) const {
215
+ serializer.WriteProperty("sample_size", sample_size);
216
+ serializer.WriteProperty("is_percentage", is_percentage);
217
+ serializer.WriteProperty("method", method);
218
+ serializer.WriteProperty("seed", seed);
219
+ }
220
+
221
+ unique_ptr<SampleOptions> SampleOptions::FormatDeserialize(FormatDeserializer &deserializer) {
222
+ auto result = duckdb::unique_ptr<SampleOptions>(new SampleOptions());
223
+ deserializer.ReadProperty("sample_size", result->sample_size);
224
+ deserializer.ReadProperty("is_percentage", result->is_percentage);
225
+ deserializer.ReadProperty("method", result->method);
226
+ deserializer.ReadProperty("seed", result->seed);
227
+ return result;
228
+ }
229
+
230
+ void VacuumOptions::FormatSerialize(FormatSerializer &serializer) const {
231
+ serializer.WriteProperty("vacuum", vacuum);
232
+ serializer.WriteProperty("analyze", analyze);
233
+ }
234
+
235
+ VacuumOptions VacuumOptions::FormatDeserialize(FormatDeserializer &deserializer) {
236
+ VacuumOptions result;
237
+ deserializer.ReadProperty("vacuum", result.vacuum);
238
+ deserializer.ReadProperty("analyze", result.analyze);
239
+ return result;
240
+ }
241
+
242
+ } // namespace duckdb