Skip to content

Commit 9210c11

Browse files
author
qxip
committed
resync
1 parent 94a6666 commit 9210c11

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

src/gigapi_attach.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,17 @@ class GigapiTableEntry : public TableCatalogEntry {
3333
}
3434
};
3535

36-
GigapiSchema::GigapiSchema(Catalog &catalog, const std::string &name)
37-
: SchemaCatalogEntry(catalog, name) {}
36+
GigapiSchema::GigapiSchema(Catalog &catalog, CreateSchemaInfo &info)
37+
: SchemaCatalogEntry(catalog, info) {}
3838

39-
TableCatalogEntry *GigapiSchema::GetTable(ClientContext &context, const std::string &table_name) {
39+
optional_ptr<CatalogEntry> GigapiSchema::LookupEntry(CatalogTransaction transaction, const EntryLookupInfo &lookup_info) {
40+
// Only handle table lookups
41+
if (lookup_info.type != CatalogType::TABLE_ENTRY) {
42+
return nullptr;
43+
}
4044
// Always return a GigapiTableEntry for any table name
41-
return new GigapiTableEntry(*catalog, *this, table_name);
45+
auto entry = make_uniq<GigapiTableEntry>(*catalog, *this, lookup_info.name);
46+
return entry.release();
4247
}
4348

4449
// Handler for ATTACH ... (TYPE gigapi, ...)
@@ -53,7 +58,7 @@ static void GigapiAttachHandler(ClientContext &context, const std::string &schem
5358
auto &db = DatabaseInstance::Get(context);
5459
auto &schemas = db.GetCatalogSet(CatalogType::SCHEMA_ENTRY);
5560
schemas.DropEntry(context, schema_name, false);
56-
auto gigapi_schema = make_uniq<GigapiSchema>(catalog, schema_name);
61+
auto gigapi_schema = make_uniq<GigapiSchema>(catalog, info);
5762
schemas.AddEntry(context, std::move(gigapi_schema));
5863
}
5964

src/include/gigapi_attach.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ namespace duckdb {
77

88
class GigapiSchema : public SchemaCatalogEntry {
99
public:
10-
GigapiSchema(Catalog &catalog, const std::string &name);
10+
GigapiSchema(Catalog &catalog, CreateSchemaInfo &info);
1111

12-
TableCatalogEntry *GetTable(ClientContext &context, const std::string &table_name) override;
12+
optional_ptr<CatalogEntry> LookupEntry(CatalogTransaction transaction, const EntryLookupInfo &lookup_info) override;
1313
};
1414

1515
void RegisterGigapiAttach(DatabaseInstance &instance);

0 commit comments

Comments
 (0)