Feature/update to exposed v0.57.0 (#1150)

* Update to exposed-migrations v3.5.0

* Update to kotlin-logging v7.0.0

* Update to exposed v0.46.0

* Update to exposed v0.47.0

* Update to exposed v0.55.0

* Update to exposed v0.56.0

* Update to exposed v0.57.0
This commit is contained in:
schroda
2024-12-08 05:49:11 +01:00
committed by GitHub
parent f926714544
commit 1d541a30ae
87 changed files with 463 additions and 359 deletions

View File

@@ -4,7 +4,7 @@ import graphql.execution.DataFetcherResult
import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq
import org.jetbrains.exposed.sql.and
import org.jetbrains.exposed.sql.deleteWhere
import org.jetbrains.exposed.sql.select
import org.jetbrains.exposed.sql.selectAll
import org.jetbrains.exposed.sql.transactions.transaction
import org.jetbrains.exposed.sql.update
import suwayomi.tachidesk.graphql.asDataFetcherResult
@@ -75,7 +75,8 @@ class MangaMutation {
val mangas =
transaction {
MangaTable
.select { (MangaTable.id inList ids) and (MangaTable.initialized eq false) }
.selectAll()
.where { (MangaTable.id inList ids) and (MangaTable.initialized eq false) }
.map { MangaTable.toDataClass(it) }
}
@@ -98,7 +99,7 @@ class MangaMutation {
val manga =
transaction {
MangaType(MangaTable.select { MangaTable.id eq id }.first())
MangaType(MangaTable.selectAll().where { MangaTable.id eq id }.first())
}
UpdateMangaPayload(
@@ -118,7 +119,7 @@ class MangaMutation {
val mangas =
transaction {
MangaTable.select { MangaTable.id inList ids }.map { MangaType(it) }
MangaTable.selectAll().where { MangaTable.id inList ids }.map { MangaType(it) }
}
UpdateMangasPayload(
@@ -148,7 +149,7 @@ class MangaMutation {
val manga =
transaction {
MangaTable.select { MangaTable.id eq id }.first()
MangaTable.selectAll().where { MangaTable.id eq id }.first()
}
FetchMangaPayload(
clientMutationId = clientMutationId,
@@ -198,14 +199,15 @@ class MangaMutation {
transaction {
val meta =
MangaMetaTable
.select { (MangaMetaTable.ref eq mangaId) and (MangaMetaTable.key eq key) }
.selectAll()
.where { (MangaMetaTable.ref eq mangaId) and (MangaMetaTable.key eq key) }
.firstOrNull()
MangaMetaTable.deleteWhere { (MangaMetaTable.ref eq mangaId) and (MangaMetaTable.key eq key) }
val manga =
transaction {
MangaType(MangaTable.select { MangaTable.id eq mangaId }.first())
MangaType(MangaTable.selectAll().where { MangaTable.id eq mangaId }.first())
}
if (meta != null) {