Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
samansmink committed Jun 1, 2023
1 parent f9a919e commit 1e95087
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
3 changes: 0 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ set(EXTENSION_NAME ${TARGET_NAME}_extension)
project(${TARGET_NAME})
include_directories(src/include)

#set(CMAKE_CXX_STANDARD 14)
#set(CMAKE_CXX_STANDARD_REQUIRED True)

set(EXTENSION_SOURCES src/aws_extension.cpp)
add_library(${EXTENSION_NAME} STATIC ${EXTENSION_SOURCES})

Expand Down
16 changes: 4 additions & 12 deletions src/aws_extension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#include "aws_extension.hpp"
#include "duckdb.hpp"
#include "duckdb/common/exception.hpp"
#include "duckdb/parser/parsed_data/create_table_function_info.hpp"

#include "duckdb/main/extension_util.hpp"
#include <duckdb/parser/parsed_data/create_scalar_function_info.hpp>
#include <aws/core/Aws.h>
#include <aws/core/auth/AWSCredentialsProviderChain.h>
#include <iostream>
Expand Down Expand Up @@ -62,16 +62,8 @@ static void LoadAWSCredentialsFun(ClientContext &context, TableFunctionInput &da
}

static void LoadInternal(DuckDB &db) {
Connection con(db);

con.BeginTransaction();
auto &catalog = Catalog::GetSystemCatalog(*con.context);

TableFunction load_credentials_func("load_aws_credentials", {}, LoadAWSCredentialsFun, LoadAWSCredentialsBind);
CreateTableFunctionInfo load_credentials_info(load_credentials_func);
catalog.CreateTableFunction(*con.context, &load_credentials_info);

con.Commit();
auto load_credentials_func = TableFunction("load_aws_credentials", {}, LoadAWSCredentialsFun, LoadAWSCredentialsBind);
ExtensionUtil::RegisterFunction(*db.instance, load_credentials_func);
}

void AwsExtension::Load(DuckDB &db) {
Expand Down

0 comments on commit 1e95087

Please sign in to comment.