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

Method getPreparedMultiple

lib/prepare-handler.js:74–93  ·  view source on GitHub ↗

* @param {Client} client * @param {LoadBalancingPolicy} loadBalancing * @param {Array} queries * @param {String} keyspace * @static

(client, loadBalancing, queries, keyspace)

Source from the content-addressed store, hash-verified

72 * @static
73 */
74 static async getPreparedMultiple(client, loadBalancing, queries, keyspace) {
75 const result = [];
76
77 for (const item of queries) {
78 let query;
79
80 if (item) {
81 query = typeof item === 'string' ? item : item.query;
82 }
83
84 if (typeof query !== 'string') {
85 throw new errors.ArgumentError('Query item should be a string');
86 }
87
88 const { queryId, meta } = await PrepareHandler.getPrepared(client, loadBalancing, query, keyspace);
89 result.push({ query, params: utils.adaptNamedParamsPrepared(item.params, meta.columns), queryId, meta });
90 }
91
92 return result;
93 }
94
95 /**
96 * Prepares the query on a single host or on all hosts depending on the options.

Callers 1

client.jsFile · 0.80

Calls 2

getPreparedMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected