I feel like we could build something like this with SQLite, application defined functions and in-memory DB pretty quickly.
But then I ask myself... Why would I want to do any of this? If I do Database=>sql command=>Database... Don't I have to write yet-more-SQL (or something approximating SQL) to get at my final items? I can't write a foreach loop over pile-o-tables. Virtually all programming abstractions expect some serial flow and enumerations of types.
At some point, you are going to have to map A to B, and I'd argue adding another database in the middle probably isn't strictly headed in the right direction.
If you want to select 2 different result shapes, just write 2 different queries. Use some lateral concepts in your programming environment to make the SQL part not suck. If you stand on some weird "one query only" principle every time you have to populate a practical view, you are going to have a super rough time with life.
Maybe if the client did the JOINs and other logic that were in the query, it would shed load from the upstream DB? That would be helpful for RDBMS which tend to be harder to scale when they are CPU bound.
I have seen a lot of services move to microservices and do client-side joins to help distribute load. Maybe there is a way for a DB built around this approach to run each table on a dedicated instance and have each stream the data back async? That would reduce cross-talk between the DBs serving the query and effectively create a client-side JOIN again, but be transparent to the client (if it were handled by the DB driver instead).
I imagine that this could be useful when you want to perform multiple operations on a subset of the data from the database at the client-side. So you load the RESULTDB to client and then perform subsequent queries client-side and those actually do the JOINs
This could dramatically reduce the load on the database for some applications as well as simplifying some queries that can be awkward to do fully in SQL (some GROUP BYs can get quite complicated to understand)
Another useful thing I can see is using this to simplify the creation of edge databases backed by a central database, like imagine creating a RESULTDB "view" at the edge using this syntax.
But then I ask myself... Why would I want to do any of this? If I do Database=>sql command=>Database... Don't I have to write yet-more-SQL (or something approximating SQL) to get at my final items? I can't write a foreach loop over pile-o-tables. Virtually all programming abstractions expect some serial flow and enumerations of types.
At some point, you are going to have to map A to B, and I'd argue adding another database in the middle probably isn't strictly headed in the right direction.
If you want to select 2 different result shapes, just write 2 different queries. Use some lateral concepts in your programming environment to make the SQL part not suck. If you stand on some weird "one query only" principle every time you have to populate a practical view, you are going to have a super rough time with life.