* Uses the metadata to fill the user provided parameter hints * @param {String} keyspace * @param {Array} hints * @internal * @ignore
(keyspace, hints)
| 845 | * @ignore |
| 846 | */ |
| 847 | async adaptUserHints(keyspace, hints) { |
| 848 | if (!Array.isArray(hints)) { |
| 849 | return; |
| 850 | } |
| 851 | const udts = []; |
| 852 | // Check for udts and get the metadata |
| 853 | for (let i = 0; i < hints.length; i++) { |
| 854 | const hint = hints[i]; |
| 855 | if (typeof hint !== 'string') { |
| 856 | continue; |
| 857 | } |
| 858 | |
| 859 | const type = types.dataTypes.getByName(hint); |
| 860 | this._checkUdtTypes(udts, type, keyspace); |
| 861 | hints[i] = type; |
| 862 | } |
| 863 | |
| 864 | for (const type of udts) { |
| 865 | const udtInfo = await this.getUdt(type.info.keyspace, type.info.name); |
| 866 | if (!udtInfo) { |
| 867 | throw new TypeError('User defined type not found: ' + type.info.keyspace + '.' + type.info.name); |
| 868 | } |
| 869 | type.info = udtInfo; |
| 870 | } |
| 871 | } |
| 872 | |
| 873 | /** |
| 874 | * @param {Array} udts |
no test coverage detected