Class: Rsconn::Redshift
Instance Attribute Summary collapse
-
#query_group ⇒ Object
readonly
Returns the value of attribute query_group.
-
#query_slot_count ⇒ Object
readonly
Returns the value of attribute query_slot_count.
Attributes inherited from Postgres
Instance Method Summary collapse
-
#initialize(host, port, database, user, password, options = {}) ⇒ Redshift
constructor
A new instance of Redshift.
- #set_query_group(query_group) ⇒ Object
- #set_query_slot_count(count) ⇒ Object
Methods inherited from Postgres
#clear_error_state, #drop_table_if_exists, #drop_view_if_exists, #error_occurred?, #execute, #execute_script, #query, #table_exists?
Constructor Details
#initialize(host, port, database, user, password, options = {}) ⇒ Redshift
Returns a new instance of Redshift.
8 9 10 11 12 13 14 15 |
# File 'lib/rsconn.rb', line 8 def initialize(host, port, database, user, password, ={}) super @query_group = .fetch(:query_group, nil) @query_slot_count = .fetch(:query_slot_count, nil) set_query_group(@query_group) if @query_group set_query_slot_count(@query_slot_count) if @query_slot_count end |
Instance Attribute Details
#query_group ⇒ Object (readonly)
Returns the value of attribute query_group.
6 7 8 |
# File 'lib/rsconn.rb', line 6 def query_group @query_group end |
#query_slot_count ⇒ Object (readonly)
Returns the value of attribute query_slot_count.
6 7 8 |
# File 'lib/rsconn.rb', line 6 def query_slot_count @query_slot_count end |
Instance Method Details
#set_query_group(query_group) ⇒ Object
17 18 19 |
# File 'lib/rsconn.rb', line 17 def set_query_group(query_group) execute("SET query_group TO #{query_group};") end |
#set_query_slot_count(count) ⇒ Object
21 22 23 |
# File 'lib/rsconn.rb', line 21 def set_query_slot_count(count) execute("SET wlm_query_slot_count TO #{count};") end |