diff --git a/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/Queries.kt b/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/Queries.kt index 611079e030..d849126e34 100644 --- a/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/Queries.kt +++ b/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/Queries.kt @@ -391,7 +391,7 @@ fun T.insertIgnore( * Represents the SQL statement that inserts new rows into a table and returns specified data from the inserted rows. * * @param returning Columns and expressions to include in the returned data. This defaults to all columns in the table. - * @param ignore Whether to ignore any possible errors that occur during the process. + * @param ignoreErrors Whether to ignore any possible errors that occur during the process. * Note `INSERT IGNORE` is not supported by all vendors. Please check the documentation. * @return A [ReturningStatement] that will be executed once iterated over, providing [ResultRow]s containing the specified * expressions mapped to their resulting data. @@ -399,10 +399,10 @@ fun T.insertIgnore( */ fun T.insertReturning( returning: List> = columns, - ignore: Boolean = false, + ignoreErrors: Boolean = false, body: T.(InsertStatement) -> Unit ): ReturningStatement { - val insert = InsertStatement(this, ignore) + val insert = InsertStatement(this, ignoreErrors) body(insert) return ReturningStatement(this, returning, insert) } diff --git a/exposed-tests/src/test/kotlin/org/jetbrains/exposed/sql/tests/shared/dml/ReturningTests.kt b/exposed-tests/src/test/kotlin/org/jetbrains/exposed/sql/tests/shared/dml/ReturningTests.kt index b1aea9783f..225d64e9fc 100644 --- a/exposed-tests/src/test/kotlin/org/jetbrains/exposed/sql/tests/shared/dml/ReturningTests.kt +++ b/exposed-tests/src/test/kotlin/org/jetbrains/exposed/sql/tests/shared/dml/ReturningTests.kt @@ -61,14 +61,14 @@ class ReturningTests : DatabaseTestsBase() { assertEquals(1, tester.selectAll().count()) // no result set is returned because insert is ignored - val resultWithConflict = tester.insertReturning(ignore = true) { + val resultWithConflict = tester.insertReturning(ignoreErrors = true) { it[item] = "Item A" }.toList() assertTrue { resultWithConflict.isEmpty() } assertEquals(1, tester.selectAll().count()) - val resultWithoutConflict = tester.insertReturning(ignore = true) { + val resultWithoutConflict = tester.insertReturning(ignoreErrors = true) { it[item] = "Item B" }.single()