Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump and fixes: autoloadable & serialization #65

Merged
merged 2 commits into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion duckdb
Submodule duckdb updated 1898 files
15 changes: 3 additions & 12 deletions src/sqlite_extension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,24 @@
#include "sqlite_scanner_extension.hpp"

#include "duckdb/catalog/catalog.hpp"
#include "duckdb/main/extension_util.hpp"
#include "duckdb/parser/parsed_data/create_table_function_info.hpp"

using namespace duckdb;

extern "C" {

static void LoadInternal(DatabaseInstance &db) {
Connection con(db);
con.BeginTransaction();
auto &context = *con.context;
auto &catalog = Catalog::GetSystemCatalog(context);

SqliteScanFunction sqlite_fun;
CreateTableFunctionInfo sqlite_info(sqlite_fun);
catalog.CreateTableFunction(context, sqlite_info);
ExtensionUtil::RegisterFunction(db, sqlite_fun);

SqliteAttachFunction attach_func;

CreateTableFunctionInfo attach_info(attach_func);
catalog.CreateTableFunction(context, attach_info);
ExtensionUtil::RegisterFunction(db, attach_func);

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

config.storage_extensions["sqlite_scanner"] = make_uniq<SQLiteStorageExtension>();

con.Commit();
}

void SqliteScannerExtension::Load(DuckDB &db) {
Expand Down
2 changes: 1 addition & 1 deletion src/storage/sqlite_index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class LogicalSQLiteCreateIndex : public LogicalExtensionOperator {
return make_uniq<SQLiteCreateIndex>(std::move(info), table);
}

void Serialize(FieldWriter &writer) const override {
void Serialize(Serializer &writer) const override {
throw InternalException("Cannot serialize SQLite Create index");
}

Expand Down
Loading