(waitReconnect)
| 882 | } |
| 883 | |
| 884 | async getKeyspaces(waitReconnect) { |
| 885 | const keyspaces = {}; |
| 886 | const queries = [ |
| 887 | { query: _selectAllKeyspacesV2, virtual: false }, |
| 888 | { query: _selectAllVirtualKeyspaces, virtual: true } |
| 889 | ]; |
| 890 | |
| 891 | await Promise.all(queries.map(async (q) => { |
| 892 | let result = null; |
| 893 | try { |
| 894 | result = await this.cc.query(q.query, waitReconnect); |
| 895 | } |
| 896 | catch (err) { |
| 897 | if (q.virtual) { |
| 898 | // Only throw error for non-virtual query as |
| 899 | // server reporting C* 4.0 may not actually implement |
| 900 | // virtual tables. |
| 901 | return; |
| 902 | } |
| 903 | throw err; |
| 904 | } |
| 905 | for (let i = 0; i < result.rows.length; i++) { |
| 906 | const ksInfo = this._parseKeyspace(result.rows[i], q.virtual); |
| 907 | keyspaces[ksInfo.name] = ksInfo; |
| 908 | } |
| 909 | })); |
| 910 | return keyspaces; |
| 911 | } |
| 912 | |
| 913 | async getKeyspace(name) { |
| 914 | const ks = await this._getKeyspace(_selectSingleKeyspaceV2, name, false); |
nothing calls this directly
no test coverage detected