From 93549c0f2126e8478a3a32b7b600b9d74b431053 Mon Sep 17 00:00:00 2001 From: Chantal Loncle <82039410+bog-walk@users.noreply.github.com> Date: Tue, 21 Nov 2023 16:01:35 -0500 Subject: [PATCH] feat: EXPOSED-220 Support multiple statements returning a result in exec() Fix Detekt issue. Add to KDocs about unsupported databases. --- .../src/main/kotlin/org/jetbrains/exposed/sql/Transaction.kt | 2 ++ .../exposed/sql/statements/api/PreparedStatementApi.kt | 1 + 2 files changed, 3 insertions(+) diff --git a/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/Transaction.kt b/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/Transaction.kt index 0977b59292..1203ecf69b 100644 --- a/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/Transaction.kt +++ b/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/Transaction.kt @@ -127,6 +127,8 @@ open class Transaction( * * **Note** `StatementType.MULTI` can be set to enable execution of multiple concatenated statements. * However, if more than one [ResultSet] is generated, only the first will be used in the [transform] block. + * Multiple statements in a single execute is not supported by all databases and some may require setting + * a JDBC driver flag, like MySQL with `allowMultiQueries`. Please check the specific database documentation. * * @return The result of [transform] on the [ResultSet] generated by the statement execution, * or `null` if no [ResultSet] was returned by the database. diff --git a/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/statements/api/PreparedStatementApi.kt b/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/statements/api/PreparedStatementApi.kt index 397336e543..f01cdbd6f0 100644 --- a/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/statements/api/PreparedStatementApi.kt +++ b/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/statements/api/PreparedStatementApi.kt @@ -6,6 +6,7 @@ import java.io.InputStream import java.sql.PreparedStatement import java.sql.ResultSet +@Suppress("TooManyFunctions") interface PreparedStatementApi { var fetchSize: Int?