Skip to content

Commit

Permalink
Merge pull request #114 from esadek/format
Browse files Browse the repository at this point in the history
Code formatting
  • Loading branch information
samansmink authored Nov 8, 2024
2 parents f71402e + dd40939 commit e02abad
Show file tree
Hide file tree
Showing 9 changed files with 1,444 additions and 1,415 deletions.
1 change: 1 addition & 0 deletions .clang-format
20 changes: 10 additions & 10 deletions src/delta_extension.cpp
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
#define DUCKDB_EXTENSION_MAIN

#include "delta_extension.hpp"
#include "delta_functions.hpp"

#include "delta_functions.hpp"
#include "duckdb.hpp"
#include "duckdb/common/exception.hpp"
#include "duckdb/main/extension_util.hpp"

namespace duckdb {

static void LoadInternal(DatabaseInstance &instance) {
// Load functions
for (const auto &function : DeltaFunctions::GetTableFunctions(instance)) {
ExtensionUtil::RegisterFunction(instance, function);
}
// Load functions
for (const auto &function : DeltaFunctions::GetTableFunctions(instance)) {
ExtensionUtil::RegisterFunction(instance, function);
}
}

void DeltaExtension::Load(DuckDB &db) {
LoadInternal(*db.instance);
LoadInternal(*db.instance);
}

std::string DeltaExtension::Name() {
return "delta";
return "delta";
}

} // namespace duckdb

extern "C" {

DUCKDB_EXTENSION_API void delta_init(duckdb::DatabaseInstance &db) {
duckdb::DuckDB db_wrapper(db);
db_wrapper.LoadExtension<duckdb::DeltaExtension>();
duckdb::DuckDB db_wrapper(db);
db_wrapper.LoadExtension<duckdb::DeltaExtension>();
}

DUCKDB_EXTENSION_API const char *delta_version() {
return duckdb::DuckDB::LibraryVersion();
return duckdb::DuckDB::LibraryVersion();
}
}

Expand Down
9 changes: 5 additions & 4 deletions src/delta_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@

#include "duckdb.hpp"
#include "duckdb/main/extension_util.hpp"

#include <duckdb/parser/parsed_data/create_scalar_function_info.hpp>

namespace duckdb {

vector<TableFunctionSet> DeltaFunctions::GetTableFunctions(DatabaseInstance &instance) {
vector<TableFunctionSet> functions;
vector<TableFunctionSet> functions;

functions.push_back(GetDeltaScanFunction(instance));
functions.push_back(GetDeltaScanFunction(instance));

return functions;
return functions;
}

};
}; // namespace duckdb
Loading

0 comments on commit e02abad

Please sign in to comment.