Skip to content

Commit

Permalink
chsql system table emulator
Browse files Browse the repository at this point in the history
  • Loading branch information
lmangani committed Jan 4, 2025
1 parent a8bbca1 commit 36d3029
Show file tree
Hide file tree
Showing 4 changed files with 622 additions and 1 deletion.
2 changes: 1 addition & 1 deletion chsql/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ include_directories(
../duckdb/third_party/mbedtls
../duckdb/third_party/mbedtls/include
../duckdb/third_party/brotli/include)
set(EXTENSION_SOURCES src/chsql_extension.cpp src/duck_flock.cpp)
set(EXTENSION_SOURCES src/chsql_extension.cpp src/duck_flock.cpp src/chsql_system.cpp)
build_static_extension(${TARGET_NAME} ${EXTENSION_SOURCES})
build_loadable_extension(${TARGET_NAME} " " ${EXTENSION_SOURCES})
# Link OpenSSL in both the static library as the loadable extension
Expand Down
10 changes: 10 additions & 0 deletions chsql/src/chsql_extension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
// OpenSSL linked through vcpkg
#include <openssl/opensslv.h>
#include "parquet_ordered_scan.cpp"
#include "chsql_system.hpp"

namespace duckdb {

// To add a new scalar SQL macro, add a new macro to this array!
Expand Down Expand Up @@ -228,6 +230,14 @@ static void LoadInternal(DatabaseInstance &instance) {
ExtensionUtil::RegisterFunction(instance, ReadParquetOrderedFunction());
// Flock
ExtensionUtil::RegisterFunction(instance, DuckFlockTableFunction());
// System Table
RegisterSystemFunctions(instance);
// Register Views
Connection con(Catalog::GetSystemCatalog(instance).GetDatabase());
con.BeginTransaction();
CreateSystemViews(con);
con.Commit();

}

void ChsqlExtension::Load(DuckDB &db) {
Expand Down
Loading

0 comments on commit 36d3029

Please sign in to comment.