You might be able to write a REPL for mem_query if your schema is known at compile time, but there's a very good chance the compiler would fall over trying to figure out the query planning.
@zeroexcuses Do you know what your relations look like ahead of time?
Or is it more of a DBMS scenario where you want to deal with new relations encountered at runtime?