Ejemplo n.º 1
0
 /** Prepares a SQL query for execution. For use within Optiq only. */
 public static OptiqPrepare.PrepareResult<Object> prepare(
     final OptiqConnection connection,
     final OptiqSchema schema,
     final List<String> schemaPath,
     final String sql) {
   final OptiqPrepare prepare = OptiqPrepare.DEFAULT_FACTORY.apply();
   return prepare.prepareSql(
       makeContext(connection, schema, schemaPath), sql, null, Object[].class, -1);
 }
Ejemplo n.º 2
0
 /** Parses and validates a SQL query. For use within Optiq only. */
 public static OptiqPrepare.ParseResult parse(
     final OptiqConnection connection,
     final OptiqSchema schema,
     final List<String> schemaPath,
     final String sql) {
   final OptiqPrepare prepare = OptiqPrepare.DEFAULT_FACTORY.apply();
   final OptiqPrepare.Context context = makeContext(connection, schema, schemaPath);
   OptiqPrepare.Dummy.push(context);
   try {
     return prepare.parse(context, sql);
   } finally {
     OptiqPrepare.Dummy.pop(context);
   }
 }