Fix SQLite and H2 file paths

This commit is contained in:
Potatoboy9999 2024-04-10 13:10:06 -07:00
parent 9f1f12318d
commit a8844600d3
No known key found for this signature in database
GPG Key ID: 59B6B6930BF7F2AB
2 changed files with 2 additions and 2 deletions

View File

@ -8,7 +8,7 @@ import kotlin.io.path.pathString
object H2Database : LedgerDatabase { object H2Database : LedgerDatabase {
override fun getDataSource(savePath: Path): DataSource = JdbcDataSource().apply { override fun getDataSource(savePath: Path): DataSource = JdbcDataSource().apply {
setURL("jdbc:h2:${savePath.pathString};MODE=MySQL") setURL("jdbc:h2:${savePath.resolve("ledger.h2").pathString};MODE=MySQL")
} }
override fun getDatabaseIdentifier() = LedgerDatabases.identifier("h2") override fun getDatabaseIdentifier() = LedgerDatabases.identifier("h2")

View File

@ -7,7 +7,7 @@ import kotlin.io.path.pathString
object SQLite : LedgerDatabase { object SQLite : LedgerDatabase {
override fun getDataSource(savePath: Path) = SQLiteDataSource().apply { override fun getDataSource(savePath: Path) = SQLiteDataSource().apply {
url = "jdbc:sqlite:${savePath.pathString}" url = "jdbc:sqlite:${savePath.resolve("ledger.sqlite").pathString}"
} }
override fun getDatabaseIdentifier() = Ledger.identifier(Ledger.DEFAULT_DATABASE) override fun getDatabaseIdentifier() = Ledger.identifier(Ledger.DEFAULT_DATABASE)