Build the current query and run it on the associated database.
(query: QueryDescription)
| 219 | |
| 220 | /** Build the current query and run it on the associated database. */ |
| 221 | private static async _runQuery(query: QueryDescription) { |
| 222 | this._currentQuery = this._queryBuilder.queryForSchema(this); |
| 223 | |
| 224 | if (query.type) { |
| 225 | this._runEventListeners(query.type); |
| 226 | } |
| 227 | |
| 228 | const results = await this._database.query(query); |
| 229 | |
| 230 | if (query.type) { |
| 231 | this._runEventListeners(query.type, results); |
| 232 | } |
| 233 | |
| 234 | return results; |
| 235 | } |
| 236 | |
| 237 | /** Format a field or an object of fields, following a field matching table. |
| 238 | * Defaulting to `defaultCase` or `field` otherwise. */ |