A Sequel adapter for Google's BigQuery.
- Pre-push hook
Be warned: Given I was unable to find Sequel documentation covering how to write a database adapter, this was put together by reading Sequel's source and hacking at things until they worked. There are probably a lot of rough edges.
- Table creation, with automatic removal of defaults from statements (since BigQuery doesn't support it)
- Inserting rows
- Updating rows, with automatic addition of
where 1 = 1to statements (since BigQuery requires a
- Transactions (buffered since BigQuery only supports them when you execute the whole transaction at once)
- Ruby types:
- DateTime (note that BigQuery does not persist timezone)
Add it to the
Gemfile of your project:
and install all your gems:
Or you can install it to your system directly using:
gem install sequel-bigquery
Connect to BigQuery:
require 'sequel-bigquery' db = Sequel.connect( adapter: :bigquery, project: 'your-gcp-project', database: 'your_bigquery_dataset_name', logger: Logger.new(STDOUT), )
And use Sequel like normal.
Pull requests welcome! =)
This hook runs style checks and tests.
To set up the pre-push hook:
echo -e "#\!/bin/bash\n\$(dirname \$0)/../../auto/pre-push-hook" > .git/hooks/pre-push chmod +x .git/hooks/pre-push
To release a new version:
auto/release/update-version && auto/release/tag && auto/release/publish
This takes care of the whole process:
- Incrementing the version number (the patch number by default)
- Tagging & pushing commits
- Publishing the gem to RubyGems
- Creating a draft GitHub release
To increment the minor or major versions instead of the patch number, run