MysqlIndexMetadataParser implements IndexMetadataParser { @Override public List<RDBIndexMetadata> parseTableIndex(String tableName) { return schema.findFeatureNow(SyncSqlExecutor.ID) .select(SqlRequests.of(selectIndexSql, schema.getName(), tableName), ResultWrappers.lowerCase(new MysqlIndexWrapper())); }  @Override List<RDBIndexMetadata> parseTableIndex(String tableName); @Override Optional<RDBIndexMetadata> parseByName(String name); @Override List<RDBIndexMetadata> parseAll(); @Override Flux<RDBIndexMetadata> parseAllReactive(); @Override Mono<RDBIndexMetadata> parseByNameReactive(String name); @Override Flux<RDBIndexMetadata> parseTableIndexReactive(String tableName);  }
@Test public void test() { SyncSqlExecutor sqlExecutor = new TestSyncSqlExecutor(new Mysql57ConnectionProvider()); try { MysqlSchemaMetadata schema= new MysqlSchemaMetadata("ezorm"); MysqlIndexMetadataParser parser =new MysqlIndexMetadataParser(schema); parser.getSchema().addFeature(sqlExecutor); sqlExecutor.execute(SqlRequests.of( "create table test_index_parser(" + "id varchar(32) primary key," + "name varchar(32) not null," + "age int," + "addr varchar(128))")); sqlExecutor.execute(SqlRequests.of("create index test_index on test_index_parser (age)")); sqlExecutor.execute(SqlRequests.of("create unique index test_index_2 on test_index_parser (name)")); sqlExecutor.execute(SqlRequests.of("create index test_index_3 on test_index_parser (name,addr desc)")); List<RDBIndexMetadata> list = parser.parseTableIndex("test_index_parser"); Assert.assertEquals(list.size(),4); } finally { try { sqlExecutor.execute(SqlRequests.of("drop table test_index_parser")); } catch (Exception e) { } } }