It is by design that a schema does not reference an Optiq connection. We wanted schemas to be re-usable across connections, so we made it difficult to connections to leak into them. A schema is typically created before the first connection.
There's nothing wrong with your schema containing a reference to your connection. Create a connection to your backend in your schema's constructor, based on credentials passed in from SchemaFactory.create, and store it as a field of your schema. This is exactly how MongoSchema does it. Note that MongoTable references neither a schema nor a connection, but when a scan is started it creates a MongoQueryable, which has both a QueryProvider (which you can down-cast to an OptiqConnection) and a SchemaPlus (from which you can access your schema, via unwrap). Julian
