MCPcopy Create free account
hub / github.com/apache/cassandra-nodejs-driver / setKeyspace

Method setKeyspace

lib/request-handler.js:220–235  ·  view source on GitHub ↗

* Sets the keyspace in any connection that is already opened. * @param {Client} client * @returns {Promise}

(client)

Source from the content-addressed store, hash-verified

218 * @returns {Promise}
219 */
220 static setKeyspace(client) {
221 let connection;
222
223 for (const host of client.hosts.values()) {
224 connection = host.getActiveConnection();
225 if (connection) {
226 break;
227 }
228 }
229
230 if (!connection) {
231 throw new errors.DriverInternalError('No active connection found');
232 }
233
234 return connection.changeKeyspace(client.keyspace);
235 }
236
237 /**
238 * @param {Error} err

Callers 1

client.jsFile · 0.45

Calls 3

getActiveConnectionMethod · 0.80
changeKeyspaceMethod · 0.80
valuesMethod · 0.65

Tested by

no test coverage detected