新增MySQL和pg数据库的同步

This commit is contained in:
2025-08-27 12:09:04 +08:00
parent 6e06bc0259
commit 8b276ec2ee

View File

@@ -30,9 +30,9 @@ public class dbController {
if (vToken.isValidToken(token)) {
DbConfig dbConfig = dbConfigService.getById(dbId);
JdbcTemplate jdbcTemplate = DataSourceConfig.createJdbcTemplate(dbConfig);
// 补充参数传递修复SQL参数绑定问题
String querySql = "SELECT table_name FROM information_schema.tables WHERE table_schema = ?";
// 执行通用查询
List<Map<String, Object>> result = jdbcTemplate.queryForList(querySql);
List<Map<String, Object>> result = jdbcTemplate.queryForList(querySql, dbConfig.getDbSchema());
List<String> data = result.stream()
.map(row -> row.values().iterator().next().toString())
.toList();