项目作者: derekennui

项目描述 :
convert your sql to json format result through presto query
高级语言: Go
项目地址: git://github.com/derekennui/presto-go-sql.git
创建时间: 2019-10-23T06:35:38Z
项目社区:https://github.com/derekennui/presto-go-sql

开源协议:

下载


presto-go-sql

This project allows you to have easy access to your different datasources like mysql,hive.

step 1: config your presto url.

step 2: pass the sql you want to execute.

step 3: return the query result in json format.

For example,we have presto catalog mysql,schema test and table Persons:

PersonID LastName FirstName Address City

1 White Clover 305 - 14th Ave. S. Suite 3B Seattle

2 Wilman Kala Keskuskatu 45 Helsinki

we pass sql[select * from mysql.test.Persons limit 10] and get the result:

[{“address”:”305 - 14th Ave. S. Suite 3B”,”city”:”Seattle”,”firstname”:”Clover”,”lastname”:”White”,”personid”:1},
{“address”:”Keskuskatu 45”,”city”:”Helsinki”,”firstname”:”Kala”,”lastname”:”Wilman”,”personid”:2}]