File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,8 @@ class WebDB {
3333 public:
3434 // / A connection
3535 class Connection {
36+ friend WebDB;
37+
3638 protected:
3739 // / The webdb
3840 WebDB& webdb_;
Original file line number Diff line number Diff line change @@ -783,11 +783,29 @@ std::string WebDB::Tokenize(std::string_view text) {
783783// / Get the version
784784std::string_view WebDB::GetVersion () { return database_->LibraryVersion (); }
785785
786+ class ProgressBarCustom : public ProgressBarDisplay {
787+ public:
788+ ProgressBarCustom () {
789+ }
790+ ~ProgressBarCustom () {}
791+ public:
792+ void Update (double percentage) {
793+ std::cout << " ProgressBar::Update() called with " << percentage << " \n " ;
794+ }
795+ void Finish () {
796+ std::cout << " Finish() called\n " ;
797+ }
798+ static unique_ptr<ProgressBarDisplay> GetProgressBar () {
799+ return make_uniq<ProgressBarCustom>();
800+ }
801+ };
802+
786803// / Create a session
787804WebDB::Connection* WebDB::Connect () {
788805 auto conn = duckdb::make_uniq<WebDB::Connection>(*this );
789806 auto conn_ptr = conn.get ();
790807 connections_.insert ({conn_ptr, std::move (conn)});
808+ ClientConfig::GetConfig (*conn_ptr->connection_ .context ).display_create_func = ProgressBarCustom::GetProgressBar;
791809 return conn_ptr;
792810}
793811
You can’t perform that action at this time.
0 commit comments