duckdb 0.7.2-dev2699.0 → 0.7.2-dev2706.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.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "duckdb",
3
3
  "main": "./lib/duckdb.js",
4
4
  "types": "./lib/duckdb.d.ts",
5
- "version": "0.7.2-dev2699.0",
5
+ "version": "0.7.2-dev2706.0",
6
6
  "description": "DuckDB node.js API",
7
7
  "gypfile": true,
8
8
  "dependencies": {
@@ -55,6 +55,8 @@ void TableCatalogEntry::Serialize(Serializer &serializer) const {
55
55
  D_ASSERT(!internal);
56
56
 
57
57
  FieldWriter writer(serializer);
58
+ auto catalog_name = catalog.GetName();
59
+ writer.WriteString(catalog_name);
58
60
  writer.WriteString(schema.name);
59
61
  writer.WriteString(name);
60
62
  columns.Serialize(writer);
@@ -66,6 +68,7 @@ unique_ptr<CreateTableInfo> TableCatalogEntry::Deserialize(Deserializer &source,
66
68
  auto info = make_uniq<CreateTableInfo>();
67
69
 
68
70
  FieldReader reader(source);
71
+ info->catalog = reader.ReadRequired<string>();
69
72
  info->schema = reader.ReadRequired<string>();
70
73
  info->table = reader.ReadRequired<string>();
71
74
  info->columns = ColumnList::Deserialize(reader);
@@ -1,8 +1,8 @@
1
1
  #ifndef DUCKDB_VERSION
2
- #define DUCKDB_VERSION "0.7.2-dev2699"
2
+ #define DUCKDB_VERSION "0.7.2-dev2706"
3
3
  #endif
4
4
  #ifndef DUCKDB_SOURCE_ID
5
- #define DUCKDB_SOURCE_ID "199c0211c7"
5
+ #define DUCKDB_SOURCE_ID "43a97f9078"
6
6
  #endif
7
7
  #include "duckdb/function/table/system_functions.hpp"
8
8
  #include "duckdb/main/database.hpp"
@@ -10,8 +10,7 @@ unique_ptr<LogicalOperator> LogicalCreate::Deserialize(LogicalDeserializationSta
10
10
  auto &context = state.gstate.context;
11
11
  auto info = CreateInfo::Deserialize(reader.GetSource());
12
12
 
13
- auto schema_catalog_entry =
14
- Catalog::GetSchema(context, INVALID_CATALOG, info->schema, OnEntryNotFound::RETURN_NULL);
13
+ auto schema_catalog_entry = Catalog::GetSchema(context, info->catalog, info->schema, OnEntryNotFound::RETURN_NULL);
15
14
  return make_uniq<LogicalCreate>(state.type, std::move(info), schema_catalog_entry);
16
15
  }
17
16
 
@@ -22,7 +22,7 @@ unique_ptr<LogicalOperator> LogicalCreateIndex::Deserialize(LogicalDeserializati
22
22
  auto catalog_info = TableCatalogEntry::Deserialize(reader.GetSource(), context);
23
23
 
24
24
  auto &table =
25
- Catalog::GetEntry<TableCatalogEntry>(context, INVALID_CATALOG, catalog_info->schema, catalog_info->table);
25
+ Catalog::GetEntry<TableCatalogEntry>(context, catalog_info->catalog, catalog_info->schema, catalog_info->table);
26
26
  auto unbound_expressions = reader.ReadRequiredSerializableList<Expression>(state.gstate);
27
27
 
28
28
  auto create_info = reader.ReadOptional<CreateInfo>(nullptr);
@@ -1,6 +1,7 @@
1
1
  #include "duckdb/planner/operator/logical_delete.hpp"
2
- #include "duckdb/parser/parsed_data/create_table_info.hpp"
2
+
3
3
  #include "duckdb/catalog/catalog_entry/table_catalog_entry.hpp"
4
+ #include "duckdb/parser/parsed_data/create_table_info.hpp"
4
5
 
5
6
  namespace duckdb {
6
7
 
@@ -19,8 +20,7 @@ unique_ptr<LogicalOperator> LogicalDelete::Deserialize(LogicalDeserializationSta
19
20
  auto &context = state.gstate.context;
20
21
  auto info = TableCatalogEntry::Deserialize(reader.GetSource(), context);
21
22
 
22
- auto &table_catalog_entry =
23
- Catalog::GetEntry<TableCatalogEntry>(context, INVALID_CATALOG, info->schema, info->table);
23
+ auto &table_catalog_entry = Catalog::GetEntry<TableCatalogEntry>(context, info->catalog, info->schema, info->table);
24
24
 
25
25
  auto table_index = reader.ReadRequired<idx_t>();
26
26
  auto result = make_uniq<LogicalDelete>(table_catalog_entry, table_index);
@@ -41,7 +41,7 @@ unique_ptr<LogicalOperator> LogicalInsert::Deserialize(LogicalDeserializationSta
41
41
  auto bound_defaults = reader.ReadRequiredSerializableList<Expression>(state.gstate);
42
42
  auto action_type = reader.ReadRequired<OnConflictAction>();
43
43
 
44
- auto &catalog = Catalog::GetCatalog(context, INVALID_CATALOG);
44
+ auto &catalog = Catalog::GetCatalog(context, info->catalog);
45
45
 
46
46
  auto &table_catalog_entry = catalog.GetEntry<TableCatalogEntry>(context, info->schema, info->table);
47
47
  auto result = make_uniq<LogicalInsert>(table_catalog_entry, table_index);
@@ -21,7 +21,7 @@ void LogicalUpdate::Serialize(FieldWriter &writer) const {
21
21
  unique_ptr<LogicalOperator> LogicalUpdate::Deserialize(LogicalDeserializationState &state, FieldReader &reader) {
22
22
  auto &context = state.gstate.context;
23
23
  auto info = TableCatalogEntry::Deserialize(reader.GetSource(), context);
24
- auto &catalog = Catalog::GetCatalog(context, INVALID_CATALOG);
24
+ auto &catalog = Catalog::GetCatalog(context, info->catalog);
25
25
 
26
26
  auto &table_catalog_entry = catalog.GetEntry<TableCatalogEntry>(context, info->schema, info->table);
27
27
  auto result = make_uniq<LogicalUpdate>(table_catalog_entry);
@@ -5,46 +5,25 @@
5
5
 
6
6
  namespace duckdb {
7
7
  void BoundCreateTableInfo::Serialize(Serializer &serializer) const {
8
- schema.Serialize(serializer);
9
8
  serializer.WriteOptional(base);
10
-
11
- // TODO[YLM]: Review if we want/need to serialize more of the fields.
12
- //! The map of column names -> column index, used during binding
13
- // case_insensitive_map_t<column_t> name_map;
14
-
15
- //! Column dependency manager of the table
16
- // ColumnDependencyManager column_dependency_manager;
17
-
18
9
  serializer.WriteList(constraints);
19
10
  serializer.WriteList(bound_constraints);
20
11
  serializer.WriteList(bound_defaults);
21
-
22
- //! Dependents of the table (in e.g. default values)
23
- // unordered_set<CatalogEntry *> dependencies;
24
-
25
- //! The existing table data on disk (if any)
26
- // unique_ptr<PersistentTableData> data;
27
-
28
- //! CREATE TABLE from QUERY
29
12
  serializer.WriteOptional(query);
30
-
31
- //! Indexes created by this table <Block_ID, Offset>
32
- // vector<BlockPointer> indexes;
33
13
  }
34
14
 
35
15
  unique_ptr<BoundCreateTableInfo> BoundCreateTableInfo::Deserialize(Deserializer &source,
36
16
  PlanDeserializationState &state) {
37
- auto &context = state.context;
38
- auto create_info = SchemaCatalogEntry::Deserialize(source);
39
- auto schema_name = create_info->schema;
40
- auto &schema = Catalog::GetSchema(context, INVALID_CATALOG, schema_name);
41
- auto result = make_uniq<BoundCreateTableInfo>(schema, std::move(create_info));
42
- result->base = source.ReadOptional<CreateInfo>();
17
+ auto create_info_base = source.ReadOptional<CreateInfo>();
18
+ // Get schema from the catalog to create BoundCreateTableInfo
19
+ auto schema_name = create_info_base->schema;
20
+ auto catalog = create_info_base->catalog;
21
+ auto &schema_catalog_entry = Catalog::GetSchema(state.context, catalog, schema_name);
43
22
 
23
+ auto result = make_uniq<BoundCreateTableInfo>(schema_catalog_entry, std::move(create_info_base));
44
24
  source.ReadList<Constraint>(result->constraints);
45
25
  source.ReadList<BoundConstraint>(result->bound_constraints);
46
26
  source.ReadList<Expression>(result->bound_defaults, state);
47
-
48
27
  result->query = source.ReadOptional<LogicalOperator>(state);
49
28
  return result;
50
29
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  namespace duckdb {
4
4
 
5
- const uint64_t VERSION_NUMBER = 49;
5
+ const uint64_t VERSION_NUMBER = 50;
6
6
 
7
7
  struct StorageVersionInfo {
8
8
  const char *version_name;