Skip to content

Commit 9987752

Browse files
committed
build: 2.9.0
1 parent f465602 commit 9987752

File tree

4 files changed

+24
-4
lines changed

4 files changed

+24
-4
lines changed

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## 2.9.0 (24/09/11)
2+
3+
1. update: h2 2.3.232
4+
2. update: sqlite-jdbc 3.46.1.0
5+
3. update: postgresql 42.7.4
6+
4. update: mssql-jdbc 12.8.1.jre1
7+
5. feat: MiraiH2
8+
19
## 2.8.2 (24/08/11)
210

311
1. update: hibernate-platform 6.6.0.Final

build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ plugins {
88
}
99

1010
group = "xyz.cssxsh.mirai"
11-
version = "2.8.2"
11+
version = "2.9.0"
1212

1313
mavenCentralPublish {
1414
useCentralS01()

src/main/kotlin/xyz/cssxsh/mirai/hibernate/MiraiH2.kt

+8-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ import org.hibernate.*
1111
import java.sql.*
1212
import kotlin.coroutines.*
1313

14+
/**
15+
* H2 相关操作
16+
* @since 2.9.0
17+
*/
1418
public object MiraiH2 : SimpleListenerHost() {
1519

1620
override fun handleException(context: CoroutineContext, exception: Throwable) {
@@ -56,8 +60,10 @@ public object MiraiH2 : SimpleListenerHost() {
5660
} catch (_: SQLException) {
5761
return@launch
5862
}
59-
logger.info(message = "h2 web $url")
60-
Server.openBrowser(url)
63+
logger.info(message = "h2database editor $url")
64+
if (System.getProperty("h2.web.browser", "false").toBoolean()) {
65+
Server.openBrowser(url)
66+
}
6167
}
6268
}
6369
}

src/main/kotlin/xyz/cssxsh/mirai/hibernate/MiraiHibernatePlugin.kt

+7-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ internal object MiraiHibernatePlugin : KotlinPlugin(
1414
JvmPluginDescription(
1515
id = "xyz.cssxsh.mirai.plugin.mirai-hibernate-plugin",
1616
name = "mirai-hibernate-plugin",
17-
version = "2.8.1"
17+
version = "2.9.0"
1818
) {
1919
author("cssxsh")
2020

@@ -65,6 +65,12 @@ internal object MiraiHibernatePlugin : KotlinPlugin(
6565
.renameTo(resolveDataFile("backup.$current.h2.trace.db"))
6666
throw RuntimeException("本地文件和数据库版本不匹配,已备份,请重新启动", exception)
6767
}
68+
if ("password" in exception.message.orEmpty()) {
69+
throw RuntimeException(
70+
"配置错误:\n ${configuration.loader.configuration.toPath().toUri()}\"",
71+
exception
72+
)
73+
}
6874
throw exception
6975
}
7076

0 commit comments

Comments
 (0)