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

Method _borrowAndPrepare

lib/prepare-handler.js:243–253  ·  view source on GitHub ↗

* Borrows a connection from the host and prepares the queries provided. * @param {Host} host * @param {String} keyspace * @param {Array} queries * @returns {Promise } * @private

(host, keyspace, queries)

Source from the content-addressed store, hash-verified

241 * @private
242 */
243 static async _borrowAndPrepare(host, keyspace, queries) {
244 if (queries.length === 0) {
245 return;
246 }
247
248 const connection = await PrepareHandler._borrowWithKeyspace(host, keyspace);
249
250 for (const query of queries) {
251 await connection.prepareOnceAsync(query, keyspace);
252 }
253 }
254
255 /**
256 * Borrows a connection and changes the active keyspace on the connection, if needed.

Callers 2

prepareAllQueriesMethod · 0.80
_prepareOnAllHostsMethod · 0.80

Calls 1

_borrowWithKeyspaceMethod · 0.80

Tested by

no test coverage detected