Comment on page
HiveSQL for Ruby developers
To use this gem, you must an active @hivesql subscription and store the credentials as environment variables. Read Register your HiveSQL acount to find out about HiveSQL accounts
First, install ruby. One way to do this is install rvm. Once ruby is installed, install
hive_sql
with the gem
command:gem install hive_sql
Or, add it to your
Gemfile
:gem 'hive_sql'
gem install hive_sql
export HIVESQL_HOST=<your hivesql host>
export HIVESQL_USERNAME=<your hivesql username>
export HIVESQL_PASSWORD=<your hivesql password>
hive_sql top upvoted
The above example will query the top upvoted content for the last 7 days.
- Account
- Block
- Transaction
- various operations
- Comment
- Community
- Role
- Subscriber
- Follower
- Reblog
- Tag
- Token
- Witness
How to query today's followers:
followers = HiveSQL::Tx::Custom::Follow
followers.following(:alice).today.count
How to query today's reblogs:
reblogs = HiveSQL::Tx::Custom::Reblog
reblogs.author(:alice).today.count
How to query current accounts that are actively using a proxy:
proxied = HiveSQL::Tx::AccountWitnessProxy.active('alice')
proxied.pluck(:account)
How to query comments by application:
comments = HiveSQL::Comment.app('esteem').where(author: 'good-karma')
HiveSQL gem is licensed under a Creative Commons CC0 License.