mirror of
https://github.com/hasura/graphql-engine.git
synced 2025-01-08 08:44:24 +03:00
91b4fc6ee6
<!-- The PR description should answer 2 important questions: --> ### What The motivation was to allow introspecting field descriptions of object types. To accomplish this, a fair number of things had to change. Prior to this, we determined a model's and command's schema at the sql layer by looking at its type mappings. When introspecting these models and commands, if there are any nested fields, they are output as 'STRUCT<field1 type1, field2 type2>' without any descriptions. With this change, we first build a catalog of types at the sql layer from scalars and object types defined at opendd layer. These types are then used when adding models and commands as opposed to looking at their type mappings. This also changes how the type catalog is presented in introspection. One can now query 'struct type's and their fields along with their descriptions. Models and commands merely refer to these struct types. ### How <!-- How is it trying to accomplish it (what are the implementation steps)? --> V3_GIT_ORIGIN_REV_ID: 550da03c84b33ca44851858ee2cb73a31674d3d0 |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
readme.md |
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 TableScan
s 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.