Skip to content

Commit 82db91e

Browse files
committed
upgrade API call
1 parent 22d1d12 commit 82db91e

File tree

4 files changed

+16
-18
lines changed

4 files changed

+16
-18
lines changed

duckdb

Submodule duckdb updated 3381 files

src/include/pbix_extension.hpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,14 @@
99
using namespace duckdb;
1010

1111

12-
class PbixExtension : public Extension {
12+
class PbixExtension{
1313
public:
14-
std::string Name() override {
14+
static void Load(ExtensionLoader &loader);
15+
static std::string Name() {
1516
return "pbix";
1617
}
17-
void Load(DuckDB &db) override;
18+
static std::string Version() {
19+
return DuckDB::LibraryVersion();
20+
}
1821
};
1922

20-
extern "C" {
21-
DUCKDB_EXTENSION_API void pbix_init(duckdb::DatabaseInstance &db);
22-
DUCKDB_EXTENSION_API const char *pbix_version();
23-
24-
}

src/pbix_extension.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include "pbix_extension.hpp"
99

1010
#include "duckdb/catalog/catalog.hpp"
11-
#include "duckdb/main/extension_util.hpp"
1211
#include "duckdb/parser/parsed_data/create_table_function_info.hpp"
1312

1413
using namespace duckdb;
@@ -17,24 +16,25 @@ using namespace duckdb;
1716
extern "C"
1817
{
1918

20-
static void LoadInternal(DatabaseInstance &db)
19+
static void LoadInternal(ExtensionLoader &loader)
2120
{
2221
PbixScanFunction pbix_fun;
23-
ExtensionUtil::RegisterFunction(db, pbix_fun);
22+
loader.RegisterFunction(pbix_fun);
2423
PbixReadFunction pbix_read_fun;
25-
ExtensionUtil::RegisterFunction(db, pbix_read_fun);
24+
loader.RegisterFunction(pbix_read_fun);
25+
auto &db = loader.GetDatabaseInstance();
2626
auto &config = DBConfig::GetConfig(db);
2727
config.AddExtensionOption("pbix_magic_number", "A magic number to accelerate file parsing", LogicalType::INTEGER);
2828
}
2929

30-
void PbixExtension::Load(DuckDB &db)
30+
void PbixExtension::Load(ExtensionLoader &loader)
3131
{
32-
LoadInternal(*db.instance);
32+
LoadInternal(loader);
3333
}
3434

35-
DUCKDB_EXTENSION_API void pbix_init(duckdb::DatabaseInstance &db)
35+
DUCKDB_CPP_EXTENSION_ENTRY(pbix,loader)
3636
{
37-
LoadInternal(db);
37+
LoadInternal(loader);
3838
}
3939

4040
DUCKDB_EXTENSION_API const char *pbix_version()

0 commit comments

Comments
 (0)