* Borrows a connection and changes the active keyspace on the connection, if needed. * It does not perform any retry or error handling. * @param {Host!} host * @param {string} keyspace * @returns {Promise } * @throws {errors.BusyConnectionError} When the connection is busy.
(host, keyspace)
| 264 | * @private |
| 265 | */ |
| 266 | static async _borrowWithKeyspace(host, keyspace) { |
| 267 | const connection = host.borrowConnection(); |
| 268 | |
| 269 | if (keyspace && connection.keyspace !== keyspace) { |
| 270 | await connection.changeKeyspace(keyspace); |
| 271 | } |
| 272 | |
| 273 | return connection; |
| 274 | } |
| 275 | |
| 276 | /** |
| 277 | * Prepares the provided query on all hosts, except the host provided. |
no test coverage detected