* @param {Client} client * @param {LoadBalancingPolicy} loadBalancing * @param {Array} queries * @param {String} keyspace * @static
(client, loadBalancing, queries, keyspace)
| 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. |
no test coverage detected