Qri & SQL

The query engine writes the results to IPFS as a Dataset object, writing the Data, Query and Structure hash references into the Dataset, and saving the output Data too.

It’s still early

Demo introducing SQL Support:

Qri as a global SQL database:

SQL errors & prepping datasets for querying:

Let’s see an Example

qri sql "SELECT * FROM nyc-open-data-archive/popular-baby-names a LIMIT 10"
+-----------------+----------+-------------+---------------------+---------+--------+
| a.year_of_birth | a.gender | a.ethnicity | a.childs_first_name | a.count | a.rank |
+-----------------+----------+-------------+---------------------+---------+--------+
| 2011 | 'FEMALE' | 'HISPANIC' | 'GERALDINE' | 13 | 75 |
| 2011 | 'FEMALE' | 'HISPANIC' | 'GIA' | 21 | 67 |
| 2011 | 'FEMALE' | 'HISPANIC' | 'GIANNA' | 49 | 42 |
| 2011 | 'FEMALE' | 'HISPANIC' | 'GISELLE' | 38 | 51 |
| 2011 | 'FEMALE' | 'HISPANIC' | 'GRACE' | 36 | 53 |
| 2011 | 'FEMALE' | 'HISPANIC' | 'GUADALUPE' | 26 | 62 |
| 2011 | 'FEMALE' | 'HISPANIC' | 'HAILEY' | 126 | 8 |
| 2011 | 'FEMALE' | 'HISPANIC' | 'HALEY' | 14 | 74 |
| 2011 | 'FEMALE' | 'HISPANIC' | 'HANNAH' | 17 | 71 |
| 2011 | 'FEMALE' | 'HISPANIC' | 'HAYLEE' | 17 | 71 |
+-----------------+----------+-------------+---------------------+---------+--------+
qri sql "SELECT a.ethnicity, count(childs_first_name) AS count FROM nyc-open-data-archive/popular-baby-names a GROUP BY a.ethnicity"
+------------------------------+-------+
| a.ethnicity | count |
+------------------------------+-------+
| 'WHITE NON HISP' | 1338 |
| 'HISPANIC' | 5714 |
| 'WHITE NON HISPANIC' | 5473 |
| 'ASIAN AND PACIFIC ISLANDER' | 2693 |
| 'BLACK NON HISPANIC' | 2826 |
| 'ASIAN AND PACI' | 693 |
| 'BLACK NON HISP' | 681 |
+------------------------------+-------+

SQL support is coming to Desktop

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Rico Gardaphe

Rico Gardaphe

Head of Business Development for Qri — free and open source dataset versioning software. Former strategy consultant and Obama White House staffer.