graphql-engine
graphql-engine copied to clipboard
SQL as an API
Feature Description
Ability to generate a SQL front-end from Hasura on any data source of your choice. Same experience as instant GraphQL but on SQL.
User value / outcome
SQL is still the default choice for millions of developers and data analysts around the world to work with relational databases. However, we seldom use SQL over HTTP and for API like use-cases. But what if Hasura supports standard SQL or a subset of SQL enabling business users, analysts and data scientists to use standard BI/analytics tools (such as Tableau, Qlik, MicroStrategy, Spotfire, SAS and Excel) to interact with both relational and non-relational datastores by leveraging Hasura's data connectivity framework and querying engine.
Current status (design, alpha, beta etc.)
In discovery at this stage. We would like to know more about your use-case and ideas for this feature. Any particular dialect of SQL that you would like Hasura to support?
Resources (e.g. RFCs)
Some related products include Apache Drill.
Personally, I'm astounded something like this would be worked on before improving something like Relay, which has not received any feature updates in nearly 3 years.
@KayakinKoder - we hear you and aim to provide Relay like improvements in V3 first. We will provide more details about it in Tanmai's keynote tomorrow. If you are interested to know more please sign up here. Also, can you please let know what kind of improvements are you looking for in Relay? The SQL as an API is an idea under consideration and has not been prioritized on the roadmap yet.
Is SQL as an API still on the road map? Any idea when to expect it? I guess most of the work is already done, as promptql is already executing sql via the hasura query engine.
@olmohake the SQL layer is actively development along with PromptQL. It's still in the alpha stage and isn't production-ready yet. However, the SQL API is available in v3-engine and you can try it now. The naming convention of tables are <subgraph>.<model_name>, for example:
curl http://localhost:3280/v1/sql \
-H 'content-type: application/json' \
-d '{"sql": "SELECT id, productId, createdAt FROM app.Orders LIMIT 1"}'
[
{
"id": "c7406b75-6b24-41e4-9c5b-ff3feada9447",
"productId": "3bef8a40-3c33-11ee-bb29-070df467ec94",
"createdAt": "2023-10-29T17:02:50.889261"
}
]
Happy to see you are moving forward with this! If I am not mistaken, it can’t be used pull data from hasura into bi tools such as superset or interact with the data via gis tools like felt or qgis at the moment as it is expose via http. Are you planning to expose a tcp endpoint supporting a sql protocol i.e postgres in the future?
any updates on getting an endpoint that supports a native sql dialect?