query
@ExperimentalCoroutinesApi
Executes a query for the given SQL statement using the provided fetchSize as a result set fetch size.
Return
a Flow of Row objects, representing the result set.
Example usage:
val result = Jdbc.query("SELECT * FROM my_table WHERE id = ?") {
setInt(1, 10)
}
result.collect { println(it) }
Content copied to clipboard
Parameters
sql
the SQL statement to be executed
fetchSize
the result set fetch size to be used in the query (default: 100)
prepare
a function that prepares the PreparedStatement for the query (default: {})