Skip to content

Commit 3443b29

Browse files
authored
Merge pull request #65 from carlopi/bump_and_fixes
Bump and fixes: autoloadable & serialization
2 parents 6146452 + c6927c7 commit 3443b29

File tree

3 files changed

+5
-14
lines changed

3 files changed

+5
-14
lines changed

duckdb

Submodule duckdb updated 1898 files

src/sqlite_extension.cpp

+3-12
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,24 @@
88
#include "sqlite_scanner_extension.hpp"
99

1010
#include "duckdb/catalog/catalog.hpp"
11+
#include "duckdb/main/extension_util.hpp"
1112
#include "duckdb/parser/parsed_data/create_table_function_info.hpp"
1213

1314
using namespace duckdb;
1415

1516
extern "C" {
1617

1718
static void LoadInternal(DatabaseInstance &db) {
18-
Connection con(db);
19-
con.BeginTransaction();
20-
auto &context = *con.context;
21-
auto &catalog = Catalog::GetSystemCatalog(context);
22-
2319
SqliteScanFunction sqlite_fun;
24-
CreateTableFunctionInfo sqlite_info(sqlite_fun);
25-
catalog.CreateTableFunction(context, sqlite_info);
20+
ExtensionUtil::RegisterFunction(db, sqlite_fun);
2621

2722
SqliteAttachFunction attach_func;
28-
29-
CreateTableFunctionInfo attach_info(attach_func);
30-
catalog.CreateTableFunction(context, attach_info);
23+
ExtensionUtil::RegisterFunction(db, attach_func);
3124

3225
auto &config = DBConfig::GetConfig(db);
3326
config.AddExtensionOption("sqlite_all_varchar", "Load all SQLite columns as VARCHAR columns", LogicalType::BOOLEAN);
3427

3528
config.storage_extensions["sqlite_scanner"] = make_uniq<SQLiteStorageExtension>();
36-
37-
con.Commit();
3829
}
3930

4031
void SqliteScannerExtension::Load(DuckDB &db) {

src/storage/sqlite_index.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class LogicalSQLiteCreateIndex : public LogicalExtensionOperator {
3838
return make_uniq<SQLiteCreateIndex>(std::move(info), table);
3939
}
4040

41-
void Serialize(FieldWriter &writer) const override {
41+
void Serialize(Serializer &writer) const override {
4242
throw InternalException("Cannot serialize SQLite Create index");
4343
}
4444

0 commit comments

Comments
 (0)