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

Method _getSingleFunction

lib/metadata/index.js:710–725  ·  view source on GitHub ↗

* Gets a single cql function or aggregate definition * @param {String} keyspaceName * @param {String} name * @param {Array} signature * @param {Boolean} aggregate * @returns {Promise } * @private

(keyspaceName, name, signature, aggregate)

Source from the content-addressed store, hash-verified

708 * @private
709 */
710 async _getSingleFunction(keyspaceName, name, signature, aggregate) {
711 if (!keyspaceName || !name) {
712 throw new errors.ArgumentError('You must provide the keyspace name and cql function name to retrieve the metadata');
713 }
714 if (!Array.isArray(signature)) {
715 throw new errors.ArgumentError('Signature must be an array of types');
716 }
717 signature = signature.map(item => {
718 if (typeof item === 'string') {
719 return item;
720 }
721 return types.getDataTypeNameByCode(item);
722 });
723 const functionsMap = await this._getFunctions(keyspaceName, name, aggregate);
724 return functionsMap.get(signature.join(',')) || null;
725 }
726
727 /**
728 * Gets the trace session generated by Cassandra when query tracing is enabled for the

Callers 2

getFunctionMethod · 0.95
getAggregateMethod · 0.95

Calls 2

_getFunctionsMethod · 0.95
getMethod · 0.65

Tested by

no test coverage detected