HiveSQL
  • Introduction
  • Register your HiveSQL account
  • Support
  • Technical informations
    • Database Diagram
    • Operations
      • TxAccountClaims
      • TxAccountCreates
      • TxAccountRecoveryChanges
      • TxAccountRecoveryRequests
      • TxAccountRecoveryConfirms
      • TxAccountUpdates
      • TxAccountUpdates2
      • TxAccountWitnessProxies
      • TxAccountWitnessVotes
      • TxClaimRewardBalances
      • TxCollateralizedConverts
      • TxComments
      • TxCommentsOptions
      • TxConverts
      • TxCustoms
      • TxDeclineVotingRights
      • TxDelegateVestingShares
      • TxDeleteComments
      • TxEscrowApproves
      • TxEscrowDisputes
      • TxEscrowReleases
      • TxEscrowTransfers
      • TxFeeds
      • TxLimitOrdersCancels
      • TxLimitOrdersCreates
      • TxPows
      • TxProposalCreates
      • TxProposalRemoves
      • TxProposalUpdates
      • TxProposalVoteUpdates
      • TxRecurrentTransfers
      • TxTransfers
      • TxVotes
      • TxWithdraws
      • TxWithdrawVestingRoutes
      • TxWitnessSetProperties
      • TxWitnessUpdates
    • Virtual Operations
      • VOAccountCreateds
      • VOAuthorRewards
      • VOChangedRecoveryAccounts
      • VOClearNullAccountBalances
      • VOCollateralizedConvertImmediateConversions
      • VOCommentBenefactorRewards
      • VOCommentPayoutUpdates
      • VOCommentRewards
      • VOCommentsVotes
      • VOConsolidateTreasuryBalances
      • VOCurationRewards
      • VODelayedVotings
      • VODHFConversions
      • VODHFFundings
      • VOExpiredAccountNotifications
      • VOFailedRecurrentTransfers
      • VOFillCollateralizedConvertRequests
      • VOFillConvertRequests
      • VOFillOrders
      • VOFillRecurrentTransfers
      • VOFillTransferFromSavings
      • VOFillVestingWithdraws
      • VOHardforkHiveRestores
      • VOHardforkHives
      • VOHardforks
      • VOInterests
      • VOLimitOrderCancelleds
      • VOLiquidityRewards
      • VOPowRewards
      • VOProducerMisseds
      • VOProducerRewards
      • VOProposalFees
      • VOProposalPays
      • VOReturnVestingDelegations
      • VOShutdownWitnesses
      • VOSPSConverts
      • VOSPSFunds
      • VOTransferToVestingCompleteds
    • State tables
      • DynamicGlobalProperties
      • Accounts
      • Blacklists
      • BlacklistsFollows
      • Comments
      • Communities
      • CommunitiesRoles
      • CommunitiesSubscribers
      • Delegations
      • Followers
      • Mutes
      • MutesFollows
      • Proposals
      • ProposalsApprovals
      • RCDelegations
      • Reblogs
      • Tags
      • Witnesses
    • Full Text Search
    • Language detection
  • Tutorials
    • HiveSQL for Python developers
    • HiveSQL for PHP developers
    • HiveSQL for Ruby developers
    • HiveSQL for Microsoft Excel
  • HiveSQL Status
  • Resources
Powered by GitBook
On this page
  1. Tutorials

HiveSQL for Ruby developers

PreviousHiveSQL for PHP developersNextHiveSQL for Microsoft Excel

Last updated 4 years ago

is developing and maintaining a library for Ruby developers

Gem repository:

To use this gem, you must an active subscription and store the credentials as environment variables. Read to find out about HiveSQL accounts

Installation

First, install ruby. One way to do this is install . Once ruby is installed, install hive_sql with the gem command:

gem install hive_sql

Or, add it to your Gemfile:

gem 'hive_sql'

How To Use (Standalone)

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.

Models

  • Account

  • Block

    • Transaction

      • various operations

  • Comment

  • Community

    • Role

    • Subscriber

  • Follower

  • Reblog

  • Tag

  • Token

  • Witness

Followers

How to query today's followers:

followers = HiveSQL::Tx::Custom::Follow
followers.following(:alice).today.count

Reblog

How to query today's reblogs:

reblogs = HiveSQL::Tx::Custom::Reblog
reblogs.author(:alice).today.count

Account Witness Proxy

How to query current accounts that are actively using a proxy:

proxied = HiveSQL::Tx::AccountWitnessProxy.active('alice')
proxied.pluck(:account)

Applications

How to query comments by application:

comments = HiveSQL::Comment.app('esteem').where(author: 'good-karma')

License

HiveSQL gem is licensed under a Creative Commons CC0 License.

@inertia
https://github.com/inertia186/hive_sql
@hivesql
Register your HiveSQL acount
rvm