Access [HiveSQL.io](https://hivesql.io) data from your ruby/rails application. <center><img src="https://files.peakd.com/file/peakd-hive/inertia/In1ZQ9bW-image.png" /></center> Gem repository: https://github.com/inertia186/hive_sql ### How to Subscribe **Note:** HiveSQL is a monthly subscription. To use this gem, you must subscribe to @hivesql and store the credentials as environment variables. See: https://hivesql.io ### Installation First, install ruby. One way to do this is install [rvm](https://rvm.io/install). Once ruby is installed, install `hive_sql` with the `gem` command: ```bash gem install hive_sql ``` Or, add it to your `Gemfile`: ```ruby gem 'hive_sql' ``` ### How To Use (Standalone) ```bash 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: ```ruby followers = HiveSQL::Tx::Custom::Follow followers.following(:alice).today.count ``` ### Reblog How to query today's reblogs: ```ruby reblogs = HiveSQL::Tx::Custom::Reblog reblogs.author(:alice).today.count ``` ### Account Witness Proxy How to query current accounts that are actively using a proxy: ```ruby proxied = HiveSQL::Tx::AccountWitnessProxy.active('alice') proxied.pluck(:account) ``` ### Applications How to query comments by application: ```ruby comments = HiveSQL::Comment.app('esteem').where(author: 'good-karma') ``` ## Get in touch! If you're using HiveSQL with ruby, I'd love to hear from you. Drop me a line and tell me what you think! I'm @inertia on Hive. Please note that this gem just provides access to the HiveSQL data services are provided by @arcange. ## License I don't believe in intellectual "property". If you do, consider the HiveSQL gem as licensed under a Creative Commons CC0 License.
author | inertia | ||||||
---|---|---|---|---|---|---|---|
permlink | hive-sql-for-ruby-and-rails-applications | ||||||
category | hive-146513 | ||||||
json_metadata | {"app":"peakd/2020.03.11","format":"markdown","tags":["hivesql","hive","sql","ruby","rails"],"users":["hivesql","inertia","arcange"],"links":["https://hivesql.io","https://github.com/inertia186/hive_sql","/@hivesql","https://hivesql.io","https://rvm.io/install","/@inertia","/@arcange"],"image":["https://files.peakd.com/file/peakd-hive/inertia/In1ZQ9bW-image.png"]} | ||||||
created | 2020-03-24 17:54:24 | ||||||
last_update | 2020-03-24 17:54:24 | ||||||
depth | 0 | ||||||
children | 0 | ||||||
last_payout | 2020-03-31 17:54:24 | ||||||
cashout_time | 1969-12-31 23:59:59 | ||||||
total_payout_value | 6.326 HBD | ||||||
curator_payout_value | 6.479 HBD | ||||||
pending_payout_value | 0.000 HBD | ||||||
promoted | 0.000 HBD | ||||||
body_length | 2,140 | ||||||
author_reputation | 346,568,901,399,561 | ||||||
root_title | "Hive SQL for Ruby and Rails Applications" | ||||||
beneficiaries |
| ||||||
max_accepted_payout | 1,000,000.000 HBD | ||||||
percent_hbd | 10,000 | ||||||
post_id | 96,566,547 | ||||||
net_rshares | 32,998,150,956,043 | ||||||
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
gerber | 0 | 51,226,700,129 | 3% | ||
daan | 0 | 102,562,814,043 | 8% | ||
inertia | 0 | 283,008,037,239 | 100% | ||
arcange | 0 | 2,224,106,590,921 | 100% | ||
exyle | 0 | 636,300,800,732 | 7% | ||
raphaelle | 0 | 80,088,186,011 | 100% | ||
lukmarcus | 0 | 94,544,638,143 | 50% | ||
penguinpablo | 0 | 529,705,818,725 | 10% | ||
whatsup | 0 | 919,001,603,266 | 100% | ||
edb | 0 | 12,271,773,611 | 25% | ||
mow | 0 | 3,330,102,008 | 100% | ||
borislavzlatanov | 0 | 113,922,099,468 | 100% | ||
freebornsociety | 0 | 1,198,239,813 | 6% | ||
roomservice | 0 | 1,901,239,406,607 | 100% | ||
mys | 0 | 18,848,529,366 | 5% | ||
techken | 0 | 840,893,434 | 1.5% | ||
whd | 0 | 6,429,559,968 | 5% | ||
drorion | 0 | 386,924,041,456 | 100% | ||
themarkymark | 0 | 4,797,587,679,796 | 30% | ||
techtek | 0 | 19,309,979,596 | 50% | ||
free999enigma | 0 | 193,447,417,138 | 100% | ||
accelerator | 0 | 36,099,721,882 | 3% | ||
buildawhale | 0 | 15,584,802,766,931 | 30% | ||
roleerob | 0 | 3,739,332,258 | 0.75% | ||
revisesociology | 0 | 158,948,185,644 | 20% | ||
blockbrothers | 0 | 8,136,015,454 | 3.5% | ||
steeminer4up | 0 | 4,852,177,240 | 100% | ||
cryptonized | 0 | 50,295,270,513 | 10% | ||
stuffbyspencer | 0 | 88,493,657,533 | 50% | ||
soyrosa | 0 | 326,558,133,397 | 50% | ||
psos | 0 | 15,397,086,757 | 60% | ||
mistakili | 0 | 73,194,937,977 | 100% | ||
holger80 | 0 | 1,571,350,039,789 | 52% | ||
fantasycrypto | 0 | 11,577,909,800 | 100% | ||
cadawg | 0 | 6,805,018,545 | 2.1% | ||
ipromote | 0 | 468,427,106,837 | 30% | ||
wedacoalition | 0 | 1,016,787,452 | 100% | ||
beleg | 0 | 2,249,663,502 | 5% | ||
bestboom | 0 | 23,430,795,279 | 3% | ||
beat-the-bookies | 0 | 4,599,106,770 | 100% | ||
m2nnari | 0 | 20,239,968,777 | 100% | ||
freddio | 0 | 60,840,990,780 | 15% | ||
tsnaks | 0 | 36,529,703,128 | 100% | ||
archisteem | 0 | 4,613,213,330 | 7.5% | ||
remotehorst23 | 0 | 23,296,360,128 | 100% | ||
julian2013 | 0 | 7,246,263,270 | 2.25% | ||
dlike | 0 | 148,768,192,463 | 2.7% | ||
triptolemus | 0 | 10,109,462,551 | 3% | ||
yourholiness | 0 | 4,155,764,508 | 100% | ||
lizardslayer | 0 | 4,077,699,418 | 100% | ||
fulltimebot4 | 0 | 4,326,093,715 | 100% | ||
fulltimebot6 | 0 | 4,299,334,583 | 100% | ||
fulltimebot8 | 0 | 4,330,877,855 | 100% | ||
fulltimebot12 | 0 | 4,388,783,600 | 100% | ||
exterminator | 0 | 4,671,877,694 | 100% | ||
goldenchild | 0 | 1,722,489,907 | 100% | ||
bobby.madagascar | 0 | 1,084,107,075 | 0.75% | ||
fulltimebot17 | 0 | 4,072,829,899 | 100% | ||
fulltimebot29 | 0 | 4,368,326,091 | 100% | ||
fulltimebot30 | 0 | 4,213,685,796 | 100% | ||
fulltimebot37 | 0 | 4,170,726,786 | 100% | ||
fulltimebot38 | 0 | 4,244,087,324 | 100% | ||
fulltimebot39 | 0 | 4,206,818,225 | 100% | ||
fulltimebot40 | 0 | 4,088,574,091 | 100% | ||
fulltimebot41 | 0 | 4,189,133,472 | 100% | ||
fulltimebot42 | 0 | 4,072,988,188 | 100% | ||
fulltimebot43 | 0 | 4,151,774,030 | 100% | ||
fulltimebot47 | 0 | 4,159,815,286 | 100% | ||
fulltimebot49 | 0 | 4,063,279,574 | 100% | ||
fulltimebot51 | 0 | 4,004,244,266 | 100% | ||
fulltimebot53 | 0 | 4,199,839,547 | 100% | ||
fulltimebot55 | 0 | 4,444,792,737 | 100% | ||
fulltimebot56 | 0 | 4,301,146,247 | 100% | ||
reverendrum | 0 | 9,992,827,592 | 100% | ||
fulltimebot62 | 0 | 3,822,897,579 | 100% | ||
fulltimebot65 | 0 | 4,084,366,925 | 100% | ||
fulltimebot66 | 0 | 4,084,403,293 | 100% | ||
fulltimebot70 | 0 | 4,000,644,619 | 100% | ||
anti-bully | 0 | 2,031,767,127 | 100% | ||
merlin7 | 0 | 19,566,847,050 | 3% | ||
onze | 0 | 3,959,226,903 | 60% | ||
bluerobo | 0 | 23,562,046,412 | 100% | ||
permaculturedude | 0 | 541,328,123 | 1.5% | ||
circa | 0 | 713,026,074,940 | 100% | ||
ctime | 0 | 549,262,652,262 | 6% | ||
steemitmonsters | 0 | 1,746,533,825 | 100% | ||
yff | 0 | 22,293,472,657 | 100% | ||
proboards2 | 0 | 11,910,847,438 | 100% | ||
doze | 0 | 20,273,876,907 | 60% | ||
treze | 0 | 1,322,551,568 | 60% | ||
steemindian | 0 | 761,540,248 | 3.5% | ||
fsm-liquid | 0 | 997,605,040 | 7% | ||
triplea.bot | 0 | 1,816,711,138 | 7% | ||
steem.leo | 0 | 53,529,764,772 | 2.88% | ||
leo.voter | 0 | 60,048,271,527 | 2.91% | ||
freddio.sport | 0 | 2,686,074,612 | 15% | ||
marlians.ccc | 0 | 1,723,985,824 | 100% | ||
midlet-creates | 0 | 931,930,224 | 50% | ||
leo.syndication | 0 | 1,281,316,029 | 3% | ||
one.life | 0 | 17,790,143,501 | 2.99% | ||
maxuvd | 0 | 1,832,933,141 | 2.4% | ||
maxuve | 0 | 14,763,114,261 | 3% | ||
therealyme | 0 | 5,052,794,444 | 5.6% | ||
khalpoint | 0 | 537,639,691 | 50% | ||
steemcityrewards | 0 | 19,287,973,983 | 3% | ||
fengchao | 0 | 82,387,341,732 | 100% | ||
hiveqa | 0 | 109,717,581,285 | 100% |