(eg. in Postgres, this would be more or less a replacement of the PREPARE statement.)
(eg. in Postgres, this would be more or less a replacement of the PREPARE statement.)
On the roadmap are plans to support DataFrame backends such as Polars, Pandas, Ibis, ... and Substrait.io [1]. The aim of Substrait is similar to what you describe, i.e. to create a universal relational algebra representation that can be executed directly by backend systems without having to go through SQL.
[0]: https://github.com/PRQL/prql/blob/main/prql-compiler/src/lib...
You have to join five tables in a query. What join order will you pick in your execution plan? Will you use the same ordering for different WHERE clause parameters? What if you add an index?
What you're proposing was tried in the 1970s (see CODASYL) and it was a terrible idea.