mirromutth / r2dbc-mysql

R2DBC MySQL Implementation
Apache License 2.0
656 stars 98 forks source link

Enforce prepared statement usage for simple query #96

Closed mirromutth closed 4 years ago

mirromutth commented 4 years ago

It will make sense to add a configuration property (Predicate<String> preferPreparedStatement) to enforce prepared statement usage? We have a similar feature in R2DBC MS SQL although there we control cursor execution (https://github.com/r2dbc/r2dbc-mssql/blob/master/src/main/java/io/r2dbc/mssql/MssqlConnectionConfiguration.java#L67)

Originally posted by @mp911de in https://github.com/mirromutth/r2dbc-mysql/issues/89#issuecomment-563113937

mirromutth commented 4 years ago

It is supported by PR and published to 0.8.1.BUILD-SNAPSHOT. Target version is 0.8.1.RELEASE.

If want to use snapshot versions, add Sonatype snapshots repository to Maven file, see also README

zhangchf commented 4 years ago

Thanks, add useServerPrepareStatement=true in the connectionString solved my issue.