Skip to content

Commit 9760a0d

Browse files
authored
Fix row number -1 is out of range 0..-1 (#113)
Co-authored-by: hfhbd <[email protected]>
1 parent 28e2a52 commit 9760a0d

File tree

1 file changed

+3
-2
lines changed
  • postgres-native-sqldelight-driver/src/commonMain/kotlin/app/softwork/sqldelight/postgresdriver

1 file changed

+3
-2
lines changed

postgres-native-sqldelight-driver/src/commonMain/kotlin/app/softwork/sqldelight/postgresdriver/PostgresNativeDriver.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,9 @@ public class PostgresNativeDriver(
166166
executeQuery(null, "SELECT name FROM pg_prepared_statements WHERE name = $1", parameters = 1, binders = {
167167
bindString(0, identifier.toString())
168168
}, mapper = {
169-
it.next()
170-
it.getString(0)
169+
if (it.next()) {
170+
it.getString(0)
171+
} else null
171172
})
172173
return result.value != null
173174
}

0 commit comments

Comments
 (0)