A little library to help you work with GoodData's Datawarehouse
Add this line to your application's Gemfile:
gem 'gooddata_datawarehouse'
And then execute:
$ bundle
Or install it yourself as:
$ gem install gooddata_datawarehouse
require 'gooddata_datawarehouse'
# connect
dwh = GoodData::Datawarehouse.new('[email protected]', 'yourpass', 'your ADS instance id'
# import a csv
dwh.csv_to_new_table('my_table', 'path/to/my.csv')
dwh.table_exists?('my_table') # true
dwh.get_columns('my_table') # [{column_name: 'col1', data_type: 'varchar(88)'}, {column_name: 'col2', data_type: 'int'}]
# run an aribrary sql
dwh.execute('ALTER TABLE my_table ADD COLUMN col3 INTEGER')
# run a select and process results
dwh.execute_select('SELECT * FROM my_table ORDER BY col1') do |row|
puts row[:col1]
end
# rename a table
dwh.rename_table('my_table', 'my_new_table')
# export to csv
dwh.export_table('my_new_table', 'path/to/my_new.csv')
# drop table
dwh.drop_table('my_new_table')
- Fork it ( https://github.com/[my-github-username]/gooddata_datawarehouse/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request