Just throwing it around, but there is Apache Calcite, a DBMS without the Database part. It's an SQL parsing, logical & physical plan building framework. It's pretty much a DBMS without any database of its own. You can program up an adapter for "whatever you want" pretty much and query "whatever you want" with SQL.