dave08
10/29/2023, 12:48 PMio.r2dbc.spi.R2dbcBadGrammarException
it would have been great to have been great if Komapper could try catching such errors and include some info like the sql that was run, etc...Toshihiro Nakamura
10/29/2023, 1:05 PMdave08
10/29/2023, 1:14 PMio.r2dbc.spi.R2dbcBadGrammarException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '....' at line 1 at com.github.jasync.r2dbc.mysql.JasyncStatement.mapException(JasyncStatement.kt:184) at com.github.jasync.r2dbc.mysql.JasyncStatement.access$mapException(JasyncStatement.kt:30) at com.github.jasync.r2dbc.mysql.JasyncStatement$execute$4.invoke(JasyncStatement.kt:122) at com.github.jasync.r2dbc.mysql.JasyncStatement$execute$4.invoke(JasyncStatement.kt:120) at reactor.kotlin.core.publisher.FluxExtensionsKt.onErrorMap$lambda-1(FluxExtensions.kt:172) at reactor.core.publisher.Flux.lambda$onErrorMap$28(Flux.java:7236) at reactor.core.publisher.Flux.lambda$onErrorResume$29(Flux.java:7289) at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onError(FluxOnErrorResume.java:94) at reactor.core.publisher.FluxMap$MapSubscriber.onError(FluxMap.java:134) at reactor.core.publisher.FluxConcatMapNoPrefetch$FluxConcatMapNoPrefetchSubscriber.maybeOnError(FluxConcatMapNoPrefetch.java:326) at reactor.core.publisher.FluxConcatMapNoPrefetch$FluxConcatMapNoPrefetchSubscriber.innerError(FluxConcatMapNoPrefetch.java:297) at reactor.core.publisher.FluxConcatMap$ConcatMapInner.onError(FluxConcatMap.java:875) at reactor.core.publisher.MonoCompletionStage$MonoCompletionStageSubscription.apply(MonoCompletionStage.java:122) at reactor.core.publisher.MonoCompletionStage$MonoCompletionStageSubscription.apply(MonoCompletionStage.java:71) at java.base/java.util.concurrent.CompletableFuture.uniHandle(Unknown Source) at java.base/java.util.concurrent.CompletableFuture$UniHandle.tryFire(Unknown Source) at java.base/java.util.concurrent.CompletableFuture.postComplete(Unknown Source) at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(Unknown Source) at com.github.jasync.sql.db.util.FutureUtilsKt.failed(FutureUtils.kt:18) at com.github.jasync.sql.db.mysql.MySQLConnection$failQueryPromise$1.invoke(MySQLConnection.kt:418) at com.github.jasync.sql.db.mysql.MySQLConnection$failQueryPromise$1.invoke(MySQLConnection.kt:417) at com.github.jasync.sql.db.mysql.MySQLConnection.failQueryPromise$lambda$13(MySQLConnection.kt:417) at java.base/java.util.Optional.ifPresent(Unknown Source) at com.github.jasync.sql.db.mysql.MySQLConnection.failQueryPromise(MySQLConnection.kt:417) at com.github.jasync.sql.db.mysql.MySQLConnection.setException(MySQLConnection.kt:218) at com.github.jasync.sql.db.mysql.MySQLConnection.onError(MySQLConnection.kt:212) at com.github.jasync.sql.db.mysql.codec.MySQLConnectionHandler.channelRead0(MySQLConnectionHandler.kt:128) at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
Toshihiro Nakamura
10/29/2023, 1:22 PMdave08
10/29/2023, 1:23 PMexecuteScript
and it broke all my unit tests (that are mostly running under H2...), so overriding the upsert was VERY helpful, now if delete
isn't overridable, I'm really stuck.Toshihiro Nakamura
10/29/2023, 1:36 PMgetEntityDeleteStatementBuilder
and getRelationDeleteStatementBuilder
functions in MySqlR2dbcDialect
.
Inside the Builder returned from the functions, please use TableNameType.NAME_ONLY
instead of TableNameType.NAME_AND_ALIAS
.dave08
10/29/2023, 1:54 PMprivate val aliasManager =
if (dialect.supportsAliasForDeleteStatement()) {
DefaultAliasManager(context)
} else {
EmptyAliasManager
}
maybe it's enough just to override supportsAliasForDeleteStatement()
@Toshihiro Nakamura?Inside the Builder returned from the functions, please useinstead ofTableNameType.NAME_ONLY
.TableNameType.NAME_AND_ALIAS
override fun <ENTITY : Any, ID : Any, META : EntityMetamodel<ENTITY, ID, META>> getEntityDeleteStatementBuilder(
dialect: BuilderDialect,
context: EntityDeleteContext<ENTITY, ID, META>,
entity: ENTITY
): EntityDeleteStatementBuilder<ENTITY, ID, META> {
return DefaultEntityDeleteStatementBuilder(dialect, context, entity)
}
override fun <ENTITY : Any, ID : Any, META : EntityMetamodel<ENTITY, ID, META>> getRelationDeleteStatementBuilder(
dialect: BuilderDialect,
context: RelationDeleteContext<ENTITY, ID, META>,
): RelationDeleteStatementBuilder<ENTITY, ID, META> {
return RelationDeleteStatementBuilder(dialect, context)
}
Toshihiro Nakamura
10/29/2023, 1:57 PMsupportsAliasForDeleteStatement
function. Overriding that function should be sufficient.dave08
10/29/2023, 1:58 PMoverride fun supportsAliasForDeleteStatement(): Boolean = false
supportFor57
or something... these changes aren't too big (if they really are the only difference...) and they might be helpful for others... and it's not like providing a whole new dialect for those that still have that obsolete version of mysql... it could maybe even be flagged with some kind of experimental or deprecated annotation, to indicate that it won't really be supported.Toshihiro Nakamura
11/03/2023, 4:17 AMdave08
11/15/2023, 12:16 PMToshihiro Nakamura
11/15/2023, 12:43 PMdave08
11/15/2023, 12:45 PM