* Checks if an element is a metadata object from INSERT/UPDATE/DELETE operations * rather than a row array from SELECT queries. * * Different drivers use different property names for metadata: * - MariaDB: affectedRows, warningStatus, insertId * - MySQL2: affectedRows, insertId, fieldCount, Res
(element: any)
| 15 | * - MySQL2: affectedRows, insertId, fieldCount, ResultSetHeader type |
| 16 | */ |
| 17 | function isMetadataObject(element: any): boolean { |
| 18 | if (!element || typeof element !== 'object' || Array.isArray(element)) { |
| 19 | return false; |
| 20 | } |
| 21 | |
| 22 | // Check for common metadata properties that indicate this is not a row array |
| 23 | return 'affectedRows' in element || |
| 24 | 'insertId' in element || |
| 25 | 'fieldCount' in element || |
| 26 | 'warningStatus' in element; |
| 27 | } |
| 28 | |
| 29 | /** |
| 30 | * Checks if results appear to be from a multi-statement query. |
no outgoing calls
no test coverage detected