Queuery client for Ruby.
Add this line to your application's Gemfile:
gem 'queuery_client'
# configuration
RedshiftConnector.logger = Logger.new($stdout)
GarageClient.configure do |config|
config.name = "queuery-example"
end
QueueryClient.configure do |config|
config.endpoint = 'http://localhost:3000'
config.token = 'XXXXXXXXXXXXXXXXXXXXX'
config.token_secret = '*******************'
end
In config/initializers/queuery.rb
:
QueueryClient.configure do |config|
config.endpoint = 'http://localhost:3000'
config.token = 'XXXXXXXXXXXXXXXXXXXXX'
config.token_secret = '*******************'
end
select_stmt = 'select column_a, column_b from the_great_table; -- an awesome query shows amazing fact up'
bundle = QueueryClient.query(select_stmt)
bundle.each do |row|
# do some useful works
p row
end