Class: GDK::Command::Clickhouse

Inherits:
BaseCommand show all
Defined in:
lib/gdk/command/clickhouse.rb

Overview

Executes clickhouse client command with configured connection paras and any provided extra arguments

Instance Attribute Summary

Attributes inherited from BaseCommand

#stderr, #stdout

Instance Method Summary collapse

Methods inherited from BaseCommand

#config, #display_help_message, #help, #initialize, #print_help, #print_ready_message, #ready_messages, validate_config?

Constructor Details

This class inherits a constructor from GDK::Command::BaseCommand

Instance Method Details

#run(args = []) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/gdk/command/clickhouse.rb', line 7

def run(args = [])
  unless GDK.config.clickhouse.enabled?
    GDK::Output.error('ClickHouse is not enabled. Please check your gdk.yml configuration.')

    exit(-1)
  end

  exec(*GDK::Clickhouse.new.client_cmd(args), chdir: GDK.root)
end