graphql-engine/v3/crates/sql
Abhinav Gupta 180c1dbc59 Refactor SQL layer to use OpenDD query IR (#925)
As per the multiple frontends RFC:
https://github.com/hasura/v3-engine/blob/vamshi/multiple-frontends/rfcs/multiple-frontends.md

V3_GIT_ORIGIN_REV_ID: 07f7c5323179a62fd08717d6d49f9415da139873
2024-08-05 23:38:19 +00:00
..
src Refactor SQL layer to use OpenDD query IR (#925) 2024-08-05 23:38:19 +00:00
Cargo.toml simplify the sql context that powers datafusion (#921) 2024-08-01 21:28:32 +00:00
readme.md Refactor SQL layer to use OpenDD query IR (#925) 2024-08-05 23:38:19 +00:00

SQL Interface

An experimental SQL interface over OpenDD models. This is mostly targeted at AI use cases for now - GenAI models are better at generating SQL queries than GraphQL queries.

This is implemented using the Apache DataFusion Query Engine by deriving the SQL metadata for datafusion from Open DDS metadata. As the implementation currently stands, once we get a LogicalPlan from datafusion we replace TableScans with NDC queries to the underlying connector. There is a rudimentary optimizer that pushes down projections to the opendd query so that we don't fetch all the columns of a collection.