Rubq allows access to Google Bigquery the rails way. It uses the Google::Cloud::Bigquery gem behind the scenes and allows for migrations and basic administration.
This is still very much of a work in progress. You have been warned.
When the first really useful version is available, usage directives will be written here. In the mean time, take a look at the docs below.
- Creating a model migration and its corresponding table in BigQuery
- Inserting a row in a managed table
- Everything else
- Write a
rubq:migratetask - Set up schema validation
- Migrations:
- Streamline usage
- Implement
self.down - Create / Delete tables
- Model:
#new#delete#update- Querying:
#all#find#find_by
Add this line to your application's Gemfile:
gem 'rubq'And then execute:
$ bundleOr install it yourself as:
$ gem install rubqInitialize the library:
# app/config/initializers/rubq.rb
Rubq.configure do |config|
config.project = 'my-google-project'
config.region = 'eu'
config.dataset = 'mybigquerydataset'
endWhy not an ActiveRecord adapter?
Because Bigquery is by no means a mere SQL database. This gem is just a wrapper around the Google::Cloud::Bigquery gem that provides convenience methods in an ActiveRecord-like fashion.
I will add contribution guidelines as soon as this is ready to use.
The gem is available as open source under the terms of the MIT License.