修复了sqlite报错问题
All checks were successful
Java CI-CD with Maven / build (push) Successful in 12m6s

This commit is contained in:
zhangyuheng 2024-04-05 21:01:11 +08:00
parent 078e36d0ca
commit ef64d85188
2 changed files with 4 additions and 1 deletions

View File

@ -6,7 +6,7 @@
<groupId>cn.lunadeer</groupId>
<artifactId>Dominion</artifactId>
<version>1.15.9-beta</version>
<version>1.15.11-beta</version>
<packaging>jar</packaging>
<name>Dominion</name>

View File

@ -41,6 +41,9 @@ public class Database {
}
try {
Statement stmt = conn.createStatement();
if (sql.contains("SERIAL PRIMARY KEY") && Dominion.config.getDbType().equals("sqlite")) {
sql = sql.replace("SERIAL PRIMARY KEY", "INTEGER PRIMARY KEY AUTOINCREMENT");
}
// if query with no result return null
if (stmt.execute(sql)) {
return stmt.getResultSet();