Browse Source

Add PG provider to pgrun (#732)

Александр Новожилов 1 year ago
parent
commit
06f93763e6
2 changed files with 4 additions and 0 deletions
  1. 3 0
      ydb/library/yql/tools/pgrun/pgrun.cpp
  2. 1 0
      ydb/library/yql/tools/pgrun/ya.make

+ 3 - 0
ydb/library/yql/tools/pgrun/pgrun.cpp

@@ -9,6 +9,7 @@
 #include <ydb/library/yql/providers/common/provider/yql_provider_names.h>
 #include <ydb/library/yql/providers/common/proto/gateways_config.pb.h>
 #include <ydb/library/yql/providers/yt/provider/yql_yt_provider.h>
+#include <ydb/library/yql/providers/pg/provider/yql_pg_provider.h>
 #include <ydb/library/yql/public/issue/yql_issue.h>
 
 #include <library/cpp/getopt/last_getopt.h>
@@ -971,6 +972,7 @@ int Main(int argc, char* argv[])
 
     static const TString DefaultCluster{"plato"};
     clusterMapping[DefaultCluster] = YtProviderName;
+    clusterMapping["pg_catalog"] = PgProviderName;
 
     opts.AddHelpOption();
     opts.AddLongOption("datadir", "directory for tables").StoreResult<TString>(&rawDataDir);
@@ -1001,6 +1003,7 @@ int Main(int argc, char* argv[])
 
     TVector<TDataProviderInitializer> dataProvidersInit;
     dataProvidersInit.push_back(GetYtNativeDataProviderInitializer(ytNativeGateway));
+    dataProvidersInit.push_back(GetPgDataProviderInitializer());
 
     TExprContext ctx;
     TExprContext::TFreezeGuard freezeGuard(ctx);

+ 1 - 0
ydb/library/yql/tools/pgrun/ya.make

@@ -32,6 +32,7 @@ PEERDIR(
     ydb/library/yql/providers/yt/gateway/file
     ydb/library/yql/providers/yt/comp_nodes/llvm
     ydb/library/yql/providers/yt/codec/codegen
+    ydb/library/yql/providers/pg/provider
     ydb/library/yql/core/url_preprocessing
     ydb/library/yql/parser/pg_wrapper
 )