HiveSQL
Search…
HiveSQL for Ruby developers
@inertia is developing and maintaining a library 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

Installation

First, install ruby. One way to do this is install rvm. Once ruby is installed, install hive_sql with the gem command:
1
gem install hive_sql
Copied!
Or, add it to your Gemfile:
1
gem 'hive_sql'
Copied!

How To Use (Standalone)

1
gem install hive_sql
2
export HIVESQL_HOST=<your hivesql host>
3
export HIVESQL_USERNAME=<your hivesql username>
4
export HIVESQL_PASSWORD=<your hivesql password>
5
hive_sql top upvoted
Copied!
The above example will query the top upvoted content for the last 7 days.

Models

  • Account
  • Block
    • Transaction
      • various operations
  • Comment
  • Community
    • Role
    • Subscriber
  • Follower
  • Reblog
  • Tag
  • Token
  • Witness

Followers

How to query today's followers:
1
followers = HiveSQL::Tx::Custom::Follow
2
followers.following(:alice).today.count
Copied!

Reblog

How to query today's reblogs:
1
reblogs = HiveSQL::Tx::Custom::Reblog
2
reblogs.author(:alice).today.count
Copied!

Account Witness Proxy

How to query current accounts that are actively using a proxy:
1
proxied = HiveSQL::Tx::AccountWitnessProxy.active('alice')
2
proxied.pluck(:account)
Copied!

Applications

How to query comments by application:
1
comments = HiveSQL::Comment.app('esteem').where(author: 'good-karma')
Copied!

License

HiveSQL gem is licensed under a Creative Commons CC0 License.
Last modified 7mo ago
Copy link
Contents
License