Skip to content

Small Ruby library for convenient work with GoodData's Datawarehouse (ADS)

License

Notifications You must be signed in to change notification settings

thnkr/gooddata_datawarehouse

Repository files navigation

GooddataDatawarehouse

A little library to help you work with GoodData's Datawarehouse

Installation

Add this line to your application's Gemfile:

gem 'gooddata_datawarehouse'

And then execute:

$ bundle

Or install it yourself as:

$ gem install gooddata_datawarehouse

Usage

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')

Contributing

  1. Fork it ( https://github.com/[my-github-username]/gooddata_datawarehouse/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

About

Small Ruby library for convenient work with GoodData's Datawarehouse (ADS)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published