create account

Public HafSQL database on HAF by mahdiyari

View this thread on: hive.blogpeakd.comecency.com
· @mahdiyari · (edited)
$33.10
Public HafSQL database on HAF
### Edited Jan 2025
The endpoint listed in this post is deprecated and will be dropped soon.
See https://mahdiyari.gitlab.io/hafsql/#connection-settings

The above includes the new public database as well as documentations related to that database.
  
  
***
#### What is HafSQL
It is built to run on HAF and provide gateway to certain data. For example with hafsql, you can query all the operations and virtual operations by their parameters. This includes getting `custom_json` operations based on their `id` with incredible speed. Or searching transfers based on their `memo`. Or having list of incoming delegations.

It is just the matter of what data do you want or need. Then we can add certain indexes to provide that data easily.

On top of that, `hafsql-api` is built to provide JSON-RPC 2.0 API access. This again makes it possible to add/manage custom APIs that translate to SQL queries.

#### Why this post
Although it is fairly "easy" to set up a development environment in 20 minutes and play with HAF and HafSQL, it is not as accessible for everyone. Thus I am providing a public database that is open to anyone. Just remember, this public database is not meant to be used in a production environment in your application.

Play with it and see what data is available and what is not and see how it can help your project. It is possible to add a custom API designed for your needs to `hafsql-api` that we can potentially run on all the public RPC nodes. Including `rpc.mahdiyari.info`. Check my previous related posts and gitlab for example API calls.

Here are the details for the public HafSQL database.

```
host: [Deprecated - read first paragraph] hafsql.mahdiyari.info
port: 5432
database: haf_block_log
user: hafsql_public
password: hafsql_public
```
This server has been running for couple of months now. There is also a backup server running just in case. There is a 45s timeout on queries. If you hit the timeout it usually means the query is not using an index. You can change your query around, or open an issue, or MR, or reach out to me to potentially add a new index to fit your query if needed.

***
https://gitlab.com/mahdiyari/hafsql
https://gitlab.com/mahdiyari/hafsql-api

I would also recommend [DBeaver](https://dbeaver.io/) as a free database manager.
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 428 others
properties (23)
authormahdiyari
permlinkpublic-hafsql-database-on-haf
categoryhive-139531
json_metadata{"app":"peakd/2023.11.3","format":"markdown","image":[],"tags":["hive","haf","dev","hivedev"],"users":[]}
created2023-12-25 22:28:18
last_update2025-01-15 18:32:51
depth0
children19
last_payout2024-01-01 22:28:18
cashout_time1969-12-31 23:59:59
total_payout_value16.594 HBD
curator_payout_value16.501 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length2,288
author_reputation199,858,009,060,549
root_title"Public HafSQL database on HAF"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id129,984,148
net_rshares68,026,920,753,072
author_curate_reward""
vote details (492)
@adcreatordesign ·
HAF - Hive Application Framework.  I just looked up what HAF stands for.  Thank you for your post on HAFSQL service.  I will read it over and it does give me the novice a bit of insite on what HAF is @mahdiyari Thank you and have a great weekend!  Barb !BBH !CTP #ctp
properties (22)
authoradcreatordesign
permlinkre-mahdiyari-yishd9cj
categoryhive-139531
json_metadata{"app":"leothreads/0.3","format":"markdown","tags":["leofinance"],"canonical_url":"https://inleo.io/@adcreatordesign/re-mahdiyari-yishd9cj","isPoll":false,"pollOptions":{},"dimensions":[]}
created2023-12-29 22:43:51
last_update2023-12-29 22:43:51
depth1
children0
last_payout2024-01-05 22:43:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length267
author_reputation23,898,003,876,134
root_title"Public HafSQL database on HAF"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id130,078,237
net_rshares0
@braaiboy ·
Hi @mahdiyari 

This is off-topic: But I was wondering if everything is still OK over there on https://hive.vote/ ? 

My @braaiboy account was following @curie ... but 99.9% of my trail votes were for like 1-2% and contributed very little to the author and 0 to my curation... so I disabled it yesterday, but I see I'm still trailing @curie votes.

Thanks in advance.

!LUV
!PIZZA
properties (22)
authorbraaiboy
permlinkre-mahdiyari-s6xuw3
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2023.11.3"}
created2024-01-08 10:38:36
last_update2024-01-08 10:38:36
depth1
children5
last_payout2024-01-15 10:38:36
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length380
author_reputation52,076,644,008,009
root_title"Public HafSQL database on HAF"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id130,314,901
net_rshares0
@luvshares ·
<center><p>mahdiyari, braaiboy sent you LUV. 🙂 <sub>(2/5)</sub> <a href="https://crrdlx.on.fleek.co" target="_blank">tools</a> | <a href="https://tribaldex.com/trade/LUV" target="_blank">trade</a> | <a href="https://hiveconnect.on.fleek.co/" target="_blank">connect</a> | <a href="https://ichthys.netlify.app" target="_blank">daily</a></p>
<p>Made with <a href="https://hive.blog/@luvshares">LUV</a> by <a href="https://hive.blog/@crrdlx/about">crrdlx</a>.</p></center>
properties (22)
authorluvshares
permlinkre-re-mahdiyari-s6xuw3-20240108t103854z
categoryhive-139531
json_metadata"{"app": "beem/0.24.26"}"
created2024-01-08 10:38:54
last_update2024-01-08 10:38:54
depth2
children0
last_payout2024-01-15 10:38:54
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length469
author_reputation5,651,102,754,153
root_title"Public HafSQL database on HAF"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id130,314,908
net_rshares0
@mahdiyari · (edited)
Are you sure it is curie and not someone else?

Edit: Asking because I saw your last votes and curie's last votes, they don't match.
properties (22)
authormahdiyari
permlinks6xv31
categoryhive-139531
json_metadata{"app":"hiveblog/0.1"}
created2024-01-08 10:42:36
last_update2024-01-08 10:44:15
depth2
children3
last_payout2024-01-15 10:42:36
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length132
author_reputation199,858,009,060,549
root_title"Public HafSQL database on HAF"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id130,314,966
net_rshares0
@braaiboy · (edited)
I could of course be wrong ;-)... but all signs are pointing that way:
Take this post (https://peakd.com/@player101/buffet-in-seoul-garden) for example. curie voted @ 3.5% and my hive.vote was set at 50% scale and I made a 1.75% vote.

 *edit - They won't 100% match, because I have a 95%, I think, VP limit for hive.vote and I use a lot of my VP manually too.
properties (22)
authorbraaiboy
permlinkre-mahdiyari-s6xv8e
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2023.11.3"}
created2024-01-08 10:45:51
last_update2024-01-08 10:48:30
depth3
children2
last_payout2024-01-15 10:45:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length360
author_reputation52,076,644,008,009
root_title"Public HafSQL database on HAF"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id130,315,012
net_rshares0
@ctrpch ·
Hi @mahdiyari, Can I ask you for a witness vote please. I am running a witness node, on my private server, hosted here in Adelaide, it would be great to have your support.
properties (22)
authorctrpch
permlinkre-mahdiyari-s950py
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2024.1.1"}
created2024-02-20 04:34:48
last_update2024-02-20 04:34:48
depth1
children0
last_payout2024-02-27 04:34:48
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length171
author_reputation95,380,658,484,224
root_title"Public HafSQL database on HAF"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id131,438,027
net_rshares0
@gadrian ·
$0.10
Thank you for providing a public HAFSQL service. I will use it.
👍  
properties (23)
authorgadrian
permlinkre-mahdiyari-s6a8zk
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2023.11.3"}
created2023-12-26 16:40:33
last_update2023-12-26 16:40:33
depth1
children0
last_payout2024-01-02 16:40:33
cashout_time1969-12-31 23:59:59
total_payout_value0.052 HBD
curator_payout_value0.052 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length63
author_reputation627,816,483,739,082
root_title"Public HafSQL database on HAF"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id130,001,022
net_rshares217,152,053,046
author_curate_reward""
vote details (1)
@gibic ·
Hello @mahdiyari this is really cool.
I already connect with DBeaver, and it's fast!

one question, can we filter the query in `comments_table` for certain language? I'm an absolute noobs for SQL.
properties (22)
authorgibic
permlinkre-mahdiyari-shxsbo
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2024.8.3"}
created2024-08-09 05:52:39
last_update2024-08-09 05:52:39
depth1
children3
last_payout2024-08-16 05:52:39
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length196
author_reputation34,268,502,310,257
root_title"Public HafSQL database on HAF"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id136,050,939
net_rshares0
@mahdiyari ·
We don't have a language filter yet. It could be possible but I don't know how accurate it is going to be.
properties (22)
authormahdiyari
permlinkre-gibic-shyc7c
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2024.8.3"}
created2024-08-09 13:02:06
last_update2024-08-09 13:02:06
depth2
children2
last_payout2024-08-16 13:02:06
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length106
author_reputation199,858,009,060,549
root_title"Public HafSQL database on HAF"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id136,056,532
net_rshares0
@gibic ·
I see. Maybe I could do the language filter on the frontend then. Thanks!
properties (22)
authorgibic
permlinkre-mahdiyari-shylxv
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2024.8.3"}
created2024-08-09 16:32:21
last_update2024-08-09 16:32:21
depth3
children1
last_payout2024-08-16 16:32:21
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length73
author_reputation34,268,502,310,257
root_title"Public HafSQL database on HAF"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id136,060,442
net_rshares0
@hdmed ·
![](https://images.ecency.com/DQmXRBwDURqy9j4z2YA5qfj97BF5cB4u2ikfGTcfU4vKFWk/capture_d_cran_2024_05_09_165405.png)

Hi @mahdiyari, which driver to choose from this list.
properties (22)
authorhdmed
permlinkre-mahdiyari-202459t1657126z
categoryhive-139531
json_metadata{"tags":["hive","haf","dev","hivedev"],"app":"ecency/3.2.0-vision","format":"markdown+html"}
created2024-05-09 15:57:12
last_update2024-05-09 15:57:12
depth1
children4
last_payout2024-05-16 15:57:12
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length170
author_reputation66,254,816,822,123
root_title"Public HafSQL database on HAF"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id133,507,168
net_rshares0
@mahdiyari ·
HAF is running on PostgreSQL so choose PostgreSQL
properties (22)
authormahdiyari
permlinkre-hdmed-sd879g
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2024.5.1"}
created2024-05-09 16:03:21
last_update2024-05-09 16:03:21
depth2
children3
last_payout2024-05-16 16:03:21
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length49
author_reputation199,858,009,060,549
root_title"Public HafSQL database on HAF"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id133,507,258
net_rshares0
@hdmed ·
![](https://images.ecency.com/DQmXyW5w4AQGoCq5EeJM4QQMAWKQz3uuQKT73XgJHtSHxvb/capture_d_cran_2024_05_09_171348.png)

![](https://images.ecency.com/DQmZ2MBu7VEPH4VTUKGu4htvVteHqY3fbaPw7sxTaJpbSQn/capture_d_cran_2024_05_09_171326.png)

@mahdiyari Sorry , can you help thanks
properties (22)
authorhdmed
permlinkre-mahdiyari-202459t171517577z
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"ecency/3.2.0-vision","format":"markdown+html"}
created2024-05-09 16:15:18
last_update2024-05-09 16:15:18
depth3
children2
last_payout2024-05-16 16:15:18
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length273
author_reputation66,254,816,822,123
root_title"Public HafSQL database on HAF"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id133,507,521
net_rshares0
@pizzabot ·
<center>PIZZA!


$PIZZA slices delivered:
@braaiboy<sub>(2/10)</sub> tipped @mahdiyari 


</center>
properties (22)
authorpizzabot
permlinkre-public-hafsql-database-on-haf-20240108t103901z
categoryhive-139531
json_metadata"{"app": "pizzabot"}"
created2024-01-08 10:39:00
last_update2024-01-08 10:39:00
depth1
children0
last_payout2024-01-15 10:39:00
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length99
author_reputation7,430,269,960,795
root_title"Public HafSQL database on HAF"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id130,314,909
net_rshares0