Interface CalciteConnection

All Superinterfaces:
AutoCloseable, Connection, QueryProvider, Wrapper

public interface CalciteConnection extends Connection, QueryProvider
Extension to Calcite's implementation of JDBC connection allows schemas to be defined dynamically.

You can start off with an empty connection (no schemas), define one or two schemas, and start querying them.

Since a CalciteConnection implements the linq4j QueryProvider interface, you can use a connection to execute expression trees as queries.

  • Method Details

    • getRootSchema

      SchemaPlus getRootSchema()
      Returns the root schema.

      You can define objects (such as relations) in this schema, and also nested schemas.

      Returns:
      Root schema
    • getTypeFactory

      JavaTypeFactory getTypeFactory()
      Returns the type factory.
      Returns:
      Type factory
    • getProperties

      Properties getProperties()
      Returns an instance of the connection properties.

      NOTE: The resulting collection of properties is same collection used by the connection, and is writable, but behavior if you modify the collection is undefined. Some implementations might, for example, see a modified property, but only if you set it before you create a statement. We will remove this method when there are better implementations of stateful connections and configuration.

      Returns:
      properties
    • setSchema

      void setSchema(String schema) throws SQLException
      Specified by:
      setSchema in interface Connection
      Throws:
      SQLException
    • getSchema

      String getSchema() throws SQLException
      Specified by:
      getSchema in interface Connection
      Throws:
      SQLException
    • config

    • createPrepareContext

      CalcitePrepare.Context createPrepareContext()
      Creates a context for preparing a statement for execution.