fix: PG 数据源填写数据库名称有横杠,报错 invalid database name

This commit is contained in:
taojinlong 2024-06-11 12:19:28 +08:00
parent d26a67b119
commit b9a05adc6c

View File

@ -951,7 +951,7 @@ public class JdbcProvider extends DefaultJdbcProvider {
break;
case pg:
PgConfiguration pgConfiguration = new Gson().fromJson(datasource.getConfiguration(), PgConfiguration.class);
if (!pgConfiguration.getDataBase().matches("^[0-9a-zA-Z_]{1,}$")) {
if (!pgConfiguration.getDataBase().matches("^[0-9a-zA-Z_.-]{1,}$")) {
throw new Exception("Invalid database name");
}
break;