use of io.shardingjdbc.core.parsing.SQLParsingEngine in project sharding-jdbc by shardingjdbc.
the class InsertStatementParserTest method parseInsertFirstForOracle.
@Test(expected = SQLParsingUnsupportedException.class)
public void parseInsertFirstForOracle() {
ShardingRule shardingRule = createShardingRule();
new SQLParsingEngine(DatabaseType.Oracle, "INSERT FIRST INTO TABLE_XXX (field1) VALUES (field1) SELECT field1 FROM TABLE_XXX2", shardingRule).parse();
}
use of io.shardingjdbc.core.parsing.SQLParsingEngine in project sharding-jdbc by shardingjdbc.
the class UpdateStatementParserTest method parseWithoutCondition.
@Test
public void parseWithoutCondition() {
ShardingRule shardingRule = createShardingRule();
SQLParsingEngine statementParser = new SQLParsingEngine(DatabaseType.MySQL, "UPDATE TABLE_XXX SET field1=field1+1", shardingRule);
DMLStatement updateStatement = (DMLStatement) statementParser.parse();
assertThat(updateStatement.getTables().find("TABLE_XXX").get().getName(), is("TABLE_XXX"));
}
use of io.shardingjdbc.core.parsing.SQLParsingEngine in project sharding-jdbc by shardingjdbc.
the class IntegrateSupportedSQLParsingTest method assertSupportedSQL.
@Test
public void assertSupportedSQL() {
String sql = sqlCasesLoader.getSupportedSQL(sqlCaseId, sqlCaseType, parserResultSetLoader.getParserResult(sqlCaseId).getParameters());
new SQLStatementAssert(new SQLParsingEngine(databaseType, sql, getShardingRule()).parse(), sqlCaseId, sqlCaseType).assertSQLStatement();
}
Aggregations