Package org.eigenbase.sql.pretty

Examples of org.eigenbase.sql.pretty.SqlPrettyWriter


                new SqlIdentifier("*", SqlParserPos.ZERO)),
            SqlParserPos.ZERO);
    SqlSelect node =
        new SqlSelect(SqlParserPos.ZERO, SqlNodeList.EMPTY, selectList,
            tableName(), null, null, null, null, null, null, null);
    final SqlPrettyWriter writer = new SqlPrettyWriter(jdbcSchema.dialect);
    node.unparse(writer, 0, 0);
    return writer.toSqlString();
  }
View Full Code Here


    SqlNode node =
        SqlParser.create("alter system set schema = true").parseStmt();
    SqlSetOption opt = (SqlSetOption) node;
    assertThat(opt.getScope(), equalTo("SYSTEM"));
    assertThat(opt.getName(), equalTo("SCHEMA"));
    SqlPrettyWriter writer = new SqlPrettyWriter(SqlDialect.EIGENBASE);
    assertThat(writer.format(opt.getValue()), equalTo("TRUE"));
    writer = new SqlPrettyWriter(SqlDialect.EIGENBASE);
    assertThat(writer.format(opt),
        equalTo("ALTER SYSTEM SET \"SCHEMA\" = TRUE"));

    check("alter system set \"a number\" = 1",
        "ALTER SYSTEM SET `a number` = 1");
    check("alter system set flag = false",
View Full Code Here

    SqlNode node =
        SqlParser.create("alter system set schema = true").parseStmt();
    SqlSetOption opt = (SqlSetOption) node;
    assertThat(opt.getScope(), equalTo("SYSTEM"));
    assertThat(opt.getName(), equalTo("SCHEMA"));
    SqlPrettyWriter writer = new SqlPrettyWriter(SqlDialect.EIGENBASE);
    assertThat(writer.format(opt.getValue()), equalTo("TRUE"));
    writer = new SqlPrettyWriter(SqlDialect.EIGENBASE);
    assertThat(writer.format(opt),
        equalTo("ALTER SYSTEM SET \"SCHEMA\" = TRUE"));

    check("alter system set \"a number\" = 1",
        "ALTER SYSTEM SET `a number` = 1");
    check("alter system set flag = false",
View Full Code Here

                new SqlIdentifier("*", SqlParserPos.ZERO)),
            SqlParserPos.ZERO);
    SqlSelect node =
        new SqlSelect(SqlParserPos.ZERO, SqlNodeList.EMPTY, selectList,
            tableName(), null, null, null, null, null, null, null);
    final SqlPrettyWriter writer = new SqlPrettyWriter(jdbcSchema.dialect);
    node.unparse(writer, 0, 0);
    return writer.toSqlString();
  }
View Full Code Here

                new SqlIdentifier("*", SqlParserPos.ZERO)),
            SqlParserPos.ZERO);
    SqlSelect node =
        new SqlSelect(SqlParserPos.ZERO, SqlNodeList.EMPTY, selectList,
            tableName(), null, null, null, null, null, null, null);
    final SqlPrettyWriter writer = new SqlPrettyWriter(jdbcSchema.dialect);
    node.unparse(writer, 0, 0);
    return writer.toSqlString();
  }
View Full Code Here

  // implement RelDataTypeImpl
  protected void generateTypeString(StringBuilder sb, boolean withDetail) {
    sb.append("INTERVAL ");
    SqlDialect dialect = null;
    dialect = SqlDialect.DUMMY;
    SqlPrettyWriter writer = new SqlPrettyWriter(dialect);
    writer.setAlwaysUseParentheses(false);
    writer.setSelectListItemsOnSeparateLines(false);
    writer.setIndentation(0);
    intervalQualifier.unparse(writer, 0, 0);
    final String sql = writer.toString();
    sb.append(new SqlString(dialect, sql).getSql());
  }
View Full Code Here

TOP

Related Classes of org.eigenbase.sql.pretty.SqlPrettyWriter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.