Skip to content

Use raw response mode for all driver queries to fix numResults crash#42

Open
mikhail-zhadanov wants to merge 4 commits intomainfrom
fix/raw-response-numresults
Open

Use raw response mode for all driver queries to fix numResults crash#42
mikhail-zhadanov wants to merge 4 commits intomainfrom
fix/raw-response-numresults

Conversation

@mikhail-zhadanov
Copy link
Copy Markdown
Collaborator

Fixes #41

Summary

  • Add centralized rawQuery()/rawExecute() wrappers in utils.ts that always use the driver's 'raw' response mode
  • Replace all direct driver.query()/driver.execute() calls across 8 files to go through these wrappers
  • Add throwSqlError() helper to deduplicate error formatting and include SQL error codes (e.g., SQL Error [42000]: object not found)
  • Remove dead code: isNonResultMetadataError, E-EDJS-11 fallback, safeQuery wrapper, no-op try/catch blocks
  • Simplify executeWithoutResult to a thin alias over rawQuery

The Exasol driver's default response mode crashes with
"Cannot read properties of undefined (reading 'numResults')" when
the database returns an error (responseData is undefined). Switch
all driver.query()/driver.execute() calls to raw mode and handle
response parsing via getRowsFromResult/getColumnsFromResult.

- Add rawQuery()/rawExecute() wrappers in utils.ts
- Add throwSqlError() for deduplicated error formatting with SQL codes
- Remove dead code: isNonResultMetadataError, E-EDJS-11 fallback,
  safeQuery wrapper, no-op try/catch blocks

Fixes #41
@mikhail-zhadanov mikhail-zhadanov force-pushed the fix/raw-response-numresults branch from e2de959 to c414019 Compare March 31, 2026 11:42
@mikhail-zhadanov mikhail-zhadanov marked this pull request as ready for review March 31, 2026 15:38
@mikhail-zhadanov
Copy link
Copy Markdown
Collaborator Author

@mkcorneli , please review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Driver crashes with TypeError on numResults when database returns error responses

1 participant