duckdb 0.7.1-dev11.0 → 0.7.1-dev137.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 (80) hide show
  1. package/package.json +1 -1
  2. package/src/duckdb/extension/json/buffered_json_reader.cpp +29 -5
  3. package/src/duckdb/extension/json/include/buffered_json_reader.hpp +5 -1
  4. package/src/duckdb/extension/json/include/json_scan.hpp +17 -2
  5. package/src/duckdb/extension/json/json_functions/json_transform.cpp +19 -0
  6. package/src/duckdb/extension/json/json_functions/read_json.cpp +30 -28
  7. package/src/duckdb/extension/json/json_functions.cpp +6 -0
  8. package/src/duckdb/extension/json/json_scan.cpp +111 -23
  9. package/src/duckdb/extension/parquet/parquet-extension.cpp +3 -2
  10. package/src/duckdb/src/common/enums/logical_operator_type.cpp +2 -0
  11. package/src/duckdb/src/common/enums/physical_operator_type.cpp +2 -0
  12. package/src/duckdb/src/common/enums/statement_type.cpp +2 -0
  13. package/src/duckdb/src/common/file_system.cpp +14 -0
  14. package/src/duckdb/src/common/operator/cast_operators.cpp +14 -8
  15. package/src/duckdb/src/common/printer.cpp +1 -1
  16. package/src/duckdb/src/common/types/time.cpp +1 -1
  17. package/src/duckdb/src/common/types/timestamp.cpp +35 -4
  18. package/src/duckdb/src/common/types.cpp +36 -10
  19. package/src/duckdb/src/execution/column_binding_resolver.cpp +5 -2
  20. package/src/duckdb/src/execution/operator/persistent/base_csv_reader.cpp +6 -11
  21. package/src/duckdb/src/execution/operator/persistent/buffered_csv_reader.cpp +7 -13
  22. package/src/duckdb/src/execution/operator/persistent/parallel_csv_reader.cpp +1 -1
  23. package/src/duckdb/src/execution/operator/schema/physical_detach.cpp +37 -0
  24. package/src/duckdb/src/execution/operator/schema/physical_drop.cpp +0 -5
  25. package/src/duckdb/src/execution/physical_plan/plan_simple.cpp +4 -0
  26. package/src/duckdb/src/execution/physical_plan_generator.cpp +1 -0
  27. package/src/duckdb/src/function/pragma/pragma_queries.cpp +36 -9
  28. package/src/duckdb/src/function/table/read_csv.cpp +15 -4
  29. package/src/duckdb/src/function/table/version/pragma_version.cpp +2 -2
  30. package/src/duckdb/src/include/duckdb/common/enums/logical_operator_type.hpp +1 -0
  31. package/src/duckdb/src/include/duckdb/common/enums/physical_operator_type.hpp +1 -0
  32. package/src/duckdb/src/include/duckdb/common/enums/statement_type.hpp +2 -1
  33. package/src/duckdb/src/include/duckdb/common/exception.hpp +10 -0
  34. package/src/duckdb/src/include/duckdb/common/file_system.hpp +1 -0
  35. package/src/duckdb/src/include/duckdb/common/types/timestamp.hpp +5 -1
  36. package/src/duckdb/src/include/duckdb/execution/operator/persistent/base_csv_reader.hpp +1 -3
  37. package/src/duckdb/src/include/duckdb/execution/operator/persistent/buffered_csv_reader.hpp +0 -2
  38. package/src/duckdb/src/include/duckdb/execution/operator/persistent/csv_reader_options.hpp +2 -0
  39. package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_detach.hpp +32 -0
  40. package/src/duckdb/src/include/duckdb/main/client_data.hpp +2 -2
  41. package/src/duckdb/src/include/duckdb/main/config.hpp +0 -3
  42. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_database_info.hpp +0 -4
  43. package/src/duckdb/src/include/duckdb/parser/parsed_data/detach_info.hpp +32 -0
  44. package/src/duckdb/src/include/duckdb/parser/statement/detach_statement.hpp +29 -0
  45. package/src/duckdb/src/include/duckdb/parser/statement/list.hpp +1 -0
  46. package/src/duckdb/src/include/duckdb/parser/tokens.hpp +1 -0
  47. package/src/duckdb/src/include/duckdb/parser/transformer.hpp +1 -0
  48. package/src/duckdb/src/include/duckdb/planner/binder.hpp +1 -0
  49. package/src/duckdb/src/include/duckdb/planner/operator/logical_execute.hpp +1 -5
  50. package/src/duckdb/src/include/duckdb/planner/operator/logical_show.hpp +1 -2
  51. package/src/duckdb/src/include/duckdb/storage/storage_extension.hpp +7 -0
  52. package/src/duckdb/src/include/duckdb/storage/table/update_segment.hpp +2 -0
  53. package/src/duckdb/src/parser/statement/copy_statement.cpp +2 -13
  54. package/src/duckdb/src/parser/statement/detach_statement.cpp +15 -0
  55. package/src/duckdb/src/parser/statement/insert_statement.cpp +3 -0
  56. package/src/duckdb/src/parser/transform/expression/transform_case.cpp +3 -3
  57. package/src/duckdb/src/parser/transform/statement/transform_create_database.cpp +0 -1
  58. package/src/duckdb/src/parser/transform/statement/transform_detach.cpp +19 -0
  59. package/src/duckdb/src/parser/transformer.cpp +2 -0
  60. package/src/duckdb/src/planner/binder/statement/bind_create.cpp +16 -14
  61. package/src/duckdb/src/planner/binder/statement/bind_detach.cpp +19 -0
  62. package/src/duckdb/src/planner/binder/statement/bind_drop.cpp +29 -4
  63. package/src/duckdb/src/planner/binder/statement/bind_insert.cpp +22 -1
  64. package/src/duckdb/src/planner/binder/tableref/bind_joinref.cpp +2 -1
  65. package/src/duckdb/src/planner/binder.cpp +2 -0
  66. package/src/duckdb/src/planner/expression_binder/lateral_binder.cpp +21 -5
  67. package/src/duckdb/src/planner/logical_operator.cpp +4 -0
  68. package/src/duckdb/src/planner/planner.cpp +1 -0
  69. package/src/duckdb/src/storage/storage_info.cpp +2 -1
  70. package/src/duckdb/src/storage/table/column_data.cpp +4 -2
  71. package/src/duckdb/src/storage/table/update_segment.cpp +15 -0
  72. package/src/duckdb/third_party/libpg_query/include/nodes/nodes.hpp +1 -0
  73. package/src/duckdb/third_party/libpg_query/include/nodes/parsenodes.hpp +14 -0
  74. package/src/duckdb/third_party/libpg_query/include/parser/gram.hpp +530 -1006
  75. package/src/duckdb/third_party/libpg_query/src_backend_parser_gram.cpp +17659 -17626
  76. package/src/duckdb/ub_src_execution_operator_schema.cpp +2 -0
  77. package/src/duckdb/ub_src_parser_statement.cpp +2 -0
  78. package/src/duckdb/ub_src_parser_transform_statement.cpp +2 -0
  79. package/src/duckdb/ub_src_planner_binder_statement.cpp +2 -0
  80. package/src/duckdb/src/include/duckdb/function/create_database_extension.hpp +0 -37
@@ -27,8 +27,10 @@ ColumnData::ColumnData(BlockManager &block_manager, DataTableInfo &info, idx_t c
27
27
 
28
28
  ColumnData::ColumnData(ColumnData &other, idx_t start, ColumnData *parent)
29
29
  : block_manager(other.block_manager), info(other.info), column_index(other.column_index), start(start),
30
- type(std::move(other.type)), parent(parent), updates(std::move(other.updates)),
31
- version(parent ? parent->version + 1 : 0) {
30
+ type(std::move(other.type)), parent(parent), version(parent ? parent->version + 1 : 0) {
31
+ if (other.updates) {
32
+ updates = make_unique<UpdateSegment>(*other.updates, *this);
33
+ }
32
34
  idx_t offset = 0;
33
35
  for (auto segment = other.data.GetRootSegment(); segment; segment = segment->Next()) {
34
36
  auto &other = (ColumnSegment &)*segment;
@@ -36,6 +36,21 @@ UpdateSegment::UpdateSegment(ColumnData &column_data)
36
36
  this->statistics_update_function = GetStatisticsUpdateFunction(physical_type);
37
37
  }
38
38
 
39
+ UpdateSegment::UpdateSegment(UpdateSegment &other, ColumnData &owner)
40
+ : column_data(owner), root(std::move(other.root)), stats(std::move(other.stats)), type_size(other.type_size) {
41
+
42
+ this->heap.Move(other.heap);
43
+
44
+ initialize_update_function = other.initialize_update_function;
45
+ merge_update_function = other.merge_update_function;
46
+ fetch_update_function = other.fetch_update_function;
47
+ fetch_committed_function = other.fetch_committed_function;
48
+ fetch_committed_range = other.fetch_committed_range;
49
+ fetch_row_function = other.fetch_row_function;
50
+ rollback_update_function = other.rollback_update_function;
51
+ statistics_update_function = other.statistics_update_function;
52
+ }
53
+
39
54
  UpdateSegment::~UpdateSegment() {
40
55
  }
41
56
 
@@ -422,6 +422,7 @@ typedef enum PGNodeTag {
422
422
  T_PGExportStmt,
423
423
  T_PGImportStmt,
424
424
  T_PGAttachStmt,
425
+ T_PGDetachStmt,
425
426
  T_PGCreateDatabaseStmt,
426
427
  T_PGUseStmt,
427
428
 
@@ -2070,6 +2070,20 @@ typedef struct PGAttachStmt
2070
2070
  PGNode *query;
2071
2071
  } PGAttachStmt;
2072
2072
 
2073
+ /* ----------------------
2074
+ * Dettach Statement
2075
+ * ----------------------
2076
+ */
2077
+
2078
+ typedef struct PGDetachStmt
2079
+ {
2080
+ PGNodeTag type;
2081
+ char *db_name; /* list of names of attached databases */
2082
+ bool missing_ok;
2083
+ } PGDetachStmt;
2084
+
2085
+
2086
+
2073
2087
  /* ----------------------
2074
2088
  * CREATE DATABASE Statement
2075
2089
  * ----------------------